P4: Programming Independent Packet Processors

Pat Bosshart, Dan Daly, Glen Gibb, Martin Izzard, Nick McKeown, Jennifer Rexford, Cole Schlesinger, Dan Talayco, Amin Vahdat, George Varghese, and David Walker. 2014. P4: programming protocol-independent packet processors. SIGCOMM Comput. Commun. Rev. 44, 3 (July 2014), 87–95. DOI:https://doi.org/10.1145/2656877.2656890

The promise of SDN is that a single control place can directly control a whole network of switches. OpenFlow (OF) supports this goal by providing a single, vendor-agnostic API. But the control plane cannot express how the packets howd be processed to best meet the needs of control apps. OF v1.0 (Dec 2009) started simple with abstractions of a single table of rules that could match packets on 12 header field, e.g. MAC addresses, IP addresses, protocol, TCP/UDP port numbers, etc. OF v1.4 (Oct 2013) specification requires 41 header fields. Datacenter network operators want to apply new forms of packet encapsulation (e.g. NVGRE, VXLAN, STT) requiring more header fields. This requires repeatedly extending the OF specification. Instead P4 enables supporting flexible mechanisms for parsing packets & matching header fields, allowing controller apps to leverage these capabilities.

The challenge is to find a sweet spot that balances:

P4 has three goals:

The work first describes an abstract forwarding model.

Switches forward packets via a programmable parser followed by multiple stages of match+action, arranged in series, parallel, or a combination of both.

This generalizes how packets are processed on different forwarding devices - Ethernet switches, load-balancers, routers, etc. & by different technologies - fixed-function switch ASICs, NPUs, reconfigurable switches, s/w switches, FPGAs. This allows using a common language, P4, to represent how packets are processed.

The forwarding model is controlled by 2 ops:

Arriving packets are first handled by the parser. The packet body is buffered separately, unavailable for matching. The parser extracts the fields from the header. The extracted header fields are passed to match+action tables (ingress & egress).

A packet processing language must allow the programmer to express any serial dependencies between header fields. Dependencies determine which tables can be executed in parallel. Dependencies can be identified by analyzing the Table Dependency Graphs (TDG) which describe the field inputs, actions, and control flow between tables.

They propose a 2-step compilation process:

The key concepts in P4 are: headers, parsers, tables, actions, control programs.

They explore P4 by examining a simple example. They consider a L2 network deployment with ToR switches at the edge connected by a two-tier core. The number of end-hosts is growing and the core L2 tables are overflowing. P4 lets us express a custom solution with minimal changes to the network architecture. The routes through the core are encoded by a 32-bit tag.

Strengths

Weaknesses

Future Work