P4 (programming language): Difference between revisions

Content deleted Content added
Ljwobker (talk | contribs)
added overview / design goals section
Ljwobker (talk | contribs)
m formatting and wiki-links
Line 19:
=Language overview and design considerations=
 
As the language is specifically targeted at packet forwarding applications, the list of requirements or design choices is somewhat unique to thatthose forwardinguse casecases. The language is designed to meet a number of these goals:
 
==Target independence==
 
P4 programs are designed to be '''implementation-independent''', meaning they can be compiled against many different types of execution machines such as general-purpose CPUs, FPGAs, system(s)-on-chip, network processors, and ASICs. These different types of machines are known as P4 '''targets''', and each target must be provided along with a [[compiler]] that converts the P4 source code into an executable format. As many of the initial targets for P4 programs were used for simple packet switching it is very common to hear the term “P4 switch” used, even though “P4 target” is more formally correct.
 
==Protocol independence==
P4 is designed to be '''protocol-independent''', meaning that the language has no native support even for common protocols such as IP, Ethernet, TCP, VxLAN, or MPLS. Instead, the P4 programmer describes the header formats and field names of the required protocols in the program, which are in turn interpreted and processed by the compiled program and target device.
 
==Reconfigurability==
 
Protocol independence and the abstract language model allow for '''reconfigurability''' – P4 targets should be able to change the way they process packets (perhaps multiple times) after they are deployed. Previously,This manycapability high-speedis packettraditionally switchesassociated werewith limitedforwarding inplanes theirbuilt capabilitieson to[[History expandof general-purpose CPUs|general-purpose CPUs]] or alter[[network processor|network processors]], rather than the fixed function once[[Application-specific installedintegrated circuit|ASICs]]. Although within the language there is nothing to prevent a given target from optimizing around a certain set of protocols, these optimizations are invisible to the language author and may ultimately reduce the system’s flexibility and reconfigurability goals.