Skip to content

Build and Install BESS

Justine Sherry edited this page Feb 10, 2017 · 37 revisions

Welcome!

This page provides the step-by-step guide to install and get started with BESS! If you have any questions, feel free to email the BESS development team. We recommend you read the BESS Overview first to get a lay of the land before getting started.

Host Configuration

BESS runs best under Ubuntu 16.04 LTS with Linux kernel 4.4.0 x86_64. It's easiest to start with a fresh install of the operating system. If you're just looking to play around with BESS and get started, many developers run BESS inside of a virtual machine. A known-good configuration is running in VirtualBox with a fresh Ubuntu 16.04 install. Make sure your VM has at least two vcpus and 5GB of memory.

Clone BESS

Once you have your host configured, go ahead and clone the BESS codebase and cd to the new directory:

https://github.com/NetSys/bess.git
cd bess/

Install dependencies

BESS conveniently comes with all of its dependencies bundled in an ansible script -- all you have to do is run the script and it will set everything up. A warning: the script will aggressively replace any conflicting packages (this is why we recommend a fresh install). Here's what to run in your shell:

sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible
ansible-playbook --ask-become-pass ansible-playbook.yml
sudo reboot

Start hugepages

Every time you reboot the system, you have to set up hugepages. Note that this step is not just for installation! Every time you reboot and want to use bess, you need to run the following:

echo 16384 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 1024 | sudo tee /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages

And build!

Return to your bess/ directory (the downloaded, cloned repository) and run ./build.py. This should build BESS for you.

Start up BESS and run a sample configuration.

Assuming building BESS was successful, you should now be ready to use bessctl to start up a bessd switch and configure it. Here's what to do from your bess/ directory:

cd bessctl/
./bessctl

You will now enter a command line interface. You should see an error saying that no bess daemon is running -- here's how to start bessd:

> daemon start

You should now see a command prompt that says localhost:10514. This means that you have successfully started a bessd instance (which is currently forwarding no packets) and that your bessctl instance is communicating with bessd over a local socket. To make your bessd instance forward some packets, try running a sample script!

> run samples/acl
> monitor pipeline

run samples/acl starts up a sample configuration of modules. bessd is not connected to any network interface cards or VMs so it creates its own packets to forward using a Source module; it then forwards them through an ACL module which filters out half of the packets (those that match a blacklisted term). monitor pipeline is a quick way to see how packets are flowing in your bessd configuration -- you can always type monitor pipeline to see all of the modules and ports in the system and how many packets per second are flowing through them.

Visual display from bessctl

To experiment more with bessctl, you might try running some other configurations (run samples/ and tab will show you a list of auto-complete options to play with) or type help to get a list of available commands.

Congrats! You're running BESS!

From here, we recommend that you learn how to write your own BESS configuration scripts (so that you can choose from your own modules and connect them together how you want). Then you might choose your own adventure:

  • How to connect BESS to a network interface using DPDK
  • How to connect BESS to a virtual machine or application
  • How to write your own module code