TCP Three-time handshake

Source: Internet
Author: User

1. The client actively sends a syn=1, randomly generates a SEQ number = x packet to the server (the server is known by syn=1 that the client is required to establish a connection) 2. After the server receives the request to confirm the online information, sends the syn=1,ack=1 to the client, generates the SEQ randomly number= Y, ack number = client's seq number +1 (x+1) 3. The client checks if the ACK number is correct, that is, the SEQ number +1 is sent for the first time, and if the code ACK is 1, and if the correct client sends the ACK again Numbe R = y+1 (service-side SEQ number + 1), seq number = server-side ack (that is, x+1, also the first SEQ # + 1), after the server has received a value of the SEQ after acknowledgement of the ack=1, the connection is established successfully.

Instance:

IP 192.168.1.116.3337 > 192.168.1.123.7788:s 3,626,544,836:3,626,544,836
IP 192.168.1.123.7788 > 192.168.1.116.3337:s 1739326486:1739326486 ack 3626544837
IP 192.168.1.116.3337 > 192.168.1.123.7788:ack 1739326487,ack 1

First handshake: 192.168.1.116 sends a bit code syn=1, randomly generates a SEQ number=3626544836 packet to 192.168.1.123,192.168.1.123 by syn= 1 know 192.168.1.116 requirements to establish online;

Second handshake: 192.168.1.123 to confirm the online information after receiving the request, send Ack number=3626544837,syn=1,ack=1 to 192.168.1.116, randomly generate seq=1739326486 packet;

Third handshake: 192.168.1.116 received after checking ACK number is correct, that is, the first time the SEQ Number+1 sent, and the bit code ACK is 1, if correct, 192.168.1.116 will send an ACK again number=1739326487 , Ack=1,192.168.1.123 received after confirmation seq=seq+1,ack=1 the connection was established successfully.

Graphic:
A three-time handshake process (Fig. 1, fig. 2)

(Fig. 1)

(Fig. 2)

The first handshake of the flag bit (Fig. 3)
We can see that there is only one sync bit inside the flag, which is the request (SYN)

(Fig. 3)

The second handshake's flag bit (Fig. 4)
We can see that there is a confirmation bit and a sync bit inside the flag, which is the answer (SYN + ACK).

(Fig. 4)

The sign of the third handshake (Figure 5)
We can see that there is only one confirmation bit inside the flag, that is, re-confirm (ACK).


(Fig. 5)

A full three-time handshake is the request---answer---confirm again


part of the content reference >



From for notes (Wiz)



TCP Three-time handshake

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.