Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.protocols.tcp-ip Subject: Re: Warning: Keep-Alive considered harmful Message-ID: <1990Nov19.063111.21768@Think.COM> Date: 19 Nov 90 06:31:11 GMT References: <1990Nov16.164448.9918@bwdls61.bnr.ca> <9011170344.AA20268@gaak.LCS.MIT.EDU> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 27 Unfortunately, keep-alives are sometimes needed to work around deficiencies in application protocols. For instance, there's no way for a server telnet to detect when the client host has crashed (it could send an IAC Are-You-There, but there's no standard for the response, so it would confuse the process receiving the input). However, I think the common design of keep-alives is incorrect. The connection shouldn't be killed as a result of keep-alive timeouts. Instead, the purpose of keep-alives should be to elicit RSTs from the other host. Timeouts can be due to any number of reasons, but a RST indicates unambiguously that the connection is unusable, because the other end rebooted or closed the connection itself (perhaps network problems prevented the FIN from getting through). If a host crashes, the keepalive won't actually notice this until it comes back up, which is probably good enough. Yes, this will not catch all half-open connections. If the host dies for good, or crashes and is given a new address, the other hosts won't automatically kill their connections to it. But it's better to leave some useless connections open than to close some useful connections. Pinging for RSTs is fail-safe. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar