TCP connection close
The last step of connection close -
Client waits for a period of time equal to double the maximum segment life (MSL) time, also known as TIME_WAIT interval, to ensure the ACK it sent was received.
MSL is the maximum time a TCP segment can exist in the internetwork system.
On a FreeBSD system, MSL can be checked by -
sysctl -d net.inet.tcp.msl sysctl net.inet.tcp.msl
http://www.tcpipguide.com/free/t_TCPConnectionTermination-2.htm
Half Open Connection - This condition arises when one side has terminated its end, while the other side has not. The side that has terminated can no longer send any data into the connection, but the other side can.
Possible test scenarios
Connection close via a three-way handshake -
It is also possible to terminate the connection by a 3-way handshake, when host A sends a FIN and host B replies with a FIN & ACK (merely combines 2 steps into one) and host A replies with an ACK.
Check whether FreeBSD implements a half-duplex close sequence -
- If such a host actively closes a connection but still has not read all the incoming data the stack already received from the link, this host sends a RST instead of a FIN. This allows a TCP application to be sure the remote application has read all the data the former sent—waiting the FIN from the remote side, when it actively closes the connection. But the remote TCP stack cannot distinguish between a Connection Aborting RST and Data Loss RST. Both cause the remote stack to lose all the data received.
Section 4.2.2.13 in RFC 1122