-
TCP backlog with handshakeWeb/Network 2019. 9. 28. 16:56
1. Overview
In simple words, the backlog parameter specifies the number of pending connections the queue will hold(also called pending count in incomplete connection queue). When multiple clients connect to the server, the server then holds the incoming requests in a queue. The clients are arranged in the queue, and the server processes their requests one by one as and when queue-member proceeds. The nature of this kind of connection is called a queued connection. The backlog has an effect on the maximum rate at which a server can accept new TCP connections on a socket. The rate is a function of both the backlog value and the time that connections stay in the queue of partially open connections.
2. Description
2.1 Process(with Three-way handshake)
Each listening socket in TCP/IP stack has two queues
- Incomplete connection queue
- Complete connection queue.
When SYN arrives from the client, TCP creates a new entry in on the incomplete queue and then responds with the second segment of the three-way handshake which is SYN/ACK to the client. This entry will remain on the incomplete queue until the third segment of the three-way handshake which is ACK arrives from a client or until the entry times out (timeout is 75 seconds by default e.g. no option tcp_keepinit=150). If the three-way handshake completes normally, the entry moves from the incomplete queue to the end of completed queue. When server application calls accept(), the first entry from completed queue is processed.
3. References
https://www.ibm.com/support/pages/what-discarded-due-listeners-queue-full-counter-netstat-s-output
https://stackoverflow.com/questions/36594400/what-is-backlog-in-tcp-connections
'Web > Network' 카테고리의 다른 글
Difference between TCP keepalive and HTTP keepalive (0) 2019.09.28 TCP Keepalive (0) 2019.09.28 Data serialization and deserializaiton (0) 2019.09.27 Redundant Array of Independent Disks (RAID) (0) 2019.09.05 Directly Attached Storage (DAS), Network Attached Storage (NAS), and Storage Area Networks(SAN) (0) 2019.09.05