From owner-freebsd-questions@FreeBSD.ORG Thu Oct 13 15:55:28 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 E761816A41F for ; Thu, 13 Oct 2005 15:55:28 +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 7841143D49 for ; Thu, 13 Oct 2005 15:55:28 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id D92E55F82; Thu, 13 Oct 2005 11:55:27 -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 29163-01; Thu, 13 Oct 2005 11:55:18 -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 675025F7B; Thu, 13 Oct 2005 11:55:18 -0400 (EDT) Message-ID: <434E8368.1020608@mac.com> Date: Thu, 13 Oct 2005 11:55:20 -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: <20051012215146.15508.qmail@web32714.mail.mud.yahoo.com> In-Reply-To: <20051012215146.15508.qmail@web32714.mail.mud.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 15:55:29 -0000 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