Repository navigation
[mcast, pt1] multicast address, source, and route key types - #943
Open
zeeshanlakhani wants to merge 11 commits into
Open
zeeshanlakhani wants to merge 11 commits into
zeeshanlakhani wants to merge 11 commits into
Conversation
zeeshanlakhani
force-pushed
the
zl/mcast-types
branch
from
October 20, 2026 07:21
48df477 to
beaa7a3
Compare
This is the first of a series of recut PRs split from #675/#696. Validated address types now live in client-common (`Vni`, `OverlayMulticast`, `UnderlayMulticastIpv6`). We'll eventually get to the great big shared oxnet typed world :)! MRIB route types in mg-api-types-versions point toward the upcoming v13. While the API version itself is not declared here, we'll be working with this version throughout the upcoming split set. Group validation is essentially ported from dendrite oxidecomputer/dendrite#396: RFC-based (and flexible) ruleset(s) plus the internal, Oxide-specific `ff04::/64` underlay reservation. Proptests can be found in `impls/mrib/` and import `crate::latest::mrib`. The proptest suite is differential: `spec_*` fns encode the RFC rules and the Oxide underlay reservation, and the properties check that the constructors agree, error variant(s) included. Includes: - Fixed: in test-proptest.sh, the `rdb`/`bgp` blocks copied regressions to paths that the output rule never could match, and copies were skipped on failures as well; the output rule is now `**/*` over per-crate subdirs. - Running client-common unit tests in CI.
zeeshanlakhani
force-pushed
the
zl/mcast-types
branch
from
October 20, 2026 07:48
beaa7a3 to
2005d61
Compare
An upcoming stack split-out for the admin API adds MRIB lookups with
`?group=239.1.1.1`. `MulticastAddr` previously serialized as a tagged
object (`{"V4":"239.1.1.1"}`), which the query decoder cannot read.
This update converts the type to use `IpAddr` for serde conversion and
the schema. `TryFrom` keeps the existing multicast validation.
DDM's v4 wire types (pt4, incoming) need the same source checks as the MRIB (and the DDM admin API will take them through the v4 origin as well). We don't want the ddm-protocol relying on mg-api-types just for source validation. We move the source types into client-common, next to the group/underlay ones.
Dendrite's `dpd-types-versions` is now responsible for the validated multicast types (validator fns, unicast sources, underlay group, etc) and `Vni`, removing the copies we had in `client-common`. Our `MulticastAddrV4/V6` wrappers remain and call dendrite's checks, and we import the pinned version modules (`v14::mcast`, `v8::mcast`, `v14::network`) directly. Includes: - We no longer default to the multicast VNI directly (77 is OPTE/omicron policy that must be passed in) -> `vni` is required on route keys. - Group wrappers drop `#[schemars(transparent)]`, retaining their names and docs in generated schemas (like `UnicastAddrV4/V6` in dendrite). The wire format is still an IP string. - Introduction of our own `testing` feature (built on dendrite's) with `Arbitrary` for `MulticastAddrV4/V6` and `MulticastRouteKey`, for upcoming omicron proptests. - proptests: address validation specs were moved to dendrite, along with the types. We keep route/key properties and targeted IPv6 input checking here. - deps: dendrite -> 563cb147 (oxidecomputer/dendrite#405), softnpu -> a6a87853. - falcon-lab's build.rs pulls the dpd-client rev out of Cargo.lock and makes it the `--dendrite-commit` default. Otherwise, npuvm installs dendrite from main, where the types currently differ. Note: We need to move the dendrite rev back to main when that stack goes in.
zeeshanlakhani
force-pushed
the
zl/mcast-types
branch
from
October 31, 2026 08:48
8982bf6 to
50d5e53
Compare
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
reviewed
Nov 5, 2026
taspelund
requested changes
Nov 5, 2026
taspelund
left a comment
Contributor
There was a problem hiding this comment.
This PR looks pretty good overall. I left some comments, but most of it is around style / API rather than actual functional problems.
One note on the tests: I think it might be good to confirm constructors for SSM types when passing in ASM groups. It's possible they already do this, but I can't recall off the top of my head what range SSM occupies.
I did also ask 🤖 to take a look and these were the noteworthy items it reported:
Minor findings in #943
- A message points to an API mgd doesn't have. Dendrite's ReservedUnderlaySubnet message ends with "must be created via the internal multicast API". It reaches mgd users word for word, because MulticastGroupError is just an alias for dendrite's error type. Either change the wording in dendrite or accept it.
- SourceFamilyMismatch can't happen through JSON. Something like {"V4":{"source":"2001:db8::1",…}} fails with a generic invalid IPv4 address syntax. The family-mismatch error only comes from MulticastRouteKey::new(Option, …). The Group variant is also never produced inside this crate; it only exists for ? conversions.
- A CI line runs no tests, and the PR description is out of date. test-rdb.sh adds -p client-common. But 45466a1 moved client-common's multicast code into dendrite, so the package has no tests now. The "Running client-common unit tests in CI" bullet should go too.
- Two property tests partly check the function against itself. prop_group_v{4,6}_matches_validator compare MulticastAddrV4::new with validate_external_multicast_ipv4, which is the only thing new calls. The checks that JSON decoding and MulticastAddr agree are the useful part. About 90 lines of generators (GroupV6Case, EmbeddedRpCase) mostly exercise dendrite's validator, which dendrite now tests itself. This only costs maintenance: 1M cases ran in about 100 s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first of a series of recut PRs split from #675/#696. The validated multicast address types and
Vnicome from dendrite'sdpd-types-versions(oxidecomputer/dendrite#396, stacked through oxidecomputer/dendrite#405). We import the version modules that define them, pinning the rules with the associated version:v14::mcast(validators, unicast sources,is_ssm_address),v8::mcastfor the underlay group, andv14::network::Vni.MRIB route types in
mg-api-types-versionsare whatmg-adminv14serves. The API version itself is declared in #959 (pt3), and the rest of the split builds on it.Includes:
vniis required on route keys, no auto-defaulting to the multicast VNI (77 is OPTE/omicron policy that must be passed in).testingfeature (built on dendrite's) withArbitraryforMulticastAddrV4/V6andMulticastRouteKey, for upcoming omicron proptests (forwarded through mg-api-types/mg-admin-client in [mcast, pt3] mgd admin API + mgadm for the MRIB #959).build.rsnow pulls the dpd-client rev out of Cargo.lock and makes it the--dendrite-commitdefault. Otherwise, npuvm installs dendrite from main, which would supply the wrong types.rdb/bgpblocks intest-proptest.shhad copied regressions to paths for which the output rule would never match (and skipped that copy on failures).mg-api-typesproptests run there now too.Note: We need to move the dendrite rev back to main when that stack goes in.