TCP retransmissions are an important indicator of network reliability and performance. When a Linux server repeatedly retransmits TCP segments, applications may experience slow connections, increased latency, interrupted file transfers, or inconsistent response times.
However, retransmissions do not automatically mean that a network link is failing. They can result from packet loss, network congestion, packet reordering, delayed acknowledgments, or problems along the return path.
Linux provides several tools for investigating these conditions without immediately changing network settings. Commands such as nstat, ss, and tcpdump help administrators identify retransmission activity, inspect individual TCP connections, and investigate what is happening between endpoints.
This guide explains how TCP retransmissions work and provides a practical troubleshooting workflow for Linux servers.
TCP is a connection-oriented protocol that uses sequence numbers and acknowledgments to provide reliable data delivery.
When a sender transmits a TCP segment, it expects the receiving endpoint to acknowledge the transmitted data. If the sender cannot determine that the data was successfully received, it may retransmit the segment.
For example:
Retransmission allows TCP to recover from packet loss without requiring the application to restart the entire connection.
The retransmission timer and its calculation are described in RFC 6298 – Computing TCP’s Retransmission Timer.
The Retransmission Timeout, or RTO, determines how long TCP waits before retransmitting data when it has not received the expected acknowledgment.
TCP estimates the round-trip time (RTT) and its variation to calculate an appropriate timeout.
If the RTO expires, TCP retransmits the earliest unacknowledged segment. When repeated timeouts occur, the retransmission timeout is backed off, normally by doubling its value.
This behavior prevents TCP from continuously sending data into a potentially congested network.
TCP does not always need to wait for the RTO to expire.
When a receiver receives segments beyond a missing sequence range, it can send duplicate acknowledgments indicating the sequence number it is still expecting.
Under the traditional fast retransmit algorithm, three duplicate ACKs can trigger retransmission before the RTO expires.
The relevant congestion-control and fast-retransmit behavior is described in RFC 5681 – TCP Congestion Control.
Identifying the underlying cause is more important than simply counting retransmitted segments.
The most common causes include:
A packet can disappear at different points along its path:
If the receiver does not receive a segment, it cannot acknowledge that segment’s data. The sender may eventually retransmit it.
Congestion occurs when network devices receive more traffic than they can efficiently forward.
Common symptoms include:
Congestion can occur on a server’s network interface, an uplink, a virtual switch, or an intermediate router.
TCP congestion-control algorithms respond to signs of loss by adjusting the sending rate and congestion window.
Not every duplicate ACK indicates that a packet was lost.
For example, a network may deliver TCP segments in a different order from the order in which they were transmitted.
The receiver may acknowledge the last contiguous sequence range repeatedly while waiting for an earlier segment.
This can cause the sender to interpret the situation as a potential loss and initiate recovery.
Packet reordering can occur with:
Incorrect MTU settings can create connectivity problems, particularly across VPNs, tunnels, and networks with different encapsulation overhead.
A connection may establish successfully but experience problems when transferring larger amounts of data.
Investigate MTU and Path MTU Discovery when retransmissions occur alongside symptoms such as stalled transfers or failures with larger packets.
See the related guide: Linux MTU Troubleshooting: Fix MTU and PMTUD Issues.
Firewalls may drop packets or acknowledgments because of incorrect state tracking, filtering rules, or resource limitations.
Asymmetric routing can also complicate troubleshooting when outbound and return traffic follow different paths.
Investigate both directions of the connection rather than assuming that the problem exists on the sending interface.
TCP retransmissions and packet loss are closely related, but they are not identical measurements.
A retransmission means that TCP sent data again because it considered previously transmitted data unacknowledged or potentially lost.
Packet loss means that a packet did not reach its intended destination.
There are several reasons why the two measurements may differ:
For this reason, a retransmission counter should be treated as a troubleshooting indicator, not a direct measurement of the percentage of packets physically lost across the network.
A useful starting point is to compare retransmission counters with total TCP traffic and investigate changes over time.
The nstat command is part of the iproute2 networking utilities. It displays Linux kernel network statistics, including TCP counters.
It is useful for determining whether retransmission activity is increasing on a server.
Run:
nstat | grep -i retrans You may see output similar to:
TcpRetransSegs 125
TcpExtTCPFastRetrans 18
TcpExtTCPSlowStartRetrans 7
TcpExtTCPSynRetrans 3 The exact counters available depend on the Linux kernel version.
Important counters include:
| Counter | Meaning |
|---|---|
TcpRetransSegs | TCP segments retransmitted |
TcpExtTCPFastRetrans | Fast retransmission events |
TcpExtTCPSlowStartRetrans | Retransmissions associated with slow-start recovery |
TcpExtTCPSynRetrans | Retransmitted SYN segments |
These counters help identify whether retransmission activity is occurring during established connections or connection establishment.
To inspect the absolute values rather than increments since the previous nstat invocation, use:
nstat -az | grep -i retrans The -a option displays absolute counter values, while -z includes counters with zero values.
Take an initial snapshot:
nstat -az TcpRetransSegs Wait for a defined observation period:
sleep 60 Take another snapshot:
nstat -az TcpRetransSegs Compare the two values to determine how much the counter increased during the observation period.
For example:
Initial value: 1200
After 60 sec: 1260
Difference: 60 This indicates that the host’s TCP retransmission counter increased by 60 during that period.
Important: TcpRetransSegs is a host-level cumulative counter, not a per-connection measurement. It can include activity from multiple TCP connections. Also, it is not a direct packet-loss percentage.
For more precise interpretation, compare it with traffic volume and inspect individual connections.
The Linux kernel SNMP counter documentation provides additional information about network statistics and TCP counters.
The ss command provides detailed information about Linux network sockets.
Unlike host-wide statistics, ss helps investigate individual TCP connections.
Run:
ss -tn state established This displays established TCP connections using numeric addresses and ports.
Run:
ss -tin The -i option displays internal TCP information.
Depending on the kernel and iproute2 version, output may contain fields such as:
ESTAB 0 0 192.168.1.10:443 192.168.1.20:52144
rto:204 rtt:12.5/3.2
backoff:1
mss:1448
cwnd:10
retrans:1/3 This is an illustrative example; actual output varies by system and kernel version.
Important fields include:
| Field | Meaning |
|---|---|
rto | Current retransmission timeout, in milliseconds |
rtt | Estimated round-trip time and variation |
backoff | Retransmission timeout backoff value |
retrans | Retransmission information for the connection |
cwnd | TCP congestion window |
mss | Maximum Segment Size |
pmtu | Path MTU information, when available |
A rising retransmission count, increasing RTT, or growing backoff value can indicate that a connection is experiencing delivery problems.
To inspect connections involving a particular remote IP address:
ss -tin dst 192.168.1.20 To inspect connections using a particular destination port:
ss -tin dst :443 You can also inspect the process using a socket:
ss -tinp This is useful when you need to identify which application owns a problematic connection.
For additional command details, see the Linux ss manual.
Statistics indicate that retransmissions are occurring, but they do not explain exactly what is happening in a particular TCP flow.
A packet capture provides a closer look at sequence numbers, acknowledgments, timing, and traffic direction.
The tcpdump utility can capture traffic directly from a Linux interface.
Replace the example address with the actual remote server IP:
sudo tcpdump -i any -nn -s 0 \
'host 203.0.113.20 and tcp port 443' \
-w /tmp/tcp-retransmissions.pcap This command:
-i any.-nn.-s 0.Stop the capture with Ctrl+C after collecting enough traffic.
You can inspect the saved capture using:
sudo tcpdump -nn -tttt \
-r /tmp/tcp-retransmissions.pcap Look for repeated TCP sequence ranges, duplicate acknowledgments, missing expected traffic, and unusual delays.
A repeated sequence range can be evidence of retransmission, but packet timing and reverse-direction ACKs must also be considered.
For a visual analysis, open the capture file in Wireshark.
Useful display filters include:
tcp.analysis.retransmission tcp.analysis.fast_retransmission tcp.analysis.duplicate_ack tcp.analysis.out_of_order These filters help identify retransmission candidates, duplicate ACKs, and out-of-order segments.
Wireshark’s TCP analysis is based on its interpretation of the captured packet sequence. Its labels are analysis results, not TCP flags transmitted over the network.
Read the Wireshark TCP Analysis documentation for details about how these classifications are generated.
For a broader introduction to packet capture and filtering, see Wireshark Explained: Packet Capture, Filters and Network Analysis.
Capture limitation: Capturing traffic on a Linux endpoint does not always show the exact packets transmitted on the physical network. Features such as GRO, GSO, and TSO can affect how packets appear in host-level captures. Check the capture point and, when necessary, compare captures from both endpoints or a network tap.
Two important indicators during TCP troubleshooting are retransmission timeouts and duplicate acknowledgments.
They provide different clues about how TCP is recovering from potential data loss.
A retransmission timeout occurs when TCP does not receive the expected acknowledgment within the current RTO.
Look for:
rto values in ss -ti.backoff value.Repeated RTO events can indicate serious packet delivery problems, but they do not identify the exact network device responsible.
Duplicate ACKs occur when a receiver continues acknowledging the same contiguous sequence range.
For example:
ACK 5001
ACK 5001
ACK 5001
ACK 5001 This may indicate that a segment beyond sequence number 5000 arrived while an earlier segment was still missing.
However, duplicate ACKs can also result from packet reordering or packet duplication.
Therefore, investigate the sequence numbers and packet arrival times before concluding that a specific packet was lost.
| Observation | Possible interpretation |
|---|---|
| Duplicate ACKs followed by retransmission | Fast retransmit or another loss-recovery mechanism |
| Long delay followed by retransmission | Possible RTO expiration |
| Repeated RTO backoff | Persistent lack of acknowledgment |
| Out-of-order packets without repeated RTOs | Possible packet reordering |
| Retransmissions during traffic peaks | Possible congestion or queue drops |
TCP recovery behavior is more complex than these simplified examples, so always correlate the observations with the actual packet trace.
After identifying retransmission activity, investigate the network path instead of immediately changing TCP parameters.
Use:
ip -s link Inspect the relevant network interface for:
You can also inspect interface details:
ip -details link show If interface counters increase during the problem, investigate the NIC, driver, virtual switch, physical link, and upstream network devices.
Use:
ip -s link show dev eth0 Replace eth0 with the actual interface name.
Compare transmitted and received byte and packet counters over time.
High traffic levels combined with retransmissions and increased latency may indicate congestion, but interface utilization alone does not prove that congestion is the cause.
Display the interface MTU:
ip link show dev eth0 For a basic IPv4 path MTU test, use:
ping -M do -s 1472 192.168.1.1 The example assumes a 1500-byte IPv4 MTU and a 20-byte IPv4 header plus an 8-byte ICMP header.
If the path uses a smaller MTU, the test may fail. Adjust the payload size and investigate whether ICMP fragmentation-needed messages are being delivered correctly.
For a complete diagnostic workflow, see Linux MTU Troubleshooting.
Display the route used to reach a remote address:
ip route get 203.0.113.20 Check whether the selected interface, gateway, and source address are expected.
When outbound and return traffic follow different paths, investigate routing policies, firewalls, and intermediate devices on both paths.
The guide Linux Traffic Uses Wrong Interface: Routing Troubleshooting Guide covers additional routing diagnostics.
Consider a Linux application server experiencing slow responses when communicating with a remote database server.
The application team reports intermittent delays, but the TCP connection remains established.
A systematic investigation can help narrow down the cause.
nstat | grep -i retrans Record the current values and observe whether they increase during the reported issue.
ss -tin state established Identify the database connection and inspect its RTT, RTO, congestion window, and retransmission information.
sudo tcpdump -i any -nn -s 0 \
'host 203.0.113.20 and tcp port 5432' \
-w /tmp/database-connection.pcap This example assumes the database listens on TCP port 5432.
ip -s link Look for interface drops and errors, especially when the retransmission counter increases.
ip route get 203.0.113.20 Verify that traffic uses the expected interface and gateway.
Open the capture in Wireshark and inspect:
Use the collected evidence to classify the likely cause.
| Evidence | Investigation direction |
|---|---|
| Interface drops increase | NIC, driver, virtual switch, or network path |
| Retransmissions and RTT rise during peak traffic | Congestion and queueing |
| Repeated RTO and backoff | Missing or delayed acknowledgments |
| Out-of-order traffic and duplicate ACKs | Path reordering or possible packet loss |
| Large transfers stall while smaller ones work | MTU and PMTUD |
| Outbound packets visible but return traffic absent | Return path, firewall, or remote endpoint |
This workflow helps narrow down the problem before making configuration changes.
Preventing recurring TCP retransmissions requires continuous monitoring and a clear understanding of the network environment.
Recommended practices include:
Collect TcpRetransSegs and related TCP counters periodically.
Analyze changes over time instead of relying on a single snapshot.
Track RX and TX errors, dropped packets, and interface utilization.
Correlate these measurements with application latency and retransmission activity.
Track RTT and response-time trends for important services.
A sudden increase in latency can provide an early warning of network congestion or path changes.
Pay particular attention to:
Ensure that encapsulation overhead is accounted for and Path MTU Discovery works correctly.
Do not randomly modify:
Such changes can hide symptoms, introduce new problems, or make performance worse.
First identify the source of retransmissions, then make a targeted change and measure its effect.
TCP retransmissions are valuable indicators when diagnosing slow or unreliable Linux network connections.
However, a high retransmission counter alone does not prove that a particular network device is dropping packets.
A reliable investigation combines several sources of evidence:
nstat for host-wide TCP statistics.ss -ti for individual connection information.tcpdump for packet-level inspection.ip -s link for interface errors and drops.ip route get for routing verification.By correlating these measurements, Linux administrators can distinguish possible packet loss, congestion, packet reordering, MTU problems, and return-path issues.
The objective is not simply to reduce the retransmission counter. It is to identify why TCP is retransmitting data and correct the underlying network problem.
Introduction Border Gateway Protocol (BGP) is the routing protocol used to exchange network reachability information…
Introduction A Linux server can experience connection failures even when its network interface is working…
Open Shortest Path First (OSPF) is a link-state routing protocol widely used in enterprise networks…
Group Policy is one of the most important management features in Windows Server Active Directory…
Windows DNS servers play an essential role in Active Directory environments, allowing computers, servers, applications,…
Linux services are responsible for running many of the critical components that keep a server…