xdp-project / xdp-tutorial

XDP tutorial
2.49k stars 579 forks source link

can AF_XDP socket join for multicast like normal linux sockets ? #224

Open Adarsh97 opened 3 years ago

Adarsh97 commented 3 years ago

can AF_XDP socket join for multicast like normal linux sockets ? if yes how ?

tohojo commented 3 years ago

Adarsh Sunilkumar @.***> writes:

can AF_XDP socket join for multicast like normal linux sockets ? if yes how ?

Think of AF_XDP more like a raw socket: it'll get all packets that your hardware / the XDP program on the interface sends it, and it doesn't care about the IP layer, so multicast/unicast doesn't make any difference.

If you need to send out a multicast subscribe request to get your network to forward you those packets, though, you'll have to do so yourself from the AF_XDP socket; there's no mechanism for the kernel to do that for you...

Adarsh97 commented 3 years ago

Hi, Any example code for that is present ? (for joining multicast)

tohojo commented 3 years ago

Nope :)

gizahNL commented 3 years ago

Nope :)

Wouldn't just opening a normal UDP socket bound to that interface & sending the join from that socket suffice? Or does opening an AF_XDP socket prevent the Kernel from doing any normal packet sending from the interface?