Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/locality-enrichment.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ which is kept only as the explanation of what they do.

```sh
nix run .#capture-netlink-fixtures # DUMPS (RTM_GET* replies), host + sudo
nix run .#microvm-x86_64-nlmon-capture # EVENTS (link/addr/route/neigh), hermetic microVM
# The EVENTS oneshot (microvm-x86_64-nlmon-capture) was retired in V401; the
# 7_1_4 event corpus is frozen and committed.
```

Both write into `pkg/xtcpnl/testdata/<kernel>/` and must be run from the repo
Expand Down
7 changes: 4 additions & 3 deletions docs/netlink/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,19 @@ Events are parsed but not yet exported β€” they do not fit `XtcpFlatRecord`, whi

### Regenerating the fixtures

Four harnesses, all producing real `nlmon` captures under `pkg/xtcpnl/testdata/<kernel>/`. **The three primary ones run in a microVM**; the host script is a diagnostic fallback:
Three harnesses, all producing real `nlmon` captures under `pkg/xtcpnl/testdata/<kernel>/`. **The two primary ones run in a microVM**; the host script is a diagnostic fallback:

| Command | Captures | Where it runs |
|---|---|---|
| `nix run .#microvm-x86_64-netlink-dump-capture` | **dumps** β€” `RTM_GET*` request/reply pairs, into `testdata/<kernel>/dumps/` (clean namespace) and `dumps/mesh/` (bridge + veth pair) | in a hermetic microVM, no `sudo` |
| `nix run .#microvm-x86_64-nlmon-capture` | **events** β€” a scripted link / addr / route / neigh sequence | in a hermetic microVM, no `sudo` |
| `nix run .#microvm-x86_64-link-write-capture` | **bond / LACP readback** β€” an 802.3ad bond with a real LACP partner in a second namespace, captured in three negotiation states, into `testdata/<kernel>/link-write/<state>/` | in a hermetic microVM, no `sudo` |
| `nix run .#capture-netlink-fixtures` | **dumps on whatever host you are on** β€” a diagnostic fallback, not the path for committed fixtures | on the host, via `sudo` |

Run all of them from the repo root.

