Coder Social home page Coder Social logo

dpdk-udp-echo's Introduction

udp-dpdk-echo

UDP packet echo server implemented over DPDK. This runs on a single thread using a single port and is readily able to saturate a 10 gigabit connection, tested on a Core i9-12900KF with an Intel X570 network interface. This should work fine on other DPDK-compatible NICs.

IMPORTANT: You need to comment out line 1009 in lwip/lwip-2.1.2/src/core/ipv4/etharp.c for this to work. There is an assert which does little but is triggered whenever UDP load > one gibibit occurs. If there are complications to commenting this out, I am not aware of them.

// Comment this out
LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));

This is needed because LWIP constructs linked lists of packets to send to the network interface; but when the etharp component needs to wait to refresh the DHCP lease / perform an arp request, it inexplicably won't allow the linked list to be longer than one entry. This assert seems to be the only actual issue however - things appear to work normally at least for UDP.

Usage

Place the file on the target machine (can use ./install.sh script to do this) and run using the command

sudo LD_LIBRARY_PATH=./dpdk/dpdk-stable-22.11.1/install/lib/x86_64-linux-gnu ./udpecho-l 0-1 --proc-type=primary --file-prefix=pmd1

... making sure to include the appropriate directory for a DPDK installation matching the one used to build the program. You need to set up DPDK and attach the vfio-pci driver to your target network device!. Follow the DPDK Linux Quick-start guide for help on this.

If you want to run this on your local machine, ignore the moving instructions and just run the command :)

Bugs

This program does not work as you might expect. It's not entirely clear why, but running DPDK in the same address space as LWIP appears to cause constant and frustrating issues. Please be warned that if you use my code as a reference, many design decisions are simply avoiding the issues that would appear noramlly as opposed to being best practice.

** Do not trust the LWIP documentation if you want to extend this! **

dpdk-udp-echo's People

Contributors

omeh-a avatar junmingzhao42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.