2
votes

As long as I know, when a connection request SYN segment arrives, TCP will response with an SYN&ACK segment and mark the connection incomplete(SYN_RCVD) and put it into an incomplete queue, waiting for the ACK to complete the connection.

But I think it won't always stay in the queue, is there a timeout on it?

1

1 Answers

1
votes

On my Ubuntu system:

# cat /proc/sys/net/ipv4/tcp_synack_retries
5

A tcp_synack_retries variable is responsible for controlling the number of retransmissions in Linux operating system. Its default value is set to 5 for most Linux operating systems, which causes the half-open connection to be removed after 3 minutes. In the below table there are calculations for other values.

Value   Time of retransmission          Total time to keep half-open connections in the backlog queue
1       in 3rd second                   9 seconds
2       in 3rd and 9th second           21 seconds
3       in 3rd , 9th and 21st second    45 seconds