Wednesday 24 October 2012

TCP slow start

Slow start is a congestion control strategy used by TCP.

On startup, and after an idle period, since the session doesn't know what the congestion on the network is, the session will start with a TCP congestion window of only 2 segments. This means the session will only send 2 segments and then wait for an ACK before exponentially increasing the congestion window.

With today's modern 10Gb networks, congestion is rarely an issue; and in a low-latency environment practitioners will often say "congestion be damned, send as much as we can and deal with the issues later!"

We can override the default setting on a route by route basis in linux by setting the initial congestion window size:


$ ip route show
10.80.32.0/22 dev eth0  proto kernel  scope link  src 10.80.33.247 
169.254.0.0/16 dev eth0  scope link 
127.0.0.0/8 dev lo  scope link 
default via 10.80.32.1 dev eth0 

Now we can change the congestion window size on the default route as follows:

$ sudo ip route change default via 10.80.32.1 dev eth0 proto static initcwnd 10



No comments:

Post a Comment