Commit 09d1d59
committed
[multicast] adds multicast replication for sidecar-lite
This PR adds multicast packet replication to sidecar-lite's P4 pipeline,
emulating Dendrite's tofino sidecar implementation. Packets arriving
inside geneve with a multicast inner destination are source-filtered,
replicated to external and underlay groups, and tagged via the oxg_mcast
geneve option so downstream hops suppress already-served groups.
## TTL==1 route dropping
Packets with TTL==1 are dropped at the route table level via a
compound key (path_idx, route_ttl_is_1) so the ttl_exceeded action
fires instead of forward, preventing replication of expiring packets.
The control plane programs paired entries for both TTL values.
## Parser
IPv6 multicast scope validation now matches Dendrite's sidecar:
ff01 (interface-local) rejected, ff02 (link-local) forwarded to scrimlet
with hop_limit >= 1, other multicast requires hop_limit > 1.
IPv4 multicast (224.0.0.0/4) TTL==0 and TTL==1 rejected.
## Ingress
Source filtering for geneve-encapsulated multicast is executed via
mcast_source_filter_v4/v6 tables (inner src LPM + inner dst exact).
Replication tables set both grp_a (external) and grp_b (underlay)
unconditionally, while per-packet tag handling suppresses the group
whose stage is already done (0 = external, 1 = underlay, 2 = both).
Non-encapsulated multicast bypasses source filtering.
## Egress
The multicast tag is stamped into geneve options on every replicated
copy. Port reflection filter drops copies where egress == ingress port.
Decap occurs on bifurcated replication, or tag=2 (both groups served),
with inner TTL validation and IPv4 header checksum update (RFC 1624).
Also included:
- A VLAN-aware decap variant that inserts 802.1Q tag with configured
VLAN ID.
- Multicast dst MAC derivation from IP destination on all copies,
matching Dendrite's MulticastMacRewrite.
- Per-port src MAC rewritten via the `mcast_src_mac` table.
## Dependencies
p4 crates are currently updated to the `zl/multicast` branch
for multicast replication support in p4rs/softnpu and LHS bit-slice
assignment in x4c (used for multicast MAC derivation).1 parent 69fae2a commit 09d1d59
8 files changed
Lines changed: 3828 additions & 452 deletions
File tree
- p4
- scadm/src
- softnpu/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
| |||
82 | 106 | | |
83 | 107 | | |
84 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
85 | 122 | | |
86 | 123 | | |
87 | 124 | | |
| |||
0 commit comments