/commands/ss/ss-tcp-info-rtt-retransmits
ss -ti: show TCP round-trip time, congestion window and retransmissions
- tool
- ss / netstat
- versions
- iproute2 5.x, iproute2 6.x
- os
- linux
ss -ti prints the kernel's internal TCP state for each connection on a second line: smoothed round-trip time (rtt), retransmission timeout (rto), congestion window (cwnd), MSS, congestion control algorithm, bytes acked and received, and retransmission counters. It is the quickest way to see whether a slow connection suffers from latency, packet loss or a small window, without capturing packets.
ss -ti # all established TCP connections
ss -tni dst 192.0.2.10 # one peer, numeric addresses
ss -tnio state established 'sport = :443' # add timers, only my HTTPS server
ss -tnim 'dport = :5432' # add socket memory (skmem)Fields you will read most
| Field | Meaning |
|---|---|
| cubic / bbr | Congestion control algorithm of the socket (cubic is the Linux default). |
| wscale:S,R | Window scale factors for send and receive. |
| rto:N | Retransmission timeout in milliseconds. |
| rtt:A/B | Smoothed round-trip time and its mean deviation, in milliseconds. |
| mss:N | Maximum segment size used on the connection. |
| cwnd:N | Congestion window, in segments. |
| ssthresh:N | Slow start threshold; it appears after the window has been reduced. |
| bytes_acked / bytes_received | Payload bytes the peer acknowledged and bytes received. |
| retrans:X/Y | Segments currently unacknowledged after retransmission / total retransmissions. |
| send Nbps, pacing_rate | Estimated send rate and pacing rate. |
| lastsnd / lastrcv / lastack | Milliseconds since the last send, receive and ACK. |
How to read it
- High
rttwith no retransmissions is distance or a congested path: the connection is healthy but slow to round-trip. Compare withpingto the same host. - Growing
retransand a smallcwndmean packet loss; TCP keeps halving its window. Check interfaces for errors (ip -s link) and the path withmtr. - Large
rtoand abackoffvalue mean the kernel is backing off exponentially after unanswered retransmissions; the peer or the path stopped answering. lastrcvlarge on an established connection points to an idle or stuck peer; with-oyou also see thekeepalivetimer, if enabled.
Watch a single connection change over time with watch -n1 "ss -tni dst 192.0.2.10".
Related options
-o adds timer:(name,expire,retrans) (on, keepalive, timewait, persist), -m adds skmem:(...) buffer usage, -e adds the UID and inode, and -O prints everything on one line, which is easier to grep. Filters work as with any other ss command; see filter by port or address.
FAQ
What unit is the rtt value in?
Milliseconds. rtt:12.5/3.1 means a smoothed round-trip time of 12.5 ms with a mean deviation of 3.1 ms. rto, ato, lastsnd, lastrcv and lastack are milliseconds too.
Does ss -ti need root?
No. Any user can read TCP information for all sockets. Root is needed only for the process names that -p shows for sockets owned by other users.
Why do I not see the retrans field?
ss prints fields that have a value. A connection that has not retransmitted anything does not show retrans; it appears once the kernel has counted retransmitted segments.