networking - Unclear on Nagle's Algorithm -


I am doing some research on Nagle's algorithm out of idle awkwardness. I understand the basic concept behind it (TCP packets contain a significant amount of overhead, especially when dealing with small payloads), but I'm not sure that I influence the implementation.

I was reading on Wikipedia, but I still take the example of a telnet connection, unclear on how it still works. The connection is established and I'm starting to type. Let me say that I type three characters (for example, cat) and hit returns now we're talking cat \ r \ n which still only 5 bytes is. I thought that it will not be sent until we queue enough bytes to send - and yet, does are instantly sent from the perspective of the user, because Cat is immediately executed upon killing the return.

I think there is a basic misconception about how the algorithm works, especially about the bit where "unrecognized data is still in the pipes, enqueue, and send it immediately."

Data is sent instantly, if the server has already responded to any previous messages by you (Or this is your first contact with this session). Therefore, as the server is able to avoid the bog with too many packets, in order to respond promptly and slow, the maximum packet becomes queued before sending data.

So whether the data immediately sends or not only can be determined in the context of previous messages, if any.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -