Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've read that 2.6.33+ allows setting custom cwnd.

  1. if the IW is 10 by default (for all distros? only some?)
  2. how does one view what the current IW is on a particular compiled kernel?

references:

share|improve this question

2 Answers 2

up vote 7 down vote accepted

As of Linux kernel version 2.6.38 (released in March 2011) the receive window was increased to 10 segments to make sure that a low value will not become a bottleneck for any senders that implement IW10. The initial congestion window, respectively, was afterwards increased to 10 segments in kernel version 2.6.39 (released in May 2011). Version 2.6.39 was very short-lived and quickly became 3.0 (released in the end of July 2011), being the first kernel to include those changes that is widely used by Linux distributions.

You can take a look at the kernel change logs:

Here is the kernel source code as well:

Popular desktop distributions released in and after Q4/2011, such as Ubuntu and Fedora, use kernel versions 3.x.

Stable server distributions adopt much slower newer kernels, as well as other software in general. Debian stable 6.0.3 (released in October 2011) goes with kernel version 2.6.32-2.6.38. Red Hat Enterprise Linux 6.x and CentOS 6.x use kernel versions 2.6.32 to 2.6.34 but do backport some kernel features.

Edit:

  • there was a mistake in Ilya Grigorik's article saying the first version with IW10 support is 2.6.33 but it has been corrected (on the 04 Feb 2014).
  • CentOS 6.4 supports IW10, with the feature being backported to kernel version 2.6.32-358.0.1.el6 (Red Hat 4.4.7-3); more info here.
share|improve this answer
1  
Great, very helpful. However there's conflicting information about the version -- this article igvita.com/2011/10/20/faster-web-vs-tcp-slow-start says "As of kernel version 2.6.33, following a protracted discussion and a number of IETF recommendations, the initial cwnd value has been reset to 10 packets" –  John Bachir Dec 14 '11 at 22:08
1  
The article at igvita.com highly probably has an error where it claims 2.6.33 supports IW10. –  Mikko Rantalainen Jun 21 '12 at 8:03

You should look closer at code demonstrated in your first link:

net/ipv4/tcp_output.c

/* Set initial window to value enough for senders,
 * following RFC2414. Senders, not following this RFC,
 * will be satisfied with 2.
 */
if (mss > (1 << *rcv_wscale)) {
    int init_cwnd = 4;
    if (mss > 1460 * 3)
      init_cwnd = 2;
    else if (mss > 1460)
      init_cwnd = 3;
    if (*rcv_wnd > init_cwnd * mss)
      *rcv_wnd = init_cwnd * mss;
}

In newer kernels (since 21 Dec 2010) constant defined in

include/net/tcp.h

/* Offer an initial receive window of 10 mss. */
#define TCP_DEFAULT_INIT_RCVWND 10

So to put it simple: support initial window == 10 depends on kernel version and patches applied by your distribution, wscale and mss. You should really try to look at your kernel's sources and system setup(MTU).

For Linux <= 2.6.38 init_cwnd is not tunable there and set between 2 and 4. The only way to tune it is to hack tcp_output and recompile a kernel. As i see in Linux HEAD (3.2 by now) it's defaults to TCP_DEFAULT_INIT_RCVWND which is 10 by default.

PS. You can tune this variable per route via ip route:

   initcwnd NUMBER (2.5.70+ only)
          the  initial congestion window size for connections to this des‐
          tination.  Actual window size is this value  multiplied  by  the
          MSS  (``Maximal Segment Size'') for same connection. The default
          is zero, meaning to use the values specified in RFC2414.

   initrwnd NUMBER (2.6.33+ only)
          the initial receive window size for connections to this destina‐
          tion.  Actual window size is this value multiplied by the MSS of
          the connection.  The default value is zero, meaning to use  Slow
          Start value.

PS. IW10 is only one of Google proposed enchantments to TCP

share|improve this answer
    
Thanks -- but the problem is I'm not enough of a C or Kernel hacker to fully understand the space, so I still don't know what the answer is. Could you perhaps articulate the answer instead of merely showing me code which implies it? –  John Bachir Nov 17 '11 at 23:22
    
Interesting -- could you put that info above into your answer, and maybe offer some guidance about how to figure out what settings a popular distributed kernel has? –  John Bachir Nov 18 '11 at 0:09
    
here are a list of terms/variables you've mentioned that I do not understand: mss, rcv_wscale, init_cwnd, rcv_wnd, wscale, MTU. :-D –  John Bachir Nov 18 '11 at 0:11
    
i've also made my original 2 questions a bit more clear. –  John Bachir Nov 18 '11 at 0:12
3  
If you can't understand code/terms then you should not really touch that code. TCP is pretty complex - there are lots of RFCs involved. –  SaveTheRbtz Nov 21 '11 at 7:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.