Wifiduck
March 28, 2026 ยท View on GitHub
wifiduck is a SQL-first Wi-Fi troubleshooting toolkit built for DuckDB. It adds Wi-Fi-specific macros on top of packet capture data so engineers can investigate retries, disconnects, roaming churn, channel health, DHCP/DNS stalls, and early Wi-Fi 7 / MLO signals using focused queries instead of ad-hoc packet browsing.
What makes it useful
- SQL-first workflow for packet troubleshooting
- bundled public sample captures and deterministic JSONL fixtures
- Wi-Fi 7 and MLO-oriented examples that contributors can extend
- staged case packs that move from triage to proof
- optional helper tooling when Wireduck is unavailable locally
Project layout
sql/: modular SQL macro packexamples/sql/: runnable query playbookscases/: issue-focused walkthroughs with staged SQL playbookssample-data/: public captures, JSONL fixtures, and provenance notestools/: helper scripts for turning captures into JSONL fixturestests/: regression tests for the SQL pack and helper toolingdocs/: protocol notes and project planning artifacts
Quick start with DuckDB + Wireduck
INSTALL wireduck FROM community;
LOAD wireduck;
.read sql/wifiduck.sql
SELECT * FROM wd_retry_hotspots('sample-data/pcap/wpa-induction.pcap', 20);
SELECT * FROM wd_disconnect_reasons('sample-data/pcap/wpa-induction.pcap', 20);
SELECT * FROM wd_capture_report('sample-data/pcap/wpa-induction.pcap', 20);
SELECT * FROM wd_mlo_overview('sample-data/pcap/your_wifi7_capture.pcapng', 10);
Quick start without Wireduck
python tools/open_pcap_analysis.py \
--input sample-data/pcap/wpa-induction.pcap \
--output sample-data/jsonl/local_wpa.jsonl
Then load the modular SQL files in DuckDB and use the _jsonl variants:
SELECT * FROM wd_retry_hotspots_jsonl('sample-data/jsonl/local_wpa.jsonl', 20);
SELECT * FROM wd_capture_report_jsonl('sample-data/jsonl/local_wpa.jsonl', 20);
SELECT * FROM wd_mlo_overview_jsonl('sample-data/jsonl/wifi7_mlo_fixture.jsonl', 10);
Markdown incident report
python -m wifiduck_tools.report \
--input sample-data/jsonl/wifi7_mlo_fixture.jsonl \
--format jsonl
Current macro set
wd_retry_hotspotsandwd_retry_hotspots_jsonlwd_disconnect_reasonsandwd_disconnect_reasons_jsonlwd_channel_healthandwd_channel_health_jsonlwd_roaming_eventsandwd_roaming_events_jsonlwd_roam_healthandwd_roam_health_jsonlwd_dns_dhcp_gapsandwd_dns_dhcp_gaps_jsonlwd_post_roam_blackholeandwd_post_roam_blackhole_jsonlwd_auth_assoc_loopsandwd_auth_assoc_loops_jsonlwd_packet_class_histogramandwd_packet_class_histogram_jsonlwd_connection_sessionsandwd_connection_sessions_jsonlwd_capture_reportandwd_capture_report_jsonlwd_mlo_overview/wd_wifi7_capabilitiesplus JSONL equivalentswd_wifi7_link_health,wd_wifi7_link_transitions, andwd_wifi7_missing_linksplus JSONL equivalents
Sample data
Public sample captures are tracked in sample-data/notes/SOURCES.md. Wi-Fi 7 coverage is currently conservative: the repo ships JSONL fixtures for MLO-shaped examples and documents a public capture lead that still needs redistribution verification.
Case packs and staged workflows
Use examples/sql/staged_triage.sql for the standard triage -> isolate -> prove -> explain flow. Issue-focused walkthroughs live under cases/, including roam-blackhole, retry-loop, wifi7-mlo-auth-loop, and wifi7-mlo-link-imbalance.
Real-world Wi-Fi 7 example
The project includes Wi-Fi 7 example playbooks under examples/sql/, including MLO-focused diagnostics. A practical public case for further expansion is Cisco 9800 Wi-Fi 7 capture analysis, where early MLO-era association behavior can produce abnormal authentication patterns before association.
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
python -m unittest discover -s tests -v