Repository navigation
[swadm,multicast] add multicast subcommand (->list, ->get, ->add, ->del) - #366
Open
zeeshanlakhani wants to merge 24 commits into
Open
zeeshanlakhani wants to merge 24 commits into
zeeshanlakhani wants to merge 24 commits into
Conversation
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 2, 2026 14:35
cb72382 to
0ea6ca4
Compare
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 3, 2026 04:09
0ea6ca4 to
d5121e0
Compare
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 5, 2026 16:09
d5121e0 to
87483a1
Compare
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 8, 2026 03:47
87483a1 to
842fa41
Compare
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 8, 2026 03:53
842fa41 to
e51be15
Compare
This work constrains group and SSM source validation based on a variety of specs, linked throughout the PR. Previously, DPD was accepting groups and (S, G) sources that no packet could actually exercise, including ones that can never leave a host/link or, worse, sources a switch can't forward. Here's the list (the first classifier one was the most obvious): | address | verdict | spec | |--------------------------------|---------|-------------------------------| | ff3x::/32 in ff30::/12 only | is SSM | RFC 4607 §1; RFC 3306 is ASM | | ff3x:: group ID > 0x40000000 | accept | RFC 4607 §4.3 | | v6 scopes other than 4/5/8/e | reject | RFC 7346; no Ethernet realm | | class E (240.0.0.0/4) source | reject | RFC 6890 "Source: False" | | 0.0.0.0/8 source | reject | RFC 6890 "Forwardable: False" | | 100.64.0.0/10 source | accept | RFC 6598, operator-internal | | source/group family mismatch | reject | (local choice) | | 232.0.0.0 (SSM null) | reject | RFC 4607 §4.3 | | v4-mapped/compat v6 source | reject | RFC 4291 §2.5.5, aliases IPv4 |
The external-group docs say “IPv4 and non-admin-local IPv6 multicast traffic,” but external groups can use admin-local IPv6 too. The exception, however, is the `ff04::/64` underlay range, which is reserved for the underlay mcast group mapped from the external mcast group. This makes the information explicit. The old wording is in a blessed spec, so this needs a new API version: `MCAST_EXTERNAL_SCOPE_DOCS`.
This adds a READ-only (no-mutation) `swadm multicast` subcommand (aliased as `mcast` as well) for inspecting the multicast groups programmed on the switch. The two commands are essentially a LIST and GET: - `multicast list [-t <tag>] [-k external|underlay]` renders all groups as a table view, filtered by tag, by replication kind, or both. - `multicast get <group-ip>` shows one group's full configuration. The kind filter matches on the response type: `external` means an external group with a NAT target and no (underlying) direction membership; `underlay` groups sit in the reserved ff04::/64 subnet and replicate to the member ports (to guest subscribers).
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 9, 2026 14:53
e51be15 to
5c0477d
Compare
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
September 11, 2026 12:28
860fcdc to
6e49b3f
Compare
cfzimmerman
requested changes
Sep 11, 2026
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
October 8, 2026 03:38
3e97732 to
47ab9cc
Compare
This update moves the swadm multicast testing harness onto the common expectorate setup from #350, and gives swadm multicast group create/delete (add/del) semantics, removing the tests' need for tokio and the dropshot client. `add/del` subcommands work on a pair (of groups) by default: `add` creates the underlay group, then the external group that maps to it (1:1, rolling the underlay back out if the external create fails), and `del` checks both (shared) tags before removing either group. `-t` defaults to the client tag on both subcommands, similar to `arp add`. `del --underlay-only` removes unreferenced underlay groups, including any left behind after a failed pair deletion. Includes: - `multicast get` runs through `TabWriter`, like `list`, for consistency. - `list` headers use Title Casing, like `nat`/`attached`. - `add` flags match what `nat add` has, i.e. `-i` underlay, `-m` mac, `-v` vni, and `--member` is long-only. - clap parses right into our new types (parent commit ~ type-validation), with bad addresses failing at arg parse-time. - extended test coverage and test helpers
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
October 8, 2026 05:40
47ab9cc to
5125d95
Compare
cfzimmerman
approved these changes
Oct 16, 2026
zeeshanlakhani
force-pushed
the
zl/mcast-swadm
branch
from
November 2, 2026 16:34
1d00d00 to
70b2e4d
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
swadm multicastsubcommand (aliased asmcastas well) for inspecting, creating, and deleting the multicast groups programmed on the switch:multicast list [-t <tag>] [-k external|underlay]renders all groups as atable view, filtered by tag, by replication kind, or both.
multicast get <group-ip>shows one group's full configuration.multicast add <ext-ip> -i <underlay> -m <mac> -v <vni> [--member port/link:dir]... [--vlan <id>] [-s <src>]... [-t <tag>]creates an external group and the underlay group that it maps to.multicast del <group-ip> [-t <tag>] [--underlay-only]deletes the pair, or just an unreferenced underlay group with--underlay-only.The kind filter matches on the response type:
externalmeans an external multicast group with a NAT target and no (underlying) direction membership;underlaygroups reside in the reservedff04::/64subnet and replicate to the member ports (to guest subscribers).add/delsubcommands work together as a pair (of groups) by default:addcreates the underlay group, then the external group that maps to it (1:1, rolling the underlay back out if the external create fails), anddelchecks both (shared) tags before removing either group. The-tflag defaults to the client tag on both subcommands, similar toarp add.del --underlay-onlyremoves unreferenced underlay groups, including any left behind after a failed pair deletion.Includes:
multicast getruns throughTabWriter, likelist;listheaders use Title Casing, likenat/attached.addflags match whatnat addhas, i.e.-iunderlay,-mmac,-vvni, and--memberis long-only.