hjlogzw / DPDK-TCP-UDP_Protocol_Stack

Simple protocol stack based on dpdk(使用dpdk搭建协议栈)
24 stars 13 forks source link

About UDP socket API #1

Open BugDoombringer opened 2 years ago

BugDoombringer commented 2 years ago

Hello, my project is a multi-threaded model. The bottom layer of each thread uses UDP recvfrom and sendto API to send and receive data. Now I want to use DPDK to bypass the kernel. Can I replace the sendto and recvfrom API with the nrecvfrom and nsendto API in the project? Or is there a possibility to achieve my thoughts?

hjlogzw commented 2 years ago

As you can see, what this project will do is implement a simple kernel protocol stack based on DPDK, which is currently only in a prototype stage. Using nrecvfrom to replace recvfrom is of course feasible, after all, recvfrom is just a system call api, using DPDK will have to implement a set of api, which requires you to implement a set of socket related structure and the underlying implementation. For example, define a socket structure, define a connection queue, and define a skb structure and so on. I currently have simple examples in my project that you can download and read later.

BugDoombringer commented 2 years ago

I wonder how to run the example in this project. Is there any specific tutorials?

hjlogzw commented 2 years ago

First you need to install dpdk, follow the official documentation of the configuration, such as binding network card, set up large page memory and so on. Then, open the downloaded project folder, make clean; make sh run.sh

BugDoombringer commented 2 years ago

I have installed and configured the DPDK environment, but the following problems occur when “make”, it looks like a missing dynamic library, how to solve that? Thanks very much! test result