Web Service-1, HTTP protocol three handshake four times wave

Source: Internet
Author: User
Tags ack

Knowledge Point: HTTP protocol: It is based on the TCP protocol, browser access to the server, the server to the resource back to the browser, the process is to follow the HTTP protocol, otherwise cannot be completed, HTTP early is the 1.0 version, now basically is the 1.1 version, the difference between the two versions is 1.0 using a short connection, the early years of the site is relatively simple, short-link communication is not a big problem, but now the site a variety of cool complex, so the use of 1.1 version of the long connection, improve communication efficiency. So, what is his specific communication process? That's the three times we used to shake hands and four waves.

1, directly look at the picture:

Three-time handshake:
1: The browser tells the server that I want to establish a link with you, a bit code syn=1 and a random packet seq1_num=123 sent to the server.
2: After the server receives the 1 message, it also tells the browser I received, the server will take the ack= 1 and Ack2_num=seq1_num+1, and their own random packet seq2_num=789 will be sent to the browser.
3: The browser receives the response data of the service and will determine the ack2_ Num whether or not in the past Seq1_num added 1, yes, he will give the server back, tell the server, the data I verified, is right, the browser will be sent with the server random code seq2_num+1 and ACK sent past, the server received confirmation seq2_num+ 1 and an ACK value to establish the connection.
four times wave:
Generally disconnected is the browser first break, so,

1: The Browser calls Close () closes the Send channel, tells the server, I will not send the data to you again.

2: After the server receives, it closes the method of sending the message (SOCKET.RECV ()) and sends it back to the browser I received your message.
3: Close the receiving channel of the server and send it back to the browser.
4: The browser receives a message from the server, closes the channel receiving the message, and sends back a confirmation message to the server telling the server that it received the server, and then closes the server send channel.

Web Service-1, HTTP protocol three handshake four times wave

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.