What is the P4 Programming Language?

What is the P4 Programming Language?

It seems there may be some confusion as to what P4 is, in particular how it relates to OpenFlow. So let's get one thing out of the way first, P4 is NOT a replacement for OpenFlow. They serve two different functions and as a matter of fact, complement each other. Both have a simple set of goals, to increase extensibility and reduce time to market.

OpenFlow is a protocol, one that allows the separation of the control and data planes in a network device. By moving the control plane away from the network device onto commodity hardware, it allows the user to develop their own custom logic to centralise and enhance overall network manageability. Then OpenFlow allows these two components to communicate with each other.

P4, on the other hand, is a programming language designed explicitly for programming the data plane on a network device. It allows the user to create custom protocol definitions, develop complex match/action pipelines, and incorporate external functions into their code.

So, could you use one without the other? Of course, you can. Can you use them together? Definitely. However, the point is that OpenFlow allows separate control and data planes to communicate with each other, whereas P4 allows you to define how a data plane processes packets. Two different implementations and objectives.

For a deeper explanation of the history, reasoning and purpose of P4 I would highly recommend reading Nick McKeown and Jen Rexford's post on P4.org.

Leave a comment

Comments will be approved before showing up.