Get in touch:
01524 851 877
07718 896 553

Linux and TCP Congestion Control

Posted on Jun 12 2008 by Matthew Jakeman

I saw a question on the Ubuntu forums this morning from someone who has recently started using a satellite connection and was getting poor performance loading web pages, which is to be expected really with the high Bandwidth Delay Product (BDP) of satellite links.

The question was asking if there are any ways to tune TCP in Linux to perform better over this type of connection. There are obviously various TCP congestion control algorithms knocking about, cubic, reno, vegas, hybla etc but up until now I thought you had to recompile the kernel in order to change the algorithm being used. I was wrong.

It appears that since Linux kernel version 2.6.13 a new feature, pluggable congestion avoidance modules, has been supported. This enables the changing of the algorithm being used by simply issuing a sysctl command.

The available algorithms have to be configured when the kernel is compiled but once they have been set up they can be easily changed in a running kernel. In order to see what algorithms are already in your running kernel you can issue the command :

sysctl net.ipv4.tcp_available_congestion_control

If the algorithm you wish to use is not already in your running kernel you can find a list of them and compile them in in the following place using make menuconfig/xconfig :

Networking --->
Networking options --->
TCP: advanced congestion control --->
TCP congestion control --->

Once you have all the algorithms you want in your running kernel it is a simple matter to switch between them, for example to change to using the hybla algorithm (ideal for satellite links as it tries to keep the window size as large as possible on high BDP links) you just issue the following command (as root):

sysctl -w net.ipv4.tcp_congestion_control=hybla

This is a nifty little addition to the Linux kernel that could prove very useful, especially for people with mobile devices that constantly use networks with varying characteristics.

Leave a comment