Giter Site home page Giter Site logo

Abstract

LuaJIT + DPDK = fast and flexible packet processing at speeds above 100 Gbit/s.

Read and try out one of the examples to get started.

libmoon started out as the packet generator MoonGen which evolved into a more general framework for packet processing. You can read our IMC 2015 Research Paper (BibTeX) for a discussion of our architecture which remained unchanged in libmoon. Please use this paper as a canonical reference to libmoon if you are writing a paper or thesis.

The libmoon Framework

libmoon is a high-speed framework to develop DPDK applications in Lua and C/C++. Its main goal is to simplify the initial creation of new DPDK applications by providing a concise and solid framework to build upon. The core is a Lua wrapper for DPDK that simplifies operations that are typically extremely verbose in DPDK, e.g., device initialization. libmoon also simplifies protocol implementations and tests by providing an extensible packet header processing and parsing library.

Explicit multi-core support is at the heart of libmoon. Scripts define a master task that is executed on startup. This task configures devices and queues and then starts one or more slave tasks that then handle packet IO.

Note that Lua does not have any native support for multi-threading. libmoon therefore starts a new and completely independent LuaJIT VM for each task. Tasks can only share state through communication primitives provided by libmoon. The example script inter-task-communication.lua showcases the available communication methods.

Further Examples and Applications Built on libmoon

The MoonGen packet generator features user scripts that are essentially small libmoon applications. Hence, MoonGen's examples may be useful.

FlowScope is a traffic analysis tool using libmoon. It's a good example on integration libmoon with custom C++ code.

Installation

Just run build.sh, bind-interfaces.sh, and setup-hugetlbfs.sh. When using Mellanox NICs additional steps are neccessary.

# install dependencies and compile libmoon
sudo apt-get install git build-essential cmake linux-headers-`uname -r` lshw libnuma-dev
git clone https://github.com/libmoon/libmoon
cd libmoon
./build.sh
# bind all NICs that are not actively used (no IP configured) to DPDK
sudo ./bind-interfaces.sh
# configure hugetlbfs
sudo ./setup-hugetlbfs.sh
# run the hello-world example
sudo ./build/libmoon examples/hello-world.lua

Note: Use deps/dpdk/tools/dpdk-devbind.py to manage NIC drivers manually to get them back into the OS.

Dependencies

  • gcc >= 4.8
  • make
  • cmake
  • kernel headers (for the DPDK igb-uio driver)
  • lspci (for dpdk-devbind.py)
  • libnuma-dev

FAQ

Which NICs do you support?

libmoon supports all NICs supported by DPDK. Note that some NICs (e.g., Mellanox) require external components to work with DPDK. Refer to the DPDK documentation for further information. We test and develop libmoon on various NICs of the ixgbe, i40e, and igb family.

Why should I use this instead of DPDK directly?

It's easier to get started. Seriously, have you tried reading one of the DPDK examples?

Why should I use this instead of Snabb?

Snabb has a completely different approach. They build their own drivers and generally do not rely on hardware capabilities (e.g., filtering and offloading). libmoon is just a wrapper for DPDK and heavily uses hardware-specific features.

libmoon's Projects

libmoon icon libmoon

libmoon is a library for fast and flexible packet processing with DPDK and LuaJIT.

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.