In the age of softwarization, SDN is unfolding its boundaries and industries are focusing to take networking control at top of the pyramid – from sophisticated hardware to software application. P4 has already taken charge of the bottom of the pyramid (forwarding plane), by offering network programmability down to ASIC. And in recent years, a couple of conceptions and protocols have also come to rule at the top of the pyramid (control plane), but with P4, it seems that history is going to change!
Control Plane of Network Device
Control Plane is the brain of networking devices. It has the various application that can learn and populate tables defined by data plane. In traditional network devices, the control plane or software which is used to configure the control movement of the packet was on the same device. Because of these, for any changes, the network admin has to configure the switch by separately connecting to each device. To add more complexity, each chip vendor provides their own proprietary interfaces/APIs for controlling data plane. To make a life of network admins easy, the goal was to separate the Control and Data Planes of networking devices. This gave birth to SDN (Software Defined Networking) technology. SDN uses a software application to program switches through a centralized controller thus decoupling control plane and data plane. This made configuration of the network through centralized controller easy. But still, due to different interface from different vendors, it was impossible to use single control plane APIs to control switch ASICs from different chip vendor. Over the period of time to solve this issue, different protocols/standardization were introduced to make APIs open source.
OpenFlow: OpenFlow is the first standard open source communication protocol between the control plane and data plane by ONF (Open Networking Foundation) to promote adoption of SDN. OpenFlow is a solution to SDN networks which provides a standard interface between controller and switch in terms of flows. Flows contains match fields, priority and actions which are organized in tables. The APIs provided are generic, not dependent on target, thus making it suitable for any control plane software which are OpenFlow compatible.
SAI (Switch Abstraction Interface): SAI provides an open source standard C APIs to program data plane of networking chip officially accepted by OCP (Open Compute Project). SAI abstracts underlying chip thus allowing any same control plane software to plug to any device making SAI target independent.
Why P4 Runtime?
There are various limitations with OpenFlow and SAI. Both were designed keeping in mind the fixed switches which makes it unscalable to new protocols in future. They are target independent but protocol dependent. Adding a new protocol involves a lot of time and efforts plus community involvement. SAI is designed for switches whose control plane is inside the switch. Both cannot scale itself with programmable data plane. With P4 programmable data plane, there were no standard for control plane interface. Few vendors developed their own proprietary tools to auto-generate APIs which can populate tables from P4 program or JSON. But, there were no standard on how to define these APIs. So, p4.org decided to launch the API Working Group, to create silicon-independent APIs for controlling the forwarding plane of switches. P4 Runtime architecture makes it independent of protocols as well as underlying forwarding switch. The same API can be used to control different switches supporting different protocols. P4 Runtime helps to control any forwarding plane, whether it’s fixed, semi-programmable or fully programmable. P4 Runtime can be used for any switches whether local or remote control plane. It is flexible enough to support both OpenFlow APIs and SAI APIs.
Function of P4 Runtime
P4 Runtime API have support for two main functionalities:
- Managing Match-Action Tables: Managing behavior of data plane by adding, deleting, modifying, displaying entries in match-action tables
- Update forwarding plane logic: Update the forwarding behavior of P4 programmable switch using new P4 code
Architecture of P4 Runtime in SDN Network
Figure 1: P4 Runtime flow in SDN networks with different devices
The architecture of P4 Runtime makes it flexible enough to be suitable for local or remote control plane infrastructure as well as suitable for fixed and programmable networking devices.
For local control plane, P4 Runtime APIs generated from P4 compiler can be directly used to control the ASIC including entries programming to table creation and deletion based on ASIC type (fixed or programmable). Similarly, for the remote control plane, P4 Runtime APIs generated by P4 compiler can be used to control switch via the control plane. P4 compiler will generate the schema as needed by the control plane.
For fixed function switches, P4 language can be first used to emulate the behavior of switch and then P4 Runtime APIs can be used to control the fixed function switches. The runtime APIs can be used to insert/delete entries in tables defined by P4 Language which is similar to actual HW.
If the switch is programmable, this can be extended to control all programmable entities like adding a new table, insert the entry, delete the entry to update forwarding plane at runtime using P4 Runtime APIs generated by a compiler.
Figure 1 shows the generic P4 Runtime architecture in SDN (remote control plane) network independent of forwarding plane.
P4 and P4 Runtime – New horizon for SDN Programmability
For programmable networking devices, P4 Runtime opens a true SDN programmability by programming from top to bottom till ASIC data plane using P4. P4 language can be used to describe the forwarding pipeline and P4 Runtime can be used control the forwarding and updating the forwarding logic runtime from the remote. With P4, SDN controllers has gain ability to redefine tables, entries, parser, match actions, and packet processing logic. Thus giving complete control of the network.
P4 Runtime gives a seamless way to build networks using a mix of programmable and fixed-function switches. P4 compiler auto-generates the APIs that are needed to populate tables. P4 Runtime makes it easier to program large networks. VOLANSYS provide end-to-end solution for your networking device including compiler development, P4 Runtime integration to NOS, adding support for new features/protocol and complete testing.
About Author: Komal Shah
Komal is associated with VOLANSYS Technologies as a Senior Engineer with 3+ years of experience in development of Software Development Kit (SDK) for reconfigurable networking switches. She has good hands-on working with programmable Parser, P4 Runtime, P4 Compiler back-end development and data plane pipeline programming. She is always ready to take up challenges.