Help untangling CAKE settings for FTTH

Sebastian Moeller moeller0 at gmx.de
Thu Nov 17 01:50:19 PST 2022


Hi T.


so taking your proposa under consideration I canged the section that threw you off course to read:


	• Ethernet with Overhead: SQM can also account for the overhead imposed by VDSL2 links - add 22 bytes of overhead (mpu 68). Cable Modems (DOCSIS) set both up- and downstream overhead to 18 bytes (6 bytes source MAC, 6 bytes destination MAC, 2 bytes ether-type, 4 bytes FCS), to allow for a possible 4 byte VLAN tag it is recommended to set the overhead to 18 + 4 = 22 (mpu 64). For FTTH the answer is less clear cut, since different underlaying technologies have different relevant per-packet-overheads; however underestimating the per-packet-overhead is considerably worse for responsiveness than (gently) overestimating it, so for FTTH set the overhead to 44 (mpu 84) unless there is more detailed information about the true overhead on a link available.
	• None: All shaping below the physical gross-rate of a link requires correct per-packet overhead accounting to be precise, so None is only useful if approximate shaping is sufficient, say if you want to clamp a guest network to at best ~50% of the available capacity or similar tasks, but even then configuring an approximate correct per-packet-overhead is recommended (overhead 44 (mpu 84) is a decent default to pick).


I hope this is explicit enough.

Regards
	Sebastian


> On Nov 16, 2022, at 12:46, Thibaut <hacks at slashdirt.org> wrote:
> 
> Hi Sebastian,
> 
> Thanks for your reply.
> 
>> Le 16 nov. 2022 à 11:49, Sebastian Moeller <moeller0 at gmx.de> a écrit :
>> 
>> HI T.
>> 
>> 
>> 
>>> On Nov 16, 2022, at 11:22, Thibaut <hacks at slashdirt.org> wrote:
>>> 
>>> Hi,
>>> 
>>> A few questions for the CAKE experts here:
>> 
>> 	Quick note, this is not necessarily the best place to get advice on cake, both the cake mailing list and the OpenWrt forum tend to be directer paths to the "bakers".
> 
> Well since this looked to me like an openwrt-specific question (with links to openwrt wiki), it felt more adequate to ask here, but thanks for redirecting.
> 
>>> I’m trying to untangle the information available in the openwrt wiki:
>>> https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
>>> https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm-details
>>> and for the latter especially the part here: https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm-details#sqmlink_layer_adaptation_tab
>>> 
>>> For ADSL/VDSL, I believe the instructions are clear and the Luci interface is too. However for ethernet/fiber, I’m confused:
>>> 
>>> In the first list of this paragraph it is first suggested to use « Ethernet with overhead » and set the per-packet overhead to 44 for FFTH (which seems like a large value for this use case),
>> 
>> That is the point here, 44 is a value that in all likelihood is >= any realistic true overhead. Gently over-estimating the true overhead has a relative small cost in potential throughput, underestimating the overhead however can result in noticeable degradation of responsiveness under working conditions, so the recommendation is to rather err on the side of too large an overhead and not too small an overhead.
>> Why not simply recommend the worst case scenario `overhead 44 atm` to be on the safe side on all links? Because the ATM/AAL5 encapsulation is only used on ADSL links (so is getting rarer and rarer and the ATM encapsulation results in a >=9% throughput reduction on non-ATM links, which is IMHO too steep a price... plus the ATM/AAL5 encapsulation size in addition also depends on the packet size so not a reasonable default in a world where ATM-usage is on the way out.
> 
> I hear your argument, however the point here is that either we offer a « single click » solution, and then we shouldn’t even bother allowing to tweak the 44 setting by default, or we allow customizing this value and then it seems logical to offer precise guidance on how to do so, especially in the « detailed » section of the wiki.
> 
> Currently we achieve neither IMHO, hence my initial email :)
> 
>>> then later in the second list (« the details »), it is suggested to use « None », directly contradicting the above.
>> 
>> Are you referring to:
>> 
>> 	• None: Fiber, and direct Ethernet connections generally do not need any kind of link layer adaptation. Well, I am kidding, all shaping below the physical gross-rate requires correct per-packet overhead accounting, but for fiber and ethernet it is much harder to figure out the exact overhead to specify… (the question is typically how is the ISP's upstream traffic shaper configured). For true ethernet shaping without VLANs specify 38 bytes (mpu 84).
>> 
>> I was under the impression that the "Well, I am kiddung" part was clear enough, no?
> 
> It wasn’t to me. And I don’t think that « jokes » should be part of a technical explanation that may be read by non-native speakers (like myself): it’s likely to cause confusion (as it did for me).
> 
> So I’ll try to edit this section to move the relevant information back where it belongs.
> 
>>> The 44 byte overhead for ethernet/FTTH is also mentioned here: https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
>>> 
>>> More specifically, there are two (increasingly common I think) use cases I would like to document with your help:
>>> 
>>> - FTTH with plain DHCP, no VLAN
>>> - FTTH with PPPoE, no VLAN
>>> (And adding a footnote for the extra overhead to consider if the above include a VLAN tag)
>> 
>> 	I am with you, I would like to have these settled as well, but alas FTTH is not terribly well defined as a technology. For active optical networks the encapsulation is likely ethernet framing, but for PONs like GPON and XGS-PON it is far less clear what needs to be accounted for. Yes with PON large parts of the ethernet framing overhead are replaced by a smaller GEM header, but how to account for the request-grant traffic and stuff...
>> 	The good thing is that gently over-estimating the per-packet overhead only leads to a relative small reduction in maximal theoretical throughput, so `overhead 44` is still a decent recommendation even for FTTH.
> 
> Hmm ok.
> 
>>> In the latter case (FTTH with PPPoE), another point that needs to be clarified is: do we apply CAKE to the ethernet interface, or to the PPP interface?
>> 
>> 	That is your choice...
> 
> Well I don’t really care to choose (and I suspect a lot of users don’t either), except for the most relevant/efficient choice if there is one: which would that be? :)
> In any case I suspect this is a FAQ that should be addressed, even if with a simple « it doesn’t matter ».
> 
>>> (and I assume that depending on the answer, the overhead settings will have to be adjusted).
>> 
>> 	It used to yes, but cake is smart enough to get the size of the IP packet and add the overhead on top of that, so the overhead will not depend on whether you instantiate cake on say eth0 or on pppoe-wan (assuming pppoe-wan uses eth0). HOWEVER for simple.qos and simplest.qos it again matters...
> 
> Could you elaborate? I’ll try to integrate your comments in my update to the wiki, with your permission.
> 
>>> Also in that case, what about ISPs that allow sending a full 1500 frame over PPPoE (using 1508 MTU on the underlying ethernet interface)?
>> 
>> 	SQM with cake does not care about that, it sees the IP packet size and adds the configured overhead. That wat cake also has no issue with GRO/GSO meta packets which can be up to 64KB in size abd still get accounted for correctly. Baby-jumbo frames from that perspective simply result in IP packet sizes > 1492. 
> 
> OK, understood.
> 
> Thanks again,
> Thibaut




More information about the openwrt-devel mailing list