Skip to the content.

TCP Transmission Timeout

Introduction

The tcp_retries1 and tcp_retries2 variable. Since Linux 2.2.

System Configuration (Linux)

$ cat /proc/sys/net/ipv4/tcp_retries1
3
$ sysctl net.ipv4.tcp_retries1
net.ipv4.tcp_retries1 = 3
$ cat /proc/sys/net/ipv4/tcp_retries2
15
$ sysctl net.ipv4.tcp_retries2
net.ipv4.tcp_retries2 = 15

sysctl -w net.ipv4.tcp_retries1 = 3
sysctl -w net.ipv4.tcp_retries2 = 5

More Details

Karn’s algorithm:

Retransmission: RTO (Retransmission Time-Out), RTT (Round Trip Time),

new_RTTs = (1 - α) × (old_RTTs) + α × (new_RTT_sample), 0 <= α < 1 (0.125 recommended)
RTO = RTTs + 4 × RTTd
new_RTTd = (1 - β) × (old_RTTd) + β × |RTTs - new_RTT_sample|, 0 <= β < 1 (0.25 recommended)

See RFC 6298.

Python Recipes

References