ns3 with dpdk and several NIC/ethernet-ports

88 views
Skip to first unread message

Johnny

unread,
Jan 29, 2021, 7:14:00 AM1/29/21
to ns-3-users
Hi,
I want to use ns3 with dpdk support and connect to two NICs, but I keep getting errors because I can't initialize eal twice. https://www.nsnam.org/docs/models/html-old/dpdk-net-device.html mentions that it is possible to extend the functionality to work with several NICs. Right now I'm using ns-3.33 and the DpdkNetDeviceHelper to install the dpdk device to a node. 

Does anyone knows how to extend ns3 to work for two NIC with dpdk?
Any help would be highly appreciated!

Harsh Patel

unread,
Feb 1, 2021, 2:26:06 AM2/1/21
to ns-3-users

Hi Johnny,

Sorry for the late reply.

Yes, the current implementation of DPDK NetDevice lacks ability to work with more than one NICs. This functionality required us to make several design changes which we are still working on.

But in order to unblock you, we have a working code for two NICs in multiple-nics branch of our Gitlab repo. We only have made changes to the Ping example to use two NICs, but same changes can be done to the On-off example. Although this does not have clean code and design, it might help you in doing your simulations.

We'll be happy to help if you have any doubts with the code.

Thanks and Regards
Harsh

Johnny Molander

unread,
Feb 1, 2021, 2:45:52 AM2/1/21
to ns-3-...@googlegroups.com
Thank you very much! This is exactly what I was hoping for!
I will take a look and see if I can make it run. Right away I see you are using SetDpdkMode in EmuFdNetDevieHelper. 
I can't find this function in ns3.33. Do you know if it has been taken over by DpdkNetDeviceHelper?

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/LR2btHYqkJ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/f304c062-9101-47f8-85a5-6cfb3b6016b0n%40googlegroups.com.

Hrishikesh Hiraskar

unread,
Feb 1, 2021, 3:13:56 AM2/1/21
to ns-3-users
Hi Johnny


> I can't find this function in ns3.33. Do you know if it has been taken over by DpdkNetDeviceHelper?

Yes, this is correct. The branch is based on a slightly old code.

Regards
Hrishi

Johnny Molander

unread,
Feb 1, 2021, 3:16:58 AM2/1/21
to ns-3-...@googlegroups.com
Thank you!
I think this will help me understand the relationship between dpdk and ns3 much better

Johnny

Johnny

unread,
Feb 26, 2021, 6:39:54 AM2/26/21
to ns-3-users

Hi,
I'm getting a lot of packets out-of-order using iperf with the two-nic implementation. Do you know why this might happen or where it could be smart to investigate? I have tried to set the tx and rx buffer to 1 and also to set the tx timeout to 1 nanoseconds. 

After investigating the pcap from the NS-3 simulation it seems like the packets are in order inside the simulation, but it's the transmission out that screws up the order. I'm suspecting it has something to do about how ns-3 uses the write function inside dpdk-net-device.cc, but I don't have a clue on where to start looking or if my assumption is correct.  Do you have any Idea?

ps: I'm using ns-3.33 and have used your code from gitLab to modify it for several NICs :)

Best regards,
Johnny Molander
Reply all
Reply to author
Forward
0 new messages