P4 programming language multi-service scenario test method, device, dpu and system

By acquiring and configuring the business files of the P4 programming language in the system-on-chip (SoC) of the data processor (DPU), generating plain text target files, and conducting tests, the resource limitations and portability issues of the P4 programming language on different platforms are resolved, enabling efficient business scenario testing and data transfer.

CN119420683BActive Publication Date: 2025-11-18YUSUR TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411324026.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-11-18
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The P4 programming language is limited by physical resources when transferring data between different platforms, and it does not have a parallel portability method between different platforms, resulting in limitations and high costs in its application on different platforms.

Method used

This paper provides a multi-service scenario testing method for the P4 programming language. By obtaining the assembly files of the P4 programming language description service files for each service scenario from the system-on-chip (SoC) in the data processor (DPU), generating plain text target files, configuring table entries, and testing each service scenario separately, the method achieves parallel porting of the P4 programming language between different platforms.

Benefits of technology

It improves the testing efficiency and reliability of the P4 programming language on different platforms, solves the problem of physical resource limitations, and enables flexible expansion of business scenarios and efficient data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420683B_ABST
    Figure CN119420683B_ABST
Patent Text Reader

Abstract

The application provides a P4 programming language multi-service scenario test method, device, DPU and system. The method is executed in a system on chip (SoC) in a data processor (DPU), and includes the following steps: obtaining an assembly file corresponding to a P4 programming language description service file of each service scenario; generating a target file in a pure text format corresponding to each assembly file and configuring a table entry of each target file; and testing each service scenario according to each configured target file. The application can provide a parallel transplantation mode of the P4 programming language between different platforms by implementing the test of the P4 programming language in multi-service scenarios. The application can solve the problem that the P4 programming language is limited by physical resources in different platforms by implementing the P4 programming language multi-service scenario test based on the DPU.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a P4 programming language multi-service scenario testing method, device, DPU and system. BACKGROUND

[0002] P4 (Programming Protocol-Independent Packet Processors) is a protocol-independent packet processing programming language. The P4 programming language supports user-defined matching fields, protocol parsing processes and forwarding processes, thereby enabling a truly protocol-independent programmable network data plane. As a dedicated programming language, the P4 programming language first defines the processing flow of a packet, and then uses a compiler to generate specific configurations on a switch or a network card that is not limited to a specific protocol, thereby implementing the packet processing logic expressed by the P4 programming language. The network device is not bound to any specific network protocol, and users can use the P4 programming language to describe any network data plane protocol and packet processing behavior. This feature is implemented through a custom packet parser, a matching process of a matching-action table and a flow control program.

[0003] However, the P4 programming language transfers structured data between different systems for defining communication between the control plane and the data plane of a network device. These communications have deficiencies in different programming languages and hardware architectures. The P4 programming language sends configurations and commands from the control plane to the data plane, and the P4 programming language ultimately controls a resource-limited data plane forwarding chip. Therefore, the P4 programming language does not have super-high external storage resources like the computing plane where the CPU is located. Therefore, the P4 programming language is physically limited in different platforms, and because it does not have a parallel porting method between different platforms, each platform that supports the P4 programming language needs to have its own product architecture model and compiler, and needs to select the corresponding physical platform during compilation to implement landing.

[0004] Therefore, there is an urgent need to design a solution that can solve the problem of physical resource limitation of the P4 programming language when transferring data in different platforms and the lack of parallel porting method between different platforms. SUMMARY

[0005] In view of this, the embodiments of the present application provide a P4 programming language multi-service scenario testing method, device, DPU and system to eliminate or improve one or more defects in the prior art.

[0006] One aspect of the present application provides a P4 programming language multi-service scenario testing method, which is executed in a system on chip (SoC) in a data processing unit (DPU). The method comprises:

[0007] obtain an assembly file corresponding to each of the P4 programming language description service files of the respective service scenarios;

[0008] generate a target file in pure text format corresponding to each of the assembly files, and configure a table entry of each of the target files;

[0009] test each of the service scenarios according to the respective target files after configuration.

[0010] In some embodiments of the present application, each of the service scenarios includes at least two of the following: a service forwarding scenario based on a VLAN protocol, a service forwarding scenario based on an IPV4 protocol or an IPV6 protocol, a flow forwarding scenario based on a TCP / UDP protocol, an encapsulation and decapsulation scenario based on a VxLAN protocol, an encapsulation and decapsulation scenario based on a GRE protocol, an encapsulation and decapsulation scenario based on a GENEVE protocol, and an encapsulation and decapsulation scenario based on a MPLS protocol.

[0011] In some embodiments of the present application, the obtaining of the assembly file corresponding to each of the P4 programming language description service files of the respective service scenarios includes:

[0012] receiving an assembly file corresponding to each of the service scenarios, wherein each of the assembly files is generated by a P4 compiler on a host side after compiling a service file based on a P4 programming language corresponding to each of the service scenarios.

[0013] In some embodiments of the present application, the generating of the target file in pure text format corresponding to each of the assembly files includes:

[0014] generating a binary file corresponding to each of the assembly files based on a local assembler, and converting each of the binary files into a target file in pure text format, wherein the pure text format includes a CSV format.

[0015] In some embodiments of the present application, the configuring of each of the service scenarios includes:

[0016] installing a driver locally and starting a local control plane software;

[0017] receiving configuration information for each of the service scenarios based on the control plane software and configuring a table entry based on each of the configuration information, so as to determine a processing mode of each of the target files in a network device.

[0018] In some embodiments of the present application, the testing of each of the service scenarios according to the respective target files after configuration includes:

[0019] According to the configured target files respectively, and the test for each business scenario is performed together with the test equipment which has established a communication connection.

[0020] In some embodiments of the present application, the control plane software includes a Stratum control plane and a P4RT controller.

[0021] Another aspect of the present application provides a P4 programming language multi-business scenario test device, which is arranged in a system on chip (SoC) in a data processing unit (DPU), and includes:

[0022] A file acquisition module is configured to acquire an assembly file corresponding to each business scenario P4 programming language description business file;

[0023] A format conversion and configuration module is configured to generate a target file in a pure text format corresponding to each assembly file, and configure table entries of each target file respectively;

[0024] A scenario test module is configured to test each corresponding business scenario according to each generated target file respectively.

[0025] A third aspect of the present application provides a DPU, and a P4 programming language multi-business scenario test device is arranged in a system on chip (SoC) of the DPU;

[0026] The P4 programming language multi-business scenario test device is configured to execute the P4 programming language multi-business scenario test method;

[0027] The P4 programming language multi-business scenario test device is arranged with an assembler, control plane software and a P4 programmable software switch model;

[0028] The assembler is configured to generate a binary file corresponding to each assembly file respectively and convert each binary file into a target file in a pure text format respectively;

[0029] The control plane software is configured to receive configuration information for each business scenario respectively and perform table entry configuration according to each configuration information respectively, so as to determine a processing mode of each target file in a network device.

[0030] A fourth aspect of the present application provides a P4 programming language multi-business scenario test system, which includes a DPU, a host and a test equipment in communication connection with the P4 programming language multi-business scenario test device in a system on chip (SoC) of the DPU, and the test equipment is also in communication connection with the host.

[0031] The host is provided with a P4 compiler, which is used to compile the service files respectively corresponding to each service scenario and described based on the P4 programming language to generate the assembly files respectively corresponding to each service scenario, and copy each of the assembly files and send the copied each of the assembly files to the P4 programming language multi-service scenario test device;

[0032] The accompanying device is used to jointly execute the test for each of the service scenarios with the P4 programming language multi-service scenario test device.

[0033] The P4 programming language multi-service scenario test method provided in the application is executed in the system on chip SoC in the data processor DPU, the method acquires the assembly files respectively corresponding to the P4 programming language description service files of each service scenario, generates the target files respectively corresponding to each of the assembly files in the pure text format, and respectively configures the table entries of each of the target files; each of the service scenarios is tested according to the configured each of the target files, the test of the P4 programming language in the multi-service scenario is realized, the parallel transplantation mode of the P4 programming language between different platforms can be provided, which is helpful for the flexible expansion of services under the DPU network card platform; the P4 programming language multi-service scenario test based on the DPU can solve the problem that the P4 programming language is limited by physical resources in different platforms, and thus the efficiency and reliability of the P4 programming language test and data transmission in different platforms can be effectively improved.

[0034] Additional advantages, objects, and features of the application will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following or can be learned by practice of the application. The objects and other advantages of the application can be realized and attained by the structure particularly pointed out in the specification and claims hereof as well as the appended drawings.

[0035] It will be understood by those skilled in the art that the objects and advantages of the present application can be realized and attained by the structure particularly pointed out in the specification and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0036] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the principles of the application. The components in the drawings are not drawn to scale, but are merely intended to illustrate the principles of the application. To facilitate an understanding of some portions of the application, corresponding portions of the drawings can be exaggerated relative to other portions, namely, parts shown in the drawings can be shown disproportionately large to illustrate details thereof. In the drawings:

[0037] Figure 1A first flowchart of a P4 programming language multi-service scenario test method in an embodiment of the present application.

[0038] Figure 2 A second flowchart of a P4 programming language multi-service scenario test method in an embodiment of the present application.

[0039] Figure 3 A structural diagram of a P4 programming language multi-service scenario test device in an embodiment of the present application.

[0040] Figure 4 A structural diagram of a DPU in an embodiment of the present application.

[0041] Figure 5 A structural diagram of a P4 programming language multi-service scenario test system in an embodiment of the present application.

[0042] Figure 6 A logical architecture diagram of a P4 programming language multi-service scenario test process executed by a P4 programming language multi-service scenario test system in an application example of the present application. DETAILED DESCRIPTION

[0043] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be described in further detail below with reference to the embodiments and drawings. Herein, the illustrative embodiments of the present application and their descriptions are used to explain the present application, but are not intended to limit the present application.

[0044] It should be noted that, in order to avoid the present application being obscured by unnecessary details, only the structures and / or processing steps closely related to the solutions according to the present application are shown in the drawings, and other details not closely related to the present application are omitted.

[0045] It should be emphasized that the term “comprises / comprising” as used herein indicates the presence of the stated features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0046] It should be noted that, if not specifically stated, the term “connected” as used herein can not only mean direct connection, but also indirect connection with an intermediate object.

[0047] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0048] In one or more embodiments of the present application, DPU refers to a data processing unit; P4 refers to a data packet processing programming language; NP refers to a networking processor; PPE refers to a packet processing engine; DOE refers to a database offload engine; SOC refers to a DPU system on chip; VLAN refers to a virtual local area network; VXLAN refers to a virtual extensible local area network; GRE refers to a generic routing encapsulation; TCP refers to a transmission control protocol; UDP refers to a user datagram protocol; GENEVE refers to a network virtualization encapsulation protocol; and MPLS refers to a multi-protocol label switching.

[0049] In order to solve the problem that the P4 programming language is limited by physical resources when transmitting data in different platforms and does not have a parallel porting method between different platforms, embodiments of the present application respectively provide a P4 programming language multi-service scenario test method, a P4 programming language multi-service scenario test device for executing the P4 programming language multi-service scenario test method, a DPU and a P4 programming language multi-service scenario test system. By implementing the test of the P4 programming language in the multi-service scenario, the parallel porting method of the P4 programming language between different platforms can be provided. By implementing the P4 programming language multi-service scenario test based on the DPU, the problem that the P4 programming language is limited by physical resources in different platforms can be solved.

[0050] The embodiments are specifically described as follows.

[0051] Based on this, the embodiment of the present application provides a P4 programming language multi-service scenario test method which can be implemented by a P4 programming language multi-service scenario test device. The method is executed in a system on chip (SoC) in a data processor (DPU). The P4 programming language multi-service scenario test device can be a functional module in the SoC. Referring to Figure 1 , the P4 programming language multi-service scenario test method specifically includes the following contents:

[0052] Step 100: Obtain the assembly files corresponding to the P4 programming language description service files of each service scenario.

[0053] In step 100, the P4 programming language multi-service scenario test device obtains the assembly files corresponding to the P4 programming language description service files of each service scenario in the system on chip (SoC) in the data processor (DPU). The P4 programming language description service files of each service scenario can be received by the P4 programming language multi-service scenario test device from the outside, or can be generated by the DPU and then processed by the P4 programming language multi-service scenario test device.

[0054] In one or more embodiments of the present application, a service scenario refers to a protocol, a multi-service scenario refers to at least two protocols, multi-service scenario testing refers to at least one of forwarding, encapsulation and decapsulation for each protocol, and P4 programming language multi-service scenario testing refers to testing each service scenario based on the related format files (such as csv files) corresponding to the P4 programming language description service files of each service scenario.

[0055] It can be understood that the assembly file specifically refers to an assembly program file, which is a computer program file. The assembly file in the present application refers to an assembly program file written in P4 assembly language, which is used to convert P4 assembly language instructions into machine language instructions so that the DPU can execute them.

[0056] In one or more embodiments of the present application, the P4 programming language description service file is a service file described in P4 programming language.

[0057] In step 100, the P4 programming language multi-service scenario test device in the system on chip (SoC) in the data processor (DPU) can generate a configuration file for the control plane while compiling the input P4 language description service file to generate the corresponding hardware architecture assembly file. This allows the tester to issue corresponding table item configuration information or instructions to the P4 programming language multi-service scenario test device based on the configuration file, so that the P4 programming language multi-service scenario test device performs the content of configuring each target file table item in the following step 200 according to the received table item configuration information or instructions.

[0058] Step 200: generating a target file in pure text format corresponding to each of the assembly files, and configuring table entries of each of the target files.

[0059] In step 200, the P4 programming language multi-service scenario testing device translates the assembly language into machine target code in the system on chip (SoC) in the data processing unit (DPU) to generate a target file in pure text format corresponding to each of the assembly files. The P4 programming language multi-service scenario testing device configures table entries of each of the target files according to received table entry configuration information or instructions, so that the tester can define different types of table entries, operations, counters, etc., to determine the processing manner of the target file in the network device.

[0060] Step 300: testing each of the corresponding service scenarios according to each of the generated target files.

[0061] In step 300, the developer can use the P4 programmable software switch model to develop, test, and debug each of the configured target files in the corresponding service scenario. It can be understood that the corresponding service scenario refers to each of the target files.

[0062] In one or more embodiments of the present application, the P4 programmable software switch model specifically refers to a virtual model of a P4 programmable software switch. The P4 programmable switch is a brand-new, highly flexible and customizable network device that can realize intelligent management and autonomous control of the network, and can support multiple network protocols and application scenarios.

[0063] In an example, the P4 programmable software switch model can specifically use a BM-NP (BMv2 Network Processor) switch model, which is a P4 behavior model derived from a P4 programmable software switch model implemented by the P4 project. It is only used for developers to develop, test, and debug P4 programs. The BMv2 project not only provides a software switch, but also provides a framework through which developers can implement their own software switch architecture. Based on the hardware architecture and characteristics of the third-generation DPU chip K2-Pro, the BM-NP switch model can be developed and adapted on the BMv2 framework.

[0064] From the above description, the P4 programming language multi-service scenario test method provided by the embodiment of the application can realize the test of the P4 programming language in the multi-service scenario, can provide a parallel transplantation mode of the P4 programming language between different platforms, and is helpful to the flexible expansion of services under the DPU network card platform. Through the implementation of the P4 programming language multi-service scenario test based on the DPU, the problem that the P4 programming language is limited by physical resources in different platforms can be solved, and thus the efficiency and reliability of the P4 programming language test and the transmission of data in different platforms can be effectively improved.

[0065] In order to further improve the comprehensiveness and wide applicability of the P4 programming language multi-service scenario test, in the P4 programming language multi-service scenario test method provided by the embodiment of the application, each service scenario specifically contains at least two items in the subordinate scenario:

[0066] (1) a service forwarding scenario based on a VLAN protocol;

[0067] (2) a service forwarding scenario based on an IPV4 protocol or an IPV6 protocol;

[0068] (3) a flow forwarding scenario based on a TCP / UDP protocol;

[0069] (4) an encapsulation and decapsulation scenario based on a VxLAN protocol;

[0070] (5) an encapsulation and decapsulation scenario based on a GRE protocol;

[0071] (6) an encapsulation and decapsulation scenario based on a GENEVE protocol;

[0072] (7) an encapsulation and decapsulation scenario based on a MPLS protocol.

[0073] Among them, the service forwarding scenario based on the VLAN protocol corresponds to a layer 2 L2 switch, the service forwarding scenario based on the IPV4 protocol or the IPV6 protocol corresponds to a layer 3 L3 switch, the flow forwarding scenario based on the TCP / UDP protocol corresponds to a layer 4 L4 switch, the encapsulation and decapsulation scenario based on the VxLAN protocol corresponds to a layer 5 L5 switch, the encapsulation and decapsulation scenario based on the GRE protocol corresponds to a layer 5 L5 switch, the encapsulation and decapsulation scenario based on the GENEVE protocol corresponds to a layer 5 L5 switch, and the encapsulation and decapsulation scenario based on the MPLS protocol corresponds to a 2.5 layer L2.5 switch.

[0074] Correspondingly, the test of each service scenario corresponding to each service scenario specifically contains:

[0075] (1) a forwarding test for the forwarding scenario based on the VLAN protocol, which can be simply written as: a forwarding test of the VLAN;

[0076] (2) For the forwarding test of the IPV4 protocol or IPV6 protocol based service forwarding scenario, which can be abbreviated as: L3 IPV4 / IPV6 forwarding test;

[0077] (3) For the stream forwarding test of the TCP / UDP protocol based stream forwarding scenario, which can be abbreviated as: L4 TCP / UDP stream forwarding test;

[0078] (4) For the encapsulation and decapsulation test of the VxLAN protocol based encapsulation and decapsulation scenario, which can be abbreviated as: VxLAN encapsulation / decapsulation test;

[0079] (5) For the encapsulation and decapsulation test of the GRE protocol based encapsulation and decapsulation scenario, which can be abbreviated as: GRE encapsulation / decapsulation database table test;

[0080] (6) For the encapsulation and decapsulation test of the GENEVE protocol based encapsulation and decapsulation scenario, which can be abbreviated as: GENEVE encapsulation / decapsulation test;

[0081] (7) For the encapsulation and decapsulation test of the MPLS protocol based encapsulation and decapsulation scenario, which can be abbreviated as: MPLS encapsulation / decapsulation test.

