Analysis and setting of backlog in TCP/IP protocol and changes of TCP status

Source: Internet
Author: User

In the TCP/IP protocol, backlog analysis and settings, and TCP status changes. In the TCP/IP protocol, the first section describes how to set the backlog value. What is this value? We all know that TCP requires three-way handshake when establishing a connection. But if the three-way handshake is complete, the server will handle it (accept). If not, what will happen, if the accept is not timely, the client will fail to connect or the connection will fail. In this way, we can't talk about throughput. We think that TCP is not so designed. Backlog is actually a connection queue. The following formula shows the size of the backlog queue. Total of backlog queues = incomplete three-way handshake queues + three-way handshake queues have been completed. The preceding parameters are described as follows: Unfinished three-way handshake Queues: the server receives the client syn Packet (connect) when the server is in the listen status) into the unfinished queue. Three-way handshake queue has been completed: the second status of the three-way handshake is after the server syn + ack responds to the client, before the third status ack message arrives (the client sends the syn ack to the server) keep it in the unfinished connection queue. If the three-way handshake is completed, this entry will move the connection queue that has never been completed to the end of the completed connection queue. backlog parameter settings can be set either in the Linux Kernel Parameter settings (modifying the file/etc/sysctl parameters) or when the socket system calls the listen function (the second parameter ), the difference between the two is that the former is global and affects all sockets. The latter is local and affects the current socket. Figure 1 below shows the status of changes in the backlog queue when the server calls accept, a socket is taken from the header of the completed (three-way handshake) queue to connect to the process. The following is the process of change.

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.