TcpWindowSize

The Registry parameter TcpWindowSize determines the maximum TCP receive window size offered by the computer. The receive window specifies the number of bytes a sender can transmit without receiving an acknowledgment (an ACK); in other words, it indicates the amount of receive data (in bytes) that can be buffered at one time on a connection. The sending host can send only the amount of data indicated by the receive window before waiting for an acknowledgment and window update from the receiving host.

In general, larger receive windows improve performance over high delay, high bandwidth networks. For greatest efficiency, the receive window should be an even multiple of the TCP maximum segment size (MSS).

However, if your clients experience connectivity problems because they time out before data transmission reaches them, you can change the value of the TcpWindowSize parameter. Reducing the value of TcpWindowSize causes an acknowledgment for data received to be sent to the sender sooner. Earlier acknowledgment lowers the possibility that the sender will time out while waiting for an acknowledgment. However, it also increases the amount of network traffic and causes slower throughput.

The TCP/IP stack is designed to self-tune in most environments. Instead of using a hard-coded default receive window size, TCP adjusts the window size to even increments of the MSS negotiated during connection setup.

Matching the receive window to even increments of the MSS increases the percentage of full-sized TCP segments used during bulk data transmission. By default, TcpWindowSize is set to 8 kilobytes (K) rounded up to the nearest MSS increment for the connection. If that increment is not at least four times the MSS, then it is adjusted to four times the MSS, with a maximum size of 64K.

The maximum window size is 64K because the field in the TCP header is 16 bits in length. Request for Comments (RFC) 1323 describes a TCP window scale option that can be used to obtain larger receive windows; however, Windows NT – based TCP/IP does not yet implement that option.

For Ethernet, the receive window is usually set to 8760 bytes (that is, 8192 rounded up to six 1460-byte segments). For 16/4 Token Ring or FDDI, it is set to around 16K. These are default values, and it is not generally advisable to alter them. However, if necessary you can either change TcpWindowSize to globally change the setting for the computer, or use the setsockopt Windows Sockets call to change the setting on a per-socket basis. For more information on Windows Sockets, see the Windows Sockets Software Development Kit (SDK).