Skip to content

bench: Tier-0 smoke working end-to-end + Tier-1 (TRex/sink) scaffolding - #1

Merged
LeTuR merged 2 commits into
mainfrom
bench/tier0-working-plus-tier1-scaffold
May 25, 2026
Merged

bench: Tier-0 smoke working end-to-end + Tier-1 (TRex/sink) scaffolding#1
LeTuR merged 2 commits into
mainfrom
bench/tier0-working-plus-tier1-scaffold

Conversation

@LeTuR

@LeTuR LeTuR commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Tier-0 smoke (make smoke CAND=nftables) is green end-to-end — six tests pass, security-effectiveness precondition (tests/benchmarks.md § 0.8) is satisfied, ~14 Gbps virtio-bounded iperf3 between gen and gen-WAN-netns through the SUT.
  • TRex + sink VMs are scaffolded for Tier-1 (make trex-up, make sink-up, make b-00 CAND=nftables). They run on the workstation but the result is the harness ceiling, not the SUT's; that's labelled in three places.
  • Throughput benchmarks (B-00..B-13) declared out of scope on Tier 0 with reasoning in bench/README.md and bench/ROADMAP.md.

What's in the diff

Commit 1 — feat(bench): working Tier-0 smoke + Tier-1 (TRex/sink) scaffolding (16 files, +927 / -83)

Tier-0 smoke fixes:

  • Topology IP collision fix (host bridges off .1).
  • Q35 NIC naming (enp1s0/enp2s0, not ens3/ens4).
  • Cloud-init seed delivery via virt-customize into the well-known /var/lib/cloud/seed/nocloud/ path on the instance qcow2 — replaces the cidata-ISO approach that was unreliable on customised images.
  • bench/Makefile new base-customise target pre-bakes packages into the cached base image (bench bridges have no NAT).
  • smoke.sh gates tests on cloud-init status --wait; ruleset check via systemctl is-active up front.
  • bench/SETUP.md § 3a: qemu user/group override + guestfs-tools + troubleshooting table.

Tier-1 scaffolding:

  • bench/candidates/trex/ and bench/candidates/sink/ — separate sink VM avoids the kernel-loopback shortcut that nukes any setup where TX and RX live in the same Linux namespace.
  • bench/scripts/b00.{sh,py} — TRex-driven binary-search NDR/PDR across seven RFC 2544 frame sizes.
  • Makefile: trex-fetch, trex-up, trex-down, sink-up, sink-down, b-00; tear-down covers all VMs.

Commit 2 — docs(bench): Tier-0 scope decision + latest smoke result (2 files, +69 / -4)

  • bench/README.md: "Scope decision: throughput is Tier-1 only" + "Latest Tier-0 smoke run" with today's pass.
  • bench/ROADMAP.md: Tier-0 "what it can't measure" calls out B-00..B-13 with reasoning.

Why two commits

The diff is large but it's two coherent stories — one of code/config that makes the bench do things, one of docs that says what it won't try to do. Splitting the Makefile by hunk into three commits adds noise without help.

Test plan

  • cd bench && make tear-down
  • make smoke CAND=nftables → exit 0, result.json:.security_effectiveness_precondition.satisfied = true
  • CI: lychee link-checker on the docs changes
  • Future Tier-1 box: make b-00 CAND=nftables runs the same b00.{sh,py} against real NICs; no harness rewrite needed.

Out of scope (separate PRs)

  • Footprint metrics B-21..B-24 (image size, RSS, launch time, idle latency) — workstation-friendly and not yet implemented.
  • Functional/scenarios.md harness — full security-effectiveness suite.
  • Other candidates (pf/OPNsense, VyOS, VPP/DPDK).

@LeTuR
LeTuR force-pushed the bench/tier0-working-plus-tier1-scaffold branch from 9c0f018 to 8f850e1 Compare May 25, 2026 18:34
LeTuR added 2 commits May 25, 2026 20:53
Brings the Tier-0 smoke test green end-to-end and lays in the TRex/sink
VM scaffolding for the future Tier-1 lab box. Per tests/benchmarks.md
§ 0.6/§ 0.8, this satisfies the security-effectiveness precondition on
a developer workstation while reserving the throughput numbers for a
substrate that can produce them honestly.

