On Sun, Nov 12, 2000 at 04:49:44PM +1100, Howard Lowndes wrote:
> Well, setting TCP_NODELAY in telnet certainly improved things and got rid
> of the 200 ms delay between packets, but I still have a problem in that
> the packets are still going:
>
> DATA1 -> ACK1 -> DATA2 -> ACK2 ...
Sounds like you've still got Nagle happening, but delayed ACK is disabled!?
> only now the delay is only the length of the circuit latency, which is
> still occasionally causing a problem at the far end.
>
> My understanding of TCP is that there is the ability to window packets up
> to the window byte limit so that in effect I could have:
>
> DATA1 -> DATA2 -> ACK1 -> ACK2 ...
Delayed ACK is the thing which makes this work (well). By default TCP will
send the ACK as soon as the packet to ACK has arrived. With delayed ACK it
will wait up to (normally) 200ms for multiple packets to arrive, then ACK
them all at once. The stream is actually more like :
DATA1 -> DATA2 -> DATA3 -> ACK3
ie, ACK1 and ACK2 are not required - you can just ACK the last packet and
everything before that is implied. The saving here is that we've only sent
40-odd bytes back (one TCP packet with zero data, just IP and TCP headers)
rather than 120 bytes.
> So why is this not happening, or am I misunderstanding here?
No idea. TCP_NODELAY definitely should disable Nagle, but...
> Scott Howard (unfortunately I have lost his excellent explanation) spoke
> about delayed ACK. Is this my problem?
http://www.slug.org.au/, click on mailing lists :)
Or just send me a (private) email and I'll forward you a copy.
> An unfortunate consequence of Linux is that, although a single
> cursor/function key stroke generates multiple characters, Linux
> occasionally and randomly (seemingly) chooses to send these characters in
> separate packets. I know that Ken Yap said that all that is certain about
Unless I'm mistaken, this is done by telnet (or whatever app is sending)
rather than Linux itself.
Something I did miss in my earlier message was where to look for further
info. There's several books on TCP, but the best by far (IMHO) is
"TCP/IP Illustrated: Volume 1" by W. Richard Stevens.
If you're interested in programming, one of his other books, "Unix Network
Programming" is the one to look for (of course, if you were programming
on Unix you'd already have a copy of his "Advanced Programming in the
Unix Environment", wouldnt you?)
If you are buying any of these books (in particular TCP/IP Illustrated), buy
them locally - for some reason they are much more expensive in the US (and
that was even before the dollar nose-dived)
Scott.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug