xdp-tutorial icon indicating copy to clipboard operation
xdp-tutorial copied to clipboard

AF_XDP based packet sending

Open Adarsh97 opened this issue 4 years ago • 3 comments

Any example program for af_xdp socket based packet sending with xdp, here packet can be raw ip packet (packet with ip and UDP header) or any other packets ?

Adarsh97 avatar Sep 02 '21 17:09 Adarsh97

Adarsh Sunilkumar @.***> writes:

Any example program for af_xdp socket based packet sending with xdp, here packet can be raw ip packet (packet with ip and UDP header) or any other packets ?

Have a look at the 'xdpsock' sample in samples/bpf in the kernel source tree...

tohojo avatar Sep 02 '21 17:09 tohojo

Thanks for suggesting that. So with af_xdp I can only send a complete packet(a packet with UDP, ip and ethernet headers) ? Anyway is there I can send ip packet, with ethernet header will be taken care by kernel or someone ?

Adarsh97 avatar Sep 02 '21 17:09 Adarsh97

Adarsh Sunilkumar @.***> writes:

Thanks for suggesting that. So with af_xdp I can only send a complete packet(a packet with UDP, ip and ethernet headers) ? Anyway is there I can send ip packet, with ethernet header will be taken care by kernel or someone ?

No, that would be one of the features provided by the stack (and thus bypassed by AF_XDP) :)

tohojo avatar Sep 02 '21 18:09 tohojo