Search code examples
c++boostasiodpdk

How to integrate Boost::ASIO with userland network stack?


Is there a way to integrate Boost::ASIO with a userland network stack such as F-stack or DPDK?

I am looking for a way of getting the performance benefits of the userland stacks, but maintaining the API for Boost::ASIO to be able to use all of the libraries, etc. that are written with it.


Solution

  • Basically, if no such wrapper already exists you will have to implement the low-level interfaces and sockets, I. e. those which abstract the TCP and UDP details using the boost::asio sockets (basically inside the IO-service).

    I don't know the library you want to use. So, this might be quite some effort.

    Have a look at the boost::asio basic_datagram socket, resolver, endpoint and service. You will need to translate at least the important part (performance) like send and receive. You could access the native handle of the socket through boost if you library has an interface to send and receive via that handle you might just need override all send and receive functions resp. just handle sending/receiving externally.