microsoft / xdp-for-windows

XDP speeds up networking on Windows
MIT License
346 stars 40 forks source link

XDP for window support UDP multicast? #494

Open Pikadoricrown opened 2 months ago

Pikadoricrown commented 2 months ago

is there a way to subscribe for multicast channel?

philippdiethelm commented 1 month ago

I had some success by creating a temporary winsock socket and joining the multicast group on the temporary socket. Then I get multicast traffic on the XDP socket until I close the winsock socket. I'm not sure if there is filter (maybe in the NIC) that needs to be set up to pass through the traffic.

mtfriesen commented 2 weeks ago

@philippdiethelm yes, that's exactly what is happening. NICs filter multicast; this is best-effort and some NICs let multicast through regardless of the programmed filter. Your workaround to open a multicast socket is similar to workarounds we've implemented for other issues, e.g. #44, and should work reliably.

I am converting this to a feature request, since XDP should eventually provide an API to directly configure the multicast group list on the NIC, without the assistance of traditional sockets.

Please reach out if you have more details on your use case, as it helps us prioritize our backlog.

Pikadoricrown commented 2 weeks ago

I had some success by creating a temporary winsock socket and joining the multicast group on the temporary socket. Then I get multicast traffic on the XDP socket until I close the winsock socket. I'm not sure if there is filter (maybe in the NIC) that needs to be set up to pass through the traffic.

Thanks, Are you using the rxfilter.c to receive from XDP socket

philippdiethelm commented 2 weeks ago

I had some success by creating a temporary winsock socket and joining the multicast group on the temporary socket. Then I get multicast traffic on the XDP socket until I close the winsock socket. I'm not sure if there is filter (maybe in the NIC) that needs to be set up to pass through the traffic.

Thanks, Are you using the rxfilter.c to receive from XDP socket

I use my own experimental code derived from xskfwd sample: xdp_recv.cpp

BTW: I had to downgrade my NIC driver to make it work completely with xdp. Looks like an incompatibility between nic driver and xdp. (aqnic650.sys 2.2.2.0 works, aqnic650.sys 3.1.x works partially)