[0082] Based on this, the P4 programming language multi-service scenario test method provided by the embodiments of the present application can realize that the control plane allows the administrator to configure the data plane behavior of the network device in different application scenarios, mainly through the seamless docking test of the protocol, the application interface, the Stratum control plane, and the data processing plane. Specifically, the test in the application scenarios of VLAN, IPV4, IPV6, TCP, UDP, VxLAN encapsulation / decapsulation, GRE encapsulation table / GRE decapsulation table, GENEVE encapsulation / GENEVE decapsulation, MPLS encapsulation / MPLS decapsulation, etc. can be used to solve the test method under different protocols and encapsulation and decapsulation.

[0083] In order to further improve the reliability and effectiveness of obtaining the respective assembly files of the P4 programming language description service files of each service scenario, in a P4 programming language multi-service scenario test method provided by the embodiments of the present application, referring to Figure 2 , the step 100 in the P4 programming language multi-service scenario test method specifically contains the following contents:

[0084] Step 110: receiving respective assembly files corresponding to each service scenario, wherein each of the assembly files is generated by a P4 compiler on the host side by compiling a respective P4 programming language description service file corresponding to each service scenario.

[0085] Specifically, the P4 compiler can also be a P4 language compiler, which is used to compile the service file input in the P4 language description to generate an assembly file corresponding to the hardware architecture, and at the same time generate a configuration file for the control plane, so that users can realize the programming description of the processing mode of the data packet without needing to care about the details of the underlying hardware.

[0086] In an example, the P4 compiler can adopt a P4c compiler, which is a compiler for the P4 programming language, and the design goal is to build a modular system to allow developers to add new backends to adapt to different hardware platforms, and provide standard front-end and middle-end processing.

[0087] In order to further improve the reliability and effectiveness of generating the target file in pure text format corresponding to each of the assembly files, in the P4 programming language multi-service scenario test method provided in the embodiment of the present application, referring to Figure 2 , the step 200 in the P4 programming language multi-service scenario test method specifically contains the following content:

[0088] Step 210: Based on the local assembler, generate a binary file corresponding to each of the assembly files, and convert each of the binary files into a target file in pure text format, wherein the pure text format includes CSV format.

[0089] Specifically, the assembler is a program that translates assembly language into machine object code. After the P4 programming language multi-service scenario test device generates a binary file corresponding to each of the assembly files based on the local assembler and converts each of the binary files into a target file in pure text format, it also updates the corresponding microcode.

[0090] In order to further improve the reliability and effectiveness of configuring each of the service scenarios, in the P4 programming language multi-service scenario test method provided in the embodiment of the present application, referring to Figure 2 , the step 200 in the P4 programming language multi-service scenario test method further contains the following content executed after step 210:

[0091] Step 220: Install the driver locally and start the local control plane software.

[0092] Step 230: Based on the control plane software, receive configuration information for each of the service scenarios and perform table item configuration according to each of the configuration information, to determine the processing mode of each of the target files in the network device.

[0093] Specifically, the P4 programming language multi-service scenario test device can install the driver specified by the test personnel according to the driving installation instruction issued by the test personnel.

[0094] The control plane software refers to software allowing an administrator to configure the data plane behavior of a network device, and the administrator can define different types of table entries, operations, counters, etc. through the control logic written in the P4 language, thereby determining the processing mode of the data packet in the network device.

[0095] In an example, the control plane software can include a Stratum control plane and a P4RT (P4 Runtime) controller.

[0096] The Stratum is a chip-independent control plane platform, and is oriented to software-defined networks and can run on various switch chips and various white-box switch platforms. The P4Runtime is a P4 open source project.

[0097] Considering that the network access global perspective solves traditional network problems such as network congestion, only the data plane is completed, and the forwarding process needs the participation of the control plane, the prior art has deficiencies in solving the problems at the control level, and further improves the reliability and effectiveness of the P4 programming language multi-service scenario test. In the P4 programming language multi-service scenario test method provided in the embodiment of the present application, referring to Figure 2 , the step 300 in the P4 programming language multi-service scenario test method specifically includes the following content:

[0098] Step 310: respectively according to the configured each target file, and the test device connected with the communication connection together for each service scene test.

[0099] In one or more embodiments of the present application, the test device can be written as a Target end, and the P4 programming language multi-service scenario test device in the SoC realizes the test for each service scene through the test device connected with the communication connection.

[0100] Specifically, the P4 programming language multi-service scenario test method realizes the test of the DPU in the P4 software stack under the L2 VLAN, L3 IPV4 / IPV6, L4 TCP / UDP, L5 VxLAN encapsulation / decapsulation, etc. Service scenarios to solve the forwarding, encapsulation and decapsulation of data flow, specifically as follows:

[0101] (1) Define the 2-layer Ethernet VLAN service forwarding behavior, configure the VLAN table through the control plane, provide the matching table and the forwarding action behavior, have the hardware forwarding processing, and improve the 2-layer VLAN service forwarding test;

[0102] (2) Define 3-layer IPV4 / IPV6 service forwarding capability, configure the table item of destination IP address forwarding through the control plane, specify the table item action, and when the table item IP Key matches the control plane configuration, the packet is forwarded to the specified table item interface;

[0103] (3) Define 4-layer TCP / UDP stream forwarding behavior, 4-layer TCP / UDP service stream processing, normal forwarding through TCP / UDP five-tuple ID, control plane configuration of TCP / UDP stream five-tuple ID forwarding table item, specify action table item action, forwarding from the specified port, effective control of the forwarding or discarding behavior of the flow;

[0104] (4) Define 5-layer VxLAN, GRE, GENEVE encapsulation / decapsulation service forwarding behavior, 5-layer VxLAN service, determine whether IPV4 forwarding or VxLAN encapsulation / decapsulation through IPV4 header destination IPV4 table lookup, control plane IPV4 address table item, specify table item action, specify the packet to be forwarded from which port, and perform VxLAN encapsulation / decapsulation, when the packet is forwarded to the table item configuration interface when the control plane Key matches, effectively improve the configuration of the table item and the forwarding efficiency of the data;

[0105] (5) P4 has 2.5-layer MPLS service encapsulation / decapsulation and its forwarding behavior, configure the forwarding table item through the control plane, encapsulate / decapsulate the MPLS header, and forward from the specified port, effectively realize IPV4 Key matching, packet MPLS encapsulation / decapsulation, and send to the table item configuration interface.

