Three-time handshake
- The client said: "I want to even you, OK?"
- The server said: has received your request, receive please reply "Da", then you can even
- The client says: What, da ?
Wave four times
- The client says, "I'm going to disconnect, OK?"
- Server said: Received, do not worry, I have something to pass to you, I will tell you when I am ready.
- Server said: OK, you reply to the "Da", I received after the disconnect
- The client said, "What's The DA?
TCP Link Protocol Overview
Establishing TCP requires three handshakes to be established, while disconnecting requires four handshakes. The entire process is as follows:
the process of establishing a connection
First, the client sends the connection request message, the server section accepts the connection and replies to the ACK message, and allocates resources for this connection. An ACK message is also sent to the server segment after the client receives an ACK message , and the resource is allocated so that the TCP connection is established.
the process of disconnecting the connection
The disconnect end can be either the client side or the server side. The assumes the client side initiates an interrupt connection request and sends the FIN message first. After the server has received the FIN message, but if there is no data sent to complete, you do not need to close the socket, you can continue to send data. So to stop. At this point the client enters the fin_wait state and continues to wait for Fin messages on the server side. . After the client receives the fin message, it is known that the connection can be closed, but he still does not believe the network, so after sending an ACK into the TIME_WAIT state, the server side received an ACK, it will know that the connection can be disconnected. Client side waiting for 2MSL still do not receive a reply, the server side has been properly closed, and finally, the client side can also shut down the connection, the TCP connection has been completely shut down! The process of closing the connection is as follows:
From for notes (Wiz)
Three handshakes and four waves