P4 (Programming Protocol-independent Packet Processors) Seyeon Jeong DPNM lab, Dept. of CSE, POSTECH jsy0906@postech.ac.kr 2016. 9. 27
Introduction OpenFlow was simple Over the past years A single flow rule table Matching on any of 12 fields of the incoming packet MAC addr., IP addr., Transport protocol, … Over the past years Still not enough to support many encapsulation techniques Version Date # header fields OF 1.0 Dec 2009 12 (Ethernet, TCP, IPv4) OF 1.1 Feb 2011 15 (MPLS, inter-table meta data) OF 1.2 Dec 2011 36 (ARP, ICMP, IPv6, etc.) OF 1.3 Jun 2012 40 OF 1.4 Oct 2013 41 OF 1.5 Dec 2014 45
Introduction OF switches must be updated to support Latest features of the newest version Difficulties in maintenance, compatibility, … Where does it stop? People think that future SDN(/OpenFlow) switches must have Configurable packet parser Not tied to a specific header format (protocol)! Flexible match+action tables General packet-processing primitives
Introduction New generation of switch ASICs Intel FlexPipe RMT [SIGCOMM’ 13] Cisco Doppler But, programming these chips is hard Custom, vendor-specific interface Low-level programming like microcode We need a higher-level interface! P4 (Programming Protocol-independent Packet Processors) language + P4 compiler
P4 language P4 language Provides a single means of configuration to packet forwarding Based on an abstract forwarding model With a programmable parser Allows the definition of arbitrary headers and fields Provides a context for match+action definitions
P4 language http://p4.org/wp-content/uploads/2015/03/p4-tutorial-12201423.pdf
P4 language Header and Fields Fields have a (bitwise) width and other attributes Headers are collections of fields Like an instantiated class in Java
P4 language Parser Extracts header instances Selects a next “state” by returning another parser function
P4 language Match + Action table Parsed representation of headers give context for processing of the packets An action function consists of several primitive actions
P4 as Open Source Project https://github.com/p4lang/tutorials/tree/master/examples
OpenFlow + P4 “Classic” OpenFlow 1.x OpenFlow 2.0 SDN Control Plane http://www.slideshare.net/opennetsummit/ons2014-jennifer-rexfordprinceton-university?qid=25bb2e8d-b4fa-418e-9d7c-90942d1d2e46&v=&b=&from_search=5 “Classic” OpenFlow 1.x OpenFlow 2.0 SDN Control Plane SDN Control Plane Configuring: Parser, tables, and control flow (P4 program) Populating: Installing and querying rules Installing and querying rules Parser & Table conf. Rule Translator P4 Compiler Target Switch Target Switch
Conclusion P4 in a nutshell An alternate future of OpenFlow 1.x Protocol independence Target independence Reconfigurability in the field Simple language Programmable parser Match + Action tables Control flow (packet processing pipeline) C-like syntax Multiple companies have written the compilers
Q&A