xdp-project / xdp-tutorial

XDP tutorial
2.33k stars 562 forks source link

xdp_redirect_map works for ping but not iperf #357

Open zhileiz opened 1 year ago

zhileiz commented 1 year ago

I followed Bidirectional Router and ping between left and right works:

From inside t enter --name right:

root@main:~/xdp-tutorial/packet03# ping fc00:dead:cafe:4::2
PING fc00:dead:cafe:4::2(fc00:dead:cafe:4::2) 56 data bytes
64 bytes from fc00:dead:cafe:4::2: icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from fc00:dead:cafe:4::2: icmp_seq=2 ttl=64 time=0.076 ms
64 bytes from fc00:dead:cafe:4::2: icmp_seq=3 ttl=64 time=0.155 ms
64 bytes from fc00:dead:cafe:4::2: icmp_seq=4 ttl=64 time=0.054 ms

From inside t enter --name left:

root@main:~/xdp-tutorial/packet03# ping fc00:dead:cafe:5::2
PING fc00:dead:cafe:5::2(fc00:dead:cafe:5::2) 56 data bytes
64 bytes from fc00:dead:cafe:5::2: icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from fc00:dead:cafe:5::2: icmp_seq=2 ttl=64 time=0.074 ms
64 bytes from fc00:dead:cafe:5::2: icmp_seq=3 ttl=64 time=0.067 ms
64 bytes from fc00:dead:cafe:5::2: icmp_seq=4 ttl=64 time=0.078 ms

However, I tried to run iperf3 -s in left and iperf3 -c fc00:dead:cafe:4::2 in right, the client side (right) does not have any output. tcpdump in left shows:

14:51:01.903952 IP6 fc00:dead:cafe:5::2.55894 > fc00:dead:cafe:4::2.8999: Flags [S], seq 3198610336, win 64800, options [mss 1440,sackOK,TS val 644670755 ecr 0,nop,wscale 7], length 0
14:51:02.917576 IP6 fc00:dead:cafe:5::2.55894 > fc00:dead:cafe:4::2.8999: Flags [S], seq 3198610336, win 64800, options [mss 1440,sackOK,TS val 644671769 ecr 0,nop,wscale 7], length 0                                       
14:51:04.933600 IP6 fc00:dead:cafe:5::2.55894 > fc00:dead:cafe:4::2.8999: Flags [S], seq 3198610336, win 64800, options [mss 1440,sackOK,TS val 644673785 ecr 0,nop,wscale 7], length 0                                                                                   
14:51:09.029609 IP6 fc00:dead:cafe:5::2.55894 > fc00:dead:cafe:4::2.8999: Flags [S], seq 3198610336, win 64800, options [mss 1440,sackOK,TS val 644677881 ecr 0,nop,wscale 7], length 0  

But otherwise no packet.

I am using the official solution. Do others encounter the same issue?

I also used socat in packet rewrite tutorial to verify that udp routing works.

DragosFalk commented 10 months ago

Hi @zhileiz . Facing a similar problem while using xdp. Did you figure this out ?