What is TCP BBR?

Levent CENGIZ
Trendyol Tech
Published in
3 min readJun 18, 2020

We can define it as a new congestion control algorithm that started to be developed at Google in 2016, and it is called Bottleneck Bandwidth and Round-Trip Propagation Time (BBR).

Google, Google Cloud Platform, and Youtube actively use BBR. As Trendyol, we use BBR as a congestion protocol in all our CDN infrastructure.

The algorithm uses the maximum bandwidth and round-trip time provided by the latest outgoing data packets of the network to build an explicit model of the network. Each batch or selective approval of packet distribution produces a rate pattern that records the amount of data transmitted at the time interval between the transmission of a data packet and the approval of that packet.

Today when the Network Cards evolve from megabits per second to gigabits per second, BBR provides higher bandwidth and lower latency.

How to activate BBR?

It does not require any updates on the client-side.

Linux uses RENO and CUBIC congestion protocols by default. BBR is supported as of Linux Kernel 4.9.

CentOS/RHEL BBR activation:

You can use the following command to check your kernel version.

uname -r

The output example will be as follows:

kernel-3.10.0-1062.12.1.el7.x86_64

Since our current Kernel version is less than 4.9, we first need to update the Kernel version to activate the BBR.

ELRepo setup:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Kernel installation over ELRepo:

yum --enablerepo=elrepo-kernel install kernel-ml -y

Along with the completion of the installation successfully, you can view the Kernel versions available on your system with the rpm -qa | grep kernel command. The example of the output should be as follows.

kernel-tools-3.10.0-1062.12.1.el7.x86_64
kernel-ml-5.6.5-1.el7.elrepo.x86_64
kernel-tools-libs-3.10.0-1062.12.1.el7.x86_64
kernel-3.10.0-1062.12.1.el7.x86_64
kernel-headers-3.10.0-1062.18.1.el7.x86_64

As we can see in the output, our current version kernel installation has been completed and we need to update the default grub2 boot records to activate it.

To display all the records in grub2, you need to use the following command.

egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'

The output of the command will be as follows:

CentOS Linux (5.6.5-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.12.1.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-3d5c05376530a2eb49e3e90576f83c5b) 7 (Core)

The records under the group menu are listed based on 0. Therefore, we need to use the command grub2-set-default 0 to activate it. To activate the change we have made, we need to restart the server.

shutdown -r now

When the server is active again, let’s run the uname -r command again to verify that we are using the correct Kernel version.

The output will be as follows:

5.6.5–1.el7.elrepo.x86_64

Now that we have updated the Kernel version, we can make the BBR activation. To activate BBR, we need to make update on sysctl.

echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Using the command below, you can verify that you have activated BBR validly.

sudo sysctl net.ipv4.tcp_available_congestion_control

The output will be as follows:

net.ipv4.tcp_available_congestion_control = bbr cubic reno

Let’s check that the kernel module is installed validly

lsmod | grep bbr

The output will be as follows.

tcp_bbr 20480 503

Thereby, we have completed the BBR activation on CentOS/RHEL based systems.

--

--