Skip to content

feat(golden): uplink2, NIC speed, locality and ASN in the capture VM - #331

Merged
randomizedcoder merged 8 commits into
mainfrom
feat/golden-workload-net
Nov 25, 2026
Merged

randomizedcoder merged 8 commits into
mainfrom
feat/golden-workload-net

Conversation

@randomizedcoder

@randomizedcoder randomizedcoder commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

The golden capture VM had one virtio uplink at speed 0 and no locality or ASN enrichment, so the fleet's uplink 2, NIC speed, locality, ASN, owner and egress columns were never exercised. Includes #330 (and through it #327 and #329) with their review fixes, merged in; merge those first. The new commits start at "test(golden): coverage for uplink2, NIC speed, locality and ASN (red)". Done test-first.

VM (mkVm.nix, golden flavor only; the families check is unchanged)

  • Second uplink: an emulated e1000e on its own restricted SLiRP net (restrict=on,net=10.0.3.0/24), static 10.0.3.15 with a default route at metric 2048. DefaultUplinks finds it second through the production path: two defaults were already covered by TestParseDefaultRoutesV4/two, so no code change there
  • virtio NIC: -global virtio-net-pci.speed=10000,duplex=full (virtio-net reports no speed unless told)
  • Collector adds -enrichLocality -enrichAsn. The ASN artifact is built with the VM by duckdb from documentation prefixes only: 203.0.113.0/24 → AS64500 "fixture-net", 2001:db8:113::/48 → AS64501 "fixture-net6". No feed, no internet
  • A fleet NIC's driver and IDs (bnxt_en and so on) can't be reproduced in a VM; documented in nix/README

Workload

  • golden-loc-a/b + golden-remote: from golden-loc-a, one connection each to its own address (self), golden-loc-b (subnet), and 203.0.113.10 / 2001:db8:113::10 through golden-loc-b as a router (remote)

Checks

  • ROW lines, all four categories: uplink2, locality_all, bound_ifname (positive); asn_remote, no_asn_unlisted (negative); nic_speed (boundary); v6_remote, egress_named (corner)
  • bound_ifname and enrich_socket_interface_name coverage move here from feat(golden): netns pairs for congestion, loss, socket options and states #330: only the locality enricher fills it
  • coverage.json requires uplink 2's columns (driver e1000e, vendor 32902, device 4307, speed 1000, firmware, bus, ifname), uplink 1 speed 10000, localities 1/2/3, and the ASN, owner, egress and bound interface columns

Red (coverage commit, against #330's fixture)

coverage: enrich_socket_dest_asn never populated
coverage: enrich_socket_dest_egress_ifindex never populated
coverage: enrich_socket_dest_egress_ifname never populated
coverage: enrich_socket_dest_locality never populated
coverage: enrich_socket_dest_locality=1 missing
coverage: enrich_socket_dest_locality=2 missing
coverage: enrich_socket_dest_locality=3 missing
coverage: enrich_socket_dest_network_owner never populated
coverage: enrich_socket_interface_name never populated
coverage: uplink1_nic_speed_mbps never populated
coverage: uplink1_nic_speed_mbps=10000 missing
coverage: uplink2_ifname never populated
coverage: uplink2_nic_bus_info never populated
coverage: uplink2_nic_driver never populated
coverage: uplink2_nic_driver=e1000e missing
coverage: uplink2_nic_fw_version never populated
coverage: uplink2_nic_pci_device never populated
coverage: uplink2_nic_pci_device=4307 missing
coverage: uplink2_nic_pci_vendor never populated
coverage: uplink2_nic_pci_vendor=32902 missing
coverage: uplink2_nic_speed_mbps never populated
coverage: uplink2_nic_speed_mbps=1000 missing

Green

Every ROW line PASSes in both captures, and in a third taken after the review fixes; all three diff clean against each other (exit 0); xtcp2-golden check passes coverage; go test ./... passes (except TestSockstatReader, which this PR does not touch: it reads live host sockstat and failed once, then passed in 3 of 4 reruns); the nix checks (gofmt, go-vet, nix-fmt, lint-baseline, golangci ×3, redteam-lint, golden-records, test-fuzz-all) pass.

🤖 Generated with Claude Code

randomizedcoder and others added 6 commits November 24, 2026 16:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- e1000e second uplink on a restricted SLiRP net, default route at
  metric 2048; virtio NIC reports 10000 full duplex
- -enrichLocality -enrichAsn over an artifact built from documentation
  prefixes (203.0.113.0/24 AS64500, 2001:db8:113::/48 AS64501)
- golden-loc-a/b + golden-remote: self, subnet and remote (v4, v6)
- ROW uplink2, locality_all, bound_ifname, asn_remote, no_asn_unlisted,
  nic_speed, v6_remote, egress_named
- README, CHANGELOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two captures diff clean; coverage.json passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit 563e971 into main Nov 25, 2026
1 check 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.

1 participant