Welcome to the P4TC tutorial! This repository will help you get started with the P4TC project.
Before you start, install required software. Also, you may want to visit p4tc.dev to learn more about the P4TC project.
Before you start, you have to build your own virtual machine, where you will run P4TC exercises.
First, install Vagrant and VirtualBox on your OS.
You also need to install the following Vagrant plugin:
vagrant plugin install vagrant-disksize
vagrant plugin install vagrant-reload
vagrant plugin install vagrant-scp
There is currently one flavor of the VM.
In the future we will support additional flavors.
The "examples" flavor will download and install every part of the p4tc infrastructure that is compiled as a .deb file and compile and install libbpf and iproute2. The examples flavor is the default. The "examples" flavor is intended for people interested in running p4tc examples. The p4c compiler is not available in this flavor.
To use the "examples" flavor, clone this repository and bootstrap the VM. The "examples" flavor should take about 10-20 minutes to setup.
git clone https://github.com/p4tc-dev/p4tc-tutorial-pub.git
cd p4tc-tutorial/vm
vagrant up
All flavors will install all the required software per flavor along with downloading this repository to the VM under /home/p4tc/p4tc-tutorial-pub
.
At the end of script's execution, the VM will be rebooted to apply the new configuration. You might need to wait a few minutes before you will be able to log in to the VM. Once the VM is ready, you can SSH to it with:
ssh -p 2222 vagrant@127.0.0.1
# password: p4tc
or simply if you are already in the directory vm
:
vagrant ssh `flavor`
e.g.:
vagrant ssh examples
You can also use VirtualBox GUI to access VM.