Skip to content

youf3/tutorials

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 several modules:

  1. Introduction and Language Basics
  1. P4Runtime and the Control Plane
  1. Monitoring and Debugging
  1. Advanced Behavior

Presentation

The slides are available online and in the P4_tutorial.pdf in the tutorial directory.

Obtaining required software

If you are starting this tutorial at the Spring 2018 P4 Developer Day, 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 password p4 and issue the command sudo shutdown -r now
  • When the machine reboots, you should have a graphical desktop machine with the required software pre-installed.

To install dependencies by hand, please reference the vm installation scripts. They contain the dependencies, versions, and installation procedure. You can run them directly on an Ubuntu 16.04 machine:

  • sudo ./root-bootstrap.sh
  • sudo ./user-bootstrap.sh

Docker

To build your docker image:

  • cd docker
  • make your changes
  • docker build -t <image-name>:<tag-name> .
  • docker run --privileged -t -i --rm <image-name>:<tag-name> bash

To pull from an existing docker image:

  • docker pull wangfx95/p4tutorial-rc3
  • docker run --privileged -t -i --rm wangfx95/p4tutorial-brc3 bash

About

P4 language tutorials

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 49.8%
  • P4 31.7%
  • Shell 9.0%
  • Emacs Lisp 5.2%
  • Vim Script 3.1%
  • Makefile 0.8%
  • Other 0.4%