Interview Prep/Networking/Command-Line Tools & Diagnostics

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.

All Networking questions Roadmap: Networking for DevOps

More on Command-Line Tools & Diagnostics