P4 (Programming Protocol-independent Packet Processors)
๐ก The Core Idea
P4 is a language that allows the controller to redefine how a switch parses and processes packets. Unlike OpenFlow, which relies on fixed tables and protocols, P4 makes the hardware Protocol Independent.
๐ง Key Goals
- Reconfigurability: The controller can change how the switch parses packets (e.g., defining a new header type on the fly).
- Protocol Independence: The switch isnโt hardcoded for IP or Ethernet. The controller defines the format.
- Target Independence: The same P4 program can be compiled to run on different hardware (ASIC, FPGA, Software Switch).
โ๏ธ Workflow
- Configure: Program the parser to recognize specific headers.
- Populate: Add entries to the Match+Action tables to define policies.