Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!FTP.COM!ljm From: ljm@FTP.COM (leo j mclaughlin iii) Newsgroups: comp.protocols.tcp-ip Subject: telnet and Nagle's algorithm Message-ID: <9105172007.AA28847@ftp.com> Date: 17 May 91 20:07:26 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: ljm@ftp.com Organization: The Internet Lines: 44 > >...Based on the responses I received, I would suggest the following >additions to RFC1122/1123: > > 1. Where a terminal emulator is running on a workstation directly > on the Internet, the system SHOULD ensure that escape sequences are > transmitted in a single TCP packet.... > The basic problem (and the reason folk warned you away from the algorithm you are now using) is that there is no such thing as a TCP packet. A TCP connection just transfers streams of bytes with no record boundries. Every so often this list gets a question along the lines of 'I do a write of N bytes but sometimes my read doesn't get all N bytes'. The answer is that any assumptions made about how TCP traffic is handled are eventually doomed to failure. > >The writers of RFC 1122 (Requirements for Internet Hosts) were >apparently aware of this kind of problems, because they gave SHOULD >status to the Nagle Algorithm, and MUST status to letting an application >turn it off.... > >...I would remind implementors that RFC1122 says they MUST allow an >application to turn off Nagle. Does anyone know how this is done in >practice? I don't think a site configuration option really meets this >requirement, but perhaps I misinterpret the spec. > Yet more bad news. The primary reason for allowing Nagle's algorithm to be turned off was X-Windows. Nagle's algorithm is very bad for any application (such as X-windows) with short bursts of high priority traffic. For these sorts of applications, most (all?) vendors who do Nagle allow 'no Nagle' as an option when opening a connection. Thus, it is the *application* which can turn off Nagle, not the user. Even worse from your point of view, the one application you would have a very tough time convincing people should be un-Nagled, the one application which generates the overwhelming majority of 'wasteful' small packets in the Internet, the one application for which Nagle was designed, is telnet. enjoy (or more accurately, sorry), leo j mclaughlin iii ljm@ftp.com