The three-way handshake tcp connection

TCP handshake protocol: In the TCP / IP protocol, TCP protocol provides reliable connectivity services, the use of three-way handshake to establish a connection. 
1, the first handshake: a connection is established, the client sends syn packets (syn = j) to the server, and enters SYN_SEND state, waiting for the server to confirm; the SYN: synchronization sequence number (the Synchronize Sequence Numbers) 
2, second handshake : syn server receives the packet, you must confirm the customer SYN (ack = j + 1) , while themselves sends a SYN packet (syn = k), i.e., SYN + ACK packet, then the server into SYN_RECV state;  
3, third handshake: the client receives the SYN + ACK packet to the server, the server sends an acknowledgment packet ACK (ack = k + 1) , this packet is sent, the client and server into the ESTABLISHED state, complete the three-way handshake. 
Complete three-way handshake, the client and the server begins transmitting data. 

A so-called three-way handshake (three times handshake; three-way handshaking) for each i.e., how the amount of data transmitted so that the tracking negotiated data segment transmission and reception of synchronization, the amount of data to confirm the number of the received data and determines data transmission, when receiving the complete revocation contact, and establish a virtual connection . 
To provide reliable delivery, TCP before sending new data to a particular sequence number of the data packet, and requires an acknowledgment message after the packet transfer to the target machine. TCP is always used to send large amounts of data. When the application to be made after receiving the data confirm also used TCP.

Use plain words to explain:
  • A hit B to a call, said: Hello, I want you to build a tcp connection, can it? A B receives the call, and if they wish to establish a connection, will say: Hello, I can. A to B issued a successful connection is established.
  • In answer to A B when A will also be made to establish a connection request (because TCP is full duplex, bi-directional): A to B will say: Hello, I want to tell you of a TCP connection is established ,May I?
  • A In addition to B before receiving their confirmation, also received B sent me the application, after receipt of the application A, B will be issued to a confirmation. In this case, B is connected to A, also established a success. This process is called "TCP three-way handshake ", when both parties confirm the establishment of the connection, the data transfer begins

Guess you like

Origin www.cnblogs.com/SsShirley/p/11871608.html