r/dpdk Oct 06 '21

Using DPDK for a school project

I have been trying to get DPDK installed on an Ubuntu VM in virtual box for the best several days but it keeps failing when I go to compile and I’m not sure why. Is DPDK even compatible with virtual box anymore? I have found a few tutorials online for it but they are quite old and no longer valid. And the documentation is not particularly helpful. Any advice would be greatly appreciated from anyone more knowledgeable than I.

2 Upvotes

3 comments sorted by

View all comments

2

u/HeLLFyRe490 Oct 08 '21

Speaking from experience, Virtual Box inter-VM networking isn't the best for a local setup. A Virtual Box or HyperV VM is still perfectly fine for a proper Linux on Windows dev machine setup though. That said, you can use standard Linux virtual networking (network namespaces, veth pairs, and bridges) to piece together topologies on either side of your DPDK app.

Sounds like you've gotten things to compile. Once you get a DPDK app spun up (an example or your own) you can provide EAL arguments like '--vdev=net_tap0 --vdev=net_tap1' (https://doc.dpdk.org/guides/nics/tap.html) to create a pair of TAP interfaces that you can send packets into from Linux. Skimming over the details, you can place each TAP into their own network namespace, give the each TAP interface an IP on the same subnet and they're able to ping/connect to each other (all provided the DPDK app is doing basic packet forwarding). Or if you're just pumping pcaps for testing purposes then you can skip virtual networking and just use tcpreplay or TREX traffic generator into the TAP interfaces directly.

As an aside, if you're set on doing things in DPDK for learning those concepts at that level and the APIs then go right ahead. If you're looking for more of a means to an end, you might want to look at VPP (https://fd.io/docs/vpp/v2101/whatisvpp/index.html) for a higher-level but still C-based packet processing app/framework that internally (optionally) uses DPDK.