Introduction to P4 Programmable Data Planes

UofSC and NSF

The development of this lab series was supported with funding from the National Science Foundation Award 1829698 “CyberTraining CIP: Cyberinfrastructure Expertise on High-throughput Networks for Big Science Data Transfers” at the University of South Carolina (UofSC). The labs provide hands-on training in the technologies used to build and configure high-speed networks.


This lab series introduces programmable data plane switches and their role in the Software-defined Networking (SDN) paradigm. The labs provide a hands-on introduction to the Programming Protocol-independent Packet Processors (P4), the de facto programming language used to describe the behavior of the data planes of programmable switches. The labs are supported using the Introduction to P4 Programmable Data Planes Pod.

Supported Labs

Lab Title
1 Introduction to Mininet
Exercise 1 Building a Basic Topology
2 Introduction to P4 and BMv2
Exercise 2 Compiling and Running a P4 Program
3 P4 Program Building Blocks
4 Parser Implementation
Exercise 3 Parsing UDP and RTP
5 Introduction to Match-action Tables (Part 1)
6 Introduction to Match-action Tables (Part 2)
Exercise 4 Implementing NAT using Match-action Tables
7 Populating and Managing Match-action Tables at Runtime
Exercise 5 Configuring Match-action Tables at Runtime
8 Checksum Recalculation and Packet Deparsing
Exercise 6 Building a Packet Reflector
Enabling the Labs

To enable the Introduction to P4 Programmable Data Planes labs, install the Introduction to P4 Programmable Data Planes v1.0 course using the Course Manager. See the Course Manager section of the NETLAB+ VE Admin Guide for details. The course content will then be available to be added to classes.