TCP three-way handshake introduce four wave

Studied computer network students know the TCP protocol is one of the most complex computer networks course inside of the agreement, there is little communication will put forward a three-way handshake, but also what four broke off, but also what the middle of the flow control you, congestion control, sliding window of what, beginners will be looked dizzy.

TCP three-way handshake TCP three-way handshake introduce four waving waving introduce four

The basic flow of communication

We all know the TCP protocol is connection-oriented protocol, you can ensure data is not lost, not repeat, not out of order to reach the recipient. TCP communication process is probably shown below.
TCP three-way handshake TCP three-way handshake introduce four waving waving introduce four
The picture shows a complete TCP entire communication process, first of all through the three-way handshake to establish a connection (green part), the connection is established can communicate with (blue), communication needs to finish four times and waved disconnected (red).

Three-way handshake

Three-way handshake can be understood:

TCP client is a boy, TCP server girls, boys to chase girls, we must first establish a relationship. It requires a process of establishing a relationship.

Boy: We can love you (the client requests the server to establish a connection)?

Girl: You want to go I want to clear (server requires the client to confirm the connection)?!

Boy: Yes, you are my dream lover (the client to confirm the connection)!

Three-way handshake to establish a "relationship" TCP server and client. Why do we need three-way handshake, the handshake will not do it twice? From the communication point of view, is enough, but not enough for the server to the client twice, because the server only knows two handshakes channel between the client and server is through, but between the server and the client is not known, it is necessary to receive a confirmation message sent by the client to confirm both sides of the news channel is ok.
TCP three-way handshake TCP three-way handshake introduce four waving waving introduce four

Four waving

Disconnect the need for connection of four waving, can be understood as boys and girls to break up, some need to go through the following discussion.

Boy: not to us, we break up. (Client has no data transmission)

Girl:? What so soon broke up, not so fast finish, I want to give you reckoning (server-side as well as this data is not the end of transmission)!

Girl to the boy afterwards in ...... (data not sending the continued transmission)

Girl: Well count, break (This server-side data transfer is completed)!

Boy: Well, we can still be friends in the future from ...... (wait Time_Wait time to restore single)
TCP three-way handshake TCP three-way handshake introduce four waving waving introduce four
Here is a point to note is that the client (third wave) after receiving the data transmission completion message sent by the server, can not close the connection (restore a single, looking for new love) now must wait 2MSL time to shut down, because the last wave during which the server may not be able to receive, if not received, the server will resend the third wave of news, this time if the client is closed, it will not respond to the fourth wave message so that the process can not be completed four times and waved.


Guess you like

Origin blog.51cto.com/14414295/2423425