Home

Awesome

NPF: stateful packet filter supporting NAT, IP sets, etc

Build Status

NPF is a layer 3 packet filter, supporting stateful packet inspection, IPv6, NAT, IP sets, extensions and many more. It uses BPF as its core engine and it was designed with a focus on high performance, scalability, multi-threading and modularity. NPF was written from scratch in 2009. It is written in C99 and distributed under the 2-clause BSD license.

NPF is provided as a userspace library to be used in a bespoke application to process packets. It can run on Linux, typically, in combination with such frameworks like Data Plane Development Kit (DPDK) or netmap.

Features

NPF offers the traditional set of features provided by packet filters. Some key features are:

For a full set of features and their description, see the NPF documentation and other manual pages.

Usage

You can try NPF-Router as a demo NPF+DPDK application, running a virtual test network with Docker containers.

Documentation

See on Github Pages. Source in the docs directory.

Dependencies

Each repository provides the build files for RPM (cd pkg && make rpm) and DEB (cd pkg && make deb) packages. You can also check the Travis file for an example of how to build everything.

Source code structure

app/                - NPF-Router demo application (NPF + DPDK + Docker)
docs/               - documentation source
src/                - root source code directory
    kern/           - the kernel component (npfkern library)
    lib/            - extension libraries complementing npfctl
    libnpf/         - library to manage the NPF configuration
    npfctl/         - command line user interface to control NPF
    npftest/        - unit tests and a tool to debug NPF
pkg/                - packaging files (RPM and DEB)
misc/               - auxiliary helper scripts

Packages

To build the libnpf library (link using the -lnpf and -lnpfkern flags) packages:

Who is using NPF?

<table> <tr height="150"> <th width="150"><a href="https://en.outscale.com"><img src="https://fr.outscale.com/wp-content/uploads/2018/07/Logo_Outscale_Bleu_RGB.png" alt="Outscale" align="middle"></a></th> <th width="150"><a href="https://innofield.com"><img src="https://innofield.com/wp-content/uploads/2014/07/innofield_logo_sticky.gif" alt="innofield AG" align="middle" width="80%"></a></th> <th width="150"><a href="https://www.netbsd.org"><img src="https://www.netbsd.org/images/NetBSD.png" alt="NetBSD" align="middle" width="70%"></a></th> <th width="150"><a href="https://bisonrouter.com"><img src="https://bisonrouter.com/img/logo.d1687d60.svg" alt="BisonRouter" align="middle"></a></th> </tr> </table>