nixos: Use BBR for TCP sent from colony and home #2

Merged
dev merged 1 commits from bbr-castle-routers into master 2026-11-25 18:20:55 +00:00

Adds a my.network.bbr option, which switches locally originated TCP to BBR congestion control (tcp_bbr plus net.ipv4.tcp_congestion_control = bbr). It's enabled on the boxes that send data across colony's port in ColoClue DC6, and on the home boxes that upload to it.

Why

estuary's port on the ColoClue DC6 members switch loses bursts of packets whenever the switch floods other members' traffic to it, every 15–120 s. CUBIC treats each burst as congestion. It falls to ~5–10 Mbit/s and takes 20–30 s to recover, so it never gets back to full speed between floods. BBR doesn't back off on loss and recovers within a second.

Measured on 25 November with single-stream iperf3 between river (Digiweb) and estuary, two 150 s runs of each:

Direction CUBIC BBR
estuary → river (colony → home) 258 Mbit/s 899 Mbit/s
river → estuary (home → colony) 149 Mbit/s 185 Mbit/s

Uploads gain less because the Digiweb upload is capped at 200 Mbit/s, and part of that path's loss isn't caused by the floods.

Where it's enabled

Congestion control is chosen by the sending side, and it doesn't apply to forwarded traffic.

Box Why
middleman (container on shill) nginx sends everything it proxies, including Jellyfin
shill loads tcp_bbr for its containers; containers created after boot copy the VM's setting
git Gitea, clones and fetches over SSH and HTTPS
whale2 game servers (Minecraft is TCP)
colony its own off-box traffic, such as backups
castle uploads to colony
river, stream (via routing-common) their own connections only

estuary is left alone, because it only forwards these flows.

Notes:

  • middleman sets it explicitly. A container's network namespace copies the host's value only when it's created, so without that it would keep CUBIC until its next restart. systemd-sysctl runs inside containers, because it only needs /proc/sys/net/ to be writable.
  • The default qdisc is left as fq_codel. BBR paces its own sending, and setting default_qdisc = fq would also change the forwarding queues on the routers.
  • The kernels are all stock nixpkgs ones, which build tcp_bbr as a module. river and estuary loaded it during the test.

Testing

  • check-system evaluation passes for colony, shill, middleman, git, whale2, castle, river and stream. Each gets the sysctl and tcp_bbr; estuary and palace are unchanged.
  • Existing connections keep CUBIC until they reconnect.

🤖 Generated with Claude Code

Adds a `my.network.bbr` option, which switches locally originated TCP to BBR congestion control (`tcp_bbr` plus `net.ipv4.tcp_congestion_control = bbr`). It's enabled on the boxes that send data across colony's port in ColoClue DC6, and on the home boxes that upload to it. ## Why `estuary`'s port on the ColoClue DC6 members switch loses bursts of packets whenever the switch floods other members' traffic to it, every 15–120 s. CUBIC treats each burst as congestion. It falls to ~5–10 Mbit/s and takes 20–30 s to recover, so it never gets back to full speed between floods. BBR doesn't back off on loss and recovers within a second. Measured on 25 November with single-stream iperf3 between `river` (Digiweb) and `estuary`, two 150 s runs of each: | Direction | CUBIC | BBR | |---|---|---| | `estuary` → `river` (colony → home) | 258 Mbit/s | 899 Mbit/s | | `river` → `estuary` (home → colony) | 149 Mbit/s | 185 Mbit/s | Uploads gain less because the Digiweb upload is capped at 200 Mbit/s, and part of that path's loss isn't caused by the floods. ## Where it's enabled Congestion control is chosen by the sending side, and it doesn't apply to forwarded traffic. | Box | Why | |---|---| | `middleman` (container on `shill`) | nginx sends everything it proxies, including Jellyfin | | `shill` | loads `tcp_bbr` for its containers; containers created after boot copy the VM's setting | | `git` | Gitea, clones and fetches over SSH and HTTPS | | `whale2` | game servers (Minecraft is TCP) | | `colony` | its own off-box traffic, such as backups | | `castle` | uploads to colony | | `river`, `stream` (via `routing-common`) | their own connections only | `estuary` is left alone, because it only forwards these flows. Notes: - `middleman` sets it explicitly. A container's network namespace copies the host's value only when it's created, so without that it would keep CUBIC until its next restart. `systemd-sysctl` runs inside containers, because it only needs `/proc/sys/net/` to be writable. - The default qdisc is left as `fq_codel`. BBR paces its own sending, and setting `default_qdisc = fq` would also change the forwarding queues on the routers. - The kernels are all stock nixpkgs ones, which build `tcp_bbr` as a module. `river` and `estuary` loaded it during the test. ## Testing - `check-system` evaluation passes for `colony`, `shill`, `middleman`, `git`, `whale2`, `castle`, `river` and `stream`. Each gets the sysctl and `tcp_bbr`; `estuary` and `palace` are unchanged. - Existing connections keep CUBIC until they reconnect. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
slop-cannon Bot added 1 commit 2026-11-25 18:11:57 +00:00
nixos: Use BBR for TCP sent from colony and home
CI / Check, build and cache nixfiles (push) Successful in 1h17m9s
Update docs / update (push) Failing after 1m10s
6996096765
`estuary`'s port in ColoClue DC6 loses bursts of packets whenever the
members switch floods other members' traffic to it. CUBIC treats each
burst as congestion and takes 20-30 s to recover, longer than the gap
between floods. BBR keeps going. Between `estuary` and `river`, it
averaged 899 Mbit/s against CUBIC's 258 Mbit/s downloading from
colony, and 185 against 149 Mbit/s uploading to it.

Add a `my.network.bbr` option. Congestion control is chosen by the
sender, so enable it on the colony boxes that send data off-box
(`colony`, `shill` and its `middleman` proxy, `git`, `whale2`), and
for uploads on `castle` and the home routers. Forwarded traffic isn't
affected, so the routers only gain for their own connections and
`estuary` is left alone. BBR paces itself, so the default qdisc
stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot force-pushed bbr-castle-routers from 7b27f66ab2 to 6996096765 2026-11-25 18:11:57 +00:00 Compare
slop-cannon Bot changed title from nixos/home: Use BBR on castle and the routers to nixos: Use BBR for TCP sent from colony and home 2026-11-25 18:12:07 +00:00
dev merged commit 6996096765 into master 2026-11-25 18:20:55 +00:00
dev deleted branch bbr-castle-routers 2026-11-25 18:20:55 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/nixfiles#2