PDA

View Full Version : Guide to reducing TCP Packet Size; Less Lag; More stability


scaR
05-22-2006, 07:34 PM
Everyone may have different results of course.

I found that at least three times per game my connection would hang and depending on the latency, there was a good chance that I could drop. Soo.. I got to thinking that there must be a bottleneck somewhere.

Using ecktt's advice I tried setting the MTU to 576. I used some app (deleted that mc, was no good) to do this and it resulted in a consistant stutter. According to the theory everyone needs to be set to 576 for it to work. A while after I got a few BSOD's. I reversed the settings with the app but the BSOD's we still present, however my connection did seem more stable. Still, I needed to go to a backup of the registry.

Before I did that I checked TCP entries with CableNut. It turns out that the TCPWindowSize was set at an incorrect multiplier to the TCP Send and Recv segment sizes. I noticed this by comparing the CableNut defaults. TCP entries do not include the overhead so keep a mental note of the real figure.


TCP Packets have an over head of 20 bytes for the TCP Header and 20 bytes for the IP Header. A total 40 byte overhead.

I tried 546 (576) which turned out to be clearly too small a segement size. From there I tried 1000 (1040) which was aight but not that great on dialup. Eventually I found a sweet spot of 750 (790). Having the same send and recv sizes was optimal. This cut down most of the lag and reduced hang times to once per game at a shorter length of time.

You may or may not find a better setting for you.

Another thing that was essential was finding the right TCPWindowSize. Which you must multiply directly with the TCP Segment Size. Usually Cablenut sets this on par with the GlobalMaxTCPWindowSize. I found that setting this to half meant I could have more connections without having to worry about one killing it for everything else. I noticed no bandwidth hit when running one download, but then this is dialup.


eg. 750 x 5 = 3750 : TCPWindowSize

As long as it's a multiple of the send/recv size there should be no problems.


For the GlobalMaxTCPWindowSize I simply doubled the size of the TCPWindowSize.


eg. 3750 x 2 = 7500 : GlobalMaxTCPWindowSize


http://pvpgn.trinigamers.com/images/cn.GIF

If you're on Cable or DSL I would definitely recommend that you apply the Cablenut defauts to your system before you tweak the TCP settings. You may find that the Cablenut settings are enough.


http://www.cablenut.com/

scaR
08-01-2006, 02:04 PM
A little update to this.

http://www.j79zlr.com/cablenutXP2k.php

This is an optimizer that works according to your specific internet connection. Just enter your settings and it will generate the cablenut file needed for you to download.

soldier
08-02-2006, 08:13 AM
Scar, what would you recommend for us advent dial-users [ like myself ]? Just set the connection type as 56k and compute the settings?

ecktt
08-05-2006, 02:23 AM
My 2 cents.
I recently had the chance to setup a Remote Access Server (RAS), which your ISP basically is. The lines in question weren't that good, only managing a 42Kbps connection with a single hop. Before setting up the server, XP sp2 was installed with WC3 and a "squares" map was used to test the best MTU. My findings were as follows :
576 MTU provides the least lag (choppiness of play) BUT there would be moments of prolonged freezes (10-15 seconds) as the game progressed. Larger MTUs would reduce (not eliminate) the long freezes but introduced more and more lag.
This test can be reproduced with 2 PC and 2 phone lines but the max connection speed would be 33.6Kbps (48Kbps if the modem supports V92).
The reason I picked the squares map is because of the large number of units produced as the game progressed which would probably give a worst case scenario for anything in WarCraft3.

scaR
08-05-2006, 03:08 PM
Since I reformatted and slapped on SP2 a few days ago (had to torrent it, 56k is a biatch) I've been using the default dialup generated j79zlr settings with only one change. TCPWindowSize is half of the maximum (ie. 4380)

I don't see myself lagging again even when i'm on irc and msn, unless people decide to nuke nudge me. :S Allyuh bastards!!!