Wednesday, March 5, 2008

TCP Congestion

It surprises me to no end that TCP, the most widely used protocol, has remained practically unchanged from its RFC proposal in 1982. From a time where connections were in hundreds of bytes per second to 10Gbps links now-a-days, It is still used in a more or less unchanged form.

However this flexibility comes at a cost - you will not get the maximum throughput your link supports right away. The "right away" part is important. True TCP can eventually take up the entire bandwidth. But there is an over looked issue - TCPs Congestion control. TCPs congestion control rapidly reduces the connections speed as soon as it starts seeing lost packets, and it does not recover as quickly. This has caused linux to adopt newer congestion control algorithms in TCP in a pluggable fashion.

The default congestion control algorithm is CUBIC which is a less aggressive version of BIC. You have a plethora of congestion control algorithms to choose from. They can be checked by reading from and changed by writing to /proc/sys/net/ipv4/tcp_congestion_control file.

This Linux Gazette article has a detailed description of the remaining options.

No comments: