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.

  1. Grab the latest BBR source from Linus's repo: BBR OFFICIAL SOURCE
  2. Tweak the parameters whatever you want.
  3. 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.
  4. Build it with the following makefile (change the filename to what your filename is):

    obj-m:=tcp_bbr.o
  5. Make it by command

    make -s -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=`which gcc`
  6. Copy your .ko file to module folder with command like

    cp -rf ./tcp_bbr.ko /lib/modules/$(uname -r)/kernel/net/ipv4
  7. Install the module with insmod /path/to/your/bbr.ko
  8. Run depmod to resolve dependency
  9. 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
  10. Write your module filename (without .ko extension) to /etc/modules to load the module on startup.
  11. You can also enable tcp fastopen by appending net.ipv4.tcp_fastopen = 3 to the config file. (Do not enable it on versions earlier than 4.11)
  12. For all the possible configuration values, refer to kernel doc
    A sample modified version is available here