Skip to content

multicast: support simultaneous publisher and subscriber#2882

Merged
snormore merged 18 commits intomainfrom
snor/simultaneous-pub-sub-multicast
Feb 12, 2026
Merged

multicast: support simultaneous publisher and subscriber#2882
snormore merged 18 commits intomainfrom
snor/simultaneous-pub-sub-multicast

Conversation

@snormore
Copy link
Copy Markdown
Contributor

@snormore snormore commented Feb 9, 2026

Summary of Changes

  • Allow a client to be both a multicast publisher and subscriber simultaneously via new --pub-groups and --sub-groups flags on doublezero connect multicast
  • All roles and groups must be specified in a single connect command; CLI fails early if a multicast service is already running
  • Legacy CLI syntax (multicast publisher/subscriber <groups>) remains supported
  • Add RFC-15 documenting the design and constraints
  • Consolidate three QA multi-group tests into a single phased test
  • Resolves https://github.com/malbeclabs/infra/issues/551

Testing Verification

  • E2E test verifies single client as both pub+sub with mroute state and PIM adjacency validation on device
  • QA test verifies selective fan-out, dynamic group addition, and simultaneous pub+sub with cross-client traffic

@snormore snormore force-pushed the snor/simultaneous-pub-sub-multicast branch from 3d420f1 to c296a82 Compare February 9, 2026 21:47
@snormore snormore marked this pull request as ready for review February 9, 2026 22:55
@snormore snormore force-pushed the snor/simultaneous-pub-sub-multicast branch from c23397b to b61258a Compare February 9, 2026 23:09
@snormore snormore force-pushed the snor/simultaneous-pub-sub-multicast branch 2 times, most recently from ccff17e to 4704bab Compare February 10, 2026 16:55
Copy link
Copy Markdown
Contributor

@martinsander00 martinsander00 left a comment

Choose a reason for hiding this comment

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

Lint issues but lgtm

@snormore snormore force-pushed the snor/simultaneous-pub-sub-multicast branch 5 times, most recently from 8729028 to 8723374 Compare February 11, 2026 16:53
Remove the mutual exclusion between publisher and subscriber modes so a
client can both publish and subscribe to multicast groups simultaneously.

Daemon: conditionally skip base tunnel creation when the publisher block
already created a tunnel with IP, and skip subscriber routes for groups
that already have a publisher route with Src set.

CLI: add --pub-groups / --sub-groups flags (backward compatible with
legacy positional syntax), remove the client-side mutual exclusion
validation, and set publisher/subscriber flags independently for
overlapping groups.

SDK: deduplicate multicast group PKs during user deletion to avoid
sending redundant unsubscribe calls that fail due to Updating status.

E2E: add pub_codes/sub_codes fields to ConnectMulticastRequest proto and
update the RPC handler and helpers.
Merge TestQA_MulticastMultiGroupSimultaneous, TestQA_MulticastAddGroupToExistingUser,
and TestQA_MulticastPublisherMultipleGroups into a single TestQA_MulticastMultiGroup
that runs three phases:
- Phase 1 (selective fan-out): pub on A+B, subA on A, subB on B
- Phase 2 (dynamic subscription): subA adds group B, verifies identity preserved
- Phase 3 (simultaneous pub+sub): subA reconnects as both pub and sub on group A
The daemon does not support updating an existing multicast service, so
both publisher and subscriber roles must be specified in a single connect
command. Add an early check in the CLI that queries daemon status and
fails with a clear message before modifying onchain state. Update the
RFC to document this constraint and note incremental connect as future
work.
The ReactivationPreservesAllocations test was calling connect multicast
a second time while a service was already running, which is now rejected.
Update to disconnect first, then reconnect with both pub groups.
After disconnecting multicast, poll doublezero status --json until the
daemon no longer reports a multicast service before attempting to
reconnect. This avoids the race where the daemon hasn't fully torn
down by the time connect checks for an existing service.
The namely/protoc-all image is abandoned (last updated 2023) and ships
outdated protoc v3.21.6. Switch to ghcr.io/jetexe/gobuf which bundles
buf with protoc-gen-go v1.36.10 and protoc-gen-go-grpc v1.6.0.
@snormore snormore force-pushed the snor/simultaneous-pub-sub-multicast branch from 8723374 to b1a865f Compare February 11, 2026 18:50
@snormore snormore merged commit bed8ec5 into main Feb 12, 2026
75 of 80 checks passed
@snormore snormore deleted the snor/simultaneous-pub-sub-multicast branch February 12, 2026 13:28
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.

2 participants