Skip to content

[multicast] add UDP multicast send/recv#13

Open
zeeshanlakhani wants to merge 3 commits into
mainfrom
zl/multicast
Open

[multicast] add UDP multicast send/recv#13
zeeshanlakhani wants to merge 3 commits into
mainfrom
zl/multicast

Conversation

@zeeshanlakhani
Copy link
Copy Markdown

This adds multicast send/recv to the UDP probe so omicron's a4x2 multicast end-to-end test(s) (using thundermuffin as the send/recv probe) can validate forwarding through real OPTE + softnpu. Multicast is detected at runtime via IpAddr::is_multicast().

The sender configures TTL/hops, loop, and the outgoing interface, while the receiver binds wildcard with SO_REUSEADDR and joins via join_multicast_v{4,6}. The receiver tracks rx_count and loss_count via an 8-byte big-endian sequence prefix and emits a JSON summary on exit, where exit is non-zero if rx_count == 0.

Server::duration was also added as a wallclock cutoff. TCP + multicast bails out at parse (multicast is a UDP-only concept at the IP layer).

Note that workspace edition bumped 2021 to 2024.

This adds multicast send/recv to the UDP probe so omicron's a4x2 multicast
end-to-end test(s) (using thundermuffin as the send/recv probe) can validate
forwarding through real OPTE + softnpu. Multicast is detected at runtime via
`IpAddr::is_multicast()`.

The sender configures TTL/hops, loop, and the outgoing interface, while the
receiver binds wildcard with `SO_REUSEADDR` and joins via `join_multicast_v{4,6}`.
The receiver tracks `rx_count` and `loss_count` via an 8-byte big-endian
sequence prefix and emits a JSON summary on exit, where exit is non-zero if
`rx_count == 0`.

`Server::duration` was also added as a wallclock cutoff. TCP + multicast bails
out at parse (multicast is a UDP-only concept at the IP layer).

Note that workspace edition bumped 2021 to 2024.
Comment thread app/src/main.rs Outdated
Comment thread app/src/udp.rs
Comment thread app/src/udp.rs Outdated
Comment thread app/src/udp.rs Outdated
Comment thread app/src/udp.rs Outdated
Comment thread app/src/udp.rs Outdated
Comment thread app/src/udp.rs Outdated
Comment thread app/src/udp.rs
@taspelund
Copy link
Copy Markdown

Looks pretty solid to me overall. Just a couple nits and questions

@zeeshanlakhani zeeshanlakhani requested a review from taspelund May 8, 2026 03:25
Includes:

- renames and generalizes `--ttl` for mcast and unicast needs
- receivers now bind directly to the group addr with SO_REUSEADDR
- the 8-byte BE seq prefix is now written/parsed on every UDP packet so loss/rx counts work for unicast too
- recv-loop duration check uses start.elapsed() instead of a precomputed deadline
- a bigger change: adding SSM (RFC 4607) for v4 + v6 via a repeatable `--multicast-source` on Server. 
  v4 calls socket2's join_ssm_v4 once per source; however, for v6 we have to use a POSIX setsourcefilter 
  (socket2 0.6.3 still has no v6 SSM API). Sources must parse as unicast at clap time, etc. 
- [deps] This bumps socket2 to 0.6.3 (set_nodelay -> set_tcp_nodelay, set_ttl -> set_ttl_v4) and 
  adds libc dep for the setsourcefilter wrapper
Copy link
Copy Markdown

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Zeeshan, a few notes.

Comment thread app/src/main.rs Outdated
Comment thread app/src/main.rs
Comment thread app/src/ssm.rs
Comment thread app/src/ssm.rs Outdated
Comment thread app/src/udp.rs
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.

3 participants