Awesome Open Source
Awesome Open Source

moonpol

moonpol is a traffic policer prototype on libmoon library. libmoon has high packet processing performance by bringing DPDK and LuaJIT together. Using this library, moonpol implements a token bucket algorithm for rate limiting and DIR-24-8-BASIC data structure for faster lookup.

Supported Hardware

Any DPDK supported NIC can utilize moonpol. In order to test the usability of your hardware before starting the policer, 'hello-world' example of libmoon library can be tried first.

Installation & Running

moonpol is nothing but a libmoon script. Therefore, it is strongly recommended to take a look at the readme of libmoon first. A configuration file is needed to run the policer. It is a list of subnets and rate limits in terms of packets per second (pps). Two example configurations (config and config_ru) made available in the repository.

# 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
git clone https://github.com/erkinkirdan/moonpol
mv moonpol/policer.lua moonpol/config 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 policer
sudo ./build/libmoon policer.lua

Helpers

generator.lua can be used for load generator under libmoon.

configgen.cpp is a small program for generating configuration files for benchmarking.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Lua (42,057
Related Projects