From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 23 07:56:08 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D00C1065676; Mon, 23 Mar 2009 07:56:08 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id D90B78FC1E; Mon, 23 Mar 2009 07:56:07 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id n2N7Oq2U053841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Mar 2009 00:24:52 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id n2N7OqrW053840; Mon, 23 Mar 2009 00:24:52 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA09831; Sun, 22 Mar 09 23:20:59 PST Date: Mon, 23 Mar 2009 00:19:57 -0700 From: perryh@pluto.rain.com To: ota@j.email.ne.jp Message-Id: <49c7381d.eJH7/fiaDJB9Gr6c%perryh@pluto.rain.com> References: <20090320045319.04484fc5.ota@j.email.ne.jp> <20090322235253.432874dd.ota@j.email.ne.jp> In-Reply-To: <20090322235253.432874dd.ota@j.email.ne.jp> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, rwatson@freebsd.org Subject: Re: 2 uni-directional TCP connection good? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 07:56:09 -0000 > What I meant was that there were cases when a receiver could not > tell weather no data was coming or communication was interrupted. > Once connection is established, a route is available between a > server and a client. Let's say this route is broken for some > reasons, i.e. someone unplugged a cable or a firewall started > dropping or rejecting between these server and client, a sender > may not notice as soon as it happens but at least, a sender knows > a massages was not delivered right. On the other hand, receiver > side does not have any idea that a message delivery failure has > happened at all or for a while unless using heartbeat messages > in upper layer. KEEP_ALIVE option seems to be implementation > dependent such that you cannot assure TCP connection availability > for every minute. The whole point of TCP (vs IP alone, or UDP) is to establish reliable end-to-end communication over unreliable underlying links. If a packet is corrupted or lost, it gets resent. If a route goes down, and an alternate is available, TCP will -- eventually -- find it and recover. If the last (or only) route goes down, TCP will in principle wait indefinitely for a route to become available, whether by reestablishment of the original or provision of an alternative. So you are correct that a receiver can't tell the difference between a loss of connectivity and the sender having crashed, however the situation is entirely symmetric: the sender can't tell the difference either. It all gets sorted out when communication is reestablished; at that point traffic will resume (if the link had been down) or the uncrashed end will get a connection reset (if its peer had crashed). The practice of sending keep-alive packets simply converts a temporary (thus potentially recoverable) communication loss into what amounts to an unrecoverable crash of whichever end gets impatient first.