ansyun / dpdk-ans

ANS(Accelerated Network Stack) on DPDK, DPDK native TCP/IP stack.
https://ansyun.com
BSD 3-Clause "New" or "Revised" License
1.15k stars 322 forks source link

Can not ping to IP address in VM #92

Closed sachithmuhandiram closed 5 years ago

sachithmuhandiram commented 5 years ago

I have dpdk-ans running in my VirtualBox - Centos-7 environment.

I can run everything without error

I ran -> ./build/ans -c 0x2 -n 1 -- -p 0x1 --config="(0,0,1)"

Checking link status ...............done
Port 0 Link Up - speed 1000 Mbps - full-duplex
USER8: main loop on lcore 1
USER8:  -- lcoreid=1 portid=0 rxqueueid=0

Opened another one and ran ./build/anscli inside dpdk-ans/ans

ip addr show

 veth0: mtu 1500 
   link/ether 08:00:27:0c:45:ab
   inet addr: 10.0.0.2/24

But I can not ping to 10.0.0.2 from VM or my host PC. I have changed the IP but no luck.

I would like to join dpdk-ans Slack community. Please let me know how to join.

bluenet13 commented 5 years ago

You may do such test:

sachithmuhandiram commented 5 years ago

I have tested this dpdk example. It works. Only this example gets failed.

bluenet13 commented 5 years ago
  1. Check the arp table by anscli"ip neigh show", and check the stat of the nic by anscli "ip link show".
  2. Print all rx packets in ans_main.c and check it.
sachithmuhandiram commented 5 years ago

ip neigh show

ans> ip neigh show

ANS IP neigh table

ip link show

 veth0: port 0 state DOWN mtu 1500 
   link/ether 00:1b:21:c0:51:b8
   IPV4 checksum offload enable 
   UDP checksum offload enable 
   TCP checksum offload enable 
   TCP TSO offload enable 
   Max allowed number of segments: 255 
   RX packets:0 errors:0 dropped:0
   TX packets:0 errors:0 dropped:0
bluenet13 commented 5 years ago

Something wrong with your nic.
The port is down.

sachithmuhandiram commented 5 years ago

In my network card, port as a different name other than veth0. But i have set hugepages and bind network card in dpdk module.

sachithmuhandiram commented 5 years ago

I have fixed Port down issue. But still it does not bind an IP for that.

Checking link status ...............done
Port 0 Link Up - speed 1000 Mbps - full-duplex
USER8: main loop on lcore 1
USER8:  -- lcoreid=1 portid=0 rxqueueid=0

IP assigning

ans> ip addr show

 veth0: mtu 1500 
   link/ether 08:00:27:0c:45:ab
   inet addr: 10.0.0.2/24
ans> ip add del 10.0.0.2/24 dev veth0
Bad arguments
ans> ip addr del 10.0.0.2/24 dev veth0
Del IP address successfully 
ans> ip addr del 192.168.20.10/24 dev veth0
Del IP address failed,  error code 17 
ans> ip addr add 192.168.20.10/24 dev veth0
Add IP address successfully 
ans> 
ans> ip addr show 

 veth0: mtu 1500 
   link/ether 08:00:27:0c:45:ab
   inet addr: 192.168.20.10/24

But I still can not ping to it even inside the VM.

bluenet13 commented 5 years ago

ans is userspace tcp/ip stack, you can't ping to it from linux kernel inside the VM, you shall ping to it from another vm.

sachithmuhandiram commented 5 years ago

Yes, VM to VM ping was working fine. Thanks for the support.

JorheMartinez commented 4 years ago

Good morning Sachith, I have been facing what I think is a similiar issue to yours. I know the issue is closed, but maybe you can provide me some help. I have 2 interfaces, one is NATted and the other one is for dpdk binding purposes. Within my Ubuntu 16.04 I have isntalled dpdk and dpdk-ans, and run it with: ./ans -c 0x4 -n 1 --base-virtaddr=0x2aaa2aa0000 -- -p 0x1 --config="(0,0,2)" --enable-kni --enable-ipsync

I cannot ping 10.0.0.2 from other VM. Do you know what can be happening or would it be bigger issue to you to explain me how to get connection from one VM with DPDK-ANS to another VM? Thank you very much in advance

bluenet13 commented 4 years ago

You may try the command "./ans -c 0x4 -n 1 --base-virtaddr=0x2aaa2aa0000 -- -p 0x1 --config="(0,0,2)""

JorheMartinez commented 4 years ago

Good evening. Thank you for your answer. Without ipsync I am also unable to ping the dpdk-ans stack. This is my configuration: VM1(DPDK-ANS): Interface NAT: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:8c:c9:bf brd ff:ff:ff:ff:ff:ff inet 192.168.153.148/24 brd 192.168.153.255 scope global dynamic ens33 valid_lft 1564sec preferred_lft 1564sec inet6 fe80::b286:4947:3db5:fdfe/64 scope link valid_lft forever preferred_lft forever

DPDK-ANS conf: ans> ip addr show

veth0: mtu 1500 link/ether 00:0c:29:8c:c9:c9 inet addr: 10.0.0.2/24 ans> ip route show

ANS IP routing table 10.0.0.0/24 via dev veth0 src 10.0.0.2 10.10.0.0/24 via 10.0.0.5 dev veth0

From another VM in the same network (i can ping the NAT interface), i cannot ping 10.0.0.2. Could you please make me a short explanation about how to do it? I cannot find anything on the userguide.

Thank you very much in advance.

xiaxiaobugs commented 3 years ago

Thanks for your talks! It is helpful!