Skip to content

Commit 6f00b19

Browse files
[multicast] Narrow admin-scoped to admin-local only (ff04::/16)
Previously, internal multicast groups accepted admin-scoped addresses including admin-local (ff04), site-local (ff05), and org-local (ff08). This narrows the scope to only admin-local (ff04::/16), which is what Omicron *now* dictates. - [ ] This should be merged after oxidecomputer/omicron#9450 is reviewed and merged into Omicron. We now make Dendrite/Dpd match Omicron consistently for validation. Key changes: - Remove IPV6_SITE_LOCAL_PATTERN and IPV6_ORG_SCOPE_PATTERN from P4 - Update P4 table entries to only match admin-local (size 4→2) - Add ADMIN_LOCAL_PREFIX const to dpd-types with RFC doc links - Update validation to use `is_admin_local_multicast()` from oxnet v0.1.4 - Bump to API version 2 for doc changes (only) - Update README with OpenAPI generation instructions - Use new multicast subnet constants from `omicron-common` for validation
1 parent 0aef4d5 commit 6f00b19

File tree

15 files changed

+10471
-248
lines changed

15 files changed

+10471
-248
lines changed

Cargo.lock

Lines changed: 664 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ ispf = { git = "https://github.com/oxidecomputer/ispf" }
4646
gateway-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
4747
gateway-types = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
4848
nexus-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
49-
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch= "main" }
50-
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
51-
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
52-
oximeter-instruments = { git = "https://github.com/oxidecomputer/omicron", branch = "main", default-features = false, features = ["kstat"] }
53-
oxnet = { version = "0.1.3", default-features = false, features = ["schemars", "serde"] }
49+
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch= "zl/mcast-implicit-lifecycle" }
50+
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "zl/mcast-implicit-lifecycle" }
51+
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "zl/mcast-implicit-lifecycle" }
52+
oximeter-instruments = { git = "https://github.com/oxidecomputer/omicron", branch = "zl/mcast-implicit-lifecycle", default-features = false, features = ["kstat"] }
53+
oxnet = { version = "0.1.4", default-features = false, features = ["schemars", "serde"] }
5454
propolis = { git = "https://github.com/oxidecomputer/propolis" }
5555
smf = { git = "https://github.com/illumos/smf-rs" }
5656
softnpu-lib = { git = "https://github.com/oxidecomputer/softnpu" , package = "softnpu" , branch = "main"}

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,5 +341,14 @@ proxy_arp:
341341
3. run `SDE=/opt/oxide/tofino_sde cargo test --features=<feature>` to execute
342342
the tests.
343343

344-
If regenerating the openapi specifications, set `EXPECTORATE=overwrite` when
345-
runnning the tests with the `tofino_asic` feature.
344+
### OpenAPI Generation
345+
346+
`dpd-api/src/lib.rs` contains endpoint [dropshot][dropshot-gh] definitions and
347+
controls API versioning for the `dpd` OpenAPI interface. If you add/remove or
348+
edit API points and/or documentation, you can update the API version and
349+
regenerate the latest OpenAPI specification bindings by running
350+
`cargo xtask openapi generate`. Use `cargo xtask openapi check` to verify
351+
specs are up-to-date.
352+
353+
354+
[dropshot-gh]: https://github.com/oxidecomputer/dropshot

dpd-api/src/lib.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use oxnet::{Ipv4Net, Ipv6Net};
4141
use schemars::JsonSchema;
4242
use serde::{Deserialize, Serialize};
4343
use transceiver_controller::{
44-
Datapath, Monitors, PowerState, message::LedState,
44+
message::LedState, Datapath, Monitors, PowerState,
4545
};
4646