[0106] Based on the P4 programming language multi-service scenario test method provided in the above embodiment, the network device is not bound to any specific network protocol, and users can use the P4 language to describe any network data plane protocol and packet processing behavior. This feature is implemented through a custom packet parser, a matching flow of a matching-action table, and a flow control program, as follows:

[0107] (1) P4 compiler (P4C): compile the service file described in P4 language as input to generate an assembly file corresponding to the hardware architecture, and generate a configuration file for the control plane.

[0108] (2) Assembler: an assembler is a program that translates assembly language into machine object code.

[0109] (3) BM-NP exchange model: a P4 programmable software exchange model realized by P4 project. It is only used for developers to develop, test and debug P4 programs. BMv2 project not only provides a software exchange, but also a framework through which developers can realize their own software exchange architecture. Based on K2PRO hardware architecture and characteristics, BM-NP exchange model is developed and adapted.

[0110] (4) Control plane software (PI & Stratum): The control plane allows administrators to configure the data plane behavior of network devices. Through the control logic written by P4 language, administrators can define different types of table entries, operations, counters, etc., so as to determine the processing method of data packets in network devices.

[0111] In summary, users do not need to care about the details of the underlying hardware to realize the programming description of the processing method of data packets. This feature is realized through P4 front-end and back-end compilers. The front-end compiler converts the P4 high-level language program into an intermediate representation IR, and the back-end compiler compiles the IR into device configuration to automatically configure the target device.

[0112] In summary, the above embodiments of the present application can solve the problems of being limited by physical resources, having deficiencies in porting on different architectures and different platforms, having high costs, and having limitations in application on different platforms in the implementation of platforms based on self-owned hardware architecture.

[0113] The present application also provides a P4 programming language multi-service scenario test device for executing all or part of the P4 programming language multi-service scenario test method. The device is arranged in a system on chip SoC in a data processor DPU, as shown in Figure 3 , the P4 programming language multi-service scenario test device specifically includes the following contents:

[0114] The file acquisition module 10 is used to acquire the respective assembly files corresponding to the P4 programming language description service files of each service scenario.

[0115] The format conversion and configuration module 20 is used to generate the target files in pure text format corresponding to each of the assembly files, and to respectively configure the table entries of each of the target files.

[0116] The scenario test module 30 is used to respectively test the respective service scenarios according to each of the target files after configuration.

[0117] The embodiment of the P4 programming language multi-service scenario test device provided in the application can be specifically used for executing the processing procedure of the embodiment of the P4 programming language multi-service scenario test method in the above embodiment, and the function thereof will not be repeated here, and the detailed description can be referred to the above embodiment of the P4 programming language multi-service scenario test method.

[0118] As can be known from the above description, the P4 programming language multi-service scenario test device provided in the embodiment of the application can provide a parallel transplantation mode of the P4 programming language between different platforms by implementing the test of the P4 programming language in the multi-service scenario, which is helpful for the flexible expansion of services under the DPU network card platform; the P4 programming language multi-service scenario test based on the DPU can solve the problem that the P4 programming language is limited by physical resources in different platforms, and thus can effectively improve the efficiency and reliability of the P4 programming language test and data transmission in different platforms.

[0119] Based on the P4 programming language multi-service scenario test method and / or the P4 programming language multi-service scenario test device provided in the above embodiment, the application further provides an embodiment of a DPU, which is shown in Figure 4 , wherein a P4 programming language multi-service scenario test device is arranged in a system on chip (SoC) of the DPU, and the P4 programming language multi-service scenario test device is used to execute the P4 programming language multi-service scenario test method provided in the above embodiment.

[0120] The P4 programming language multi-service scenario test device is provided with an assembler, control plane software and a P4 programmable software switch model.

[0121] The assembler is used to generate a binary file corresponding to each of the assembly files respectively and convert each of the binary files into a target file in a pure text format respectively.

[0122] The control plane software is used to receive configuration information for each of the service scenarios respectively and perform table item configuration according to each of the configuration information respectively, so as to determine the processing mode of each of the target files in the network device.

[0123] Based on the P4 programming language multi-service scenario test method and / or the P4 programming language multi-service scenario test device provided in the above embodiment, the application further provides an embodiment of a P4 programming language multi-service scenario test system, which is shown in Figure 5 , and the P4 programming language multi-service scenario test system specifically includes the following contents.

[0124] The DPU, a host and a test equipment which are in communication connection with the P4 programming language multi-service scenario test device in the system on chip (SoC) of the DPU, and the test equipment is also in communication connection with the host.

[0125] The system on chip SoC is used to execute the P4 programming language multi-service scenario test method provided by the above-mentioned embodiments;

[0126] The host (HOST side) is provided with a P4 compiler, which is used to compile the service file respectively corresponding to each service scenario and described based on the P4 programming language to generate the assembly file respectively corresponding to each service scenario, and copy each assembly file, and send the copied each assembly file to the P4 programming language multi-service scenario test device;

[0127] The target device (Target end) is used to execute the test for each service scenario together with the P4 programming language multi-service scenario test device.

[0128] Referring to Figure 6 The process of executing the P4 programming language multi-service scenario test by using the P4 programming language multi-service scenario test system specifically contains the following contents:

[0129] S1: The tester (Actor end) logs in the host (HOST end) through the control terminal and command line, and generates the assembly file through the command of L2, L3, L4 and L5;

[0130] S2: The host returns the message of successful assembly file generation;

[0131] S3: The tester copies the assembly file generated by the host to the SoC end of the DPU;

[0132] S4: The SoC end returns the message of successful copying;

[0133] S5: The copied generated assembly file is loaded on the SoC end, and the microcode is updated;

[0134] S6: After the SoC end is loaded successfully, it returns the loading completion and prompts that the microcode updating has been completed;

[0135] S7: The driver file is loaded on the SoC end, and the Stratum and P4RT service are started;

[0136] S8: The loading of the driver, the starting of the Stratum and the P4RT service are returned successfully;

[0137] S9: The tester logs in the target device (Target end) through the control terminal and command line, and issues the message sending instruction under the 0 port, and returns the success message of the issued instruction;

[0138] S10: The Target end 1 port normally captures the sent message.

[0139] The application mainly integrates the programmable language P4 tool chain through the DPU card, directly connects the HOST end and the Target device MAC interface at the far end of the Target MAC interface, and realizes the test of various scenarios (such as L2 VLAN, L3 IPV4 / V6, L4 TCP / UDP, VxLAN, GRE, GENEVE, MPLS, etc.) of different service scenarios of P4 programmable language in a hardware environment, including but not limited to function test, performance and security test. Specifically, the test of each service scenario is specifically as follows:

