VDSL2 overheads and CAKE
I have been experimenting with using CAKE and traffic shaping on my Linux router to eliminate bufferbloat on my Internet connection. My local network links are mostly 1 Gbps, including the link between my router and VDSL2 modem. The modem is configured in bridge mode and syncs reliably at an upsteam rate of 19,999 kbps.
In order for CAKE to ensure that the flow of outbound traffic won’t exceed the link rate, it needs to be told what that maximum link rate is and what the per-packet overhead will be due the encapsualtion used on that link.
VDSL2 transports Ethernet frames using Packet Transfer Mode (PTM) with a 64/65 octet encapsulation. This means that every 65th byte is a control byte rather than a payload byte. This overhead can be easily accounted for by reducing the line rate accordingly: 19,999 kbps × 64 ÷ 65 = 19,691 kbps.
Finding clear information on the per-packet overheads was more difficult. The following table shows what I think the overheads are when encapsulating an IP packet over this VDSL link.
|PPPoE||Version & Type||1||6|
|PTM||Start of frame (S)||1||4|
|End of frame (Ck)||1|
My ISP (AAISP) uses PPPoE which introduces 8 bytes of overhead. Then there are the standard Ethernet headers with the addition of a 4-byte VLAN tag (101) injected by the modem. Finally, there are an additional 4-bytes to transfer the Ethernet frame using PTM.
A total additional overhead of 34 bytes seems to agree with the corresponding keyword options in tc-cake, which gives me some confidence. The pppoe-ptm option equates to 30 bytes overhead and ether-vlan to an additional 4 bytes. I have also used the noatm option to disable compensation for the 64/65 octet encoding, as this has already been accounted for by calculating a reduction in the line rate (bandwidth).
The command to configure CAKE on my wan interface (renamed from eth1) is:
tc qdisc replace root dev wan cake bandwidth 19691kbit pppoe-ptm ether-vlan noatm
It seems to be performing well on DSLReports’ bufferbloat test. Latency increases by less than 5 ms when the upload is fully saturated at 20 Mbps.