Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site hammer.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!tektronix!orca!hammer!steveh From: steveh@hammer.UUCP (Stephen Hemminger) Newsgroups: net.unix-wizards,net.lan Subject: KEEPALIVE's do not always work. Message-ID: <1284@hammer.UUCP> Date: Wed, 29-May-85 13:48:23 EDT Article-I.D.: hammer.1284 Posted: Wed May 29 13:48:23 1985 Date-Received: Sat, 1-Jun-85 00:21:11 EDT Reply-To: steveh@hammer.UUCP (Stephen Hemminger) Organization: Tektronix, Wilsonville OR Lines: 47 Xref: watmath net.unix-wizards:13370 net.lan:828 Here is a rather complex BSD implmentation of TCP protocol bug. It is a problem with TCP not BSD, but a good solution is hard to decide; what's your opinion. Scenario: Suppose two programs have a tcp/ip connection over a socket with keepalive's set. (example rlogin or telnet). Keepalive's mean that every thirty seconds a null packet is sent. The idea is that if this null packet is not acknowledged, then eventually the idle timer will go off and the connection will terminate. For discussion, let's call the two hosts A and B. Suppose host B goes down then the keepalive packet from A to B will never be acknowlged so A will know the connection is severed. The idle timer is 15 min. in 4.2BSD. Problem: Suppose host B goes down and then comes back up in less than 15 min. (obviously it can't be a vax :-) ) When B gets a keepalive packet, it will correctly send a RST (reset) back to A. The problem is that since the keep alive packet is a window update pointing one past the valid window, the RST is ignored by A. Yet, the idle timer on A is cleared by this invalid RST, so A will never abort the connection. The socket on A will hang forever open! Possible solutions: A) Make RST's outside window valid. The TCP protocol says that RST outside the current window are to be ignored. Let's not violate the protocol. B) Send a different keepalive packet. (i.e. inside window). What is a packet which is a guarenteed no-operation? Any data inside window has already been seen by B and therefore no acknowledgement is neeeded. C) Don't use keepalive's. Then how to you keep idle connections alive. D) Don't use tcp. then what, ISO (are you kidding? :-( ). Comments?