From owner-freebsd-questions@FreeBSD.ORG Thu Oct 13 18:50:21 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 3742816A41F for ; Thu, 13 Oct 2005 18:50:21 +0000 (GMT) (envelope-from vishal_study@yahoo.com) Received: from web54609.mail.yahoo.com (web54609.mail.yahoo.com [206.190.49.179]) by mx1.FreeBSD.org (Postfix) with SMTP id B3B3E43D46 for ; Thu, 13 Oct 2005 18:50:20 +0000 (GMT) (envelope-from vishal_study@yahoo.com) Received: (qmail 50835 invoked by uid 60001); 13 Oct 2005 18:50:19 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TpCqjltfrthTneeNxi88BiAniyyC39Ne1cC7fV1Ld4+JH1CnXqpyo+QgQ5w89GGYZ1DtWsf3c8opuC4UMTlJ+J721oBEL0eOipGIpfKMWo0QCXcUPPDwOipKtfU6DoHI1S11lc1VfIhO30JfThCOPfxMhI5ReVpBpFeLUJ/9h6Q= ; Message-ID: <20051013185019.50833.qmail@web54609.mail.yahoo.com> Received: from [64.169.86.195] by web54609.mail.yahoo.com via HTTP; Thu, 13 Oct 2005 11:50:19 PDT Date: Thu, 13 Oct 2005 11:50:19 -0700 (PDT) From: Vishal M To: Chuck Swiger In-Reply-To: <434E8368.1020608@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: vishal_study@yahoo.com, 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 18:50:21 -0000 Hi Chuck: Thanks for your reply. 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. 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? Could someone please give any pointers. Thanks, Vishal. --- Chuck Swiger wrote: > Vishal M wrote: > > I have a question on Simulataneous TCP close. > > > > According to the TCP state machine mentioned in > > "TCP/IP Illustrated - Vol 2", pg 806; TCP stack is > > supposed to just send out an ACK before > transitioning > > into CLOSING state. > > > > However, according to tcp_outflags[] array shown > on pg > > 807, fig #24.16; the associated flags are FIN+ACK. > > > > I looked at 4.x FreeBSD codebase and it sends out > > FIN+ACK while transitioning to CLOSING state > (inside > > tcp_outflags[] defined in tcp_fsm.h file). > > > > Question: > > - Could someone please let me know the correct > > behavior i.e should we send out just an ACK or > FIN+ACK > > while transitioning into CLOSING state? > > The RFC suggests sending out bare FIN packets, but > it is not required, and it > is more efficient to set the FIN in the last data > packet you need to send to > flush the queue before closing, resulting in a > FIN+ACK packet rather than two > packets. > > This is not directly connected to the notion of > "simultaneous TCP closing", > BTW. :-) > > -- > -Chuck > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com