Turn: From the graphic TCP/IP P204
The three-time handshake and four-wave status transition diagram are as follows:
, because the second handshake receiver sends the syn+ack signal so the handshake only used three times, waving because the receiver ACK and fin two times, so wave needs four times .
Finally, the receiving end needs a time_wait state, and if the last ACK sent by the TCP client is lost, it will be sent again . The time required in the TIME_WAIT state is dependent on the implementation method. Typical values are 30 seconds, 1 minutes, and 2 minutes. The connection is formally closed after waiting, and all resources (including the port number) are released.
The entire client (send side) status graph is as follows:
The entire server (receive side) status diagram is as follows:
A TCP connection in SYNC_RECV is called a semi-connection and is stored in a semi-connected queue in the kernel, which finds a half-connection queue when the kernel receives an ACK packet from the peer, and stores the compliant Requst_sock information in the queue of the connection that completes the three handshake, and then deletes the half connection.
TCP/IP 3 Handshake 4 wave