Skip to content

damachine/bbr_classic-multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bbr_classic-multi

This Linux kernel module brings the original BBRv1 back as bbr_classic, so you can use both BBRv1 and BBRv2/3 side by side. Why this: On BBRv2/3-patched kernels (e.g. CachyOS, TKG, Zen, Liquorix, and Xanmod), BBRv1 is replaced by BBRv2/3.


Install (build manual)

Builds and installs as kernel module. Requires kernel headers.

git clone https://github.com/damachine/bbr_classic-multi.git
cd bbr_classic-multi
make                # download tcp_bbr.c and build the module
sudo make install   # install module permanently (no DKMS)

Install as DKMS package

git clone https://github.com/damachine/bbr_classic-multi.git
cd bbr_classic-multi
sudo make dkms-install

Uninstall:

sudo make dkms-uninstall

Install bbr-classic-dkms (Arch-based distros)

git clone https://github.com/damachine/bbr_classic-multi.git
cd bbr_classic-multi
makepkg -si

Uninstall:

pacman -R bbr-classic-dkms

Load & activate

# load module
sudo modprobe tcp_bbr_classic
# set Qdisc and congestion control algorithm
sudo sysctl -w net.core.default_qdisc=fq
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr_classic

Verify:

# check module info
modinfo tcp_bbr_classic
# check module is loaded
lsmod | grep bbr_classic
# check congestion control algorithm and Qdisc
sysctl net.ipv4.tcp_congestion_control
sysctl net.core.default_qdisc

Persistent

# add sysctl config file for persistent settings
sudo tee /etc/sysctl.d/99-bbr-classic.conf << EOF
# Set Qdisc (Fair Queue)
net.core.default_qdisc=fq
# Enable BBR Classic as TCP Congestion Control
net.ipv4.tcp_congestion_control=bbr_classic
EOF
# reload sysctl settings
sudo sysctl --system

Testing performance

Requires iperf3 and a server that allows selecting the congestion control algorithm.

# compare against BBRv3
iperf3 -c <server> -C bbr

# test BBR Classic
iperf3 -c <server> -C bbr_classic

See also: [CachyOS/linux-cachyos#706] for benchmark results.


Technical Implementation

Build tcp_bbr_classic.c from tcp_bbr.c source:

  • The unmodified BBRv1 source tcp_bbr.c is downloaded from the main Linux tree

Patches in tcp_bbr_classic.c:

  • renames string literal "bbr" to "bbr_classic" for new congestion control name

  • renames struct bbr to avoid symbol conflicts with in-tree BBRv3

  • replaces BTF kfunc registration with a no-op (CONFIG_DEBUG_INFO_BTF_MODULES compatibility)

  • checks for BBRv3 kernels

The BBRv1 algorithm itself is untouched.


Credits

Original idea and approach by cmspam/bbr_classic.

License

GPL-2.0

About

Keep BBRv1 available alongside BBRv2/3

Topics

Resources

License

Stars

Watchers

Forks

Contributors