Easy-to-understand TCP three-way handshake

TCP transmission protocol is a protocol specially designed to provide reliable end-to-end byte stream transmission on unreliable networks. After all, the network is so big, I do n’t know if you are there when I send data to you, when I return data to me, my receiving function is not necessarily ok

For example, if you want to play at a friend's house in the distance, you must ask him in advance whether he is at home or not. The reality is via phone / WeChat, and the network transmission is through three handshake

 

The first time the client initiates a message to the server, if the server receives the certificate that the client's initiating function is fine, the server's receiving function is fine.

(I call you if someone receives a call indicating someone in your family. But I do n’t know if you are at home or your brother is at home)

The second time, the server returns a message to the client after receiving it. If the client receives it, it proves that the client's receiving function is fine, and the server's initiating function is fine. But at this time, the server does not know whether the message client sent by the client has been received.

(You told me that you are at home)

The third time, the client sends a message to the server to prove that the server's sending ability is no problem. At this time, the sending and picking functions of both ends are no problem, and the client can safely send data requests to the server.

(I heard you said you were there, and I replied to you: Okay, I ’ll go to your house to play)

Guess you like

Origin www.cnblogs.com/Vinlen/p/12758412.html