"Deng Geqi case of Hutchison 3" - TCP three-way handshake

  How often do you hear people mention the TCP three-way handshake and waved it four times? Have you seen many times on three shook hands and waved four articles of no use to understand or do not remember?
  Three-way handshake with the four waving a basic knowledge of the computer industry, whether it is social or school recruit trick, either the front or the back-end are likely to be asked, because many students will start school ready to move, then we today on the first to talk about the TCP three-way handshake.
  Let's talk about three-way handshake, we see this question, the first question is, Shajiao handshake? How can a handshake between two machines? How I did not find my home computer has a hand?
  The second question is, why should three times? Two will not do it? I think grip on the line ~ Why would hold three times? Rogue ~
  Today we first use the example of Deng brother, let us remember the three-way handshake ~
  saying Deng brother's college life, with a word to describe it is: "small leaves across the river, thanks to the waves ~." Deng brother in college, there is a goddess in mind, green tea sister ~
  day Deng brother decided to write a love letter - green tea green tea sister sister sitting two rows in front of Deng brother's position, Deng brother needed someone to help pass a small piece of paper - but Deng brother worried teaser direct words of the book, do not help students pass the front row how to do? After receiving no reply green tea sister paper how to do?
  This time, Deng brother and green tea is the equivalent of two to be communicating with the host, but the two main To communicate, we must first demonstrate the ability of the two hosts have received and issued. Therefore, the main purpose of the three-way handshake is to confirm that both hosts have the ability to receive and transmit the.
  So Deng brother decided to send a small piece of paper to test ~ So Deng brother wrote the first small piece of paper: "This note is green tea - serial number 249, we preach of chat ah ~?." Small piece of paper very well to the green tea sister's hands -
  Three-way handshake is actually made of three messages - between A and B is the total mass of the three small piece of paper - has now passed the one - we assume that Deng brother is the host A, green tea is the host B, A need to confirm B both income can also send, B must either confirm a collection can be made only after the start of real communication. Because if there is either received or hair problems, communication can not succeed. First a note: that first handshake three-way handshake, the main pass two messages, one to establish a connection request, the second is to send a serial number. In actual connection, the connection establishment request SYN = 1 represents, with the sequence number seq = n, where n is a number. In the process of Deng brother pass the strip, Deng brother said this piece of paper number is 249, "we began to pass of chat ah?" Is the equivalent of a request to establish a connection. The first handshake let B know A host can send out a message
  of green tea Deng brother sister back to the piece of paper: "hello ~ 250 of the ~ received a note of the serial number is 99 this note, we now begin to chat ?. " This small piece of paper and then passed to Deng brother's hands -
  this is the second piece of paper, which is the second handshake - we have to note the serial number issued by Deng brother is 249, green tea reply is received 250. In practice, this reply a total of three pieces of information, one agreed to establish a connection (SYN = 1), the second is to acknowledge receipt of the message just (ack = just seq + 1), the third is issuing its own serial number ( seq = x, where x is a number). In the process of green tea in reply, "Then we start chatting?" This sentence agreed to establish a connection. "Received 250 of a piece of paper." This sentence represents just received the information, but we have to remember, do you want to add a process of just numbers, it received 249 replies from 250. "This paper is the number 99", that is the number of issued green tea. We carefully think about, in the first transfer bar B can know the hair A second piece of paper issued after receiving the A, A knows B can receive also can be issued. Well, this time, there is not a proof that B does not know A can not receive your note. While A receives a note, but B does not know - so B to generate a number, let A reply to confirm this number plus one A can receive the messages. This is the reason green tea to issue number. A second handshake let know B can receive, also can be issued.
  After Deng brother received a reply of green tea sister paper, issued a third piece of paper: "Ha ha ~ received a serial number 100, this note of the serial number 250 is now open talk ~." Then green tea has received this note -
  this is the third piece of paper, which is the third handshake. The reply also have three pieces of information, one represents now send (SYN = 0), the second is successfully received the message of green tea (ack = just seq + 1), the third is this note of the serial number (seq = beginning number issued + 1). Third handshake let B know that A can receive.
  So now we have no clear is why can not two-way handshake of it? This can clearly be seen by the following table, the first handshake only let B know that A can be made, the second handshake let A know B can receive can be made, but this time do not know A B can receive, so a need to send information to prove that you have received a reply B - it must be three times to make two machines can receive all know each other can be made.
  # A (Deng brother) B (green tea sister)
  received third handshake second handshake
  hair first handshake second handshake
  Through this example, we should be able to understand the following diagram, right ~?
"Deng Geqi case of Hutchison 3" - TCP three-way handshake
  After the three-way handshake by Deng brother can rest assured that green tea to send a love letter -
  Deng brother: "Learn bitter, Oliver knows no boundaries, repent and I -"
  green sister: "I like to suffer ..."
  Deng brother: "cry ing ~ "
  another Note: many Internet companies, when the leader made a notification in the group, a lot of people reply ack in the group, this stems from the source of it here.
  That's the whole process - TCP three-way handshake for you on our next course of four waving ~

Guess you like

Origin blog.51cto.com/13409950/2457087