nixos/home: Use BBR on castle and the routers
`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: uploading from `river` to `estuary`, it averaged 185 Mbit/s against CUBIC's 149 Mbit/s. Add a `my.network.bbr` option and enable it on `castle`, which uploads to colony, and on the home routers. The routers only gain for their own connections, since congestion control doesn't apply to forwarded traffic. BBR paces itself, so the default qdisc is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c3e7a4daa3
commit
7b27f66ab2
3 files changed
+18
No files matched your search
@@ -221,6 +221,7 @@ in
|
||||
|
||||
my = {
|
||||
tmproot.size = "24G";
|
||||
network.bbr = true;
|
||||
|
||||
user = {
|
||||
config.extraGroups = [ "input" ];
|
||||
|
||||
@@ -317,6 +317,7 @@ in
|
||||
as211024 = config.age.secrets."l2mesh/as211024.key".path;
|
||||
};
|
||||
};
|
||||
network.bbr = true;
|
||||
firewall = {
|
||||
trustedInterfaces = [ "lan-hi" "lan-lo" ];
|
||||
udp.allowed = [ 5353 ];
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
inherit (lib) flatten optional mkIf mkDefault mkMerge versionAtLeast;
|
||||
inherit (lib.my) mkBoolOpt';
|
||||
|
||||
cfg = config.my.network;
|
||||
in
|
||||
{
|
||||
options.my.network.bbr = mkBoolOpt' false
|
||||
("Whether to use BBR congestion control for TCP connections this box sends. Unlike the default " +
|
||||
"(CUBIC), BBR doesn't treat packet loss as congestion, so it keeps throughput up on lossy paths. " +
|
||||
"It has no effect on traffic the box forwards.");
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
networking = {
|
||||
@@ -22,6 +30,14 @@ in
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.bbr {
|
||||
# BBR paces its own sending, so the default qdisc (fq_codel) stays as it is.
|
||||
boot = {
|
||||
kernelModules = [ "tcp_bbr" ];
|
||||
kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf config.my.build.isDevVM {
|
||||
networking.interfaces.eth0.useDHCP = mkDefault true;
|
||||
virtualisation = {
|
||||
|
||||
Reference in new issue
Block a user