tcpretrans(8)

πŸ“¦ version 0.36.1, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

πŸ’– tcpretrans(8) ✨ System Manager's Manual πŸ’–

🌸 NAME 🌸

okay so tcpretrans is the tool that traces or counts TCP retransmits and TLPs (tail loss probes) πŸ¦‹. It runs on Linux and uses eBPF/bcc, so it's giving low-level energy πŸ’….

🧚 SYNOPSIS 🧚

tcpretrans [-h] [-s] [-l] [-c] [-4 | -6]

πŸ’œ DESCRIPTION πŸ’œ

bestie, this one traces TCP retransmits and shows the address, port, and TCP state info for each one 🫢. Sometimes you'll also get the PID, but honestly usually not, because retransmits are usually sent by the kernel on timeouts πŸ™ˆ. To keep the overhead super low, only the TCP retransmit functions get traced. It does not trace every packet, so it's not giving tcpdump(8) or a packet sniffer vibes ❌. If you want, it can also count retransmits over an interval you set yourself, which is a lowkey great way to spot network paths the flows go through that might be dropping stuff πŸ”₯.

This works by dynamically tracing the kernel's tcp_retransmit_skb() and tcp_send_loss_probe() functions. Those can change with kernel updates, so the tool will need updating to match πŸ› οΈ.

⚠️ Since this uses BPF, only the root user can run this tool. No cap, that's a hard rule πŸ’€.

πŸŽ€ REQUIREMENTS πŸŽ€

You need CONFIG_BPF and bcc. That's the whole list, no notes πŸ’….

✨ OPTIONS ✨

  • -h β€” Prints the usage message πŸ’Œ.
  • -s β€” Shows the TCP sequence numbers πŸ”’.
  • -l β€” Includes tail loss probe attempts 🌈. Heads up, the kernel may not always finish the TLP send, so those can be incomplete.
  • -c β€” Counts the retransmits that happen per flow πŸ“Š.
  • -4 β€” Only traces the IPv4 family 🌸.
  • -6 β€” Only traces the IPv6 family πŸ¦‹.

πŸ“ EXAMPLES πŸ“

Trace TCP retransmits:

# tcpretrans

Trace TCP retransmits and TLP attempts:

# tcpretrans -l

Trace IPv4 family only:

# tcpretrans -4

Trace IPv6 family only:

# tcpretrans -6

πŸ“š FIELDS πŸ“š

  • TIME β€” When the retransmit happened ⏰.
  • PID β€” The process ID that was on-CPU 🧠. Less useful than it sounds, since it's often 0 (the kernel) for timer-based retransmits.
  • IP β€” The IP address family, either 4 or 6 🌐.
  • LADDR β€” The local IP address 🏠.
  • LPORT β€” The local port πŸšͺ.
  • T> β€” The type of event: R> means retransmit, L> means tail loss probe 🎯.
  • RADDR β€” The remote IP address πŸ›°οΈ.
  • RPORT β€” The remote port πŸ”Œ.
  • STATE β€” The TCP session state 🫧.
  • SEQ β€” The TCP sequence πŸ”’.
  • RETRANSMITS β€” The total retransmits that have piled up since the start πŸ“ˆ.

πŸ¦‹ OVERHEAD πŸ¦‹

The overhead should be negligible. TCP retransmit events are usually low (under 1000 per second), and the tiny bit of extra work this tool adds to each event keeps the cost basically nothing πŸ’–.

🌈 SOURCE 🌈

This comes from bcc 🫢. Check out https://github.com/iovisor/bcc.

Also, look in the bcc distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool πŸ“.

🌍 OS 🌍

Linux 🐧

πŸ§ͺ STABILITY πŸ§ͺ

Unstable, still in development 🚧. Use it with a little caution, bestie.

πŸ‘‘ AUTHOR πŸ‘‘

Brendan Gregg πŸ™Œ

πŸ”— SEE ALSO πŸ”—

tcpconnect(8), tcpaccept(8) πŸ’œ


Okay that's the whole tea πŸ«– This page came from the USER COMMANDS manual, last updated 2016-02-14, and the manual name is tcpretrans(8). Go make the kernel behave, bestie πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from