Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'What Delayed ACK Means' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
What Delayed ACK Means
Authored by: jaaronp on Mar 05, '08 01:18:15PM

I was a bit curious about this hint (I have an MBP that suffers from poor airport performance) and wanted to find out what the delayed_ack setting did, why setting it to 0 might be helpful, and if so why the default value is 3.

The delayed_ack setting controls the amount of time the kernel waits before sending a TCP ACK packet to acknowledge the receipt of some incoming data. This is considered an optimization because in many cases network communications are bidirectional so it is likely to be the case that the application which just received a packet is about to send some data to the original sender of the packet. By waiting a little while the OS gives the application time to generate a response which can then be combined with the ACK packet. This means only one packet is sent instead of two (one for the ack and one for the application's response).

Even in a typical asynchronous protocol (like fetching a webpage for example where the server is sending lots of data and the web browser is unlikely to need to send a response), delaying the ACK doesn't cause any serious latency problems because the sender needn't wait for ACK packets before sending more data. The penalty of having to resend some earlier portion of the data (if an ACK packet is never received) is relatively low since the data is relatively small and likely to be cached somewhere.

For a large block transfer, like copying a multi-gig file using a networked filesystem, the penalty can be dramatic since the volume of data is too big to fit in the cache and the seek time penalty of having to go back and reread an earlier piece of the file is so large. It is likely that to avoid this penalty filesystem servers wait for acks before moving updating their cache (this is probably implemented as a ring-buffer so that the number of pending acks is never greater than some fixed value and as soon as one is received new data can be sent).

This is why setting the delayed_ack to 0 improves performance of large block transfers across a high-bandwidth lossy network (like 802.11g). If the server is able to determine more quickly that the client has received a chunk of the data, then the ring buffer can be advanced and new data can be loaded and sent. If the client always waits 100ms before sending the ack then the server will be constantly filling its buffers and waiting to receive an old ack (which may never arrive). Which leads to jerky performance and thus an overall slow transfer speed.



[ Reply to This | # ]
What Delayed ACK Means
Authored by: jaaronp on Mar 05, '08 01:28:25PM

I should note that in the previous comment my explanation of what TCP Delayed ACK means is based on actual facts. My explanation of why setting it to 0 is helpful is conjecture.



[ Reply to This | # ]
What Delayed ACK Means
Authored by: sblasl on Mar 05, '08 01:57:26PM

The description for Delayed ACK in the application Mac Pilot shows the following:

"Delay ACK to try and piggyback it onto a data packet. 0=disabled; 1=enabled; 2=more compatible (TH_PUSH); 3=streaming detection;"

So by using "0" we are disabling this parameter.

Mac Pilot will allow you to change the parameter on a permanent basis if you so choose to do so.



[ Reply to This | # ]