# Ten months of fighting bufferbloat on cable, and why I stopped writing my own controller

> What building an adaptive CAKE controller taught me about cable links, and why cake-autorate replaced it.

Status: active · Kind: note · Date: 2026-11-28

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](https://github.com/lynxthecat/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](https://github.com/kevinb361/cake-autorate-tools/blob/main/docs/CABLE_SQM_NOTES.md).

## 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 `tc` call 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](https://github.com/kevinb361/wanctl); the pieces still in use live in
  [cake-autorate-tools](https://github.com/kevinb361/cake-autorate-tools).

## What carries over to your cable link

1. **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.
2. **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.
3. **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.
4. **CAKE's `rtt` matters, 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.
5. **Re-test the winners together.** Settings that won one at a time stopped winning in combination.
6. **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.
7. **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.
8. **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`](https://github.com/kevinb361/wanctl/blob/main/docs/CABLE_TUNING.md).
