



P4 Background
In 2014, a team of Stanford University researchers led by Nick McKeown published a paper in SIGCOMM Computer Communication Review, P4: Programming Protocol-Independent Packet Processors, which proposed a P4 network programming language, which is mainly used in network devices such as NICs, switches, routers, etc., and allows users to program to control the packet forwarding behavior in the data plane.
After nearly 10 years of development, P4 has become a de facto standard programming language in the field of network applications. P4 is an open source, dedicated programming language for network behavioral level, compared to circuit behavioral level programming languages such as Verilog/VHDL or general-purpose computational programming languages such as C/C++, P4 has orders of magnitude improvement in the development efficiency for network application business.
The P4 platform is a powerful and efficient way to improve the performance of networked applications.
Auto Sync with Cloud No manual interaction required to synchronize with cloud services.
P4 Architecture
P4 Architecture Diagram
P4 Program dark blue block diagram is a program written in P4 language, as a high-level language specifically for network applications, engineers will be very easy to complete in a short period of time to meet the business needs of the code written. There will be a lot of L2 forwarding, L3 routing processing code in switching and routing devices, and a lot of flow table processing code in smart NICs.
After the P4 program is written, the code can be compiled with the P4 compiler. The compilation result produces two files, one is the binary target file to be downloaded to the hardware, which is read, parsed, and executed by the hardware to complete the corresponding message processing operations; the other is the table entry format information required by the hardware to do message forwarding, and the P4 Runtime software will send the correct table entries to the hardware according to this file.
The light blue portions of the diagram are specifications provided by the P4 standards organization, while the green portions are related to specific manufacturers’ hardware implementations. the front end of the P4 compiler is also an implementation of the specification, and the back end of the compiler needs to be implemented by the manufacturers themselves to generate executables corresponding to the hardware design.
P4 Ecosystem.
P4 Ecogram
The P4 ecosystem is growing rapidly, with more than 50 corporate members and 15 university research organizations joining to drive the construction and commercial adoption of P4. The P4 ecosystem employs a top-down model, with application-related at the top and hardware-related at the bottom, to broadly leverage P4’s products, programs, and services.
P4 Data Surface Features
1. It can realize the parsing and processing functions of existing protocols;
2. Can customize the packet structure;
3. Can be based on the existing protocol for new functionality expansion;
4. Software style development – the development model of protocol processing is similar to software development.
P4 Data Surface Elements
1.
2.Match Action Table (MAT) & Deparser
Deparser
3. Control flow code
Parser
When a packet arrives at the Switch, the Parser parser parses and extracts the keywords from the Header of the message. This process is handled by the Parser module programmed into P4, which contains the memory for defining the various protocol header formats supported and the actuator for performing layer-by-layer protocol parsing. The actuator extracts key information from the protocol header based on the predefined protocol header format and determines the next layer start position and protocol type to determine the next step of message parsing until the end of parsing.
Match Action Table (MAT) & Deparser
Match Action Table is sent by Controller through southbound protocol, match mode can include exact match, fuzzy match and longest match three modes; Match Action Table provides the table and how to check the table, after checking the table, how to carry out the action is also completely realized by the P4 program, known as P4 Deparser, which can be used by users according to specific needs through the P4 Deparser. Users can complete the data processing Action through P4 programming according to specific needs, including forwarding, encapsulation and decapsulation, packet header updating and so on.
Control flow code
Similar to the conditional logic processing structure in C programs, this part of the programmability, the single function of the network data surface becomes more autonomous and intelligent, no longer only to complete a simple IP or a specific field matching, but a relatively complex and controllable process, can be a succession of multiple matching tasks, but also can be the packet header of the data packet modification, addition, deletion and other actions. The so-called protocol parsing and forwarding strategy becomes as simple as software development.
About Us
Resnics was founded in July 2020 and is headquartered in Caohejing New Technology Development Zone, Shanghai, China. The team consists of core professionals in the fields of networking, switching, and storage at home and abroad, with deep technical expertise in networking, switching, storage, and high-performance CPUs.
The company is committed to providing leading storage and network chip solutions for the communications and Internet industries, aiming to become a high-tech innovative company with international competitiveness, leading the industry with innovation and participating in the development of industry standards.