A Hands-on Tutorial on P4 Programmable Data Planes

uofsc_logo NSF Logo

 

 

A Hands-on Tutorial on P4 Programmable Data Planes

Tuesday April 25 – Thursday April 27, 2023

 
Organizers
  • University of South Carolina (USC)
Venue
  • Online Workshop - NETLAB+
  •  

Overview

This tutorial provides Information Technology (IT) professionals with hands-on exercises on P4 programmable data plane switches, covering from introductory to advanced topics. Programmable data plane switches have recently emerged, attracting significant attention from the industry and the academia. They permit operators and programmers in general to run customized packet processing functions in the data plane at terabit rates, thus paving the way for an unprecedented wave of innovation and experimentation by reducing the time of designing, testing, and adopting new protocols; enabling a customized, top-down approach to develop network applications; providing granular visibility of packet events defined by the programmer; reducing complexity and enhancing resource utilization of the programmable switches; and drastically improving the performance of applications that are offloaded to the data plane. This tutorial will permit each attendee to execute virtual laboratory experiments, covering a wide range of features and topics related to P4 programmable switches, from introductory to advanced levels.

intro_p4

 

Outcomes

By the end of this tutorial, attendees will:

 
P4 Programmable Data Plane Switches (Part I):
  • Describe the elements of the Protocol Independent Switch Architecture (PISA)
  • Define protocol headers and header fields in P4
  • Write simple parsers using P4
  • Define match-action tables
  • Populate and manage match-action tables at runtime
  • Verify and update checksums
P4 Programmable Data Plane Switches (Part II):
  • Define and process custom headers
  • Inspect and use the standard metadata provided by the switch
  • Create and parse header stacks
  • Count flow statistics
  • Store arbitrary data using registers
  • Notify the control plane using digests

 

Intended Audience

The tutorial is targeted to IT educators and professionals such as system administrators, network engineers, practitioners. The content is suitable for instructors who want to incorporate advanced material into their networking classes. The content is available for NETLAB systems.
 

Pre-requisites

The laboratory environment consists of routers, switches, and hosts deployed in IPv4 networks. Attendees are expected to know basic networking (IPv4, local area networks, OSI model). Training activities will be conducted using NetLab. Attendees will be provided with a username and a password.

 

Agenda

DAY 1: Tuesday, April 25
Time Topic Presenter
09:00 - 09:15 Tutorial Overview Jorge Crichigno, Miguel Figueroa, Christian Vega
09:15 - 09:45 Motivation for Data Plane Programmability [PPT, PDF] Jorge Crichigno
09:45 - 09:50 Overview of P4 Programmable Data Plane Switches (BMv2) (Part I) [PPT, PDF] Jorge Crichigno
09:50 - 10:35 Lab 3: P4 Program Building Blocks [PPT, PDF] and Mininet [PPT, PDF] Jorge Crichigno, Christian Vega
10:35 - 10:45 Break  
10:45 - 11:00 Parsers [PPT, PDF] Jorge Crichigno
11:00 - 11:45 Lab 4: Parser Implementation [PPT, PDF] Jorge Crichigno, Christian Vega
11:45 - 12:00 Homework: Exercise 3 - Parsing UDP and RTP. Review of the Day Jorge Crichigno, Miguel Figueroa, Christian Vega
 
DAY 2: Wednesday, April 26
Time Topic Presenter
03:00 - 03:10 Review Exercise 3 - Parsing UDP and RTP Jorge Crichigno, Christian Vega
03:10 - 03:30 Match-action Tables [PPT, PDF] Jorge Crichigno
03:30 - 04:20 Lab 6: Match-action Tables [PPT, PDF] Jorge Crichigno, Christian Vega
04:20 - 04:30 Break  
04:30 - 04:50 Runtime Controller, Checksum Calculation, Deparser [PPT, PDF] Jorge Crichigno
04:50 - 05:40 Lab 7: Populating and Managing Match-action Tables at Runtime [PPT, PDF] Jorge Crichigno, Christian Vega
05:40 - 06:00 Homework: Exercise 4 - Implementing NAT and Lab 8 [PPT, PDF] Jorge Crichigno, Miguel Figueroa, Christian Vega
 
DAY 3: Thursday, April 27
Time Topic Presenter
03:00 - 03:10 Review Exercise 4 - Implementing NAT using Match-action Tables Jorge Crichigno, Christian Vega
03:10 - 03:30 Standard Metadata and Counters [PPT, PDF] Jorge Crichigno
03:30 - 04:20 Lab 5: Monitoring the Switch's Queue using Standard Metadata [PPT, PDF] Jorge Crichigno, Christian Vega
04:20 - 04:30 Break  
04:30 - 04:45 Registers [PPT, PDF] Jorge Crichigno
04:45 - 05:40 Lab 10: Calculating packets interarrival times using hashes and registers [PPT, PDF] Jorge Crichigno, Christian Vega
05:40 - 06:00 Discussions opportunities USC - U Concepcion Jorge Crichigno, Miguel Figueroa

 

 

Resources

Item Note
VM for P4 Programmable Data Plane Switches (BMv2) Labs Link Virtual Machine for the P4 Programmable Data Plane Switches (BMv2) lab series
VM for P4 Programmable Data Planes: Applications, Stateful Elements, and Custom Packet Processing Labs Link Virtual Machine for the P4 Programmable Data Planes: Applications, Stateful Elements, and Custom Packet Processing lab series
P4 Cheat Sheet: Link P4 language cheat sheet
BMv2 Docker Containers: Link DockerHub link for the BMv2 containers
Cybertraining Material: Link List of virtual labs on P4, SDN, network tools and protocols, ...
P4 Campus: Link P4 applications for campus networks
FABRIC: Link A programmable research infrastructure
Behavioral Model version 2 (BMv2): Link Reference P4 software switch used as a tool for developing, testing and debugging P4 data planes
Software-Defined Networks: A Systems Approach: Link A book that explores the key principles of Software-Defined Networking (SDN)
Mininet: Link Virtual testbed enabling the development and testing of network tools and protocols
Containernet: Link Mininet fork that allows to use Docker containers as hosts in emulated networks
Mininet Installation: Link A guide that describes the steps to install Mininet on Linux
Wireshark: Link Packet analyzer used for network troubleshooting, analysis, protocol development, and education