Enable TCP BBR on AlmaLinux 9 | Best Congestion Algorithm

Posted on

Enable TCP BBR on AlmaLinux 9 | Best Congestion Algorithm

Enable TCP BBR on AlmaLinux 9 | Best Congestion Algorithm

In this comprehensive guide, we will walk you through the process of How To Enable TCP BBR on AlmaLinux 9. TCP BBR, which stands for Transmission Control Protocol Bottleneck Bandwidth and Round-trip propagation time, is a state-of-the-art TCP congestion control algorithm designed to optimize network performance in the face of modern internet congestion. Developed by Google in 2016, it offers significant improvements over traditional congestion control algorithms like Reno and Cubic.

Visit the Orcacore website for more in-depth information and other helpful guides. Let’s dive into an introduction to TCP BBR and its installation on AlmaLinux 9.

Introduction To TCP BBR (Congestion Control Algorithm)

The foundation of the internet rests on a network of interconnected nodes and links. Data packets traverse this network, hopping from one node to the next until they reach their destination. Each node is responsible for determining the next hop, aiming to guide the packet closer to its intended recipient. However, if the chosen path is congested, packets may be forced to wait in a queue. When these queues become full, packets are dropped, leading to network congestion. This phenomenon occurs when a network node or link is overwhelmed with more data than it can efficiently handle.

With billions of devices and connections constantly being established, from wired to wireless, the potential for network congestion is ever-present. A robust congestion control algorithm becomes crucial for mitigating these issues. This is precisely where TCP BBR shines. Enable TCP BBR on AlmaLinux 9 to see an improvement in network performance.

Before proceeding, ensure you are logged into your AlmaLinux 9 server as a non-root user with sudo privileges. If you need assistance with this, consult our guide on Initial Server Setup with AlmaLinux 9.

Enable BBR on AlmaLinux 9

Let’s proceed with the steps to enable TCP BBR on your AlmaLinux 9 server.

First, update your system’s package index and upgrade existing packages to their latest versions:

sudo dnf update && sudo dnf upgrade -y

Next, it’s essential to check the currently active congestion control algorithm.

Check Existing Congestion Control Algorithms

Linux systems typically utilize the reno or cubic algorithms by default.

To determine which algorithm is currently in use, execute the following command:

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

The output above indicates that cubic is currently active. Your system may display a different algorithm.

To list all available TCP congestion control algorithms, use this command:

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

The output shows that reno and cubic are available. Once BBR is enabled, it should also appear in this list.

Add TCP BBR on AlmaLinux 9

Now that you’ve verified the available algorithms, you need to modify the sysctl.conf file. Use the vi editor (or your preferred text editor) to open the file:

sudo vi /etc/sysctl.conf

Add the following lines to the end of the file:

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

Save the changes and close the file.

To apply the new configuration, reload the sysctl.conf file:

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

Verify that BBR is now enabled and active:

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

You can also confirm BBR’s activation by checking if the tcp_bbr module is loaded:

lsmod | grep bbr
Verify BBR Congestion algorithm

Finally, list the available TCP congestion controls again to confirm BBR is in the list:

sudo sysctl net.ipv4.tcp_available_congestion_control

You should now see BBR included in the output:

TCP BBR on AlmaLinux 9

Congratulations! You have successfully enabled BBR on your AlmaLinux 9 server. Enable TCP BBR on AlmaLinux 9 to improve network performance.

Conclusion

In this guide, you have learned How To Enable TCP BBR on AlmaLinux 9. TCP BBR is a powerful tool for optimizing network performance by improving congestion control, resulting in faster and more reliable data transmission. This is especially beneficial on high-speed and long-distance networks where it can reduce latency and increase throughput.

Please follow us on Facebook, YouTube, and X for more helpful guides and updates.

You might also find these articles interesting:

How To Install Postfix on AlmaLinux 9

How To Install Grafana on AlmaLinux 9

Enable and Configure CSF Firewall on CWP

Alternative Methods for Enabling TCP BBR on AlmaLinux 9

While the method described above is the most common and straightforward, there are alternative approaches to enable TCP BBR on AlmaLinux 9. Here are two such methods:

Method 1: Using tuned profiles

tuned is a system tuning daemon that dynamically adjusts system settings based on predefined profiles. We can create a custom tuned profile to enable BBR. This method offers more flexibility for managing various system settings alongside BBR.

Steps:

  1. Install tuned if it’s not already installed:

    sudo dnf install tuned -y
  2. Create a custom tuned profile directory:

    sudo mkdir /etc/tuned/custom-bbr
  3. Create a tuned.conf file in the custom profile directory:

    sudo vi /etc/tuned/custom-bbr/tuned.conf

    Add the following content to the file:

    [main]
    include = network-latency
    
    [sysctl]
    net.core.default_qdisc = fq
    net.ipv4.tcp_congestion_control = bbr

    This profile inherits from the network-latency profile and overrides the congestion control settings.

  4. Activate the custom profile:

    sudo tuned-adm profile custom-bbr
  5. Verify that BBR is enabled:

    sudo sysctl net.ipv4.tcp_congestion_control

    The output should show bbr.

  6. Ensure tuned service is enabled and running:

    sudo systemctl enable tuned
    sudo systemctl start tuned

    This approach allows you to manage BBR settings through the tuned daemon, providing a more integrated solution for system tuning.

Method 2: Using a Systemd Service

This method creates a systemd service to set the required kernel parameters at boot time. This is another persistent way to enable TCP BBR on AlmaLinux 9.

Steps:

  1. Create a systemd service file:

    sudo vi /etc/systemd/system/enable-bbr.service

    Add the following content to the file:

    [Unit]
    Description=Enable TCP BBR
    After=network.target
    
    [Service]
    Type=oneshot
    ExecStart=/usr/sbin/sysctl -w net.core.default_qdisc=fq
    ExecStart=/usr/sbin/sysctl -w net.ipv4.tcp_congestion_control=bbr
    
    [Install]
    WantedBy=multi-user.target
  2. Enable and start the service:

    sudo systemctl enable enable-bbr.service
    sudo systemctl start enable-bbr.service
  3. Verify that the service ran successfully:

    sudo systemctl status enable-bbr.service

    Check the output to ensure there are no errors.

  4. Verify that BBR is enabled:

    sudo sysctl net.ipv4.tcp_congestion_control

    The output should show bbr.

This method ensures that BBR is enabled at each system boot, providing a reliable and persistent solution. While both methods offer alternative ways to enable BBR, the simplest and most direct approach remains modifying /etc/sysctl.conf.

Leave a Reply

Your email address will not be published. Required fields are marked *