How to enable BBR on Ubuntu 16.04

BBR stands for Bottleneck Bandwidth and RTT is a congestion control system. You can enable TCP BBR on your Linux desktop to improve overall web surfing experience. By default, Linux uses the Reno and CUBIC congestion control algorithm.

Requirements

  • BBR requires Linux kernel version 4.9 or above. Since Ubuntu 16.04 comes with the '4.4.0-194-generic' kernel, You'll have to upgrade your kernel.

Upgrading kernel

Issue the following commands to upgrade your kernel.

apt update

apt install --install-recommends linux-generic-hwe-16.04

After running the above commands, reboot the server. Once the server is booted, check your current kernel version by using following command

uname -r 

Output:

[email protected]:~# uname -r
4.15.0-142-generic
[email protected]:~# 

The kernel is updated to above 4.9. Now we can go ahead to enable BBR

Run the following command to check available congestion control algorithms,

sysctl net.ipv4.tcp_available_congestion_control

Output:

[email protected]:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic

Run the below command to check the current congestion control algorithm used in your system,

sysctl net.ipv4.tcp_congestion_control

Output:

[email protected]:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = cubic

Enabling TCP BBR in Ubuntu

Open the following configuration file vi /etc/sysctl.conf to enable enable TCP BBR.

vi /etc/sysctl.conf

At the end of the config file, add the following lines.

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

Save the file, and refresh your configuration by using this command,

sysctl -p

Output:

[email protected]:~# sysctl -p
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

Now, Verify if BBR is enabled in your system,

sysctl net.ipv4.tcp_congestion_control

Output:

[email protected]:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr

Done!