`nlmon` mirrors *every* netlink datagram in its namespace, so on a workstation the capture drowns in NetworkManager and nl80211 chatter; the guest is quiet by construction (all four netlink flavors disable `xtcp2.service`, whose own periodic dumps would otherwise swamp it β€” `mkVm.nix`'s `isNetlinkQuiet` names them once so a fifth cannot be added to two of the four places that need it).
**The events corpus is frozen, not regenerable here.** The fourth harness β€” `nix run .#microvm-x86_64-nlmon-capture`, a scripted link / addr / route / neigh sequence β€” was retired in V401 (EG2-T02, [goip-parity-events.md](goip-parity-events.md)): its machinery predates every driven-machinery fix, so re-running it regenerated nothing the corpus compares against. Its product stays committed (`pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap`, the base event corpus), and new event shapes are captured as the goip-parity VM's `ev*` rows instead.

`nlmon` mirrors *every* netlink datagram in its namespace, so on a workstation the capture drowns in NetworkManager and nl80211 chatter; the guest is quiet by construction (every netlink flavor disables `xtcp2.service`, whose own periodic dumps would otherwise swamp it β€” `mkVm.nix`'s `isNetlinkQuiet` names them once so a new one cannot be added to two of the four places that need it).

**A third flavor captures on the same topology but produces no fixtures.** `nix run .#microvm-x86_64-goip-parity` records an `ip β†’ goip β†’ ip` triple per command and runs `goip-parity compare` in the guest, so its output is a verdict rather than committed bytes β€” which is why it is not in the table above. It matters here because it shares this topology *by definition*, not by convention: the namespace build lives in `nix/microvms/scripts/netlink-topology.exp`, sourced by both drivers. The comparator subtracts `D_control = diff(ip_a, ip_b)` on the grounds that a difference visible across a window containing the goip run is not attributable to goip, and that only holds if the parity captures come off the topology these fixtures came off. Two copies would drift, and the symptom would be a green report measuring the wrong thing. If you add a device or a route below, both consumers get it.

Expand Down
26 changes: 16 additions & 10 deletions docs/netlink/coverage-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,11 @@ the fact that the levels are independent and that things do sit between them.

Each is strictly stronger than the one above it, and the interesting entries
are the ones that stop partway. The rtnetlink **event** types are decoded, and
since G4-T06 rendered by `goip monitor`, but never compared live: the parity
driver runs no monitor. `RTM_NEWRULE` and `RTM_DELRULE` became events in G4-T05.
since G4-T06 rendered by `goip monitor`; since Tier EG they are compared live:
the matrix drives the monitor section β€” fifteen live rows and seventeen
`monitor file` replay rows, each gated on two consecutive clean runs
(V393–V401, [goip-parity-events.md](goip-parity-events.md)).
`RTM_NEWRULE` and `RTM_DELRULE` became events in G4-T05.

### rtnetlink: ten body layouts, and they are the ten goip needs

Expand Down Expand Up @@ -668,8 +671,10 @@ dumps and invisible to the monitor. The corpus holds one rule notification,
covered by a constructed row, its body the same `fib_rule_hdr` layout.

Since G4-T06 `goip monitor` renders all of them, checked against the seven
captured monitor runs; none is compared live, because the matrix drives no
monitor.
captured monitor runs; since Tier EG the matrix compares them β€” the monitor
section's fifteen live rows and seventeen `monitor file` replay rows,
each gated on two consecutive clean runs (V393–V401,
[goip-parity-events.md](goip-parity-events.md)).

### sock_diag / inet_diag, which is a different surface and is complete

Expand Down Expand Up @@ -3190,7 +3195,7 @@ delivers them.
| `ndmsg` decoder | `pkg/xtcpnl/xtcpnl_ndmsg.go` (229) | `DeserializeNdMsg` + `ParseNeigh`. This is the template every new family's struct decoder copies. It shipped with a `DeserializeNdMsgReflection` twin, since moved to `_test.go` β€” see Phase 0a below. |
| pcap reader extension | `pkg/xtcpnl/xtcpnl_pcap.go` (+149) | Per-record netlink family access, which is what makes the Phase 0 "split per family in Go, not in tcpdump" decision cheap. |
| Real event fixtures | `pkg/xtcpnl/testdata/7_1_4/` | 5 pcaps + 6 `ip -d` sidecars + `uname`, captured off an `nlmon` device in a microVM. The directory has since grown a `dumps/` subtree from a *second*, unrelated flavor β€” see the note below the table. |
| Capture flavor | `nix/microvms/*`, `nix/default.nix` | `nix run .#microvm-x86_64-nlmon-capture`. A runner, **not** a check β€” a nix check cannot write fixtures into the working tree. |
| Capture flavor | `nix/microvms/*`, `nix/default.nix` | The event oneshot `nix run .#microvm-x86_64-nlmon-capture` was retired in V401 (its product stays committed; the corpus is frozen); dumps are `nix run .#microvm-x86_64-netlink-dump-capture`. A runner, **not** a check β€” a nix check cannot write fixtures into the working tree. |

`testdata/7_1_4/` now holds two corpora that share only a kernel version. The
files listed above are the event capture from this commit. `dumps/` and
Expand Down Expand Up @@ -6270,7 +6275,8 @@ error: it would be a comparator measuring one topology against an allowlist
written for another, with every sentinel green. What is *not* shared is policy β€”
which commands, which floors β€” which lives in `scripts/goip-parity.exp`.

**`ip monitor` is deliberately absent**, unlike `nlmon-capture`. For dumps it
**`ip monitor` is deliberately absent**, unlike the retired `nlmon-capture`
oneshot (V401). For dumps it
multiplies deliveries, and a multicast notification inside a read-only capture
window is a capture-hygiene FAILURE by the comparator's own design β€” so a
monitor here would fail the run it was meant to observe.
Expand Down Expand Up @@ -9713,9 +9719,9 @@ a checklist so a phase can be signed off against it.
capture cannot supply β€” bit saturation and a distinct value per field.
- [ ] **Positive fixtures are real `nlmon` captures** committed under
`pkg/xtcpnl/testdata/<kernel>/`, generated by
`nix run .#microvm-x86_64-nlmon-capture` (events) or
`nix run .#microvm-x86_64-netlink-dump-capture` (dumps) β€” **not**
hand-assembled
`nix run .#microvm-x86_64-netlink-dump-capture` (dumps; the events
oneshot was retired in V401 β€” the committed `7_1_4` event corpus is
frozen) β€” **not** hand-assembled
bytes. Constructed bytes are for truncation and malformed-input rows only.
See [fixture provenance](coverage-expansion.md#fixture-provenance-real-captures-not-hand-assembled-bytes).
- [ ] The capture path for the family exists **before** its decoder: kernel
Expand Down Expand Up @@ -10231,7 +10237,7 @@ nix build .#checks.x86_64-linux.upstream-pins -L
nix run .#check-upstream-pins

# regenerate the fixtures (run from the repo root; separate corpora, separate runs)
nix run .#microvm-x86_64-nlmon-capture # events
# The events oneshot was retired in V401; the 7_1_4 event corpus is frozen.
nix run .#microvm-x86_64-netlink-dump-capture # dumps
```

Expand Down
Loading