Window Scaling
   HOME

TheInfoList



OR:

The TCP window scale option is an option to increase the
receive window TCP tuning techniques adjust the network congestion avoidance parameters of Transmission Control Protocol (TCP) connections over high- bandwidth, high- latency networks. Well-tuned networks can perform up to 10 times faster in some cases. Howe ...
size allowed in
Transmission Control Protocol The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonly ...
above its former maximum value of 65,535 bytes. This TCP option, along with several others, is defined in which deals with
long fat network In data communications, the bandwidth-delay product is the product of a data link's capacity (in bits per second) and its round-trip delay time (in seconds). The result, an amount of data measured in bits (or bytes), is equivalent to the maximu ...
s (LFNs).


TCP windows

The throughput of a TCP communication is limited by two windows: the
congestion window Transmission Control Protocol (TCP) uses a network congestion-avoidance algorithm that includes various aspects of an additive increase/multiplicative decrease (AIMD) scheme, along with other schemes including slow start and congestion windo ...
and the receive window. The congestion window tries not to exceed the capacity of the network (
congestion control Network congestion in data networking and queueing theory is the reduced quality of service that occurs when a network node or link is carrying more data than it can handle. Typical effects include queueing delay, packet loss or the blocking of ...
); the receive window 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

TCP window scale option is needed for efficient transfer of data when the
bandwidth-delay product In data communications, the bandwidth-delay product is the product of a data link's capacity (in bits per second) and its round-trip delay time (in seconds). The result, an amount of data measured in bits (or bytes), is equivalent to the maximum ...
(BDP) is greater than 64 KB. For instance, if a T1 transmission line of 1.5 Mbit/second was used over a satellite link with a 513 millisecond
round-trip time In telecommunications, round-trip delay (RTD) or round-trip time (RTT) is the amount of time it takes for a signal to be sent ''plus'' the amount of time it takes for acknowledgement of that signal having been received. This time delay includes p ...
(RTT), the bandwidth-delay product is \scriptstyle 1,500,000 \times 0.513 = 769,500 bits or about 96,187 bytes. Using a maximum buffer size of 64 KB only allows the buffer to be filled to (65,535 / 96,187) = 68% of the theoretical maximum speed of 1.5 Mbit/second, or 1.02 Mbit/s. By using the window scale option, the receive window size may be increased up to a maximum value of 1,073,725,440\ \scriptstyle \left(= (2^-1)\times(2^) = 65,535 \times 16,384)\right) bytes. This is done by specifying a two 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. This would allow a single TCP connection to transfer data over the example satellite link at 1.5 Mbit/second utilizing all of the available bandwidth. Essentially, not more than one full transmission window can be transferred within one round-trip time period. The window scale option enables a single TCP connection to fully utilize an LFN with a BDP of up to 1 GB, e.g. a 10 Gbit/s link with round-trip time of 800 ms.


Possible side effects

Because some 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. There is also an issue if a firewall doesn't support the TCP extensions.


Configuration of operating systems


Windows

TCP Window Scaling is implemented in
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
since
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It was the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RTM), releas ...
. It is enabled by default in Windows Vista / Server 2008 and newer, but can be turned off manually if required.
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, which was released five years before, at the time being the longest time span between successive releases of ...
and
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on July 22, 2009, and became generally available on October 22, 2009. It is the successor to Windows Vista, released nearly ...
have a fixed default TCP receive buffer of 64 kB, scaling up to 16 MB through "autotuning", limiting manual TCP tuning over
long fat network In data communications, the bandwidth-delay product is the product of a data link's capacity (in bits per second) and its round-trip delay time (in seconds). The result, an amount of data measured in bits (or bytes), is equivalent to the maximu ...
s.


Linux

Linux kernel The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
s (from 2.6.8, August 2004) have enabled TCP Window Scaling by default. The configuration parameters are found in the /proc filesystem, see pseudo-file and its companions and (more information: , section sysctl). Scaling can be turned off by issuing the following command. To maintain the changes after a restart, include the line in (or as of systemd 207).


FreeBSD, OpenBSD, NetBSD and Mac OS X

Default setting for
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
,
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
,
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
and
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
is to have window scaling (and other features related to RFC 1323) enabled.
To verify their status, a user can check the value of the "" variable via the
sysctl sysctl is a software utility of some Unix-like operating systems that reads and modifies the attributes of the system kernel such as its version number, maximum limits, and security settings. It is available both as a system call for compiled ...
command: A value of 1 (output "") means scaling is enabled, 0 means "disabled". If enabled it can be turned off by issuing the command: This setting is lost across a system restart. To ensure that it is set at boot time, add the following line to ''/etc/sysctl.conf'': net.inet.tcp.rfc1323=0 However, on macOS 10.14 this command provides an error {{samp, sysctl: unknown oid 'net.inet.tcp.rfc1323'


Sources

Window Scale Option Network acceleration de:TCP Receive Window#TCP Window Scale Option