skb-tracking collector reports tracking information (unique IDs) that can be used at post-processing time to reconstruct in-kernel packet flows.
Overview
Theskb-tracking collector enables packet tracking through the Linux networking stack by reporting unique identifiers and socket buffer addresses in events. This allows you to follow a packet’s journey, even after transformations like NAT or cloning.
The
skb-tracking collector does not track skbs in the kernel itself—that’s done by Retis core. This collector only reports the tracking information in events.What Data is Retrieved
Theskb-tracking collector retrieves:
- Tracking ID: A unique identifier generated by Retis’s core tracking logic
- SKB address: The socket buffer’s memory address
- The same packet at different points in the stack
- Different packets entirely
- Clones of the same packet (they share a tracking ID but have different SKB addresses)
Probe Installation
The
skb-tracking collector does not install any probes. It relies on Retis core’s built-in skb tracking, which is always active.Command-Line Options
Theskb-tracking collector has no specific command-line options.
Event Sections Produced
Theskb-tracking collector produces the skb-tracking event section.
See skb-tracking event documentation for detailed format.
Event Format
tracking_id: Unique identifier for the packet’s data bufferskb_address: Memory address of the socket buffer structure
Usage Examples
Basic Tracking
Enable tracking to follow packets:Track and Sort
Collect events then group by packet:sort command uses tracking IDs to group events that belong to the same packet.
Track Drops
Follow packets until they’re dropped:Track Through OVS
Follow packets through OpenVSwitch including upcalls:With Filtering
Track only specific traffic:Example Output
Raw Events
Without sorting, events show tracking information:#b81253ea5defffff977be5ec6f80) and SKB address.
Sorted Events
After runningretis sort, events are grouped by packet:
+) under the first event, showing they’re all part of the same packet’s journey.
How Tracking Works
Core Tracking
Retis’s core implements packet tracking by monitoring the data part of socket buffers:- Data Buffer Tracking: The unique ID is based on the skb’s data buffer pointer
- Clone Detection: Cloned skbs share the same data buffer, so they get the same tracking ID
- Transformation Handling: Even after NAT or other modifications, the tracking ID persists
Limitations
Packet tracking cannot be 100% foolproof because:- It’s not a built-in kernel feature
- Some transformations may break tracking (though rare)
- Memory reuse can theoretically cause ID collisions (very rare)
If you encounter tracking issues, please report them as bugs. The tracking implementation is continuously improved.
Implementation Details
Full implementation details can be found in the source code:retis/src/core/tracking/skb_tracking.rs
Integration with Other Collectors
skb
Essential combination for seeing packet content:skb-drop
Track packets to their drop point:ovs
Track packets through OpenVSwitch:ct
Track conntrack state changes:nft
Track packets through Netfilter:Post-Processing with Sort
The primary use ofskb-tracking is with the sort post-processing command:
Basic Sorting
Sorting with Output File
Advanced Sorting
The sort command:- Groups events by tracking ID
- Orders events chronologically within each group
- Indents related events under the first event
- Handles special cases like OVS upcalls
Use Cases
Debugging Packet Loss
Find where packets disappear:Understanding Packet Path
See the full journey of a packet:NAT Troubleshooting
Track packets through NAT:Clone Investigation
See when and where packets are cloned:Cross-Namespace Tracking
Technical Details
Kernel Types
Theskb-tracking collector activates when these types appear in probe arguments:
struct sk_buff *
Tracking ID Format
The tracking ID is displayed in hexadecimal format:- SKB data buffer pointer
- Additional entropy for uniqueness
SKB Address
The SKB address is the actual kernel memory address of thestruct sk_buff:
Source Code References
- Core tracking:
retis/src/core/tracking/skb_tracking.rs - Collector:
retis/src/collect/collector/skb_tracking/ - Sort command:
retis/src/process/sort/
Best Practices
- Always use with sort: The real value comes from post-processing
- Save to file: Use
-oto enable post-processing - Combine with skb: See packet content at each point
- Use filtering: Track specific flows to reduce noise
- Enable related collectors: Add context with ct, nft, ovs, etc.
Performance Considerations
- Core overhead: Tracking is always active in core (minimal overhead)
- Collector overhead: Only adds tracking ID to events (negligible)
- Post-processing: Sorting is fast and scales well
- Storage: Each event adds ~24 bytes for tracking info
Troubleshooting
Events Not Grouped
If events aren’t grouping after sort:- Verify
skb-trackingcollector was enabled during collection - Check that events actually share the same packet (filter might be too broad)
- Ensure tracking IDs are present in events
Unexpected Tracking IDs
If tracking IDs change unexpectedly:- This might indicate packet transformation that breaks tracking
- Report as a bug with reproduction steps
- Check if data buffer was reallocated (rare)
Missing Tracking Info
If tracking info is missing:- Verify collector was enabled:
retis collect -c skb-tracking - Check that probes have
struct sk_buff *arguments - Ensure core tracking didn’t fail (check logs)
See Also
- skb collector - Retrieve packet data
- skb-tracking event format - Event format details
- Post-processing - Sort and analyze events
- OVS collector - Advanced tracking through OVS
