collect sub-command). They are responsible for handling specific data (e.g., skb) or logical parts of the networking stack (e.g., ct).
What are Collectors?
Collectors work behind the scenes to extract meaningful information from the kernel and userspace daemons using eBPF. Each collector specializes in retrieving specific types of data:- Some collectors install probes automatically (like
skb-dropandnft) - Others only retrieve data when it’s available in probe arguments (like
skbandct) - Advanced collectors can track packets through userspace daemons (like
ovs)
Enabling Collectors
The set of collectors to use is controlled by the--collectors (or -c) argument:
Auto Mode
If collectors are not explicitly requested, Retis uses theauto mode by default. In this mode:
- All collectors are started if their prerequisites are met
- If a collector’s prerequisites aren’t met, it’s silently skipped
- No error is returned
Explicit Mode
When collectors are explicitly requested:- They become mandatory
- If prerequisites aren’t met, Retis will fail with an error
- This ensures your collection has the data you expect
Mixed Mode
You can combine both approaches:skb collector to start (failing otherwise), while allowing other collectors to start only if their prerequisites are met.
Available Collectors
skb
Provides insights into socket buffer (
struct sk_buff) data structures, including packet metadata, checksums, and offload information.skb-tracking
Reports tracking information (unique IDs) for packets to reconstruct in-kernel packet flows.
skb-drop
Provides information about why packets were dropped, including drop reason codes.
ct
Reports connection tracking (conntrack) information from socket buffers, including state and protocol-specific data.
nft
Provides insight into Netfilter rules and actions, tracking packet flow through nftables.
ovs
Retrieves OpenVSwitch-specific data and tracks packets through the userspace daemon.
dev
Provides information about network devices from
struct net_device or socket buffers.ns
Retrieves namespace information, currently supporting network namespaces.
Collector Architecture
Data Flow
Collectors integrate into Retis’s event collection pipeline:- Probe Installation: Some collectors register probes on specific kernel functions or tracepoints
- Data Retrieval: When probes fire, collectors extract relevant data using eBPF
- Event Section Creation: Collectors produce event sections that are combined into complete events
- Post-Processing: Event sections can be processed by Retis’s post-processing commands
Event Sections
The event sections produced by collectors do not always map 1:1. For example:- The
skbcollector produces bothskbandpacketevent sections - Multiple collectors can contribute to a single event
- Some collectors produce sections conditionally based on available data
Collector Comparison
| Collector | Installs Probes | Requires Kernel Config | Works With |
|---|---|---|---|
| skb | No | None | struct sk_buff * |
| skb-tracking | No (uses core tracking) | None | struct sk_buff * |
| skb-drop | Yes (1 tracepoint) | None | struct sk_buff * |
| ct | No | CONFIG_NF_CONNTRACK | struct sk_buff * |
| nft | Yes (1 kprobe) | CONFIG_NF_TABLES | struct nft_traceinfo * |
| ovs | Yes (multiple probes + USDT) | OVS kernel module | struct sk_buff * |
| dev | No | None | struct net_device *, struct sk_buff * |
| ns | No | None | struct net *, struct sk_buff *, struct net_device * |
Prerequisites and Requirements
Each collector may have specific prerequisites:Kernel Configuration
- ct: Requires
CONFIG_NF_CONNTRACK=yor thenf_conntrackmodule loaded - nft: Requires
CONFIG_NF_TABLES=yor thenf_tablesmodule loaded - ovs: Requires the OpenVSwitch kernel module loaded
System Setup
- nft: Requires nftables trace rules (can be installed automatically with
--allow-system-changes) - ovs: Requires USDT support compiled into
ovs-vswitchdfor userspace tracking
Kernel Types
Collectors are automatically activated when their known kernel types appear in probe arguments:struct sk_buff *: Activates skb, skb-tracking, ct, dev, ns collectorsstruct net_device *: Activates dev, ns collectorsstruct net *: Activates ns collectorstruct nft_traceinfo *: Activates nft collector
Usage Examples
Basic Collection
With Filtering
With Probes
Output Options
Collector-Specific Options
Some collectors have their own command-line options:- skb:
--skb-sectionsto control which skb metadata to retrieve - nft:
--nft-verdictsto choose which verdicts to report - ovs:
--ovs-trackto enable userspace tracking,--ovs-enrich-flowsto query OVS daemon
Next Steps
Explore Collectors
Learn about each collector in detail
Event Sections
Understand event section formats
Filtering
Learn to filter collected events
Post-Processing
Process and analyze collected data
