[swadm,multicast] add multicast inspection subcommand - #366
Open
zeeshanlakhani wants to merge 4 commits into
Open
[swadm,multicast] add multicast inspection subcommand#366zeeshanlakhani wants to merge 4 commits into
zeeshanlakhani wants to merge 4 commits into
Conversation
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.
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 2, 2026 14:35
cb72382 to
0ea6ca4
Compare
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.
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 3, 2026 04:09
0ea6ca4 to
d5121e0
Compare
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 adds a read-only
swadm multicastsubcommand (aliased asmcastas 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:
externalselects groups with a NAT target and no direct members, whileunderlayselects those in the reserved ff04::/64 subnet that replicate to member ports.