Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2005 11:55:20 -0400
From:      Chuck Swiger <cswiger@mac.com>
To:        Vishal M <vishal_study@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: tcp_fsm.h: sending FIN or FIN+ACK in Closing state
Message-ID:  <434E8368.1020608@mac.com>
In-Reply-To: <20051012215146.15508.qmail@web32714.mail.mud.yahoo.com>
References:  <20051012215146.15508.qmail@web32714.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?434E8368.1020608>