TCP Window Scaling Option
TCP as originally specified only allows for windows up to 65536 bytes, because the window-related protocol fields all have a width of 16 bits. This prevents the use of
large TCP windows, which are necessary to achieve high transmission rates over paths with a
large bandwidth*delay product.
The
Window Scaling Option is one of several options defined in RFC 1323, "TCP Extensions for High Performance". It allows TCP to advertise and use a
window larger than 65536 bytes. The way this works is that in the initial handshake, the a TCP speaker announces a
scaling factor, which is a power of two between 2
0 (no scaling) and 2
14, to allow for an effective window of 2
30 (one Gigabyte). Window Scaling only comes into effect when both ends of the connection advertise the option (even with just a scaling factor of 2
0).
As explained under the
large TCP windows topic, Window Scaling is typically used in connection with the TCP Timestamp option and the PAWS (Protection Against Wrapped Sequence numbers), both defined in RFC 1323.
Some systems, notably Linux, limit the usable window in the absence of Window Scaling to 32 Kilobytes. The reasoning behind this is that some (other) systems used in the past were broken by larger windows, because they erroneously interpreted the 16-bit values related to TCP windows as
signed, rather than unsigned, integers.
This limitation can have the effect that users (or applications) that request window sizes between 32K and 64K, but don't have Window Scaling enabled, do not actually benefit from the desired window sizes.
The artificial limitation was finally
removed from the Linux kernel sources on March 21, 2006. The old behavior (window limited to 32KB when Window Scaling isn't used) can still be enabled through a
sysctl tuning parameter, in case one really wants to interoperate with TCP implementations that are broken in the way described above.
Problems with window scaling
Middlebox issues
MiddleBoxes which do not understand window scaling may cause very poor performance, as described in
WindowScalingProblems. Windows Vista limits the scaling factor for HTTP transactions to 2 to avoid some of the problems, see
WindowsOSSpecific.
Diagnostic issues
The
Window Scaling option has an impact on how the offered window in
TCP ACKs should be interpreted. This can cause problems when one is faced with incomplete packet traces that lack the initial SYN/SYN+ACK handshake where the options are negotiated: The SEQ/ACK sequence may look incorrect because scaling cannot be taken into account. One effect of this is that
tcpgraph or similar analysis tools (included in tools such as
WireShark) may produce incoherent results.
References
- RFC 1323, TCP Extensions for High Performance, V. Jacobson, B. Braden, D. Borman, May 1992.
- git note about the Linux kernel modification that got rid of the 32K limit, R. Jones and D.S. Miller, March 2006. Can also be retrieved as a patch.
--
SimonLeinen - 21 Mar 2006 - 07 May 2012
--
PekkaSavola - 07 Nov 2006
--
AlexGall - 31 Aug 2007 (added reference to scaling limitiation in Windows Vista)