TCP window scale option
Encyclopedia
The TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

 window scale option
is an option to increase the TCP receive window size above its maximum value of 65,535 bytes.
This TCP option, along with several others, is defined in IETF RFC 1323 which deals with Long-Fat Networks, or LFN.

In fact, the throughput of a communication is limited by two windows: the congestion window
Congestion window
In Transmission Control Protocol , the congestion window is one of the factors that determines the number of bytes that can be outstanding at any time. This is not to be confused with the TCP window size which is maintained by the receiver. This is a means of stopping the link between two places...

 and the receive window. The first one tries not to exceed the capacity of the network (congestion control) and the second one tries not to exceed the capacity of the receiver to process data (flow control). The receiver may be overwhelmed by data if for example it is very busy (such as a Web server). Each TCP segment contains the current value of the receive window. If for example a sender receives an ack which acknowledges byte 4000 and specifies a receive window of 10000 (bytes), the sender will not send packets after byte 14000, even if the congestion window allows it.

Theory

The TCP window scale option is needed for efficient transfer of data when the bandwidth-delay product
Bandwidth-delay product
In data communications, bandwidth-delay product refers to the product of a data link's capacity and its end-to-end delay . The result, an amount of data measured in bits , is equivalent to the maximum amount of data on the network circuit at any given time, i.e. data that has been transmitted but...

 is greater than 64K. For instance, if a T1
Digital Signal 1
Digital signal 1 is a T-carrier signaling scheme devised by Bell Labs. DS1 is a widely used standard in telecommunications in North America and Japan to transmit voice and data between devices. E1 is used in place of T1 outside North America, Japan, and South Korea...

 transmission line of 1.5Mbits/second was used over a satellite link with a 513 millisecond round trip time (RTT), the bandwidth-delay product is (1500000 * 0.513) = 769,500 bits or 96,188 bytes. Using a maximum buffer size of 64K only allows the buffer to be filled to (65535 / 96188) = 68% of the theoretical maximum speed of 1.5Mbits/second, or 1.02 Mbit/s.

By using the window scale option, files can be transferred at nearly 1.5Mbit/second utilizing nearly all of the available bandwidth.

This option is also useful when sending large files greater than 64KB over slow networks.

By using the window scale option, the receive window size may be increased up to a maximum value of 1,073,725,440 bytes; almost 1 Gibibyte
Gibibyte
The gibibyte is a standards-based binary multiple of the byte, a unit of digital information storage. The gibibyte unit symbol is GiB....

. This is done by specifying a one byte shift count in the header options field. The true receive window size is left shifted by the value in shift count. A maximum value of 14 may be used for the shift count value.

Possible side effects

Because many routers and firewalls do not properly implement TCP Window Scaling, it can cause a user's Internet connection to malfunction intermittently for a few minutes, then appear to start working again for no reason. If "diagnose problem" is selected in Vista, an error message will be displayed "cannot communicate with primary DNS server."

There is also an issue if a firewall doesn't support the TCP extensions.

Windows

TCP Window Scaling is implemented in Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 since Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

. It is enabled by default in Windows Vista / Server 2008 and newer, but can be turned off manually if required.

Linux

Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

s (from 2.6.8, August 2004) have enabled TCP Window Scaling by default. It chooses the good value of the option by default. The configuration parameters are found in the /proc filesystem
Procfs
procfs is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional...

, see pseudo-file /proc/sys/net/ipv4/tcp_window_scaling and its companions /proc/sys/net/ipv4/tcp_rmem and /proc/sys/net/ipv4/tcp_wmem (more information: man tcp, section sysctl).

Scaling can be turned off by issuing the command sysctl -w "net.ipv4.tcp_window_scaling=0" as root.
To maintain the changes after a restart, include the line "net.ipv4.tcp_window_scaling=0" in /etc/sysctl.conf.

Mac OS X

The default setting for Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 is to have window scaling (and other features related to RFC 1323) enabled.

To verify their status, a user can open /Applications/Utilities/Terminal and check the value of the "net.inet.tcp.rfc1323" variable via the sysctl
Sysctl
Sysctl is an interface for examining and dynamically changing parameters in the BSD and Linux operating systems. The implementation mechanism in these two systems is very different....

command:
sysctl net.inet.tcp.rfc1323

A value of 1 (output "net.inet.tcp.rfc1323=1") means scaling is enabled, 0 means "disabled". If enabled it can be turned off by issuing the command:
sudo sysctl -w net.inet.tcp.rfc1323=0

This setting is lost across a system restart, to make it permanent it must be written in the /etc/sysctl.conf configuration file, that can be accomplished via the command:
echo 'net.inet.tcp.rfc1323=0' | sudo tee -a /etc/sysctl.conf
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK