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

Help about af_xdp, i have some confusion(eg, i should process arp protocol?) #342

Closed
xjj210130 opened this issue Jul 12, 2023 · 3 comments
Closed

Comments

@xjj210130
Copy link

Hi all:
When I was using af_xdp, I found that af_xdp transferred all the messages to umem. Is there any way to continue to hand over the three-way handshake protocol of arp and tcp to the kernel for processing.
eg : the project bpf-examples/AF_XDP-forwarding. i should process all protocol.
Thanks

@xjj210130 xjj210130 changed the title Help about af_xdp, i have some confusion Help about af_xdp, i have some confusion(eg, i should process arp protocol?) Jul 12, 2023
@maryamtahhan
Copy link

The default bpf program for AF_XDP from libxdp will transfer all packet received on a queue to an AF_XDP socket if a socket is attached to that queue.
If you want ARP and TCP handshake handled by the kernel you would need to write a custom bpf program that will either:

  1. filter the packets you want to the af_xdp socket and all other traffic to the kernel. OR
  2. filter the packets you don't want to the kernel and all other traffic to the af_xdp socket.

There's a useful project called CNDP [1] that you might find useful - particularly the cnet stack. It uses a hybrid network stack (kernel space is the control plane and userspace, via af_xdp, provides the accelerated dataplane).

There's also a quick overview of it here [2].

[1] https://github.com/CloudNativeDataPlane/cndp
[2] https://fosdem.org/2023/schedule/event/hybrid_netstack/

@xjj210130
Copy link
Author

@maryamtahhan use xdp prog and af_xdp, we can capture packet from network to user space . when i process the packet in user space , i want forward packet to other network, or other pc, how to deal with it. Of couse, we can't use socket communication。we can get the packet addr from af_xdp api , but how to forward it ? thanks.
it's the question xdp-project/bpf-examples#94

Thanks again

@maryamtahhan
Copy link

Hi @xjj210130 I've replied in xdp-project/bpf-examples#94 I hope it helps

@tohojo tohojo closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants