How To Enable TCP BBR on Ubuntu 22.04

This guide intends to teach you How To Enable TCP BBR on Ubuntu 22.04.

What Is TCP BBR?

During March and April 2019, CloudFront deployed a new TCP congestion control algorithm to help improve latency and throughput: the TCP bottleneck bandwidth and round trip (BBR) congestion control algorithm. BBR is an algorithm developed by Google that aims to improve performance for internet traffic. BBR works by observing how fast a network is already delivering traffic and the latency of current roundtrips. It then uses that data as input to packet-pacing heuristics that can improve performance.

The BBR algorithm provides a number of advantages over other congestion control methods. All TCP congestion control algorithms—such as CUBIC, Reno, and Vegas—attempt to balance packet transmission fairness with how they detect or respond to congestion or packet loss. Older algorithms can result in latency and throughput oscillation because they more aggressively back off packet transmission or recover more cautiously in response to packet loss detection. In contrast, BBR evaluates congestion by measuring roundtrip times, which provides higher, more stable throughput, while also improving latency. BBR responds more agilely to changing conditions but continues to aggressively attempt to transmit as much data as possible even when there are transient issues.

Steps To Enable TCP BBR on Ubuntu 22.04

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with Ubuntu 22.04.

Enable BBR Congestion Control Algorithm on Ubuntu 22.04

First, you need to update and upgrade your local package index with the following command:

sudo apt update && sudo apt upgrade -y

Then, you need to check your existing congestion controls on your server.

Check Existing Congestion Control Algorithms

Typically, Linux uses reno and cubic algorithms.

At this point, you need to run the following command to check what existing TCP congestion controls are in place:

sudo sysctl net.ipv4.tcp_congestion_control
Output
net.ipv4.tcp_congestion_control = cubic

In the above output, cubic is employed in our system, but your output may show different results.

Next, list available TCP congestion control algorithms on your server by using the following command:

sudo sysctl net.ipv4.tcp_available_congestion_control
Output
net.ipv4.tcp_available_congestion_control = reno cubic

From the output, reno and cubic are available, and once BBR has been added/enabled, this should feature BBR.

Add TCP BBR on Ubuntu 22.04

Now that you have checked the basics to confirm the available algorithms, you need to open the sysctl.conf file. Here we use the vi editor to open the file:

sudo vi /etc/sysctl.conf

Add the following content to the file:

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

When you are done, save and close the file.

Then, reload the configuration file with the command below:

sudo sysctl -p
Output
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

At this point, you need to verify that  BBR is enabled and active as the new TCP congestion control by using the following command on Ubuntu 22.04:

sudo sysctl net.ipv4.tcp_congestion_control
Output
net.ipv4.tcp_congestion_control = bbr

Also, you can use the command below to verify it:

lsmod | grep bbr
Output
tcp_bbr                20480  1

Finally, list available TCP congestion controls on your server again:

sudo sysctl net.ipv4.tcp_available_congestion_control

You should see BBR in your list:

Output
net.ipv4.tcp_available_congestion_control = reno cubic bbr

That’s it. You have successfully added BBR to your server.

Conclusion

At this point, you have learned to Enable TCP BBR on Ubuntu 22.04.

Hope you enjoy it.

You may also be interested in these articles:

How To Install WineHQ on Ubuntu 22.04

Install and Configure LibreNMS on Ubuntu 22.04

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!