skb-drop collector provides information about why packets (skbs) were dropped in the kernel networking stack.
Overview
Theskb-drop collector is essential for debugging packet loss. It captures drop events and reports the specific reason why a packet was dropped, helping you quickly identify networking issues.
What Data is Retrieved
Theskb-drop collector retrieves:
- Drop reason: The specific reason code explaining why the packet was dropped
- Reason subsystem: Which subsystem dropped the packet (core kernel, OVS, etc.)
Probe Installation
The
skb-drop collector automatically installs a probe on the skb:kfree_skb tracepoint.Command-Line Options
Theskb-drop collector has no specific command-line options.
Event Sections Produced
Theskb-drop collector produces the skb-drop event section.
See skb-drop event documentation for detailed format.
Event Format
Understanding Drop Reasons
The collector acts onenum skb_drop_reason values from the kernel, including:
Core Drop Reasons
Common drop reasons from the core kernel:NOT_SPECIFIED: Generic drop (no specific reason)NO_SOCKET: No socket found for packetPKT_TOO_SMALL: Packet smaller than minimum sizeTCP_CSUM: TCP checksum errorTCP_INVALID_SEQUENCE: Invalid TCP sequence numberSOCKET_FILTER: Dropped by socket filter (BPF)NETFILTER_DROP: Dropped by Netfilter/nftablesIPV4_CSUM: IPv4 checksum errorIP_INVALID: Invalid IP packetUNICAST_IN_L2_MULTICAST: Unicast IP in L2 multicast
Subsystem-Specific Reasons
The collector also understands non-core drop reasons:- OVS:
enum ovs_drop_reasonvalues from OpenVSwitch - Other subsystems: Additional drop reason enums as they’re added to the kernel
Finding Drop Reason Definitions
Drop reasons are defined in the kernel:- Core reasons:
include/net/dropreason.h - OVS reasons:
net/openvswitch/drop.h
Usage Examples
Basic Drop Monitoring
Monitor all packet drops:With Filtering
Monitor drops for specific traffic:With Tracking
See the path packets took before being dropped:With Additional Context
Gather more information about drops:Save for Analysis
Example Output
Basic Drop Event
- A TCP SYN packet was dropped
- Drop reason: No socket listening on port 80
- Full packet details from the
skbcollector
With Tracking
Usingretis sort after collection:
Common Drop Scenarios
No Socket
- Start the application
- Check the application is listening on the correct port
- Verify the application is listening on the correct address
Netfilter Drop
- Check firewall rules with
nft list ruleset - Use the
nftcollector to see which rule dropped it - Verify firewall configuration
Checksum Errors
- Check for network hardware issues
- Verify offloading settings (
ethtool -k) - Look for MTU mismatches
Socket Filter
- Check for BPF programs attached to sockets
- Review application-level filtering
- Use
bpftoolto inspect BPF programs
Integration with Other Collectors
skb
See packet content at drop:skb-tracking
Trace packet path to drop:ct (Conntrack)
See connection tracking state:nft (Netfilter)
Identify firewall rules:NETFILTER_DROP, shows which rule dropped it.
ovs (OpenVSwitch)
Debug OVS drops:dev
Identify interface:ns
Namespace context:Use Cases
Debugging Connection Failures
Firewall Troubleshooting
Application Not Responding
Performance Issues
OpenVSwitch Issues
Technical Details
Kernel Types
Theskb-drop collector activates when these types appear in probe arguments:
struct sk_buff *
Automatic Probe
The collector automatically installs:kfree_skb_reason() kernel function.
Drop Reason Extraction
The collector:- Hooks the
kfree_skbtracepoint - Extracts the drop reason from the tracepoint arguments
- Maps reason codes to human-readable strings
- Supports both core and subsystem-specific reasons
Source Code References
- Collector:
retis/src/collect/collector/skb_drop/skb_drop.rs - eBPF hook:
retis/src/collect/collector/skb_drop/bpf/skb_drop_hook.bpf.c - Event factory:
retis/src/collect/collector/skb_drop/bpf.rs
Best Practices
- Always combine with skb: See what was dropped
- Use tracking for context: See the path before the drop
- Filter appropriately: Focus on relevant traffic
- Combine with nft: For firewall-related drops
- Save to file: Enable detailed post-analysis
- Check systematically: Work through the stack from bottom to top
Performance Considerations
- Minimal overhead: Only triggers on drops (already rare)
- Single probe: Only adds one tracepoint
- Efficient extraction: Drop reason is readily available
- No filtering impact: Works with any filter
Troubleshooting
No Drop Events
If you expect drops but see none:- Verify packets are reaching the system (use
tcpdump) - Check if packets are dropped in hardware (driver stats)
- Confirm filter isn’t too restrictive
- Ensure
skb-dropcollector is enabled
Unknown Drop Reasons
If you see numeric reason codes instead of names:- Kernel might have newer drop reasons than Retis supports
- Update Retis to the latest version
- Report the unknown reason code
Missing Context
If drop events lack context:- Enable
skb-trackingto see the path - Add relevant collectors (
ct,nft,ovs) - Use
--skb-sections allfor full metadata
See Also
- skb collector - Retrieve packet data
- skb-tracking collector - Track packet path
- nft collector - Debug firewall drops
- skb-drop event format - Event format details
