Windows, (Disable) Nagle’s Algorithm, and gaming…

Much like HDTV buffs notice the most minute imperfections in video, gamers can basically feel the delay between when they enter a command and when their game performs the intended command.  This is called latency, which can be essentially cut in half by disabling Nagle’s Algorithm …

By default all current Microsoft operating systems have Nagle’s Algorithm enabled.  For gamers playing games that utilize TCP packets to transmit data, such as WoW, this can be a bit of a hindrance.  So here is how to go about disabling it in Windows 7… you’ll need to go into your registry editor, which to be honest, if you don’t know what you’re doing, can become quite scary as you can really hose things up if you’re careless.  However if you follow this step by step, and refrain from slamming your face on the keyboard while swinging your mouse around like you’re trying to rope cattle, you’ll be fine.  Also keep in mind that you’ll need administrative privileges to get into the registry editor.

1. To get into the registry editor, go to Start > Run > Type: regedit

2. Browse to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

Here you will see your network interface devices listed as random characters.  The only way to really identify which one you want to modify is to click on each one and search for your IP configuration information in the right pane (ie. IPAddress > 192.168.0.100).

3. You will need to create two new entries for this interface.  You can do this by right-clicking the interface in the left pane and going to New > DWORD (32-bit) Value**.

  • Name the first one “TcpAckFrequency” (case sensitive).
  • Name the second one “TCPNoDelay” (again, case sensitive).

4. As you create these, they will appear in the right pane of the registry editor.  You want to double-click each of your new values and set their ‘Value Data’ to “1”, and leave “Hexadecimal” checked under ‘Base’.

5. Exit your registry and reboot.

Notice: This can adversely effect other types of internet usage such as streaming video (ie. Hulu), further research on your part will provide more information.

**You will use DWORD (32-bit) values regardless of your operating system architecture, 32-bit or 64-bit.  Do not use QWORD (64-bit) values.

33 thoughts to “Windows, (Disable) Nagle’s Algorithm, and gaming…”

  1. Al,

    RFC1918 (IPv4, 32-bit addressing) stipulates some non-routable (on the internet, anyway) ‘private’ addresses:
    Class A = 10.0.0.0/8
    Class B = 172.16.0.0/12
    Class C = 192.168.0.0/16
    Class D = 239.something or other …

    When you enter the internet, your provider router will NAT (network address translation) your address to a public IP that they own. Typically, this is a Hide-NAT – meaning, everyone in your house will appear to the internet as the same IP, but using different TCP ports (PAT – port-overload translation).

    IPv6 (128-bit addressing) should allow us all to have public addressing, while intorducing a whole slew of new headaches (such as trying to remember 128-bit addresses).

    Think of the Nagle Algorithm like this: if you’re in a diner, and you and your friends place your order with the waitress and she then delivers it to the cooks, that’s the Nagle Algorithm enabled. If, however, after each item, she heads relays it to the cook so he can start on it immediately, that’s Nagle Algorithm disabled. Indeed, the headaches that ensue would be similar. However, certain environments do not lend themselves to buffering: market data, RTP (imho, anyway), etc.

    Regards,

    Mark

  2. i don’t know also what i meant by asking that, perhaps im confused to why my ip address is the same as was given on top, i thought every consumers have their own unique ip address to use every time, I’m not just familiar with networking stuff itself. by the way its working now, i might have placed the values on the wrong folder. and i didn’t followed the exact instructions to which i shut down my laptop and disconnected my modem before starting it. thanks for this info, im wondering what will be that bad effects of having the nagle’s algorithm disabled?

  3. sir Deek, after trying doing it, i lost my internet connection, i found a way on how to get it back by removing the dwords i created and i did hard reset on my modem, so perhaps i might have done something wrong. what i noticed is that i have seen multiple folders that has my ip address, i dont have the wireless connection active, should i add the dword string on each folders where i can see my ip address?

    1. @Al Vin – I haven’t seen an incident where multiple folders have a matching address, or a situation where adding these values ‘breaks’ an internet connection; so I can’t speak on that. I will say that you’re fine to go ahead and add the values to any interface that you see your current IP address on. Just remember which it is so you can remove them later if you deem it necessary.

  4. i’m on the step 3. but an error is appearing “Cannot create value: error writing in the registry” please help.

    1. @Chubsky – Without having control of the system you’re working on, I can only assume your user account doesn’t have access to modify the registry. Sorry I can’t be of more help.

  5. @steven – based on the nature of UDP packet transmission, there is unfortunately no similar fix or adjustment available. If you search TCP vs UDP you will find some good articles with explanations.

  6. @Deek Thank you for your reply. Is there anything similar for UDP? To speed up my connection. Appreciate it.

  7. @steven – if LoL uses UDP (instead of TCP) for gameplay, then this change will not have any effect on your ping/latency for that game. If you are concerned about any adverse effects this change may have for the rest of your computer function, you can undo it by deleting the entries or setting their values to ‘0’ (instead of ‘1’).

  8. unfortunately my ping to league of legends is still the same. hopefully this doesnt mess anything up on my computer

  9. for me i have two interfaces with the ip address found in cmd>ipconfig>ipv4 address…. so what do i do

    1. @steven – if they’re both active internet connections (ie. Wired & wireless), do them both. Otherwise just do the one that is your active internet connection.

    1. Yes, this works on Windows 8 (32-bit & 64-bit) the same way it does on Windows 7. Just follow the instructions step by step, exactly the same way.

  10. Worked perfectly for me! Using Windows 7 Home Premium 64-bit. I used the fix to boost my latency in the game Mabinogi. Followed everything to the letter. Everything is much more responsive now. Thank you very much!

  11. Please note that while, in certain cases, the current Nagle algorithm can have a negative performance impact for certain applications, turning OFF the Nagle algorithm can have a very serious negative impact on the internet. Thus, nothing in this e-mail message, or in the enclosed draft, should be taken as advice to any application developer to disable the Nagle algorithm. The current Nagle algorithm is very important in protecting the health of the internet; the proposed modification [hopefully] provides the same level of protection.

    http://www.stuartcheshire.org/papers/NagleDelayedAck/

  12. Works perfectly for me. I’m a developer, and this sped up any apps using TCP protocol.
    Thanks!

  13. @manuzark
    Well i have windows 7 64 bit Home addition and i think i heard somewhere that this is the only windows 7 that does not let you do these things, they just don’t work… I haven’t tried this one yet but i will and hope it works but for now i cannot play the game i want to correctly until i do disable it so I just keep trying.

  14. not work good for me i suppose, on win 7 x64 this need to be a DWORD (32-bit) Value or 64 bit? i try with two values, but dont decrease the latency idk why, any suggestions? thx

  15. @manuzark
    I’m using Windows 7 64-bit as well. Yes, I did create them as 32-bit values as suggested. Did you create both keys? From how you phrased your question it seems you only created one.

  16. Hmmm I can’t find Interfa in Parameters(no files call “interfa”), so I am stuck at step 2. Anyone know why? Maybe because I am using a wireless network?

    1. Your web browser may not be show you the entire string… you’re looking for the following;

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

      Please let me know if this helps.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.