TCP Connection Client state transition process
Closed-->syn_sent-->established--> fin_wait1-->fin_wait2-->time_wait-->closed
TCP connection Service side state transition process
Closed-->listen-->syn_recvd-->established-->close_wait-->lask_ack-->closed
Why is the TCP connection 3 handshake, disconnect to 4 times wave?
Because when the TCP disconnects, the client sends Fin=1 's disconnect request to the server (the first wave), itself enters the state (FIN_WAIT1), but the server may have no data sent and received, so the server will reply to the ACK (the second wave) to the client to receive the disconnection request. At this point the client state changes to Fin_wait2, and when the server is ready, the fin (Third wave) is sent to indicate that the disconnection is in the Lask_ack state at the same time that the client receives fin and sends an ACK (fourth wave) to the server itself into a time_wait state. Wait for the MSL time to go back to the closed state of the client server.
Why does TCP4 wave after waving not directly into the closed state, but wait for the MSL time to change after?
Because the computer thinks itself is not reliable, also has the 4th time to wave the ACK message service side not to receive the reason, therefore will wait for the MSL time past both sides to become closed state.
TCP3 Handshake 4 times wave