[0140] (1) The test method in the L2 VLAN scenario mainly realizes the following steps:

[0141] 1) Compile the P4 implementation VLAN two-layer forwarding (L2_vlan.p4) file through the P4C assembler to generate an assembly file, such as parser.asm (parser file), ma.asm (match action shunt), and deparser.asm (reverse analyzer) file;

[0142] 2) Generate a corresponding binary file.bin file through the assembler from the.asm format file;

[0143] 3) Convert the file into a.csv format file;

[0144] 4) Install the driver on the SoC end, and check whether the installation is successful through the command;

[0145] 5) Start the Stratum and P4RT controller on the SoC end, and configure the table item;

[0146] 6) Compile the software package on the Target end, compile the data package, and set the data table item Key;

[0147] 7) Capture the Target end 0 and 1 interface messages through Wireshark (network packet analysis software);

[0148] 8) Configure the packet sending command, such as “sudo. / xb_ether_tester.exe-i enp1s0-f tcp_74.etc--burst-num=1” (data sending instruction);

[0149] 9) Capture the data message through Wireshark, compare whether the output message and the input message are changed, and P4 defines the VLAN and DMAC (destination mac address) packet forwarding.

[0150] (2) The test method in the L3 IPV4 / IPV6 scenario mainly realizes the following steps:

[0151] 1) Compile the l3_ipv4.p4 (L3 layer ipv4 protocol type) file through the P4C compiler to generate assembly files such as parser.asm, ma.asm, and deparser.asm;

[0152] 2) Assemble the parser.asm, ma.asm, and deparser.asm files through an assembler to generate corresponding binary files parser.bin (parser file), ma.bin (shunt file), and deparser.bin (deparser file);

[0153] 3) Convert the binary files parser.bin, ma.bin, and deparser.bin into.csv files through the trans.py (python script name) file;

[0154] 4) Install the driver on the SoC side, and check whether the installation is successful through a command;

[0155] 5) Start the Stratum and P4RT controller on the SoC side, and configure table entries;

[0156] 6) Compile the software package on the Target side, compile a data package, and set the data table entry Key;

[0157] 7) Capture the Target 0 and 1 interface messages through Wireshark respectively;

[0158] 8) Configure the packet sending command;

[0159] 9) Capture packets through Wireshark and compare, output whether the data of the output packet and the input packet has changed, because P4 defines IPv4 / IPv6 for packet forwarding and TTL (Time To Live, maximum network hop count) is reduced by 1, so it is judged that there is a receive and transmit packet and attention TTL.

[0160] (3) Test method in L4 TCP / UDP scenario, the main implementation steps are as follows:

[0161] 1) Compile the l4_tcp.p4 / l4_udp.p4 (L4 layer TCP protocol / L4 layer UDP protocol) file through the P4C compiler to generate assembly files parser.asm, ma.asm, and deparser.asm;

[0162] 2) Assemble the parser.asm, ma.asm, and deparser.asm files through an assembler to generate corresponding binary files parser.bin, ma.bin, and deparser.bin;

[0163] 3) Convert the binary files parser.bin, ma.bin, deparser.bin to.csv files through the trans.py file;

[0164] 4) Install the driver on the SoC side, and check whether the installation is successful through the command;

[0165] 5) Start the Stratum and P4RT controller on the SoC side, and configure the table item;

[0166] 6) Compile the software package on the Target side, compile the data package, and set the data table item Key;

[0167] 7) Capture the Target 0 and 1 interface packets through Wireshark respectively;

[0168] 8) Configure the packet sending command, such as “sudo python3. / packet_send.py enp1s0f0np0 tcp” (interface execution configuration instruction);

[0169] 9) Capture the packets through Wireshark and compare them, output whether the data of the output packet and the input packet has changed, because P4 defines IPv4 / IPv6 to do packet forwarding while TTL is reduced by 1, so it is judged that there are sending and receiving packets and attention to TTL.

[0170] (4) The encapsulation / decapsulation test method in the L5 VxLAN scenario, the main implementation steps are as follows:

[0171] 1) Compile the l5_VxLAN.p4 file through the P4C compiler to generate the assembly files parser.asm, ma.asm, and deparser.asm;

[0172] 2) Assemble the parser.asm, ma.asm, and deparser.asm files through the assembler to generate the corresponding binary files parser.bin, ma.bin, and deparser.bin;

[0173] 3) Convert the binary files parser.bin, ma.bin, and deparser.bin to.csv files through the trans.py file;

[0174] 4) Install the driver on the SoC side, and check whether the installation is successful through the command;

[0175] 5) Start Stratum, P4RT controller on the SoC side, and configure table items, such as "sudo stratum_yusur & python3-m p4runtime_sh --grpc-addr 127.0.0.1:9559 --device-id 1 --election-id 0,1 --config l5_vxlan_p4info.txt,null" (VXLAN configuration instruction is issued on the SoC side);

[0176] 6) Compile the software package on the Target side, compile the data package, and set the data table item Key;

[0177] 7) Capture the Target side 0 and 1 interface messages through Wireshark respectively;

[0178] 8) Capture the package through Wireshark and compare the output package and input package data to determine whether there is a change;

[0179] 9) Execute the packet sending command, such as "sudo python3. / packet_send.py enp1s0f0np0 vxlan_encap" (specify the interface to issue the sending instruction and perform packet sending).

[0180] (5) The encapsulation / decapsulation test method in the L5 GRE scenario, and the main implementation steps are as follows:

[0181] 1) Compile the l5_gre.p4 (compile L5 layer GRE file) file through the P4C compiler to generate the assembly files parser.asm, ma.asm, and deparser.asm;

[0182] 2) Assemble the parser.asm, ma.asm, and deparser.asm files through the assembler to generate the corresponding binary files parser.bin, ma.bin, and deparser.bin;

[0183] 3) Convert the binary files parser.bin, ma.bin, and deparser.bin into.csv files through the trans.py file;

[0184] 4) Install the driver on the SoC side, and check whether the installation is successful through the command;

