Ten months of fighting bufferbloat on cable, and why I stopped writing my own controller
I spent most of a year building wanctl, an adaptive CAKE controller: it watched latency to a few outside hosts twenty times a second and moved CAKE’s bandwidth limit to keep queues short. It worked. Then I tried cake-autorate, an existing open-source controller, and I never got my own controller to beat it. This is what I learned on the way, the part that should help anyone running CAKE on cable. The short version, without the story, is in the notes on CAKE over cable.
How it went
- Router first. wanctl started by driving CAKE queues on a MikroTik router over its REST API. REST beat SSH clearly for rate writes (about 50 ms per command against 150-200 ms), so it became the transport.
- Then a Linux bridge. Shaping moved to a small Linux box sitting inline between the modem and the router, where a
rate change is a local
tccall instead of a network round trip. The faster loop changed which controller settings won, which was a lesson in itself. - Then cake-autorate. On the VDSL2 link cake-autorate measured the same as my controller within noise, and both links moved to it. My code became a state bridge, a metrics exporter and a steering daemon around it, and the controller was retired. The repository is archived at github.com/kevinb361/wanctl; the pieces still in use live in cake-autorate-tools.
What carries over to your cable link
- Cable is jittery when idle. The upstream is scheduled by the cable company’s head-end, so RTT wobbles by several milliseconds with nothing happening. A controller that reacts to every wobble cuts your rate on noise. Require a delay to persist before reacting.
- Give the upload real headroom. If you shape upload close to your plan speed, the modem and the head-end queue the excess, and that queue is outside your control. Mine settled near 80% of plan.
- Some evenings are not your problem. On a busy cable node, evening latency can sit in the ISP’s network. I tried a lower evening download cap for a few days; as far as I could tell it barely changed latency and cost about a quarter of my evening throughput, though it was not a controlled test. Look at where the delay is (CAKE’s own queue delay versus the RTT rise to an outside host) before spending bandwidth on it.
- CAKE’s
rttmatters, and it interacts. About twice the baseline RTT worked best here. Changing it flipped which delay threshold was best, so re-test thresholds after changing it. - Re-test the winners together. Settings that won one at a time stopped winning in combination.
- On an inline bridge, check the boring things first. With GRO, GSO, TSO and hw-tc-offload on, CAKE saw giant packets and upload suffered a severe ping-loss mode; turning them off eliminated it. Confirm which port shapes which direction from packet counters, not interface names. Test each extra CAKE keyword alone.
- Your latency probes are traffic. My upload collapsed during tests while the controller probed outside hosts. Turning off one probe stream helped but did not fix it, and I never proved the cause. Fewer, slower probes are one experiment worth running.
- Measure like it matters. Back-to-back A/B runs, repeated, at recorded times of day, against a test server you control. Public speed-test servers fail in ways that look exactly like shaping problems.
Why I stopped
I never beat cake-autorate. What I did build, over ten months, was a lot of controller, tests and process for one house. The useful parts were the measurements and the observability, so those are what I kept. If you are thinking about writing your own controller: run cake-autorate first, measure it properly, and only then decide whether you have a problem it does not solve.
What the numbers are
All numbers are from one household: a residential DOCSIS link (about 40 Mbit/s upload) and a VDSL2 link, shaped on a Linux inline bridge. The test results were measured mostly with flent RRUL (some tcp_12down) from a LAN host to a self-hosted server about 22-25 ms away; the last bullet is passive monitoring, not a load test.
- Upload maximum, April 2026 (custom controller, RRUL): median RTT under load 173 ms at 38 Mbit/s, 89 ms at 35, 47-95 ms at 32, unstable at 30.
- CAKE
rtt, April 2026 (RRUL, one evening session): 40 ms beat 25, 35, 50 and 100 ms on median, p99 and throughput. - VDSL2, June 2026: cake-autorate and wanctl within noise (about 84 Mbit/s, p99 about 60 ms).
- Cable, 14 days to 30 October 2026, cake-autorate’s added delay (RTT rise over its own baseline) from passive 15-second Prometheus samples, with the RRUL test windows left out; the line was mostly lightly loaded, so this is everyday latency, not loaded-test latency: evening (19-23 US Central) median 0.25 ms, p95 10.6 ms, p99 24.9 ms; off-peak median 0.17 ms, p95 8.7 ms, p99 18.7 ms.
These are not recommendations for your link. The full April tuning history is in the archived repository’s
docs/CABLE_TUNING.md.