tcpdrop(8)
π tcpdrop(8) π
β¨ NAME β¨
okay so the name of this bad boy is tcpdrop π¦ It's a tool that traces kernel-based TCP packet drops with details. It runs on Linux eBPF/bcc, so it's giving low-level tea β
π SYNOPSIS π
tcpdrop [-4 | -6] [-h]
πΈ DESCRIPTION πΈ
bestie, this tool catches TCP packets or segments that the kernel dropped π and shows you everything: details from the IP and TCP headers, the socket state, and the kernel stack trace. It's lowkey essential for debugging high kernel drops, because those can cause timer-based retransmits and performance issues. Not me losing sleep over this π
This tool works by dynamically tracing the tcp_drop() kernel function, so you'll need a recent kernel version π§
Since it uses BPF, only the root user can run it π sorry, no cap, that's the rule.
π REQUIREMENTS π
You need CONFIG_BPF and bcc. No shortcuts π
β¨ OPTIONS β¨
-4β trace the IPv4 family only π-6β trace the IPv6 family only π-hβ print the usage message π«Ά
π§ EXAMPLES π§
Trace kernel-based TCP packet drops with details:
# tcpdrop
Trace IPv4 family only:
# tcpdrop -4
Trace IPv6 family only:
# tcpdrop -6
π FIELDS π
TIMEβ when the drop happened, inHH:MM:SSformat β°PIDβ the process ID that was on-CPU during the drop. Heads up, this may be unrelated π drops can happen on the receive interrupt, so the PID that got interrupted isn't always the culprit.IPβ the IP address family (4 or 6)SADDRβ the source IP addressSPORTβ the source TCP portDADDRβ the destination IP addressDPORTβ the destination TCP portSTATEβ the TCP session state, like"ESTABLISHED", etc.FLAGSβ the TCP flags, like"SYN", etc.
π OVERHEAD π
This traces the kernel tcp_drop() function, which should be low frequency, so the overhead of this tool should be negligible. Lowkey vibes β¨
As always, test and understand this tool's overhead for your type of workload before you use it in production π«Ά future you will thank you.
π₯ SOURCE π₯
This is from bcc, check it 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, and it's giving main character energy π
π· OS π·
Linux π§
π STABILITY π
Unstable, it's still in development π§ so don't be shocked if things shift.
π AUTHOR π
Brendan Gregg π
π¦ SEE ALSO π¦
tcplife(8), tcpaccept(8), tcpconnect(8), tcptop(8) β iykyk π
Bestie, that's the whole tea β This page is from the USER COMMANDS section, last updated 2018-05-30, and it's all yours to read as tcpdrop(8) π«Άβ¨
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms