How do you trace TCP retransmissions and latency at the kernel level?
AdvancedConceptCommand-Line Tools & Diagnostics
Answer
nstat -az | grep -i -E 'retrans|listenoverflows|tcpbacklogdrop'
sudo tcpretrans-bpfcc # BCC tool, shows retransmitted flows
sudo tcplife-bpfcc # per-connection lifespan and bytes
ss -ti | grep -E 'retrans|rtt'
Rising TcpRetransSegs points to loss or congestion. Combine with ethtool -S eth0 to check NIC drops, and tc -s qdisc show dev eth0 to see queue drops.
More on Command-Line Tools & Diagnostics
How do you check if a remote port is open?BeginnerHow do you list listening ports and the processes that own them?BeginnerWhat does `ping` tell you and what does it not?BeginnerHow does traceroute work and how do you read the output?BeginnerWhat is mtr and why is it better than traceroute?IntermediateHow do you query DNS with dig and read the answer?Beginner