Inspecting Kernel TCP Timers with ss and inet_diag
The Linux inet_diag netlink subsystem exposes per-socket TCP state in microseconds with negligible lock contention compared to parsing /proc/net/tcp.
1. Reading Idle Timers
ss -tniH state established
# Example metrics:
# cubic wscale:7,7 rto:204 rtt:3.45/0.82 ato:40 mss:1448 cwnd:10 lastsnd:14200 lastrcv:14204
Both lastsnd and lastrcv report milliseconds elapsed since the most recent payload transmission or reception on that socket.