TCP Slow start and congestion control, and how to modify them

10,679

I was reading a little bit on the subject and I believe that kernel version 2.6.33 is needed in order to set a custom cwnd. I found it mentioned in this blog post: http://www.igvita.com/2011/10/20/faster-web-vs-tcp-slow-start/

If TCP slow start is, well, slow, then couldn't we just make it faster? Turns out, until very recently the Linux TCP stack itself was hardcoded to start with the congestion window (cwnd) of just 3 or 4 packets, which amounts to about 4kb (~1360 bytes per packet).

There is also some discussion about it being added to the kernel here: http://kerneltrap.org/mailarchive/linux-netdev/2009/10/26/6258693

I cannot find any good information on setting this up, but this is what I came across today...

Share:
10,679

Related videos on Youtube

Mediocre Gopher
Author by

Mediocre Gopher

Updated on September 18, 2022

Comments

  • Mediocre Gopher
    Mediocre Gopher over 1 year

    I'm trying to change the behavior of the tcp slow start protocol on a CentOS5 box (uname -r => 2.6.18-238.12.1.el5). I have read that the following command will change my icwnd to 8:

    ip route change default via 1.2.3.4 dev eth1 initcwnd 8
    echo "4094 $((8*16384)) 4194304" > /proc/sys/net/ipv4/tcp_wmem
    

    (Note: The tcp_wmem portion is more or less a guess on my part, I figure the exact number isn't very important as long as it's large enough)

    However, on it's own this doesn't seem to have any effect. Instead of initially sending 8 segments it still only sends 3. After further reading I found that tcp slow start works in parallel with congestion control, such that if ssthresh < cwnd, the congestion control protocol is used, otherwise slow start is used (at least, this was my understanding). I did the following to find out what my default ssthresh was set to:

    [root@host ~]# cat /proc/sys/net/ipv4/tcp_congestion_control 
    bic
    [root@host ~]# cat /sys/module/tcp_bic/parameters/initial_ssthresh 
    0
    

    Seeing that ssthresh is 0, I would want to increase it so that it will be greater than icwnd, which in turn would cause the kernel to use slow start, which would use it's default value of 8 windows. So I did the following:

    [root@host ~]# echo 13140 > /sys/module/tcp_bic/parameters/initial_ssthresh
    

    But there is still no change at all in behavior. Does anyone know what I'm doing wrong?

    (I am restarting the apache process I'm using to test this after each change). EDIT: I am also doing ip route flush cache in between changes as well