TCPnodelay

This forum is dedicated to the new universes where AP will be present: Star Wars The Old Republic and The Secret World
Post Reply
Elrojo
BacoTroll
Posts: 2517
Joined: Fri Jun 27, 2008 10:18 am
Location: Australia

TCPnodelay

Post by Elrojo »

Hyde or Chris perhaps may be best at this but welcome anyone who can provide info.

I was told of a fix to bypass or disable some sort of algorithm that can contribute to latency. I googled it and found mixed info some say it's not great for Win7 and others say its great. Some sites tell you to do stuff through command prompt and others require registry stuff. The registry stuff is a bit too complicated for me.

Can anyone give a better explanation of the steps and whether it's win7 compatible.
User avatar
Chrisax
President
Posts: 23108
Joined: Wed Apr 19, 2006 1:08 pm

Re: TCPnodelay

Post by Chrisax »

TCPnodelay is related to a feature called "nagling" in networking. This feature introduces a small 200ms delay when small data packets (under a maximum size determined by another setting) are sent. This may sound strange to add a delay but, because of the way TCP (the protocol that makes the Internet works), it actually MAY help with the data stream especially if the users are not on a high speed network. (It prevents a bunch of small transmissions popping out too fast.)

Nevertheless, for games, it MAY be interesting to disable it... or not. Actually if the network is working well, it will probably be good.

There is a lot of "if's" in all this.

Nagling depends on a Windows features called MSMQ (Microsoft Message Queue).

BUT... nagling is simply NOT implemented by default on Windows 7 because MSMQ (Microsoft Message Queue) is just NOT installed (theoretically). (I guess it was installed by default in Windows Vista, not sure.)

This is confusing because when looking in their registry, people can find a MSMQ section and think they have it working but if this section is empty, which means MSMQ is not installed and there is no nagling and thus no tcpdelay parameter to deal with.

Edit: found the conformation by a MS engineer on MS support site:
  • http://answers.microsoft.com/en-us/wind ... 495af5e6de

    "No, Nagling will not function without MSMQ running.

    By default, MSMQ (Microsoft Message Queue) sub key doesn’t exist in Windows 7 operating system if MSMQ is not enabled.

    TCPNoDelay parameter will not come into play when MSMQ sub key doesn’t exist."

What does it mean for you?

It means that you most likely don't have to touch anything regarding tcpdelay because it's just NOT installed in your system.

But to know if it's really not installed, do the following:


1) Click on the Start icon
2) In the "search program and files box, type "regedit" (without quotes)
3) Hit ENTER, Regedit will start
4) Use the tree on the left of Regedit window to navigate (like in File Explorer)
5) Look for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ

6) When there, look if it goes furtther to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\TCPNoDelay
If there is no /parameter section then MSMQ is not active (even not installed) and you have nothing to do.

Tell us what you find, and we'll see what to do or not do from that.
  • Just in case, IF it was installed and IF you wanted to try:
    7) Right-click on TcpNoDelay, and then click "Modify".
    8) A Value box opens
    9) In that box, type "1" to turn off the delay
    (Note: type "0" to turn on the delay).
    10) Click OK, and then quit Registry Editor.
    11) Restart your computer.
User avatar
Chrisax
President
Posts: 23108
Joined: Wed Apr 19, 2006 1:08 pm

Re: TCPnodelay

Post by Chrisax »

Bleh.... there is maybe something else I didn't know...

The keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces

could be involved too. #-o

For the time being, just check already what I said above. Let's go progressively.
User avatar
Hyde
Hyde!
Posts: 3477
Joined: Thu Apr 20, 2006 5:26 am

Re: TCPnodelay

Post by Hyde »

I did this in all versions of Windows through Vista ... however Win7 does a better job of optimizing this for you and mucking with it has a chance at making it worse. Feel free to give it a shot, but back up the affected registry keys BEFORE playing with it so you can restore them as needed. I'm not sure ... but Win7 may well ignore or revert some changes automatically.

PS. The thing I find ALWAYS kills my connection is if my MTU is too big, meaning my router and/or ISP are fragmenting my packets. Look for something called Dr. TCP (I think that was it) to help you optimize MTU and various related parameters.
Post Reply