Tier-0 smoke fixes:
- Topology: host bridge IPs moved off `.1` so they no longer collide
  with the SUT's own LAN/WAN addresses.
- Q35 NIC naming: cloud-init and rules.nft now reference `enp1s0`
  /`enp2s0` (the Q35 PCIe-slot names libvirt actually hands out), not
  the i440fx `ens3`/`ens4` they were originally written for.
- Cloud-init seed delivery: `render-cloud-init.sh` injects user-data
  into `/var/lib/cloud/seed/nocloud/` on the instance qcow2 via
  `virt-customize`. The well-known path always wins ds-identify;
  previous attempts via cidata-labeled CD-ROMs were unreliable on
  customised images.
- `bench/Makefile`: new `base-customise` target pre-bakes packages
  into the cached base image via virt-customize (the bench bridges
  have no NAT, so cloud-init's `packages:` step has nothing to fetch).
- `smoke.sh`: gates tests on `cloud-init status --wait`, runs the
  ruleset-loaded check up front via `systemctl is-active` (race-free)
  so iperf3 saturation can't briefly stall the check.
- `bench/SETUP.md`: § 3a documents the qemu user/group override
  (`/etc/libvirt/qemu.conf`: `user = "$USER"`, `group = "kvm"`) that
  qemu:///system needs to read disks under `/home`. `guestfs-tools`
  added to the package list; troubleshooting table extended.

Tier-1 scaffolding (runs but explicitly out-of-scope on Tier 0):
- `bench/candidates/trex/` — TRex VM cloud-init: software-mode TRex
  with MAC-resolved 2-NIC config (required even number; port 1 is a
  dummy because RX accounting comes from the sink, not from TRex).
- `bench/candidates/sink/` — receive-only WAN endpoint at
  203.0.113.200 whose `/sys/class/net/enp1s0/statistics/rx_packets`
  the b00 driver reads over SSH for RX counting. A dedicated VM
  avoids the kernel-loopback shortcut that nukes any TRex setup where
  TX and RX endpoints share a Linux network namespace.
- `bench/scripts/b00.{sh,py}` — TRex-driven binary-search NDR/PDR
  sweep across the seven RFC 2544 frame sizes. Runnable but the
  header comment is explicit that on Tier 0 the result is a harness
  ceiling, not a SUT measurement.
- `bench/Makefile`: `trex-fetch`, `trex-up`, `trex-down`, `sink-up`,
  `sink-down`, `b-00` targets; `tear-down` covers all VMs.

Verified locally: `make tear-down && make smoke CAND=nftables` exits 0
with `result.json:.security_effectiveness_precondition.satisfied=true`.
…e result

Tier-0 produces meaningful functional/correctness numbers but cannot
produce trustworthy throughput numbers — the workstation virtio path
bottlenecks the measurement well before the SUT does. Make that
explicit in three places so future readers don't chase what was
never measurable here.

- bench/README.md: new "Scope decision: throughput is Tier-1 only"
  section with reasoning (1-vCPU SUT + virtio, § 0.6 control logic)
  and a "what stays in scope on Tier 0" list (smoke, functional
  correctness, footprint metrics B-21..B-24). The TRex/sink
  scaffolding stays in the tree so the Tier-1 box runs `make b-00`
  as-is when it arrives. Also a "Latest Tier-0 smoke run" block
  showing today's pass — verdict, per-probe table, host invariants,
  Tier-0 caveat.
- bench/ROADMAP.md: Tier-0 "what it can measure" now lists footprint
  metrics; "what it can't measure" calls out B-00..B-13 explicitly
  with the substrate-bottleneck reasoning and a pointer to the
  scaffolding that's runnable for Tier 1.
@LeTuR
LeTuR force-pushed the bench/tier0-working-plus-tier1-scaffold branch from 8f850e1 to b5e52b7 Compare May 25, 2026 18:53
@LeTuR
LeTuR merged commit c5b9e81 into main May 25, 2026
5 checks passed
@LeTuR
LeTuR deleted the bench/tier0-working-plus-tier1-scaffold branch May 25, 2026 18:55
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.

1 participant