4747
api_versions!([
@@ -56,6 +56,7 @@ api_versions!([
5656
// | example for the next person.
5757
// v
5858
// (next_int, IDENT),
59+
(2, MCAST_DOCS_ADMIN_LOCAL),
5960
(1, INITIAL),
6061
]);
6162

@@ -1431,7 +1432,7 @@ pub trait DpdApi {
14311432
/**
14321433
* Create an external-only multicast group configuration.
14331434
*
1434-
* External-only groups are used for IPv4 and non-admin-scoped IPv6 multicast
1435+
* External-only groups are used for IPv4 and non-admin-local IPv6 multicast
14351436
* traffic that doesn't require replication infrastructure. These groups use
14361437
* simple forwarding tables and require a NAT target.
14371438
*/
@@ -1450,9 +1451,10 @@ pub trait DpdApi {
14501451
/**
14511452
* Create an underlay (internal) multicast group configuration.
14521453
*
1453-
* Underlay groups are used for admin-scoped IPv6 multicast traffic that
1454-
* requires replication infrastructure. These groups support both external
1455-
* and underlay members with full replication capabilities.
1454+
* Underlay groups are used for admin-local IPv6 multicast traffic
1455+
* (ff04::/16, as defined in RFC 7346 and RFC 4291) that requires
1456+
* replication infrastructure. These groups support both external and
1457+
* underlay members with full replication capabilities.
14561458
*/
14571459
#[endpoint {
14581460
method = POST,
@@ -1502,10 +1504,10 @@ pub trait DpdApi {
15021504
) -> Result<HttpResponseOk<mcast::MulticastGroupResponse>, HttpError>;
15031505

15041506
/**
1505-
* Get an underlay (internal) multicast group configuration by admin-scoped
1507+
* Get an underlay (internal) multicast group configuration by admin-local
15061508
* IPv6 address.
15071509
*
1508-
* Underlay groups handle admin-scoped IPv6 multicast traffic with
1510+
* Underlay groups handle admin-local IPv6 multicast traffic (ff04::/16) with
15091511
* replication infrastructure for external and underlay members.
15101512
*/
15111513
#[endpoint {
@@ -1521,8 +1523,8 @@ pub trait DpdApi {
15211523
* Update an underlay (internal) multicast group configuration for a given
15221524
* group IP address.
15231525
*
1524-
* Underlay groups are used for admin-scoped IPv6 multicast traffic that
1525-
* requires replication infrastructure with external and underlay members.
1526+
* Underlay groups are used for admin-local IPv6 multicast traffic (ff04::/16)
1527+
* that requires replication infrastructure with external and underlay members.
15261528
*/
15271529
#[endpoint {
15281530
method = PUT,
@@ -1537,7 +1539,7 @@ pub trait DpdApi {
15371539
/**
15381540
* Update an external-only multicast group configuration for a given group IP address.
15391541
*
1540-
* External-only groups are used for IPv4 and non-admin-scoped IPv6 multicast
1542+
* External-only groups are used for IPv4 and non-admin-local IPv6 multicast
15411543
* traffic that doesn't require replication infrastructure.
15421544
*/
15431545
#[endpoint {
@@ -2270,8 +2272,11 @@ pub struct MulticastGroupIpParam {
22702272
pub group_ip: IpAddr,
22712273
}
22722274

2273-
/// Used to identify an underlay (internal) multicast group by admin-scoped IPv6
2274-
/// address.
2275+
/// Used to identify an underlay (internal) multicast group by admin-local IPv6
2276+
/// address (ff04::/16, as defined in [RFC 7346] and [RFC 4291]).
2277+
///
2278+
/// [RFC 7346]: https://www.rfc-editor.org/rfc/rfc7346.html
2279+
/// [RFC 4291]: https://www.rfc-editor.org/rfc/rfc4291.html
22752280
#[derive(Deserialize, Serialize, JsonSchema)]
22762281
pub struct MulticastUnderlayGroupIpParam {
22772282
pub group_ip: mcast::AdminScopedIpv6,

dpd-client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ packet = { path = "../packet" }
3333
pcap = { path = "../pcap" }
3434
asic = { path = "../asic" }
3535
anyhow.workspace = true
36+
dpd-types.workspace = true
3637
lazy_static.workspace = true
3738
parking_lot.workspace = true
3839
rand.workspace = true

0 commit comments

Comments
 (0)