Skip to content

[swadm,multicast] add multicast inspection subcommand - #366

Open
zeeshanlakhani wants to merge 4 commits into
zl/mcast-external-docfrom
zl/mcast-swadm
Open

[swadm,multicast] add multicast inspection subcommand#366
zeeshanlakhani wants to merge 4 commits into
zl/mcast-external-docfrom
zl/mcast-swadm

Conversation

@zeeshanlakhani

@zeeshanlakhani zeeshanlakhani commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This adds a read-only swadm multicast subcommand (aliased as mcast as well) for inspecting the multicast groups programmed on the switch:

  • multicast list [-t <tag>] [-k external|underlay] renders all groups as a table, filtered by tag, by replication kind, or both.
  • multicast get <group-ip> shows one group's full config.

We also add a kind filter matching on the response: external selects groups with a NAT target and no direct members, while underlay selects those in the reserved ff04::/64 subnet that replicate to member ports.

A replica still carrying Geneve at the egress counter block is bound for
an underlay port, while external replicas are decapsulated earlier, at
ingress for external-only groups or in `mcast_egress` for bifurcated
ones. Counter attribution now follows along directly and correctly.

The previous conditional chain tested Geneve validity before the underlay
tag, and it counted underlay replicas as external and left the underlay
branch unreachable. Decapsulated external replicas matched no branch at
all and went uncounted entirely.

The three conditions stay independent, and the underlay and external arms
key on `is_egress_rid_mcast` rather than on the negation of
`is_link_local_ipv6_mcast`, which the compiler does not carry into the
later gateways: guarded that way, a link-local packet increments
`external_mcast_ctr` alongside `link_local_mcast_ctr`. Link-local replicas
arrive with `egress_rid` of zero, and scope 2 is refused at group creation,
meaning that no replicated packet carries a link-local outer destination.

Here, we add coverage for all three attributions, including the
link-local counter, whose exclusion from the underlay and external
conditions had no test.
dpd accepted multicast groups and (S,G) sources that no packet could ever
exercise: scopes that never leave a host or link, group IDs outside the
range hosts may allocate, and sources a switch is not permitted to forward.
Each one is programmed into the ASIC and then sits there matching nothing,
and the failure is silent, so an operator sees a configured group rather
than a rejected one. Omicron (on the mcast stackset) and maghemite
(mcast work_ already refuse these, which left dpd lagging behind.

The classifier was the root of the issue. Testing ff30::/12 instead of the
ff3x::/32 that RFC 4607 §1 reserves made an RFC 3306 unicast-prefix-based
address like ff3e:20:1234::1 look source-specific, so creating it as an ASM
group failed for want of a source. Narrowing it to the sixteen disjoint /32
blocks is what lets the rest become specific: the reserved IPv4 232.0.0.0/24
block, an IPv6 scope allowlist, the allocatable SSM group-ID range, and on
the source side the embedded-IPv4 forms, class E, 0.0.0.0/8, and agreement
between source and group address family.

Each rule cites its RFC at the point it is enforced, and where a rule is
a local choice vs a requirement.
Both external group endpoints describe themselves as serving "IPv4 and
non-admin-local IPv6 multicast traffic", which the validator contradicts:
`validate_not_underlay_subnet` accepts admin-local addresses and refuses
only the reserved underlay subnet ff04::/64.

Description text belongs to a blessed document, so correcting it takes a
new version rather than an edit. `MCAST_EXTERNAL_SCOPE_DOCS` carries the
corrected wording on the POST and the PUT, while version-bounded copies
preserve the original text for everything before it.
This adds a read-only `swadm multicast` subcommand (aliased as `mcast` as well)
for inspecting the multicast groups programmed on the switch:

- `multicast list [-t <tag>] [-k external|underlay]` renders all groups as a
  table, filtered by tag, by replication kind, or both.
- `multicast get <group-ip>` shows one group's full config.

We also add a kind filter matching on the response variant: `external`
selects groups with a NAT target and no direct members, while `underlay`
selects those in the reserved ff04::/64 subnet that replicate to member ports.
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