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

[Feature Request] Multicast Support #962

Open
Hunter-Phipps opened this issue Jul 11, 2023 · 5 comments · May be fixed by #1019
Open

[Feature Request] Multicast Support #962

Hunter-Phipps opened this issue Jul 11, 2023 · 5 comments · May be fixed by #1019
Labels
in progress This feature is being worked on

Comments

@Hunter-Phipps
Copy link

Hi, could you please add Multicast support.

@shubnil
Copy link
Member

shubnil commented Jul 13, 2023

Hi @Hunter-Phipps ,
Thanks for asking.
Just for clarification , is the ask for Multicast support for IPv4 or IPv6.

@htibosch
Copy link
Contributor

Hello @Hunter-Phipps, I see that your issue is getting little response.

Currently there is a very limited use of multicast: only in the mDNS and LLMNR protocols.

Another popular application is IGMP. @evpopov has been active with it, as you must have seen.

For what purpose do you need multicast?

Using multicast is a bit like UDP in broadcast mode. A sockets is bound to a port number, and when a packet is received for that port number, it will be received on that socket.

One thing to do is set filtering of the MAC- and IP-addresses:

  • At the network interface should be told that certain multicast MAC-addresses should be let through. The EMAC often has a has hash register for this.
  • The IP-addresses should also be allowed in functions like prvAllowIPPacketIPv4() / prvAllowIPPacketIPv6().

@evpopov
Copy link
Contributor

evpopov commented Aug 22, 2023

For everyone interested, you can follow my branch here: Multicast PR just please don't take anything for granted. I rebase and force-push this branch every once in a while to keep it based off of the latest "main".
As @htibosch mentioned earlier, supporting multicasts requires that the hardware be told which multicast addresses it needs to allow in. In the hardware that I'm working with ( SAME70 ) you can have up to 4 individual addresses + a hash table.
@Hunter-Phipps, if you decide to use the branch, you will have to provide your own add/remove functions and assign them to the interface... something like this:

NetworkInterface_t * pxSAM_FillInterfaceDescriptor( BaseType_t xEMACIndex,
                                                    NetworkInterface_t * pxInterface )
{
    .
    .
    .
	#if ( ipconfigSUPPORT_IP_MULTICAST != 0 )
		pxInterface->pfAddMulticastMAC = prvAddMulticastMACAddress;
		pxInterface->pfRemoveMulticastMAC = prvRemoveMulticastMACAddress;
	#endif
    .
    .
    .
}

Or you can always assign functions that don't do anything as a start and just configure your hardware to receive all multicasts.

@htibosch, you may be interested in how I did my DriverSAM/NetworkInterface.s and in particular the adding and removal of addresses. It attempts to keep track of how many sockets are using a particular hash and only remove the hash when no more sockets need it.
@htibosch, do you think I should just do a "work in progress PR" for this or do you think keeping it separate like it is now is cleaner.

@hangeV
Copy link

hangeV commented Sep 3, 2023

Hello @Hunter-Phipps, I see that your issue is getting little response.

Currently there is a very limited use of multicast: only in the mDNS and LLMNR protocols.

Another popular application is IGMP. @evpopov has been active with it, as you must have seen.

For what purpose do you need multicast?

Using multicast is a bit like UDP in broadcast mode. A sockets is bound to a port number, and when a packet is received for that port number, it will be received on that socket.

One thing to do is set filtering of the MAC- and IP-addresses:

  • At the network interface should be told that certain multicast MAC-addresses should be let through. The EMAC often has a has hash register for this.
  • The IP-addresses should also be allowed in functions like prvAllowIPPacketIPv4() / prvAllowIPPacketIPv6().

Multicast is necessary, such as the Rockwell EtherNet/IP protocol, a popular industrial Ethernet protocol

@archigup
Copy link
Member

Hi, this feature request is under consideration

@amazonKamath amazonKamath linked a pull request Jan 29, 2024 that will close this issue
@amazonKamath amazonKamath added the in progress This feature is being worked on label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress This feature is being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants