BBR is new TCP congestion regulation module created by Google first introduced in kernel 4.10. It is claimed to use TCP bandwidth in a more efficient way and it did, but good enough at least in many geeks' point. There are a number of modified versions of BBR available on the internet which are basically just parameter tweaked from the base. You can make it too, here is how.
- Grab the latest BBR source from Linus's repo: BBR OFFICIAL SOURCE
- Tweak the parameters whatever you want.
- Install necessary dependencies: build-essentials, libelf-dev, gcc-4.9 and linux-header for your current kernel. You can download both kernel image and kernel header from UBUNTU MAINLINE REPO. Remember, you have to install both the image and header before compiling kernel module or it will definitely fail. The latest version at the time I wrote this article is 4.15rc9.
Build it with the following makefile (change the filename to what your filename is):
obj-m:=tcp_bbr.o
Make it by command
make -s -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=`which gcc`
Copy your .ko file to module folder with command like
cp -rf ./tcp_bbr.ko /lib/modules/$(uname -r)/kernel/net/ipv4
- Install the module with
insmod /path/to/your/bbr.ko
- Run
depmod
to resolve dependency Load module with modprobe and set sysctl parameter to use your module
net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr_powered(your module name) net.ipv4.tcp_slow_start_after_idle = 0
- Write your module filename (without .ko extension) to /etc/modules to load the module on startup.
- You can also enable
tcp fastopen
by appendingnet.ipv4.tcp_fastopen = 3
to the config file. (Do not enable it on versions earlier than 4.11) - For all the possible configuration values, refer to kernel doc
A sample modified version is available here
最后一次更新于2019-03-15
0 comment