TCP BBR (Bottleneck Bandwidth and Round-trip propagation time) is an advanced TCP congestion control mechanism developed by Google. It measures congestion by analyzing round-trip time (RTT), which helps achieve higher and more stable network bandwidth and reduced packet latency. BBR dynamically adjusts to network conditions while maintaining a high data transfer rate, even during short-term network issues.
This tutorial will guide you through the process of activating BBR on CentOS 7.
Requirements
To enable BBR (Bottleneck Bandwidth and Round-trip propagation time) on your system, your kernel must be at least version 4.9. For instance, VPS Sell Container VPS servers use kernel version 3.10.0, and Storage VPS servers use kernel version 2.6.32, which are not compatible with BBR. Ensure you have a Linux VPS with an appropriate kernel version.
You can check your kernel version with the command:
uname -r
If your kernel version is outdated, you may need to upgrade it.
Enabling BBR
To activate BBR, you need to update the sysctl settings by modifying the sysctl.conf
file. The required settings include using the Fair Queue (FQ) and enabling BBR.
Edit the sysctl configuration file:
vi /etc/sysctl.conf
Add the following lines:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
Apply the changes:
You can use the sysctl command to apply the new settings:
sysctl --system
Alternatively, use echo
commands to append the settings and then apply them:
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
Checking if BBR is Enabled
To verify that BBR is enabled, use the following commands:
Check available congestion control algorithms:
sudo sysctl net.ipv4.tcp_available_congestion_control
The output should be similer to this:
net.ipv4.tcp_available_congestion_control = bbr cubic reno
Confirm the active congestion control algorithm:
sudo sysctl -n net.ipv4.tcp_congestion_control
The output should be bbr
.
Testing
Run tests using tools such as iperf3
or wget
to evaluate whether your network speed has improved after enabling BBR.
Before
After
Before
After
Keep in mind that network speed improvements can vary widely based on multiple factors, so enabling BBR may not resolve all speed issues. While BBR has significantly enhanced performance in some cases, in others, the speed increase might be modest. BBR is particularly effective for optimizing performance in multi-hop networks, such as those connecting servers in Europe and America.
For further details on BBR and its congestion control algorithm, refer to the Google documentation.