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

Add support for UDP multicast #208

Open
manifest opened this issue Jan 10, 2025 · 1 comment
Open

Add support for UDP multicast #208

manifest opened this issue Jan 10, 2025 · 1 comment

Comments

@manifest
Copy link

Currently, UDP multicast is not supported by turmoil.

Since all hosts of the simulation are known and in the same network (there isn’t any notion of network topology in turmoil), the solution might be quite straightforward and built upon the current UDP unicast implementation. The network partitioning and other parts will continue to work as they are now.

One possible solution would be to add a mapping from udp multicast group addresses to udp socket bind addresses as a property of the World.

  • On joining a multicast group, we initialize the mapping.
  • On sending a message, given that the multicast group is a destination address of a message, we look up bind addresses for every UDP socket in the mapping and send the message to those addresses.

    Multicast group addresses are reserved to 224.0.0.0/4 for IPv4 and ff00::/8 for IPv6.

The same approach might be used to implement IPv4 UDP broadcast.

  • On binding a UDP socket we collect every udp socket bind addresses in a list that is a property of the World.

    We don’t need a mapping here, since there is a single global broadcast address 255.255.255.255. It could become a mapping, if we were to support subnet's broadcast addresses, but for that we would need some notion of network topology in turmoil.

  • On sending a message, to the global broadcast address, we look up bind addresses for every UDP socket in the list and send the message to those addresses.
@manifest
Copy link
Author

I can work on this issue executing proposed solution or any other alternative that better aligns with the library's objectives.

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

No branches or pull requests

1 participant