[0185] 5) Start Stratum, P4RT controller on the SoC side, and configure table items, such as "sudo stratum_yusur & python3-m p4runtime_sh --grpc-addr 127.0.0.1:9559 --device-id 1 --election-id 0,1 --config l5_gre_p4info.txt,null" (SoC side table item configuration instruction);

[0186] 6) Compile the software package on the Target side, compile the data package, and set the data table item Key;

[0187] 7) Capture Target side 0 and 1 interface messages through Wireshark respectively;

[0188] 8) Capture packets through Wireshark and compare, output whether the data of the output packet and the input packet has changed;

[0189] 9) Execute the packet sending command, such as "sudo python3. / packet_send.py enp1s0f0 np0 gre_decap" (send packets to the specified interface through the instruction).

[0190] (6) The encapsulation / decapsulation test method in the L5 GENEVE scenario mainly includes the following implementation steps:

[0191] 1) Compile the l5_geneve.p4 (compile L5 layer GENEVE file) file through the P4C compiler to generate the assembly files parser.asm, ma.asm, and deparser.asm;

[0192] 2) Assemble the parser.asm, ma.asm, and deparser.asm files through the assembler to generate the corresponding binary files parser.bin, ma.bin, and deparser.bin;

[0193] 3) Convert the binary files parser.bin, ma.bin, and deparser.bin into.csv files through the trans.py file;

[0194] 4) Install the driver on the SoC side, and check whether the installation is successful through the command;

[0195] 5) Start Stratum, P4RT controller on the SoC side, and configure table items;

[0196] 6) Compile the software package on the Target side, compile the data package, and set the data table item Key;

[0197] 7) Capture Target 0, 1 interface packet respectively through Wireshark;

[0198] 8) Capture packet through Wireshark, compare and output whether the data of the output packet and the input packet has changed;

[0199] 9) Execute the packet sending command, such as "sudo python3. / packet_send.py enp1s0f0np0 geneve_encap (execute the packet sending instruction, send packets to the specified interface)".

[0200] (7) The encapsulation / decapsulation test method in the L2.5 MPLS scenario, the main implementation steps are as follows:

[0201] 1) Compile the l5_mpls.p4 (compile L5 layer MPLS file) file through the P4C compiler to generate the assembly files parser.asm, ma.asm, deparser.asm;

[0202] 2) Assemble the parser.asm, ma.asm, deparser.asm files through the assembler to generate the corresponding binary files parser.bin, ma.bin, deparser.bin;

[0203] 3) Convert the binary files parser.bin, ma.bin, deparser.bin into.csv files through the trans.py file;

[0204] 4) Install the driver on the SoC side, and check whether the installation is successful through the command;

[0205] 5) Start the Stratum, P4RT controller on the SoC side, and configure the table item;

[0206] 6) Compile the software package on the Target side, compile the data packet, and set the data table item Key;

[0207] 7) Capture Target 0, 1 interface packet respectively through Wireshark;

[0208] 8) Capture packet through Wireshark, compare and output whether the data of the output packet and the input packet has changed;

[0209] 9) Execute the packet sending command, such as "sudo python3. / packet_send.py enp1s0f0np0 mpls_encap (start packet sending instruction)".

[0210] In summary, the P4 programming language multi-service scenario test method provided in the application is implemented through software and hardware in the DPU network card. P4 is programmable based on the DPU network card hardware platform, and a tool set, an assembler, and a linker of P4 are designed. According to the operation of the application, the control plane and the data plane of the programmable tool P4 are flexibly compiled and flexibly configured in different platforms of software and hardware based on the DPU network card, the effective conversion of an upper-layer application Stratum and a middle-range protocol PI, BM-NPU bottom-layer table item management, or NPU table item management are implemented, the driving loading of the hardware behavior simulation BM-NPU is implemented through Stratum on the control layer, and P4runtime implementation of the P4 control layer is completed using a PI interface. The forwarding flow table of hardware and the BM-NPU can be configured respectively, the logical correctness and the syntax accuracy of the P4 service input source are tested, the tool is used for verification and testing of a Yusur-P4C compiler and a DPU hardware platform, the DPU network card packet sending and packet capturing operations based on the hardware environment are used for effective analysis and verification of the message, and the PI or Stratum control plane component can be used for the delivery configuration.

[0211] The assembler outputs a target generation file and an error prompt. According to the DPU hardware platform instruction set, the instruction scheduling function and implementation are effectively completed in the assembler. BMv2 is in a test environment and a separate chip hardware environment, and the function behavior of the hardware is simulated.

[0212] The P4 language service flow test is performed on the BM-NP. The input of the target file is obtained through the assembler, the label positioning is implemented through the redirection operation, the standard ELF format file header is generated, the problem positioning analysis is effectively implemented, the CRC check is added, the integrity of the final binary file is ensured, the effective check is first performed, and the integrity and uniformity of the file in the transmission or packaging process are ensured.

[0213] The flexible configuration and data interaction in any environment improve the test efficiency, various scenarios of the P4 programmable language in the software and hardware environment are tested (for example, L2 ETH, L2 LVAN, L3 IPV4 / V6, L4 TCP / UDP, VxLAN, L5 GRE, GENEVE, L2.5 MPLS, etc.), different service scenarios are effectively verified, the service flexible expansion under the DPU network card platform is helpful, and the test requirements of L2, L3, L4, L5, and the like in different scenarios are quickly and efficiently implemented.

[0214] Those of ordinary skill in the art will appreciate that the various illustrative components, systems and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or both. The particular implementation is dependent on the specific application and design constraints imposed on the overall system. Skilled persons can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, for example, the hardware can comprise an electronic circuit, an Application-Specific Integrated Circuit (ASIC), appropriate firmware, a plug-in card, a function card, etc. When implemented in software, the elements of the present application are the program or code segments to perform a particular task. The program or code segments can be stored in a machine-readable medium, or carried by a data signal in a carrier wave through a transmission medium or a communication link.

[0215] It is to be understood that the application is not limited to the particular configurations and processes described herein and shown in the figures. For simplicity, detailed descriptions of known methods are omitted. In the above-described embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and one skilled in the art can make various changes, modifications and additions, or change the order of the steps, after understanding the spirit of the present application.

[0216] In the present application, the features described and / or illustrated for one embodiment can be used in the same way or in a similar way in one or more other embodiments, and / or in combination with or instead of features of other embodiments.

