A Service Function Development Framework
Goal: to provide a framework to implement an NSH-capable service function.
Currently this has been tested on Ubuntu
$ uname -rv 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016
To build, you may need to install:
- make
- g++
After cloning the project,
$ cd nsh-sf-devkit
$ make
Generated object files are found in obj
folders beneath the code.
Libraries are found in lib
.
Executables are found in bin
folders beneath the application code.
Unless otherwise specified, this code compiles to use only the AF_PACKET mechanism. It may optionally be compiled to support DPDK.
To use DPDK, you need to have it compiled and installed as a shared library in the system lib path.
Please refer to README_DPDK.md for details.
Note: DPDK 2.2, which is shipped with Ubuntu, does not play nicely with virtio and recent versions of qemu. If you do not unbind/rebind a virtio nic prior to starting an application, you risk having qemu kill your guest.
These examples use the library:
- health_echo - simply echo back health-check OAM packets.
- count - simply forward all packets, and count the packets and bytes. Uses the OAM Demux.
Code is compiled with gcc options -Wall -std=c++14
.
To give a program permission to use RAW or PACKET sockets without having super-user
privilege, give capabilities to the executable: sudo setcap cap_net_raw=pe <executable>
.