< Back
BasedAI Logo

BBR Congestion Control for Improved Latency

Updated: May 18, 2024

Summary

Alignment is the human’s ability to forecast contextual problems which are or will be caused by the human outside of the task already being done by the AI.

Speed is a critical factor in decentralized artificial intelligence. BasedAI nodes planning on running validators or miners are recommended to enable the BBR congestion control algorithm; nodes with BBR active can expect a decrease in latency by approximately 53% and an increase in throughput by 14%, providing a significant efficiency improvement relative to competitor networks.

For more information about BBR: https://github.com/google/bbr.

Prerequisites

Ensure that your kernel version is 4.9 or above, as BBR requires a Linux kernel that supports this feature.

Use this command to check your kernel version:

uname -r

Enabling BBR

  1. Update sysctl Configuration

    • Open the sysctl configuration file in a text editor:
      sudo nano /etc/sysctl.conf
    • Add the following lines at the end of the file to enable BBR:
      net.core.default_qdisc=fq
      net.ipv4.tcp_congestion_control=bbr
  2. Reload sysctl Configuration

    • Apply the changes by running the following command:
      sudo sysctl -p
  3. Verify BBR is Running

    • Confirm that BBR is now the active TCP congestion control algorithm:
      sysctl net.ipv4.tcp_congestion_control
    • The command should output:
      net.ipv4.tcp_congestion_control = bbr

Additional Commands (Optional)

Change the TCP Congestion Control Algorithm Dynamically If you want to change the TCP congestion control algorithm without rebooting or without editing the sysctl configuration, use:

sudo sysctl -w net.ipv4.tcp_congestion_control=bbr

To switch to other algorithms like cubic or reno, use similar sysctl commands:

sudo sysctl -w net.ipv4.tcp_congestion_control=cubic
sudo sysctl -w net.ipv4.tcp_congestion_control=reno

Testing BBR

To see the effects of enabling BBR, you may want to perform network throughput tests:

  • Using iperf3: install iperf3 on both the server and client, then run the server:
    iperf3 -s
  • On the client side, connect to the server to initiate the test:
    iperf3 -c <server_ip>
  • Using SCP for File Transfer:
    You can transfer a large file using scp to see the differences in transfer speeds. Remember to have tc configured to emulate latency and packet loss if you want a controlled testing environment for BBR's behavior under various network conditions.

Warmly,

Based Labs