NetBricks can be built either using a Rust nightly build or using Rust built from the current Git head. In the later
case we also build
musl and statically link to things. Below we provide basic instructions for both.
Finally, in addition to the above options, NetBricks can also be built within a Docker container. In this case, you do not need to install any of the dependencies, and the final product can be run the same. However to run NetBricks you still need to be on a machine that is correctly configured to run DPDK (see here for more details), and you still need to install Rust nightly (for libraries). Please see the container build instructions for more information.
Using Rust Nightly
First obtain Rust nightly. I use rustup, in which case the following works
curl https://sh.rustup.rs -sSf | sh # Install rustup source $HOME/.cargo/env rustup install nightly rustup default nightly
Then clone this repository and run
This should download DPDK, and build all of NetBricks.
Using Rust from Git
The instructions for doing so are simple, however building takes significantly longer in this case (and consumes tons of memory), so do this only if you have lots of time and memory. Building is as simple as
export RUST_STATIC=1 ./build.sh
Building NetBricks requires the following dependency packages (on Debian):
apt-get install libgnutls30 libgnutls-openssl-dev libcurl4-gnutls-dev libnuma-dev libpcap-dev
NetBricks also supports using SCTP as a control protocol. SCTP support requires the use of
libsctp (this is an
optional dependency) which can be installed on Debian using:
apt-get install libsctp-dev
Changing some Linux parameters, including disabling C-State, and P-State; and isolating CPUs can greatly benefit NF performance. In addition to these boot-time settings, runtime settings (e.g., disabling uncore frequency scaling and setting the appropriate flags for Linux power management QoS) can greatly improve performance. The energy.sh in scripts/tuning will set these parameter appropriately, and it is recommended you run this before running the system.
You must have Docker installed. Once this is done, just run
This will build and copy the binaries over to the
target subdirectory. As noted above, you can run it if you have a
DPDK compatible machine.
This repository includes a set of example NFs under the
test directory. A complete list of example can be found by
The build script can be used to run these examples as
./build.sh run <example name> <options>
-h will provide a list of options. All of these examples accept one or more ports as input. Ports can be
specified as one of:
- PCI ID of a NIC
dpdk:<PMD spec>where PMD spec can be something like
dpdk:eth_pcap0,rx_pcap=$HOME/tcpflow/tests/udp.pcap,tx_pcap=out.pcapwhich specifies a PCAP file should be used. See DPDK source for other PMD drivers that are available.
ovs:<integer>to connect to an OpenVSwitch DPDK ring port (
bess:<port name>to connect to a BESS
futures for control plane functionality.