TCP three-way handshake of HTTP protocol

What are the three-way handshakes done in the TCP connection creation?

First time:
Client: Are you there?
Server: in.

Second time:
Client: Available?
Server: Available. Are you sure you want to use it?

Third time:
Client: Yes. let us start.
Server: Good.


Link created successfully. Start communication.


———————————————————————————————————————


But why must a three-way handshake be performed to ensure that the connection is double As for the work, can't you do it once? Not twice?
We take a real-life example of verbal communication between two people to simulate a three-way handshake.

The first conversation: The

wife asked A to go out to make soy sauce, and met a friend B on the way. A asked: buddy, have you eaten yet?

As a result, B listened to the song with headphones, but he didn't hear it at all and didn't respond. A thought to himself: I don't have a sound when I talk to you. If I don't talk to you, the communication fails. It shows that communication must fail if B cannot accept the information sent by A.

If B hears what A said, then the first conversation is successful, and the second conversation follows.

The second conversation:

B heard what A said, but he is a foreigner and his Chinese is not good. He doesn’t know what A said or how to answer, so he casually answered a sentence of Chinese he had learned: I went to the toilet. When A heard this, he immediately burst out laughing, "Going to the toilet to eat"? The difference is not conspiracy, let's stay away from you, communication fails. Explain that communication fails when B cannot respond correctly.

If B heard A's words, he made a correct answer, and also asked rhetorically: I have eaten, how about you? Then the second handshake is successful.

Through the first two dialogues, it is proved that B can understand what A said and can make correct responses. A third conversation follows.

The third conversation:

A just said hello to B, and suddenly his wife called him, "You bastard, you have been making soy sauce for so long, let's see how I will clean up you when I get home." Without saying a word, he ran home and left B to hang himself there. B thought to himself: What kind of person is this, well, let me go home too, communication failed. It means that the communication fails when A cannot respond.

If A also responded correctly: I also ate it. Then the third conversation was successful, the two have established a smooth communication channel, and then began to chat continuously.


——————————————————————————————————————————

In fact, it is for both sides of the request to be identification, so logically at least three times.


——————————————————————————————————————————

But why do I personally feel that it is three times instead of two times? , not because it is to prove that A can understand B and respond (the second time B can correctly respond to A, it means that the communication between the two has been barrier-free), but because of the fear of wasting emotions in the following situations.

The scenario goes like this:
A greets B on the road, and due to the wind, the sentence is blown away (delayed).
A greets B again, this time B hears and responds. At this time, whether it is three handshakes or two handshakes, two people can communicate happily. After 0.1 seconds, the two waved goodbye four times. At this time, the words that were blown away by the wind reached B's ears again. B thought that A wanted to communicate with him again, so he responded in response. The problem arises: if B uses a 2-way handshake, it is determined that A wants to communicate with him, so he keeps waiting and wastes his feelings. But if it is a three-way handshake, and B waits for a while and finds that A has not responded, he thinks that A has left, and then he also leaves!




—————————————————————————————————————————————


So the three-way handshake is guaranteed: duplex and fault tolerance.












Quote:
http://www.cnblogs.com/yuilin/archive/2012/11/05/2755298.html




-



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326819111&siteId=291194637