When establishing a TCP connection, what is the timeout for the first SYN packet sent? If no answer is received another SYN packet is resent (up to net.ipv4.tcp_syn_retries
) with approximately doubling the timeout. I'm wondering how can I check or alter the initial timeout.
Asked
Active
Viewed 5,610 times
4

trozen
- 143
- 1
- 4
1 Answers
5
The initial retransmission timeout setting is hardcoded in the kernel to be 1 second in modern versions: https://elixir.bootlin.com/linux/v5.9.11/source/include/net/tcp.h#L142
#define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC6298 2.1 initial RTO value
The constant is referenced in tcp.c
: https://elixir.bootlin.com/linux/v5.9/source/net/ipv4/tcp.c#L420
You cannot change it without recompiling the kernel: How can I tune the initial TCP retransmit timeout? (it seems that it used to be 3 seconds in older versions)

Juraj Martinka
- 495
- 1
- 3
- 8