Command-Line Reference¶
Synopsis¶
Modes¶
pqc-flow operates in one of three modes:
| Mode | Usage | Description |
|---|---|---|
| Mock | --mock |
Generate synthetic PQC flow for testing |
| Offline | <file.pcap> |
Analyze PCAP file |
| Live | --live <iface> |
Monitor live network interface |
Options¶
| Option | Argument | Description |
|---|---|---|
--mock |
- | Output synthetic test flow |
--live |
<interface> |
Network interface for live capture |
--snaplen |
<bytes> |
Packet capture length (default: 2048) |
--fanout |
<group_id> |
Multi-core load distribution group |
--json |
- | Force JSON output (auto-detected) |
Mode Details¶
Mock Mode¶
Generate a synthetic PQC flow for testing output format and pipeline integration:
Output includes all fields with sample PQC data. Useful for:
- Verifying installation
- Testing downstream JSON parsing
- Development and debugging
Offline Mode¶
Analyze a PCAP file:
Flows are exported when:
- Handshake completes (negotiated algorithm detected)
- End of file reached (remaining flows flushed)
Supported formats:
- PCAP (
.pcap) - PCAP-NG (
.pcapng)
Live Mode¶
Monitor a network interface in real-time:
Features:
- AF_PACKET TPACKET_V3 for zero-copy capture
- Immediate export on handshake completion
- Sub-100ms latency
Requirements:
- Root privileges or CAP_NET_RAW capability
- Valid network interface name
Option Details¶
--snaplen¶
Set packet capture length in bytes:
| Value | Use Case |
|---|---|
| 2048 (default) | Most handshakes |
| 4096 | Large TLS ClientHello with many extensions |
Increase if you see incomplete handshake detection.
--fanout¶
Enable multi-core packet distribution:
The group_id is an arbitrary number. Multiple instances with the same group ID share packets via PACKET_FANOUT.
Use for high-throughput networks (>100K packets/second).
--json¶
Force JSON output format:
Normally auto-detected based on terminal/pipe. Use --json to ensure JSON output when needed.
Examples¶
Basic Offline Analysis¶
Filter SSH Flows¶
Filter PQC-Enabled Flows¶
Live Capture on eth0¶
Live Capture with Larger Snaplen¶
Live Capture with Real-Time Filtering¶
Multi-Core Live Capture¶
Run multiple instances for load distribution:
# Terminal 1
sudo ./pqc-flow --live eth0 --fanout 100
# Terminal 2
sudo ./pqc-flow --live eth0 --fanout 100
Save Live Output to File¶
Pretty-Print Output¶
Exit Codes¶
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (invalid arguments, file not found, etc.) |
Environment Variables¶
No environment variables are currently used. All configuration is via command-line options.
See Also¶
- Understanding Output - JSON field reference
- Production Deployment - Running as a service