[0217] The above description is merely illustrative of the application, and is not intended to limit the application. The embodiments of the application can be modified and changed in various ways by those skilled in the art, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the application should be included in the protection scope of the application.

Claims

1. A multi-service scenario testing method for the P4 programming language, characterized in that, The method is executed in a system-on-chip (SoC) within a data processor (DPU), and the method includes: Obtain the assembly files corresponding to the P4 programming language description business files for each business scenario; Generate plain text target files corresponding to each of the assembly files, and configure the table entries for each of the target files respectively; Based on the P4 programmable software switch model, the corresponding service scenarios are tested according to the target files generated after configuration; wherein, the P4 programmable software switch model includes: a network processing simulator switching model developed on the BMv2 framework based on the third-generation DPU chip K2-Pro. The step of generating the plain text format target file corresponding to each of the assembly files includes: The local assembler generates binary files corresponding to each assembly file, and converts each binary file into a plain text target file, wherein the plain text format includes CSV format; the assembler is used to complete instruction scheduling functions and implementation according to the DPU hardware platform instruction set; The various service scenarios include: service forwarding scenarios based on VLAN protocol, service forwarding scenarios based on IPv4 or IPv6 protocol, flow forwarding scenarios based on TCP / UDP protocol, encapsulation and decapsulation scenarios based on VxLAN protocol, encapsulation and decapsulation scenarios based on GRE protocol, encapsulation and decapsulation scenarios based on GENEVE protocol, and encapsulation and decapsulation scenarios based on MPLS protocol. The tests corresponding to each of the aforementioned business scenarios include: Forwarding tests for the aforementioned VLAN protocol-based service forwarding scenario; Forwarding tests for the aforementioned service forwarding scenarios based on IPv4 or IPv6 protocols; Stream forwarding tests for the aforementioned TCP / UDP-based stream forwarding scenario; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the VxLAN protocol; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the GRE protocol; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the GENEVE protocol; In addition, encapsulation and decapsulation testing for the encapsulation and decapsulation scenarios based on the MPLS protocol.

2. The multi-service scenario testing method for the P4 programming language according to claim 1, characterized in that, The step of obtaining the assembly files corresponding to the P4 programming language description business files for each business scenario includes: The system receives assembly files corresponding to each business scenario. Each assembly file is generated in advance by the host-side P4 compiler after compiling the business files described in the P4 programming language for each business scenario.

3. The multi-service scenario testing method for the P4 programming language according to claim 1, characterized in that, The configuration of each of the aforementioned business scenarios includes: Install the driver locally and start the local control panel software; The control plane software receives configuration information for each of the service scenarios and configures table entries according to the configuration information to determine the processing method of each target file in the network device.

4. The multi-service scenario testing method for the P4 programming language according to claim 1, characterized in that, The step of testing the corresponding business scenarios based on the target files generated after configuration includes: Based on the configured target files, tests for each of the business scenarios are jointly performed with the established testing devices.

5. The multi-service scenario testing method for the P4 programming language according to claim 3, characterized in that, The control plane software includes: Stratum control plane and P4RT controller.

6. A multi-service scenario testing device for the P4 programming language, characterized in that, The device is disposed in a system-on-a-chip (SoC) within a data processor (DPU), and the device includes: The file acquisition module is used to acquire the assembly files corresponding to the P4 programming language description business files for each business scenario; The format conversion and configuration module is used to generate plain text format target files corresponding to each of the assembly files, and to configure the table entries of each of the target files respectively; The scenario testing module is used to test the corresponding service scenarios based on the P4 programmable software switch model and the target files generated after configuration. The P4 programmable software switch model includes a network processing simulator switching model developed on the BMv2 framework based on the third-generation DPU chip K2-Pro. The step of generating the plain text format target file corresponding to each of the assembly files includes: The local assembler generates binary files corresponding to each assembly file, and converts each binary file into a plain text target file, wherein the plain text format includes CSV format; the assembler is used to complete instruction scheduling functions and implementation according to the DPU hardware platform instruction set; The various service scenarios include: service forwarding scenarios based on VLAN protocol, service forwarding scenarios based on IPv4 or IPv6 protocol, flow forwarding scenarios based on TCP / UDP protocol, encapsulation and decapsulation scenarios based on VxLAN protocol, encapsulation and decapsulation scenarios based on GRE protocol, encapsulation and decapsulation scenarios based on GENEVE protocol, and encapsulation and decapsulation scenarios based on MPLS protocol. The tests corresponding to each of the aforementioned business scenarios include: Forwarding tests for the aforementioned VLAN protocol-based service forwarding scenario; Forwarding tests for the aforementioned service forwarding scenarios based on IPv4 or IPv6 protocols; Stream forwarding tests for the aforementioned TCP / UDP-based stream forwarding scenario; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the VxLAN protocol; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the GRE protocol; Encapsulation and decapsulation testing for the aforementioned encapsulation and decapsulation scenarios based on the GENEVE protocol; In addition, encapsulation and decapsulation testing for the encapsulation and decapsulation scenarios based on the MPLS protocol.

7. A DPU, characterized in that, The DPU's system-on-chip (SoC) includes a multi-service scenario testing device using the P4 programming language. The P4 programming language multi-service scenario testing device is used to execute the P4 programming language multi-service scenario testing method according to any one of claims 1 to 5; The P4 programming language multi-service scenario testing device includes an assembler, control plane software, and a P4 programmable software switch model. The assembler is used to generate binary files corresponding to each of the assembly files and convert each of the binary files into plain text format target files. The control plane software is used to receive configuration information for each of the service scenarios and configure table entries according to each configuration information to determine the processing method of each target file in the network device.

8. A multi-service scenario testing system for the P4 programming language, comprising: The DPU as described in claim 7, the host and the accompanying test device that are communicatively connected to the P4 programming language multi-service scenario test device in the system-on-chip SoC of the DPU, and the accompanying test device is also communicatively connected to the host. The host is equipped with a P4 compiler, which is used to compile the business files described by the P4 programming language for each business scenario to generate assembly files for each business scenario, and to copy each assembly file and send the copied assembly files to the P4 programming language multi-business scenario testing device. The accompanying testing device is used in conjunction with the P4 programming language multi-service scenario testing device to perform tests for each of the aforementioned service scenarios.

Citation Information

Patent Citations

  • Methods, systems, and computer readable media for configuring a test system using source code of a device being tested

    US20200401504A1