* Created p4runtime exercise directory with draft P4 program * Updating VM - Adding p4 to vboxsf group for VirtualBox Shared Folders - Adding gRPC Python package for p4 runtime - Setting up VM to use 2 CPUs * Updating .gitignore for PyCharms and Mac OS * Adding P4RuntimeSwitch type and support in run_exercises If the grpc switch target is used, we will instantiate a P4RuntimeSwitch. Ideally, this will get merged with BMv2's P4Switch and can be removed * Adding p4 runtime and p4info browser libraries Also, adding a Makefile for this project
P4 Tutorial
Introduction
Welcome to the P4 Tutorial!
We've prepared a set of exercises to help you get started with P4 programming, organized into four modules:
- Introduction
- Monitoring and Debugging
- Advanced Data Structures
- Dynamic Behavior
Obtaining required software
If you are starting this tutorial at SIGCOMM 2017, then we've already provided you with a virtual machine that has all of the required software installed.
Otherwise, to complete the exercises, you will need to either build a virtual machine or install several dependencies.
To build the virtual machine:
- Install Vagrant and VirtualBox
cd vm
vagrant up
- Log in with username
p4
and passwordp4
and issue the commandsudo shutdown -r now
- When the machine reboots, you should have a graphical desktop machine with the required software pre-installed.
To install dependences by hand:
git clone https://github.com/p4lang/behavioral-model.git
git clone https://github.com/p4lang/p4c
git clone https://github.com/p4lang/tutorials
Then follow the instructions for how to build each package. Each of these repositories come with dependencies, which can be installed using the supplied instructions. The first repository (behavioral-model) contains the P4 behavioral model. It is a C++ software switch that will implement the functionality specified in your P4 program. The second repository (p4c) is the compiler for the behavioral model. It takes P4 program and produces a JSON file which can be loaded by the behavioral model. The third repository (tutorial) is the P4 Tutorial itself. You will also need to installmininet
. On Ubuntu, it would look like this:
$ sudo apt-get install mininet