MSL (Maximum Segment Lifetime), TCP allows different implementations to set different MSL values. First, to ensure that the client sends the last ACK message can reach the server, because this ACK message may be lost, standing in the server's view, I have sent a fin+ack message request disconnected, the client has not responded to me, should be I sent a request to disconnect the message it did not receive, The server will then resend again, and the client will be able to receive this retransmission message within the 2MSL time period, then give the response message and restart the 2MSL timer. Second, the "Failed connection request message segment" Mentioned in the "three-time handshake" is prevented from appearing in this connection. After the client sends the last acknowledgment message, in this 2MSL time, all the message segments generated during the duration of the connection will be removed from the network. In this way, the old connection's request message does not appear in the new connection. Why is it that the connection is three handshakes, and the connection is turned off four times? When the connection is established, the server sends the ACK and SYN in a message to the client when it receives the SYN message to establish the connection request in the listen state. When the connection is closed, the server receives the other side of the fin message, only that the other side no longer send data but also can receive data, and they may not all the data are sent to each other, so you can immediately close, you can send some data to each other, then send fin message to the other side to express the consent to close the connection now, Therefore, your own ACK and fin are generally divided into the development of sending, resulting in one more. |