HSDPA, the 3.5G speed booster for UMTS networks is up and running in many neworks these days and data cards have been available for some time. Now, HSDPA phones have entered the market with Samsung’s SGH-ZV50 and Nokia in close pursuit with the N95. As an article in the latest C’T, a german computer magazine, points out, some tweaks are required for the TCP/IP stack of the notebook to achieve full performance.
The tweak mainly consists in increasing the "TCP Receive Window" to 128480 bytes. The window is used to throttle a data transfer by using receiver acknowledgements which advance the receive window. This prevents receiver buffer overflows in the routers between source and destination which would appear if the sender has a faster connection to the to the network than the receiver. As HSDPA has a delay time of about 150ms, which is about three times higher than an equally fast DSL connection, three times more unacklnowledged data can be in transit. An appropriate window size should be much higher than the bandwidth delay product (BDP) of the connection. Take a look here for further explanations. For a 1800 kbit/s HSDPA link and a round trip delay time of 150 ms plus let’s say an additional 80 ms delay in the Internet, the BDP is about 52 kBytes.
Other values Vodafone suggests to change is to increase the "Maximum MTU size" (packet size) to 1500 and to set the "Maximal TCP connect request retransmissions" parameter to 5.
The Test Run
To see if changing the values has a positive effect, I gave it a try myself. I don’t have an HSDPA mobile yet (it’s all in Nokia’s hand…) so
instead I tried the settings on my fast ADSL2+ Internet connection.
While the round trip times of the ADSL line are quicker than HSDPA, the total bandwidth of 7 MBit/s (7000 kbit/s) I get on the line is much higher than HSDPA. Thus, changing the TCP window size should have an impact as well. To compare, I went to a web site that does not throttle transmissions on its end and downloaded a file. I achieved a download speed of about 3.5 MBit/s. With
the new TCP window setting the speed went up to an amazing 7.000 kbit/s, i.e. the line was fully utilized. So if you
have an ADSL or ADSL2+ connection with a speed exceeding 3.5 MBit/s the
tweak is not only helpful for HSDPA but also for your ADSL connection
at home.
How to Change the TCP Window Size
The TCP Window Size for Windows XP can be optimized with programs like Tweakmaster or TCPOptimizer. While Tweakmaster is easier to handle, their registration process for the free version is somewhat dubious. TCPOptimizer is really free but only seems to be able to change the settings for all network cards at once instead of individually.
It’s also possible to change the parameters manually in the Windows registry. For network cards, the TCP receive window can be changed on a per adapter basis in the following registry key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersInterfacec{Interface ID}. If not already present, create a new DWORD called TcpWindowSize and assign it a value of 64240 (decimal). I also tried to set it to 128480 but for some reason the value is not accepted and the standard window size of 17520 bytes is still used after a restart.
For dial up connections things seem to be handled differently by the operating system. Here, global values which are valid for all network connections have to be changed. These can be found in the following registry key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters. If not already present, create the following DWORDs and assign them a value of 128480 (decimal): TcpWindowSize and MaxTcpWindowSize.
To activate network card specific changes the adapter has to be deactivated and activated again. For global values to take effect a reboot is required. If HSDPA is not always available it might be a good idea to remove these values before using a slower connection. This might proove to be somewhat impractical to do on a day to day basis due to the required restart.
To simplyfiy the process I’ve created to short scripts which add or remove the TcpWindowSize parameter from the list of global TCP parameters. Still, a reboot is required. You can find the two scripts at the end of this blog entry. The script to add the parameters is a .reg file so it can be executed by double clicking on the icon. The script to remove the parameters again is a .inf file which has to be executed by right clicking on the icon and selecting "execute" from the menu.
Bluetooth and HSDPA
A word to HSDPA mobile phone manufacturers: Make sure you put Bluetooth 2.0 into your phones as version 1.2’s top speed of 723 kbit/s is far too slow for HSDPA. I don’t want to be stuck with a cable again!
Download add_128k_tcp_window.REG
Download remove_128k_tcp_window.inf