From owner-freebsd-questions@FreeBSD.ORG Thu Oct 13 19:27:56 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52E3C16A420 for ; Thu, 13 Oct 2005 19:27:56 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B4D043D49 for ; Thu, 13 Oct 2005 19:27:55 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 886CE5F7B; Thu, 13 Oct 2005 15:27:54 -0400 (EDT) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 37285-01; Thu, 13 Oct 2005 15:27:43 -0400 (EDT) Received: from [192.168.1.3] (pool-68-161-76-130.ny325.east.verizon.net [68.161.76.130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 517AB5C8E; Thu, 13 Oct 2005 15:27:43 -0400 (EDT) Message-ID: <434EB531.2040503@mac.com> Date: Thu, 13 Oct 2005 15:27:45 -0400 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vishal M References: <20051013185019.50833.qmail@web54609.mail.yahoo.com> In-Reply-To: <20051013185019.50833.qmail@web54609.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-questions@freebsd.org Subject: Re: tcp_fsm.h: sending FIN or FIN+ACK in Closing state X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 19:27:56 -0000 Vishal M wrote: [ ... ] > My question was basically related to "Simultaneous > close" case wherein both sides initiate a TCP close > almost at the same time, resulting in FINs crossing > each other. Yes. But it's not apparent that the way you can handle FIN is much different in this case versus that of only one side closing, they are considering that case for the sake of completeness in the RFC and Stevens. > In FIN_WAIT1 state, on receiving FIN from the peer, we > transition into CLOSING state and send out an ACK. > My question was related to this ACK pkt. > > The RFC and Richard Stevens Vol-2 (pg 808) suggests > just sending an ACK whereas FreeBSD code (in > tcp_fsm.h) and also Stevens Vol-2 (pg 809) suggests > sending FIN+ACK. I am not clear on this...which is the > correct behavior? Both are. So long as you've received all of the sent data up through the FIN from the other side, and so long as you drain any unsent traffic on your side, it doesn't matter whether you send a FIN+ACK with the last data traffic or whether you ACK without a FIN, and then send a bare FIN seperately. -- -Chuck