sibanez12 6c82b6fbe7 Updates to basic_tunnel and basic (#78)
* Adding initial implementation of basic_encap example

* Updated basic_encap example to count the number of valid packets

* Updated basic_encap example to put encapsulation layer after Ethernet
header.

* Added solution file for basic_encap example

* Changed the name of the basic_encap example to basic_tunnel and called
the new header myTunnel. Also changed the myTunnel field names slightly.

* Updated the README file for the basic_tunnel exercise. Also added topo.pdf
image to serve as a reference during implementation.

* Updated basic/README.md to point to basic_tunnel as the next exercise.

* Updated the README for basic to point to basic_tunnel.

Updated the starter code for basic_tunnel to look like basic
solution with todo comments.

Updated send.py and receive.py to be able to send both plain IP
packets and tunneled IP packets.

Updated basic_tunnel.p4 to have same control flow as p4runtime
exercise.
2017-11-03 21:03:06 -07:00
..
2017-11-03 20:39:37 -07:00
2017-11-03 20:35:00 -07:00

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:

  1. Introduction
  1. Monitoring and Debugging
  1. Advanced Data Structures
  1. 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 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 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 install mininet. On Ubuntu, it would look like this:
$ sudo apt-get install mininet