tcp three-way handshake four times wave and network status

Schematic diagram of tcp three-way handshake and four-way wave,  see http://www.jianshu.com/p/9968b16b607e for details



 

 Description of some states,

1. At the end of the client, after sending FIN, it enters the FIN-WAIT-1 state

2. The server side receives the FIN, sends ACK, and enters the CLOSE-WAIT state

3. After the client receives the ACK, it enters the FIN-WAIT-2 state and stops sending data

4. The server continues to send the data, sends FIN to the client, and the server enters LAST-ACK

5. After the client sends ACK, it enters TIME-WAIT, waits for 2MSL (30s or 1 minute, 2 minutes), enters the CLOSE state, ends and releases the port

6. After the server receives the ACK, it enters the CLOSE state and releases the port

 

Why does the TIME_WAIT state need to go through 2MSL (maximum segment lifetime) to return to the CLOSE state?

  • In order to ensure that the last ACK segment sent can reach B
  • Prevents "defunct connection request segment" from appearing in this connection. After the last ACK segment is sent, and the time 2MSL elapses, all segments generated during the duration of this connection can disappear from the network. In this way, the old connection request segment will not appear in the next new connection.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326482144&siteId=291194637