People have this misconception that tweaking your Windows Registry (aka regedit) will make you have more reach, take less knock-back and improve your ping (latency) in Minecraft. This is all false!
In this thread I will explain in detail:
- What is RegEdit?
- What is Nagle’s Algorithm?
- What is TCP/IP?
- What Protocol does Minecraft use (UDP or TCP)?
- What is Delayed ACK?
- What is the prupose of TCPNoDelay & TcpAckFrequency?
What is RegEdit?
The Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the Registry. The kernel, device drivers, services, Security Accounts Manager (SAM), and user interface can all use the Registry. The Registry also allows access to counters for profiling system performance.
In short, it is the place where all of your applications / games / system information is stored.
The registry is made up of “Keys”. Each key is like the branch of a tree. Each key has one parent key, and zero or more child keys. Each key can contain zero or more “Values”, each of which contains a single piece of data.
To make navigating the registry a bit easier, you can think of the registry’s construction like your hard drives.
Hard drive <-> Registry
Folders <-> Keys
Files <-> Values
The registry contains 6 main keys:
- HKEY_CLASSES_ROOT ---- Contains information on file types, including which programs are used to open a particular file type.
- HKEY_CURRENT_USER ---- Contains user-specific settings that are built from information in the HKEY_USERS key during the logon process.
- HKEY_LOCAL_MACHINE ---- Contains computer specific information including installed hardware and software. This is the one users tend to spend the most time in.
- HKEY_USERS ---- Contains information about all of the users who log on to the computer. This includes settings for programs, desktop configurations, and so on. This key contains one subkey for each user.
- HKEY_CURRENT_CONFIG ---- Contains information about the computer’s hardware configuration .
What is Nagle’s Algorithm?
Nagle’s algorithm is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network.
Nagle’s algorithm works by combining a number of small outgoing messages, and sending them all at once. Specifically, as long as there is a sent packet for which the sender has received no acknowledgment, the sender should keep buffering its output until it has a full packet’s worth of output, thus allowing output to be sent all at once.
Basically, it’s a way so that the computer doesn’t need to ask unnecessary questions before proceeding in sending packets and wasting time.
What is TCP/IP ?
TCP/IP is used to refer to two different things. On one side TCP/IP is a suite of protocols that rule the Internet containing protocols like HTTP, Telnet, ICMP,SSH and many others. On the other side TCP/IP is also a pair of protocols themselves. TCP as a protocol in the transport layer, and IP as a protocol in the Internet Access Layer.
UDP, in contrast with TCP, is a transport protocol with no guarantee of delivery, ordering, or duplicate protection. There are some scenarios where UDP is better than TCP (for example VoIP), but TCP is by far much more used. Lets focus on TCP protocol, as it is the relevant protocol for explaining Delayed ACK.
As TCP needs to guarantee the delivery of the segments, every segment being sent from the source (client) to the destination (server) needs to be acknowledged.
Basically, the way TCP & UDP works, is as follow:
When TCP has a packet, it sends it as soon as it gets it, then waits for a reply from the server (to where it sent the packet) to verify that is has received the packet, before sending another packet.
UDP on the other hand, sents the packets in groups, rather then one at a time. This makes it so that the server doesn’t need to verify each and every packet, but only once for the entire group.
What is Delayed ACK?
Delayed ACK was invented to reduce the number of ACKs required to acknowledge the segments, so protocol overhead is reduced.
Basically Delayed ACK is the destination retaining the ACK segment a period of time, expecting one of two things to happen:
-
That a new segment will arrive that will also require acknowledge, so we can ACK two segments in one pure ACK instead of in two separate ACKs.
-
That, perhaps, before the ACK timer expires, the destination will need to send some data back to the source in which we can include the ACK bit and the right ACK sequence number to acknowledge the segment (piggybacking).
So delayed ACK is basically a bet.
Think of it like this: Your PC is betting (even though it already has data to send) that you will conjure up more data to send in just a few milliseconds, so it will wait for that data and send all the data in groups, reducing the amount of acknowledgement needed for the data.
Example:
Is the bet of destination saying “I bet 200 ms (or the value of the delayed ACK timer) that a new packet will arrive before the delayed ACK timer expires, or that we will need to send our own data back to the sender before 200 ms (in which we can include an ACK bit flag enabled). If I win, I save 41 bytes of the extra ACK I am avoiding. If I loose I lost a maximum of 200 ms”
What Protocol does Minecraft use (UDP or TCP)?
Minecraft uses both, even though people tend to think it is only TCP.
Meaning, when you disable the delay on TCP, you will still have to endure UDP.
What is the prupose of TCPNoDelay & TcpAckFrequency?
Some of you might be wondering what does any of what I explained above have to do with RegEdit in Minecraft. Before you can understand what TCPNoDelay and TcpAckFrequency do, you first need to understand the way networking works, and how packets are transferred.
When you add TCPNoDelay into the registry, you basically disable Nagle’s Algorithm, which in turn changes the way your PC intercepts and transmit data (packets).
Think of it like this:
Instead of your PC that keep asking the server if it received the data, before sending another packet, it just sends it no matter if it didn’t receive it. The ups and downs of this is, it increases the speed of sending data, but also increases the likelihood of not sending the correct packets (which can cause lag spikes in-game).
When you add TcpAckFrequency into the registry, you basically disable the Delayed ACK, which in turn disables the way your PC can avoid multple ACK’s (Acknowledgements)
Think of it like this:
Instead of your PC “betting” on whether there will be more data to group up or not, it just doesn’t bet anymore. The ups and downs of this is, it doesn’t waste time on bets, but does loose out when it could have scored with avoiding multiple ACK’s.
In Conclusion:
Adding TCPNoDelay and TcpAckFrequency into your registry does not affect in-game mechanics in Minecraft (neither does the TCPNoDelay mod). It’s just a placebo effect.
A lot of time and effort was spent researching this, gathering information from trusted sources and known sites.