In association with heise online

Fine tuning

image 4 [250 x 187 Pixel @ 25 KB]
Zoom Perhaps the most important TCP parameter, window size, is generally set too low for broadband connections. The key is often not present in the registry at all and Windows silently uses too low a value.
There are many parameters that affect the way a Windows XP computer surfs the internet. Windows doesn't offer a GUI for adjusting these parameters, merely registry entries. Microsoft has published a complete list of these parameters on its support pages. Their documentation on this issue is, however, often rather scanty and in places misleading, for which reason we will elucidate the more important parameters in detail.

Almost all are filed under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters. The parameters need to be entered in DWORD format and changes only take effect after restarting the computer. If the keys described here do not exist, Windows uses default values.

TcpWindowSize, also known as RWIN in Unix environments, this specifies how many bytes can be sent without a reply having been received. Microsoft states that the following rule of thumb is used to set the value for this parameter in Windows XP:

12 × (MTU of the network adapter - 40)

This is sufficient for modem and ISDN connections, but is too low for DSL connections. In practice, Microsoft does not always seem to follow its own documentation. For example, we found DSL and telephone modem drivers with window sizes set to 65,535 bytes. This is confusing for users who have not yet got to grips with the documentation. The following formula can be used to determine whether the value set is adequate for a particular connection.

Window size = downstream rate in bytes per second/3

This allows fast downloads from servers from which it takes up to 333ms for acknowledgements to be returned (round-trip time, can be determined by pinging for example). If a connection is frequently clogged up with uploads, even higher values are required to utilise the full downstream bandwidth.

For VoIP applications, much lower values are required:

Window size = downstream rate in bytes per second/10

This of course reduces the download rate, so that users may be reluctant to change this value in practice, especially as the computer has to be restarted after each change. A traffic shaper is, for this reason, to be preferred, as it automatically selects appropriate settings on the fly.

EnablePMTUDiscovery activates or deactivates path MTU discovery (value = 1 or 0 respectively). This entry should not be changed, path to MTU discovery should be left enabled.

EnablePMTUBHDetect, black hole detection, deactivated by default (value = 0) as otherwise delays can arise. This function is only useful if it is not possible to discover the path MTU due to a black hole.

If, during MTU analysis, a router discards rather than dividing an oversized packet because the Don't Fragment bit is set it sends an error message to the sender so that the latter can reduce the MTU. If the error message is lost, this mechanism fails - this is known as a black hole. EnablePMTUBHDetect deals with such situations, but in our experience reduces throughput.

DefaultTTL: time to live, gives the maximum number of routers on the network which are permitted to forward a data packet to its destination (hops). If the maximum number of hops is exceeded, the router discards the packet and informs the sender. This parameter has, despite opinions to the contrary, no effect on transfer rates - messages indicating that a packet has failed to reach the destination server will be received sooner, but the probability that a packet will fail to reach a distant server, outside the TTL, is reduced. This parameter should not be set to less than 64, as otherwise your packets risk failing to reach their destination. The standard setting is 128.

SackOpts switches selective acknowledgments on (SACKs). The recipient can then acknowledge individual packets, even where they are received in a sequence other than that in which they were sent. This option is activated by default (1=SACK) and should be left activated, as it reduces delays in the event of packet losses to a minimum without significant bandwidth overhead.

Tcp1323Opts switches window scaling and timestamps on and off. 0 deactivates window scaling and timestamps, 1 activates window scaling only, 2 timestamps only and 3 activates both (default setting).

Timestamps allow the TCP retransmission timeout to be calculated more precisely, information which the sender uses to decide when it needs to resend a data packet in the event of a problem. This is important where a very large TcpWindowSize is used.

MTU, maximum transmission unit, is the maximum size of an IP packet including IP header, TCP header and payload data. The default setting is -1, meaning that the stack determines the maximum packet size automatically by means of path MTU discovery.

The MTU is used to calculate the MSS (maximum segment size) parameter, the maximum amount of payload data per packet:

MSS = MTU - 20 byte TCP header - 20 byte IP header

MTU is the only TCP parameter in the "Interfaces" subkey under the GUID of the network adapter. If no MTU value is specified, path MTU discovery is used to determine a suitable value. Therefore if a value is specified, it is generally advisable to delete it.

The GUID of the network adapter is well hidden - it is the final line of the entry under HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Adapters \NdisWanIp\IpConfig.

Despite what many surfers believe, the window size does not necessarily need to be an integer multiple of the MSS - this would indeed fit perfectly into the TCP scheme, but as soon as one router on the path obliges the use of a smaller MSS by means of path MTU detection, this setting is scrapped anyway and is therefore in practice irrelevant.

Print Version | Permalink: http://h-online.com/-747378
  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit