Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFP: multicast support #28750

Closed
lliu0947 opened this issue Oct 24, 2023 · 16 comments · Fixed by #32612
Closed

CFP: multicast support #28750

lliu0947 opened this issue Oct 24, 2023 · 16 comments · Fixed by #32612
Labels
kind/feature This introduces new functionality. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.

Comments

@lliu0947
Copy link

Cilium Feature Proposal

Is your proposed feature related to a problem?

Our use case involves distributing data feeds to multiple consumers running in the k8s cluster, This case requires multicast support.

Describe the feature you'd like

multicast support in cilium

(Optional) Describe your proposed solution

The container network multicast transmission technology based on eBPF focuses on solving the problem of efficient multicast transmission in the container network and provides support for multiple multicast protocols. My idea is to use the eBPF map to maintain the pod list for multicast communication, complete the addition and deletion of multicast members in the cilium agent, and use the eBPF helper function to implement directional data transmission and network forwarding.

For detailed plans, see https://docs.google.com/document/d/14ekQd1MoKK9_NX0ru9rrhIHSfOyk_WkKQF7-aTLt3I0/edit?usp=sharing

@lliu0947 lliu0947 added the kind/feature This introduces new functionality. label Oct 24, 2023
@ldelossa
Copy link
Contributor

@lliu0947

Hey! your timing is pretty coincidental.

I've actually been working on the multicast feature internally for a bit now (started this before the CFP was submitted) and we are getting close to opening a OSS PR for the datapath bits.

The design we have is rather close!

When this PR is opened we invite you and other community members to review this PR and design.
We expect this PR to be opened within the next several days.

@julianwiedmann julianwiedmann added the sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. label Nov 16, 2023
@lliu0947
Copy link
Author

@lliu0947

Hey! your timing is pretty coincidental.

I've actually been working on the multicast feature internally for a bit now (started this before the CFP was submitted) and we are getting close to opening a OSS PR for the datapath bits.

The design we have is rather close!

When this PR is opened we invite you and other community members to review this PR and design. We expect this PR to be opened within the next several days.

When do you plan to open the pr? We are looking forward to supporting multicast in cilium

@ldelossa
Copy link
Contributor

@lliu0947

#29469 - Here is the initial PR for Multicast.

@lliang0947
Copy link

@lliu0947

#29469 - Here is the initial PR for Multicast.

We have several questions regarding this PR your proposed:

  1. When cilium starts, hive does not seem to start the multicast module.
  2. When a pod joins a multicast group, if the multicast group does not exist in the outer map, the join request will be discarded. We believe that the request should not be discarded, but add the multicast group and multicast members to the map.
  3. Only supports multicast communication in vxlan tunnel mode. however, multi-Pool IPAM may only be used in direct routing mode. Will it be considered to support in direct routing mode?
  4. When the pod joins the multicast group, the flags field in the mcast_subscriber_v4 structure is not assigned a value. From the ToSubsciberV4 function, this flags is used to identify whether the pod is on a remote node. It seems that cross-node multicast communication is not supported between pods.

This is a little question we have and hope to get your reply!

@ldelossa
Copy link
Contributor

ldelossa commented Dec 4, 2023

Hey @lliang0947

I think your questions here stem from the fact that this PR implements just the datapath bits.
Questions 1, 3, and 4 require a higher level control plane API to be implemented which is out of scope for our initial PR here.

When a pod joins a multicast group, if the multicast group does not exist in the outer map, the join request will be discarded. We believe that the request should not be discarded, but add the multicast group and multicast members to the map.

From a design perspective, I do not think this is possible. This is because only user-space can create eBPF maps. Since we are using a nested map structure, a control plane API must create the inner subscriber maps and assign them to outter keys (multicast groups). Again, this is a control plane responsibility which is not being implemented in the outlined PR.

@hrishin
Copy link

hrishin commented Feb 4, 2024

@ldelossa thank you for getting the intial work done!

Q: Current PR seems to be supporting the sending side? (pod to pod same host, pop to pod remote host).
Does this also support receiving side as well? (from external world to pods)

@fujitatomoya
Copy link
Contributor

@ldelossa thanks for contributing the PR 👍

I work on Robot Operating System 2 as a member of Technical Steering Committee.

ROS 2 (Internally transport implementation is configurable) in default uses Data Distribution Service and that relies on UDP multicast for participant discovery protocol in the application layer.

I just tried #29469, and since ROS 2 application cannot discover the participants, i believe it does not support pod to pod multicast communication just yet? no pressure and just checking the current status since i am not familiar with Cilium implementation.

thanks in advance,

@nakabonne
Copy link

Thanks for getting this #29469 done! Has this been released? I poked a bit around a few latest releases but can't find this commit.

@fujitatomoya
Copy link
Contributor

Thanks for getting this #29469 done! Has this been released? I poked a bit around a few latest releases but can't find this commit.

AFAIS, it's in main only, not merged into any release branches yet.

@nakabonne
Copy link

Thank you @fujitatomoya
If that's the case, does anyone know if there is a milestone for the multicast support? CC: @ldelossa

@harsimran-pabla
Copy link
Contributor

PR to add support for managing multicast BPF maps.

Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label May 12, 2024
@xmulligan
Copy link
Member

@lliang0947 I think we can close this now that #29469 is merged right?

@fujitatomoya
Copy link
Contributor

@lliang0947 @xmulligan
CC: @harsimran-pabla

i already verified that multicast works with multicast group address and subscribers with Robot Operating System 2 and Data Distributing Service, see more details for https://github.com/fujitatomoya/ros_k8s/blob/master/docs/Setup_Kubernetes_Cluster.md#enable-multicast-wip.

btw, to close this issue, we would want to add some docs for user manual explains how to set this up? i did not see those docs so i was looking at the source code for #31355 to figure this out?

if that is good to go, i can work on the quick doc update.

@github-actions github-actions bot removed the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label May 13, 2024
@xmulligan
Copy link
Member

Yes, that would be great if you could add some docs on how to use it 🙏

@fujitatomoya
Copy link
Contributor

@xmulligan i could use review for #32612

CC: @harsimran-pabla @ldelossa @joestringer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature This introduces new functionality. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants