Progressive VPP Tutorial

Overview

Learn to run FD.io VPP on a single Ubuntu 16.04 VM using Vagrant with this walkthrough covering basic FD.io VPP senarios. Useful FD.io VPP commands will be used, and will discuss basic operations, and the state of a running FD.io VPP on a system.

Note

This is not intended to be a ‘How to Run in a Production Environment’ set of instructions.

Setting up your environment

All of these exercises are designed to be performed on an Ubuntu 16.04 (Xenial) box.

  • If you have an Ubuntu 16.04 box on which you have sudo or root access, you can feel free to use that.
  • If you do not, a Vagrantfile is provided to setup a basic Ubuntu 16.04 box for you in the the steps below.

Running Vagrant

FD.io VPP runs in userspace. In a production environment you will often run it with DPDK to connect to real NICs or vhost to connect to VMs. In those circumstances you usually run a single instance of FD.io VPP.

For purposes of this tutorial, it is going to be extremely useful to run multiple instances of vpp, and connect them to each other to form a topology. Fortunately, FD.io VPP supports this.

When running multiple FD.io VPP instances, each instance needs to have specified a ‘name’ or ‘prefix’. In the example below, the ‘name’ or ‘prefix’ is “vpp1”. Note that only one instance can use the dpdk plugin, since this plugin is trying to acquire a lock on a file.

The DPDK Plugin will be disabled for this section. The link below demonstrates how this is done.

Start a FD.io VPP shell using vppctl

The command $ sudo vppctl will launch a FD.io VPP shell with which you can run multiple FD.io VPP commands interactively by running:

$ sudo vppctl
   _______    _        _   _____  ___
__/ __/ _ \  (_)__    | | / / _ \/ _ \
_/ _// // / / / _ \   | |/ / ___/ ___/
/_/ /____(_)_/\___/   |___/_/  /_/
vpp# show ver
vpp v18.07-release built by root on c469eba2a593 at Mon Jul 30 23:27:03 UTC 2018

Create an Interface

Skills to be Learned

  1. Create a veth interface in Linux host
  2. Assign an IP address to one end of the veth interface in the Linux host
  3. Create a vpp host-interface that connected to one end of a veth interface via AF_PACKET
  4. Add an ip address to a vpp interface

Traces

Routing

Skills to be Learned

In this exercise you will learn these new skills:

  1. Add route to Linux Host routing table
  2. Add route to FD.io VPP routing table

And revisit the old ones:

  1. Examine FD.io VPP routing table
  2. Enable trace on vpp1 and vpp2
  3. ping from host to FD.io VPP
  4. Examine and clear trace on vpp1 and vpp2
  5. ping from FD.io VPP to host
  6. Examine and clear trace on vpp1 and vpp2

Connecting Two FD.io VPP Instances

memif is a very high performance, direct memory interface type which can be used between FD.io VPP instances to form a topology. It uses a file socket for a control channel to set up that shared memory.

Skills to be Learned

You will learn the following new skill in this exercise:

  1. Create a memif interface between two FD.io VPP instances

You should be able to perform this exercise with the following skills learned in previous exercises:

  1. Run a second FD.io VPP instance
  2. Add an ip address to a FD.io VPP interface
  3. Ping from FD.io VPP