Three-time handshake for TCP connections
First handshake: The client sends a SYN packet (SYN=J) to the server and enters the Syn_send state, waiting for the server to confirm;
( The client asks the server: Do you love me? )
Second handshake: The server receives the SYN packet, it must confirm the customer's SYN (ACK=J+1), and also send itself a SYN packet (syn=k), that is, the Syn+ack packet, when the server enters the SYN_RECV state;
( Server Answer: I love you, you love me too? )
Third handshake: The client receives the server's Syn+ack packet, sends the acknowledgment packet ack (ACK=K+1) to the server, the packet is sent, the client and the server enter the established state, and the handshake is completed three times.
( The client replied: I love you, you love me too, so let's get married! (established))
The data is not included in the packets that are delivered during the handshake, and the client and server formally begin transmitting the data after the three handshake is complete.
TCP establishes three handshake for the connection, and 4 times the wave of closing the connection