Skip to content

Add dyode probe: one-way link measurement for the streaming trials - #7

Merged
nc-intezra merged 2 commits into
mainfrom
probe-tool
Oct 28, 2026
Merged

nc-intezra merged 2 commits into
mainfrom
probe-tool

Conversation

@nc-intezra

Copy link
Copy Markdown
Owner

Adds dyode probe, the measurement tool for the streaming hardware trials (trial plan). iperf3 can't be used through a diode or a receive-only radio because it needs a TCP control channel.

What it does

  • probe send sends numbered, timestamped, CRC-32-checked UDP packets at a fixed rate (--mbps or --pps). Each stream gets one thread and one UDP port (--streams N: port + i), paced on a schedule. --burst N tests how the link handles bursts.
  • probe recv runs one thread per port and prints a live line every second, then a report per stream:
    • loss, judged per sequence number through a reorder window (duplicates, reordered and late packets are counted separately; end markers count losses at the tail)
    • burst-length and burst-duration histograms
    • a Gilbert-Elliott fit, plus the tc netem loss gemodel p r line that replays it on the bench
    • delay and RFC 3550 jitter
    • a RaptorQ what-if (--fec-sim 200ms:1,...): what a span T and repair ratio r would have left unrecovered (systematic code: only source packets lost in failed groups count)
    • output: --log writes a per-packet CSV, --json a full report with per-port counters (damaged/foreign datagrams, buffer size actually granted), and --keep keeps listening for field soaks
  • probe analyze LOG replays a log, for example with other --fec-sim settings.
  • Docs: docs/PROBE.md (usage, how to read the report, notes per hardware class). CHANGELOG (Unreleased) and README are updated.

New file src/probe.rs; main.rs gains the probe command and help text. Nothing else changes; no new dependencies (it uses crc32fast, libc, getrandom, serde_json, which are already in the tree).

Testing (sandbox, offline build against the 2.0.2 vendored sources)

  • cargo test: 64 pass (8 new: codec/CRC, FEC-spec parsing, bursts + Gilbert, reorder/duplicate/late, tail loss with and without the end marker, late joiner, FEC simulation, and a 2-stream loopback run including a log replay). Clippy and rustfmt are clean.
  • 4 streams at 2 Gbit/s total over loopback: 1,428,572 packets with no loss on a 2-core VM.
  • Gilbert relay (a userspace UDP relay dropping with p = 1%, r = 25%; tc isn't available in the sandbox): the probe measured p = 0.94%, r = 24.95%, mean burst 4.01 packets (theory: 4). Its loss matched the relay's own count exactly (3.620%).
  • Low rate (5 pkt/s, 64 bytes, --burst 3), Ctrl-C on an idle receiver, and the usage errors were checked by hand.
  • Not yet run on diode or radio hardware.

Notes

  • Probe packets carry no HMAC. It's a trial tool; don't point it at production DYODE ports. Default port 7000 stays clear of the lidi ports, and DYODE's nftables rules only restrict lidi ports.
  • The sender busy-waits the last ~50 µs before each packet for accurate pacing, so expect one busy core per stream at high rates.
  • This PR and PR 2.1.0: local API (phase 1) and the input box's status through the diode #6 both edit CHANGELOG.md and src/main.rs, so expect a small conflict to resolve when merging the second one.

Generated by Claude Code

claude and others added 2 commits October 28, 2026 21:10
iperf3 cannot run through a diode or a receive-only radio, so DYODE
carries its own probe:

- probe send: numbered, timestamped, CRC-checked UDP at a fixed rate,
  one thread and port per stream, paced on a schedule (sleep then spin).
- probe recv: one thread per port; loss judged per sequence number
  through a reorder window; burst-length and burst-duration histograms;
  Gilbert-Elliott fit with the tc netem line that replays it; delay and
  RFC 3550 jitter; RaptorQ what-if (--fec-sim T:R); per-packet CSV log
  and JSON report.
- probe analyze: replays a receive log.

Checked: 8 unit tests, a 4-stream loopback run at 2 Gbit/s with no
loss, and a Gilbert relay (p=1%, r=25%) measured as p=0.94%, r=24.95%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Q4FHinyA2fAioyiPVH3B2
@nc-intezra
nc-intezra merged commit 89eff28 into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants