[e2e] Clarification needed on delayed acks and sliding window protocol

dissolved dissolved at comcast.net
Fri Sep 24 14:52:09 PDT 2004


Thanks Craig for the prompt response. 

So the sliding window protocol is always in effect. And the delayed ACK
timer is always counting.  It is just when certain conditions are met that,
they are invoked.  If I use interactive sessions, nagle will always be used
to ensure the network doesn't get fluttered with 1byte segments.

Now:
If Host A (the sender), sends three segments to Host B (each segment
MSS...say 1460bytes), then Host B will ack when it receives 2 of the 3
segments.  Is this correct?  That would explain my sniffer output I've been
seeing. 

Thanks
Ryan



-----Original Message-----
From: Craig Partridge [mailto:craig at aland.bbn.com] 
Sent: Friday, September 24, 2004 5:38 PM
To: dissolved
Cc: end2end-interest at postel.org
Subject: Re: [e2e] Clarification needed on delayed acks and sliding window
protocol 


In message <200409242019.i8OKJZJ00987 at boreas.isi.edu>, "dissolved" writes:

>1. The nagle algorithm is mostly used on interactive sessions. Which means,
>we wont see it on stuff like FTP transfers.  What we WILL see, while using
>FTP transfers, is TCP's sliding window protocol. Am I right so far?
>
> 
>
>Now, sliding window protocol looks something like this on a sniffer
>
>Host A   -------> host B   (1k bytes of data)
>
>Host A   ------>  host B    (1k bytes of data)
>
>Host A   <-----   -Host B            (ack)
>
>Correct?

Yes (assuming 1KB is the MSS).  Note the Nagle algorithm could be on in
this case (indeed, is highly likely to be on, as the FTP application may
not be writing data in 1KB chunks, and Nagle ensures that maximum sized
segments get sent).

>2. Is the delayed acknowledgement algorithm used in conjunction with the
TCP
>sliding window protocol?  I had heard that when the sliding window protocol
>is used, the delayed ACK timer never has a chance to go off.  

The answer is subtle.  The rule is you delay an ack unless you've received
2MSS's worth of data, in which case you ack immediately.

So, during those times in the TCP connection that less than two segments
are in flight, or in which you have an odd number of segments in flight
(so the last one arrives alone and has to wait for a delayed ack)

>3. Is the nagle algorithm used in conjunction with the delayed ack
>algorithm?

Yes, they are independent.

>4. What determines if the nagle algorithm, or sliding window protocol will
>be used in a session?  The application layer?  The amount of data being
>transferred?  

Sliding window is always in effect.  Nagle is on or off depending on
what you've set for your connection.

Craig



More information about the end2end-interest mailing list