Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux_router:tc [2026-05-13 Wed wk20 21:42] – [Persist Across Reboots] baumkplinux_router:tc [2026-07-12 Sun wk28 21:14] (current) – [Monitor CAKE statistics] baumkp
Line 23: Line 23:
 Test your connection at the [[https://www.waveform.com/tools/bufferbloat|Waveform Bufferbloat Test]] before doing anything. If you get a grade of C or worse, you have bufferbloat. Test your connection at the [[https://www.waveform.com/tools/bufferbloat|Waveform Bufferbloat Test]] before doing anything. If you get a grade of C or worse, you have bufferbloat.
  
-CAKE (Common Applications Kept Enhanced) is the modern Linux qdisc that fixes this. It combines Active Queue Management (AQM), Fair Queuing (FQ), and traffic shaping into a single qdisc. CAKE has been in the mainline kernel since 4.19, so no extra kernel modules are required on any modern distro. It replaced the older approach of combining fq_codel with htb shaping - CAKE does everything in one shot with less configuration.+[[https://www.man7.org/linux/man-pages/man8/tc-cake.8.html|CAKE]] (Common Applications Kept Enhanced) is the modern Linux qdisc that fixes this. It combines Active Queue Management (AQM), Fair Queuing (FQ), and traffic shaping into a single qdisc. CAKE has been in the mainline kernel since 4.19, so no extra kernel modules are required on any modern distro. It replaced the older approach of combining fq_codel with htb shaping - CAKE does everything in one shot with less configuration.
  
 ====Upload Shaping==== ====Upload Shaping====
 Apply CAKE to your WAN interface with your upload bandwidth set to 90-95% of measured speed: Apply CAKE to your WAN interface with your upload bandwidth set to 90-95% of measured speed:
- +  *''%%tc qdisc replace dev wan0 root cake bandwidth 450mbit besteffort wash nat ack-filter-aggressive%%''
-''tc qdisc replace dev wan0 root cake bandwidth 450mbit besteffort wash nat ack-filter-aggressive''+
  
 Key options: Key options:
Line 90: Line 89:
 ====Verify It Works==== ====Verify It Works====
  
-After applying CAKE, rerun the Waveform Bufferbloat Test . You should see latency under load drop from 200-500ms down to 5-15ms. Video calls stop freezing mid-sentence and game ping stays flat even during large transfers.+After applying CAKE, rerun the [[https://www.waveform.com/tools/bufferbloat|Waveform Bufferbloat Test]]. You should see latency under load drop from 200-500ms down to 5-15ms. Video calls stop freezing mid-sentence and game ping stays flat even during large transfers.
  
 ====Monitor CAKE statistics==== ====Monitor CAKE statistics====
-  *''tc -s qdisc show dev wan0''+  *''tc -s qdisc show dev wan0''  (Use IP a to check actual wan interface name, e.g. enp1s0)
   *''tc -s qdisc show dev ifb-wan0''   *''tc -s qdisc show dev ifb-wan0''
  
 This shows drops, ECN marks, and per-tin flow counts. If you see high drop rates, your bandwidth setting may be too close to the actual line speed. Lower it by another 5%. This shows drops, ECN marks, and per-tin flow counts. If you see high drop rates, your bandwidth setting may be too close to the actual line speed. Lower it by another 5%.
 +
 ====Links==== ====Links====
   *CAKE SQM   *CAKE SQM
     *[[https://botmonster.com/posts/build-linux-router-nftables-traffic-shaping/|Debian Router with nftables: CAKE SQM Reaches 15ms Latency]]     *[[https://botmonster.com/posts/build-linux-router-nftables-traffic-shaping/|Debian Router with nftables: CAKE SQM Reaches 15ms Latency]]
     *[[https://www.bufferbloat.net/projects/codel/wiki/Cake/|Cake - Common Applications Kept Enhanced]]     *[[https://www.bufferbloat.net/projects/codel/wiki/Cake/|Cake - Common Applications Kept Enhanced]]
 +    *[[https://www.bufferbloat.net/projects/codel/wiki/Cake/|Cake - Common Applications Kept Enhanced]]
 +    *[[https://www.bufferbloat.net/projects/codel/wiki/CakeRecipes/|Cake Recipes]]
 +    *[[https://www.bufferbloat.net/projects/codel/wiki/CakeTechnical/|Cake Technical Information]]
 +    *[[https://www.man7.org/linux/man-pages/man8/tc-cake.8.html|tc-cake]]
 +    *[[https://netdevconf.info/0x19/docs/netdev-0x19-paper16-talk-paper.pdf|mq-cake: Scaling software rate limiting across CPU cores]]
   *tc-fq_codel   *tc-fq_codel
     *[[https://www.man7.org/linux/man-pages/man8/tc-fq_codel.8.html|tc-fq_codel(8) — Linux manual page]]     *[[https://www.man7.org/linux/man-pages/man8/tc-fq_codel.8.html|tc-fq_codel(8) — Linux manual page]]
Line 118: Line 123:
   *Funtoo [[https://www.funtoo.org/Traffic_Control|Traffic Control]], good basic description.   *Funtoo [[https://www.funtoo.org/Traffic_Control|Traffic Control]], good basic description.
   *[[https://www.man7.org/linux/man-pages/man8/tc.8.html|man7.org - tc(8) — Linux manual page]]   *[[https://www.man7.org/linux/man-pages/man8/tc.8.html|man7.org - tc(8) — Linux manual page]]
 +  *[[https://www.man7.org/linux/man-pages/man8/tc-cake.8.html|tc-cake(8) — Linux manual page]]
 +  *[[https://www.man7.org/linux/man-pages/man8/tc-bpf.8.html|BPF programmable classifier and actions for ingress/egress
 +       queueing disciplines]]  
   *[[https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/linux-traffic-control_configuring-and-managing-networking#linux-traffic-control_configuring-and-managing-networking|Red Hat Documentation - Chapter 31. Linux traffic control]]   *[[https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/linux-traffic-control_configuring-and-managing-networking#linux-traffic-control_configuring-and-managing-networking|Red Hat Documentation - Chapter 31. Linux traffic control]]
 +  *ethtools
 +    *[[https://linuxvox.com/blog/linux-ethtool/|Unveiling the Power of Linux ethtool]]
 +    *[[https://www.baeldung.com/linux/using-ethtool|Using ethtool in Linux]]
 +    *[[https://linuxconcept.com/commands/ethtool|linux concept ethtool]]
 +    *[[https://sandilands.info/sgordon/segmentation-offloading-with-wireshark-and-ethtool|Segmentation and Checksum Offloading: Turning Off with ethtool]]
 +    *[[https://sokratisg.net/2012/04/01/udp-tcp-checksum-errors-from-tcpdump-nic-hardware-offloading/|UDP / TCP Checksum errors from tcpdump & NIC Hardware Offloading]]
 +    *[[https://docs.gz.ro/tuning-network-cards-on-linux.html| Linux Networking: How to disable/enable offload features, RX/TX checksum, scatter, gather and beyond]]
 +    *[[https://oneuptime.com/blog/post/2026-03-20-enable-gro-tso-linux-network/view| How to Enable Generic Receive Offload (GRO) and TCP Segmentation Offload (TSO)]]
  
 ---- ----
  
 <-  linux_router:dns_dhcp|Prev page ^ linux_router:start|Start page ^ linux_router:misc|Next page -> <-  linux_router:dns_dhcp|Prev page ^ linux_router:start|Start page ^ linux_router:misc|Next page ->