I found a topic here that said that Multicast and IGMP support is not planned, and I need it fairly quick, so I took it upon myself to add support for it to FreeRTOS+TCP. Please consider this a preliminary discussion.
I need implementation for sending/receiving UDP/IPv4 multicasts and IGMP snooping, pruning, and a querier. Currently, FreeRTOS+TCP only supports sending UDP datagrams to multicast IP addresses, so for the past week or so, I’ve been working on adding proper support for multicasts and IGMP.
My general question is: Are the maintainers and the community interested in bringing these features into FreeeRTOS+TCP “main”?
Below are some details on my vision of what needs changed or implemented to achieve this goal:
- Add at least the following socket options for UDP sockets: SO_IP_ADD_MULTICAST, SO_IP_DROP_MULTICAST
- Keep track (per socket) of which multicast the socket is subscribed for and be able to add/remove subscriptions
- Add proper filtering for sockets that are subscribed for receiving a multicast group → Done
- Add a network driver function for adding and removing multicast MACs to the EMAC hardware ( the failsafe approach here is to receive all multicasts if multicast support is enabled )
- Support for multiple groups per socket as well as multiple interfaces ( aim is to make this code portable to “multi” branch )
- IGMP <–> Socket interface so that IGMP knows what the local host is registered for.
- IGMP v1/v2/v3 frame parsing
- IGMP timers for sending “report” frames
- optional IGMP querier
- network driver hooks for multicast pruning ( only applicable when using a managed switch that is under the MCU control )
There is a lot more details and decisions behind every one of these bullet points, but let’s keep it simple for now.
I have a working first draft of the socket-related stuff and I haven’t yet started on the IGMP part. I will be able to share sample code in a few days as I’m still cleaning up and testing. I will also probably need a little help on some performance-related decisions as well as guidance on the feature-set what would be best for the general FreeRTOS+TCP user.
Is there general interest in this? Again, I’m already doing it because I need it, but do you think a PR along these lines will be met with any interest or is it totally out of the question?