Network Protocol: analysis of three-way handshake protocol

Source: Internet
Author: User



I. Analysis of the Three-way handshake protocol


First, let's look at one of the most common things in our life:





During our online shopping, we often chat with customer service like this: We asked Customer Service about something, Customer Service answered, and then we broke the network... After a while, we will log on again and receive a response from the customer service.


This interaction process completes a response three times. This process is similar to the three-way handshake mechanism when we use the TCP/IP protocol to access the server:





First handshake:

When a connection is established, the client sends the SYN Packet (SYN = J) to the server and enters the syn_send status, waiting for confirmation from the server. SYN is the synchronous sequence number.

 

The second handshake:

When the server receives the SYN packet, it must confirm the customer's Syn (ACK = J + 1) and send a SYN Packet (SYN = K), that is, the SYN + ACK packet, the server enters the syn_recv status.

 

The third handshake:

The client receives the server's SYN + ACK packet and sends a confirmation packet (ACK = k + 1) to the server. After the packet is sent, the client and server enter the established status and complete three handshakes.




2. What is the reliability of UDP?


From the above process, a TCP connection must go through three "conversations" before it can be established. That is to say, a reliable connection must be established with the other party before sending and receiving data. UDP is a non-connection-oriented protocol. Instead of establishing a connection with the other Party, it directly sends packets! Therefore, the TCP protocol is reliable and secure, while the UDP protocol does not respond. It is suitable for connections with low reliability.






Network Protocol: analysis of three-way handshake protocol

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.