Clone this repository into your machine
If you want to solve the exercises, run the examples or simply download the content get a local copy of this repository in your machine:
git clone https://github.com/nsg-ethz/p4-learning.git
We will periodically add new content to this repository (specially documentation and new examples), so make sure to check it regularly or git pull
it from your machine.
Required Software
In order to be able to compile P4 code, run it in a software switch (bmv2) and create virtual topologies with hosts, several dependencies and open source tools need to be installed first.
Since the installation process can be a bit tedious and cumbersome we provide you with a Vagrant script that automatically builds a virtual machine with all required software already installed. You can find the VM setup instructions in the P4 Virtual Machine Installation document.
Important
Some exercises or examples will only work (due to bug fixes) if you use the same version ofbmv2
andp4c
that we provide. See the following installation script and use the samecommits
.
P4-Utils
To run the exercises and examples we use P4-Utils, an extension to Mininet to support P4 devices. It was strongly inspired by the original p4app from the p4lang repository.
If you build the VM from the vagrant script we provide or directly download the OVA package you will have P4-Utils already installed, however if you already have the required software and use your own machine/VM you can manally install it:
git clone https://github.com/nsg-ethz/p4-utils.git
cd p4-utils
sudo ./install.sh
To update you just simply run:
cd /home/p4/p4-tools/p4-utils
git pull