+TCP IPv4 multicasts and IGMP

Hi, @epopov, @selamta and @w2vy ,

We are creating a new FreeRTOS+TCP branch “dev/ipv6_integration” having both IPv4 and IPv6 functionalities. The branch will have both IPv4 and IPv6 unit tested , protocol tested and CBMC proofed and this branch will soon be the main branch.
I was exploring the mcast and IGMP support and stumbled upon this thread and looked into the mcast and igmp changes in the fork
Can we collaborate and create a formal PR for “dev/ipv6_integration” branch and merge the changes.
We will need your help here and we will be more than happy to help in every possible way.

2 Likes

We will be happy to help in every possible way.

3 Likes

Hi, is there any updates on this? I need multicast for my current project.

Hi @Hunter ,
My code is still in a branch of it’s own here: https://github.com/evpopov/FreeRTOS-Plus-TCP/tree/Multicasts_Draft_2

Feel free to try it. Sadly, there is no getting started for it, so you’ll have to do some digging. Try something like this:

//Setup the local end point
struct freertos_sockaddr	LocalAddr;
LocalAddr.sin_port = FreeRTOS_htons(1234);
LocalAddr.sin_addr = FreeRTOS_htonl(0x00000000);

//Bind the socket to the local end point
FreeRTOS_bind( MySock, &LocalAddr, sizeof(LocalAddr));

struct freertos_ip_mreq				prvMReq;
prvMReq.imr_multiaddr.sin_addr = FreeRTOS_htonl(0xEFFF0303);	// 239.255.3.3 ( Local Scope: 239.255.x.x );
prvMReq.imr_multiaddr.sin_len = sizeof( struct freertos_sockaddr);
prvMReq.imr_interface.sin_addr = FreeRTOS_htonl(0x00000000);
prvMReq.imr_interface.sin_len = sizeof( struct freertos_sockaddr);
FreeRTOS_setsockopt( MySock, 0, FREERTOS_SO_IP_ADD_MEMBERSHIP, ( void * ) &prvMReq, sizeof( prvMReq ) );

// Set the multicast TTL to one so we keep our multicasts local.
// Any multicast router should discard them and not forward them.
uint8_t xMulticastTTL = 1;
FreeRTOS_setsockopt( MySock, 0, FREERTOS_SO_IP_MULTICAST_TTL, ( void * ) &xMulticastTTL, sizeof( xMulticastTTL ) );

I am currently transitioning my day-job project to the IPv6 integration branch and eventually I will have to migrate my multicast/IGMP code there as well. At this point ( probably later this summer ) I plan on starting a work-in-progress PR to hopefully eventually get this stuff into the official repository.

1 Like

Thanks for the info. Any idea how I could get your multicast code working with the current version of FreeRTOS-Plus-TCP?

If by “current” you mean the single interface IPv4-only version, then use the link I sent in my previous post.

First of all, I apologize for bringing this from the dead.
Please do not use the links from this topic as they are no longer relevant.
If you need support for receiving multicast packets, please do the following:

  1. Check out your current version of FreeRTOS+TCP. It may already supports multicast groups. One easy way to check this is to open your FreeRTOSIPConfigDefaults.h and check if it has ipconfigSUPPORT_IP_MULTICAST listed in there. If it’s in there, simply copy the define to your FreeRTOSIPConfig.h and enable it.
  2. If the current FreeRTOS+TCP doesn not yet officially support multicast groups, browse through the pull requests on github. There will probably be a PR there that you can use until that code makes it to the official releases.
2 Likes