A Hands-on Tutorial on P4 Programmable Data Planes
Monday March 6 – Wednesday March 8, 2023
- University of South Carolina (USC)
- 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.
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: Monday, March 6
Time | Topic | Presenter |
---|---|---|
08:00 - 08:15 | Tutorial Overview | Jorge Crichigno |
08:15 - 08:45 | Motivation for Data Plane Programmability [PPT, PDF] | Jorge Crichigno |
08:45 - 08:50 | Overview of P4 Programmable Data Plane Switches (BMv2) (Part I) [PPT, PDF] | Jorge Crichigno |
08:50 - 09:00 | Break | |
09:00 - 09:30 | Lab 1: Introduction to Mininet [PPT, PDF] | Jorge Crichigno |
09:30 - 10:15 | Lab 3: P4 Program Building Blocks [PPT, PDF] | Jorge Crichigno |
10:15 - 10:25 | Break | |
10:25 - 11:10 | Parsers [PPT, PDF] | Jorge Crichigno |
11:10 - 12:00 | Lab 4: Parser Implementation [PPT, PDF] | Jorge Crichigno |
Exercise | Exercise 3 - Parsing UDP and RTP |
DAY 2: Tuesday, March 7
Time | Topic | Presenter |
---|---|---|
08:00 - 08:10 | Review Exercise 3 - Parsing UDP and RTP | Jorge Crichigno |
08:10 - 08:30 | Match-action Tables [PPT, PDF] | Jorge Crichigno |
08:30 - 09:30 | Lab 6: Match-action Tables [PPT, PDF] | Jorge Crichigno |
09:30 - 09:40 | Break | |
09:40 - 10:10 | Runtime Controller, Checksum Calculation, Deparser [PPT, PDF] | Jorge Crichigno |
10:10 - 11:00 | Lab 7: Populating and Managing Match-action Tables at Runtime [PPT, PDF] | Jorge Crichigno |
11:00 - 11:10 | Break | |
11:10 - 12:00 | Lab 8: Checksum Recalculation and Packet Deparsing [PPT, PDF] | Jorge Crichigno |
Exercise | Exercise 4 - Implementing NAT using Match-action Tables |
DAY 3: Wednesday, March 8
Time | Topic | Presenter |
---|---|---|
08:00 - 08:10 | Review Exercise 4 - Implementing NAT using Match-action Tables | Jorge Crichigno |
08:10 - 08:35 | Standard Metadata and Counters [PPT, PDF] | Jorge Crichigno |
08:35 - 09:35 | Lab 5: Monitoring the Switch's Queue using Standard Metadata [PPT, PDF] | Jorge Crichigno |
09:35 - 09:45 | Break | |
09:45 - 10:00 | Registers [PPT, PDF] | Jorge Crichigno |
10:00 - 11:00 | Lab 10: Calculating packets interarrival times using hashes and registers [PPT, PDF] | Jorge Crichigno |
11:00 - 11:45 | Lab 11: Generating Notification Messages using Digests [PPT, PDF] | Jorge Crichigno |
11:45 - 12:00 | Discussions opportunities at USC | Jorge Crichigno |
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 |