seyshee.dev

retrans

Python · v0.2.1 · released Jul 25, 2026 · stable

Reads ss -tin and prints one line per established TCP connection with how many of its bytes had to be retransmitted. I wrote it while chasing upload problems on my home connection — the story is in Reading TCP retransmits on a slow uplink.

$ retrans --min-bytes 1000000
connection                                            sent   retrans   ratio  rtt ms  cwnd
192.168.1.20:51522 -> 203.0.113.10:443                1.8M       91K   5.05%    35.1    10
192.168.1.20:40112 -> 198.51.100.7:22                  12M       24K   0.20%    48.3    42

Any ss filter works as trailing arguments (retrans dport = :443). --watch 2 prints deltas every two seconds.

Linux only, needs iproute2. Standard library only.

Changelog

  • 0.2.1 (2026-07-25) — fix parsing on kernels that print bytes_acked before bytes_sent.
  • 0.2.0 (2026-07-22) — --watch mode.
  • 0.1.0 (2026-07-20) — first version.

Download

FileSHA-256Size
retrans-0.2.1.tar.gzffc23d5271b8758b…2.4 KB

Full checksums: SHA256SUMS