RHEL BasedRocky Linux

How To Enable BBR on Rocky Linux 9

Enable BBR on Rocky Linux 9

In the ever-evolving landscape of network performance optimization, BBR (Bottleneck Bandwidth and Round-trip propagation time) has emerged as a game-changing congestion control algorithm. For Rocky Linux 9 users seeking to enhance their network throughput and reduce latency, enabling BBR can be a crucial step. This comprehensive guide will walk you through the process of implementing BBR on Rocky Linux 9, providing you with the knowledge and tools to boost your system’s network performance.

Understanding BBR

Before diving into the implementation process, it’s essential to grasp what BBR is and why it’s beneficial for your Rocky Linux 9 system.

What is BBR?

BBR, which stands for Bottleneck Bandwidth and Round-trip propagation time, is a congestion control algorithm developed by Google. It’s designed to optimize network performance by more accurately modeling network traffic and adapting to various network conditions.

How BBR Works

Unlike traditional loss-based congestion control algorithms, BBR uses a model-based approach. It continuously measures the network’s bottleneck bandwidth and round-trip propagation time, allowing it to optimize data transmission rates. This approach enables BBR to maintain high throughput and low latency, even in challenging network environments.

Benefits of Using BBR

Implementing BBR on your Rocky Linux 9 system can yield several advantages:

  • Improved throughput, especially on long-distance or high-latency connections
  • Reduced bufferbloat and lower latency
  • Better performance in networks with packet loss
  • More efficient utilization of available bandwidth

Comparison with Other Congestion Control Algorithms

Compared to traditional algorithms like CUBIC or Reno, BBR often provides superior performance, particularly in networks with high bandwidth-delay products or occasional packet loss. However, it’s important to note that the effectiveness of BBR can vary depending on specific network conditions and configurations.

Prerequisites

Before proceeding with the BBR implementation on Rocky Linux 9, ensure you meet the following requirements:

System Requirements

  • A system running Rocky Linux 9
  • Kernel version 4.9 or later (Rocky Linux 9 uses kernel 5.14 by default, which supports BBR)
  • Sufficient system resources (CPU, memory) to handle increased network throughput

Root Access or Sudo Privileges

You’ll need root access or sudo privileges to modify system settings and kernel parameters.

Basic Knowledge of Linux Commands

Familiarity with basic Linux commands and text editors (such as nano or vim) will be helpful throughout this process.

Checking Current Congestion Control Algorithm

Before enabling BBR, it’s crucial to identify the congestion control algorithm currently in use on your Rocky Linux 9 system.

Using sysctl Command

To check the current algorithm, open a terminal and run the following command:

sysctl net.ipv4.tcp_congestion_control

Interpreting the Output

The output will display the active congestion control algorithm. For example:

net.ipv4.tcp_congestion_control = cubic

This indicates that the system is currently using the CUBIC algorithm, which is the default for many Linux distributions.

Enabling BBR on Rocky Linux 9

Now that we’ve confirmed the current congestion control algorithm, let’s proceed with enabling BBR on your Rocky Linux 9 system.

Updating the System

First, ensure your system is up to date:

sudo dnf update -y

Loading the BBR Module

BBR is included in the Linux kernel from version 4.9 onwards. To load the BBR module, run:

sudo modprobe tcp_bbr

Configuring sysctl Parameters

Next, we’ll configure the necessary sysctl parameters to enable BBR:

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

Making Changes Persistent Across Reboots

To ensure BBR remains enabled after system reboots, add the following lines to the /etc/sysctl.conf file:

sudo nano /etc/sysctl.conf

# Add these lines at the end of the file
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

Save the file and exit the editor. Then, apply the changes:

sudo sysctl -p

Verifying BBR Implementation

After enabling BBR, it’s important to verify that it’s active and functioning correctly.

Checking Active Congestion Control Algorithm

Run the following command to confirm BBR is now the active algorithm:

sysctl net.ipv4.tcp_congestion_control

The output should show:

net.ipv4.tcp_congestion_control = bbr

Monitoring Network Performance

To observe the impact of BBR on your network performance, you can use tools like iperf3 or netperf. These tools allow you to measure throughput and latency under various network conditions.

Optimizing BBR Settings

While BBR works well with default settings, you may want to fine-tune its performance for your specific use case.

Fine-tuning sysctl Parameters

Consider adjusting the following sysctl parameters to optimize BBR performance:

sudo sysctl -w net.ipv4.tcp_notsent_lowat=16384
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0

Adjusting TCP Settings for BBR

You can also modify TCP settings to complement BBR’s operation:

sudo sysctl -w net.ipv4.tcp_low_latency=1
sudo sysctl -w net.ipv4.tcp_autocorking=0

Remember to add these settings to /etc/sysctl.conf for persistence across reboots.

Troubleshooting Common Issues

While enabling BBR on Rocky Linux 9 is generally straightforward, you may encounter some issues. Here are solutions to common problems:

BBR Not Loading

If BBR doesn’t load, ensure the module is available:

lsmod | grep bbr

If it’s not listed, try loading it manually:

sudo modprobe tcp_bbr

Performance Not Improving

If you don’t see significant performance improvements with BBR:

  • Verify that BBR is actually in use for your connections using ss -info
  • Check for any network bottlenecks unrelated to congestion control
  • Consider your specific network conditions; BBR may not always outperform other algorithms

Compatibility Issues

In some cases, BBR may not be compatible with certain network equipment or configurations. If you experience connectivity issues after enabling BBR, temporarily revert to the previous congestion control algorithm and investigate further.

BBR vs Other Congestion Control Algorithms

Understanding how BBR compares to other algorithms can help you decide if it’s the right choice for your Rocky Linux 9 system.

Comparison with CUBIC

CUBIC, the default congestion control algorithm in many Linux distributions, performs well in many scenarios. However, BBR often outperforms CUBIC in:

  • High bandwidth-delay product networks
  • Networks with random packet loss
  • Situations requiring quick recovery from congestion events

Scenarios where BBR Excels

BBR is particularly effective in:

  • Long-distance WAN connections
  • Cellular networks with varying bandwidth and latency
  • Environments with intermittent packet loss not caused by congestion

Best Practices and Considerations

To get the most out of BBR on your Rocky Linux 9 system, keep these best practices in mind:

When to Use BBR

Consider implementing BBR when:

  • You’re experiencing high latency or packet loss
  • Your network involves long-distance connections
  • You need to maximize throughput in challenging network conditions

Monitoring and Maintenance

Regularly monitor your network performance after enabling BBR. Use tools like iftop, nethogs, or nload to keep track of network usage and performance metrics. Periodically review and adjust your BBR configuration as needed to ensure optimal performance.

Congratulations! You have successfully enabled BBR. Thanks for using this tutorial to boost network performance by enabling TCP BBR on Rocky Linux 9 system. For additional help or useful information, we recommend you check the official Debian website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button