Handling TCP Window Scaling

Background

The Transmission Control Protocol (TCP) is one of the primary protocols used on the Internet. As part of its operation, it moves data in pieces called "packets." Originally, the packet size was limited to 65536 bytes (i.e. 64K). RFC 1323 specifies mechanisms for extending the TCP protocol and includes a mechanism for handling larger sized packets with a concept known as window scaling.

The firewall which protects the local network (i.e. in the Koffolt- Fontana- MacQuigg- Watts building complex) does not support window scaling. In order to operate properly, local systems transferring files between the local network and the outside world need to disable this feature. The following details how to handle this configuration on common systems. If the operating system of the computer you're using is not cited, you should consult your system's documentation.

Note: So long as one end of a connection refuses to handle window scaling, neither end will try to use it. Any changes outlined here should only be applied to systems that may be attached to the local network.

Mac OS X

You need to use an account with administrative privilege to employ these changes.

Permanent Setting

First, check to make sure you need to apply this work-around. The default setting for Mac OS X is to have window scaling (and other features related to RFC 1323) enabled. Open Applications/Utilities/Terminal.app (which may be listed in the Finder as only "Terminal"). Use the following sequence of commands to determine if further action is required:

 $ cd /etc
 $ sudo grep rfc1323 sysctl.conf

(The "$" represents the system prompt and should not be typed. The best way to enter these commands is to use copy-and-paste and omit the leading "$".) After entering the "sudo..." command, the system will prompt you for your password, which you should supply. If the sysctl.conf file exists, it may only be readable by the root account, and using the "sudo..." command in this manner allows you to run the "grep..." command as if you were logged into the root account. We are looking for a result that looks something like this:

net.inet.tcp.rfc1323=0

If you see this, your system already has the necessary permanent setting and you can stop here. If the "sudo..." command merely returns you to the command prompt (after you enter your password), enter the following commands:

 $ sudo sh -c 'echo "# Disable RFC 1323 options" >> sysctl.conf'
 $ sudo sh -c 'echo "net.inet.tcp.rfc1323=0" >> sysctl.conf'

This will append the necessary setting to the sysctl.conf file. If you encountered a "No such file or directory" message with the "sudo grep..." command, use this form of the "sudo echo..." commmand, instead:

 $ sudo sh -c 'echo "# Disable RFC 1323 options" > sysctl.conf'
 $ sudo sh -c 'echo "net.inet.tcp.rfc1323=0" >> sysctl.conf'

This will create the sysctl.conf file and populate it with the necessary data.

Working Setting

If you applied any changes to the system to effect the computer's permanent setting to control TCP window scaling, you still need to change the system's working configuration. Often the easiest way to handle this is to merely restart the computer. If this is not convenient, though, you can use the following command to effect the change for the running system:

 $ sudo sysctl -w net.inet.tcp.rfc1323=0

Linux

The following changes need to be performed "as root." Ideally, you should be leveraging "sudo" to handle root account access (see "sudo(8)" and "sudoers(5)"). Of course, you may also have access to the "su" command, or even direct access to the root account.

Permanent Setting

Different versions of Linux may or may not enable TCP window scaling by default. The best approach is to assume it's enabled. The following assumes you are accessing the system "as root." From a command line, issue the following commands:

 $ cd /etc
 $ grep tcp_window_scaling sysctl.conf

(The "$" represents the system prompt and should not be typed. The best way to enter these commands is to use copy-and-paste and omit the leading "$".) If, after entering the "grep..." command, you merely return to the command prompt, enter the following commands:

 $ echo '"# Disable TCP window scaling" >> sysctl.conf'
 $ echo '"net.ipv4.tcp_window_scaling=0" >> sysctl.conf'

If you encountered a "No such file or directory" message with the "grep..." command, use these commmands, instead:

 $ echo '"# Disable TCP window scaling" > sysctl.conf'
 $ echo '"net.ipv4.tcp_window_scaling=0" >> sysctl.conf'

If the "grep..." command reports...

net.ipv4.tcp_window_scaling=0

...then the permanent kernel settings have already been completed.

Working Setting

If you changed the permanent kernel setting for TCP window scaling, you still need to change the running kernel. Often the most direct way is to merely restart the system. If this is not possible, you can use this command (running as root):

 $ sysctl -w net.ipv4.tcp_window_scaling=0

Alternatively, if you have the "proc" file system (see "proc(5)") loaded, you can modify the running kernel with a simple "echo" command:

 $ echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

Windows 2000/XP/2003

By default, TCP window scaling isn't enabled, but may be used if the remote end (i.e. system outside the firewall in this context) requests it. To ensure TCP window scaling won't be used, navigate to the following path in the registry on the local computer (with REGEDIT):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Look to see if there's a value named "Tcp1323Opts." If there is, make sure the value is "even" (i.e. ends with "0", "2", "4", "6", or "8"). To make an odd value even, just modify the value to substract one (1) from it. If the "Tcp1323Opts" doesn't exist, create it as a "REG_DWORD" value and assign it the value of zero (0).

To complete the change, you must restart the system.

Windows Vista/7/2008

The newer implementation of TCP/IP in Windows Vista, Windows 7 and Windows Server 2008 refer to TCP window scaling as "auto-tuning." It is enabled by default. The following article explains how to check/change the necessary setting in Windows Vista (which also applies to Windows 7 and Windows Server 2008):

Default setting for window scaling in Windows Vista incompatible with some network hardware