Programmable message parsing basic processing unit and parsing device based on layered protocol
By adopting a programmable message parsing basic processing unit based on layered protocols in message parsing, and utilizing the VLIW wide instruction architecture and multi-stage pipeline design, the problems of poor versatility and long time consumption in the existing technology are solved, and flexibility is achieved. and high-performance packet parsing to ensure deterministic latency and adaptability.
Patent Information
- Application Number
- CN202311434623.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-10-31
AI Technical Summary
The existing hardware architecture has problems in packet parsing such as poor versatility, waste of area, poor usage flexibility, long packet parsing, and difficulty in estimating delays. It is especially difficult to effectively adapt when different network topologies and performance requirements change. match.
A basic processing unit for programmable message parsing based on layered protocols is designed. It adopts the multi-stage pipeline unit and configuration bus interface of the VLIW wide instruction architecture, and implements bisection by executing preset programmable message parsing actions in parallel. Flexible parsing of layer protocols and improved processing efficiency and performance through multi-level pipeline architecture.
It reduces the complexity of a single basic processing unit, improves the adaptability and processing efficiency of message parsing, obtains deterministic latency, and has the advantages of versatility, programmability, high performance, and parameterizability.
Smart Images

Figure CN117579721B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of message parsing, and in particular to a programmable message parsing basic processing unit and a parsing device based on a layered protocol. Background Art
[0002] Packet parsing plays an important role in network switching, network cards, smart network cards, and data processors DPU (Data Processing Unit) and other equipment. It is generally implemented using various hardware such as field-programmable gate arrays FPGA (Field-Programmable Gate Array), application-specific integrated circuits ASIC (Application-Specific Integrated Circuit) and NPU (Neural Processing Unit) network processors. Since packet parsing varies in different scenarios and performance requirements, different parsing architectures need to be designed. Among them, a hardware architecture that can be applied to requirements such as using FPGA for development in the initial stage and doubling performance when the ASIC product line is updated in the later stage can effectively simplify the technical route of research and development.
[0003] At present, the existing hardware architecture, such as an expandable and reconfigurable switch packet parser basic processing unit structure, organizes multiple levels of basic processing units in a pipeline manner. However, the basic processing unit needs to be reconfigured to realize the configuration of the new network topology graph. Parsing is only a part of message processing. Each time the code needs to be reconstructed to support different network topologies, it needs to be re-verified, time-adjusted, and compiled. In other words, the capabilities of the existing reconfigurable switch packet parser basic processing unit structure need to be customized according to the complexity of the message, and the reconfigurable capabilities of the FPGA need to be used to support different network topologies, and the hardware built once is protocol-related. Therefore, the existing hardware solutions have problems such as poor versatility, waste of area, poor flexibility of use, long message parsing time, and difficult to estimate delay. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a programmable message parsing basic processing unit and a parsing device based on a layered protocol to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present application provides a programmable message parsing basic processing unit based on a layered protocol, comprising: a multi-stage pipeline unit based on a VLIW wide instruction architecture, a configuration bus interface arranged at the input side of the multi-stage pipeline unit, and the same interface group respectively arranged at the input side and the output side of the multi-stage pipeline unit;
[0006] The multi-stage pipeline unit is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface, execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side.
[0007] In some embodiments of the present application, the multi-stage pipeline unit includes: an instruction fetch and alignment module and a programmable message parsing group arranged in sequence from the input side;
[0008] The instruction fetch and alignment module is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and hit and output the corresponding wide instructions corresponding to the layered protocol based on the VLIW wide instruction architecture; at the same time, the instruction fetch and alignment module is also used to perform header alignment processing on the layered protocol and output the corresponding aligned layered header data, so that the programmable message parsing group executes the preset programmable message parsing actions on the target processing object in parallel based on each preset special function register according to the wide instructions corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain the corresponding layered protocol parsing result data.
[0009] In some embodiments of the present application, the programmable message parsing group includes a decoding module, an execution module and an update module connected in sequence; wherein the output end of the instruction fetch and alignment module is respectively connected to the decoding module, the execution module and the update module;
[0010] The decoding module is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol;
[0011] The execution module is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields;
[0012] The update module is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.
[0013] In some embodiments of the present application, the instruction fetch and alignment module includes:
[0014] A VLIW random access memory submodule for storing a plurality of wide instructions for processing layered protocols;
[0015] A hit submodule, used for identifying the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and if the identification is successful, indexing each wide instruction corresponding to the layered protocol from the VLIW random access memory submodule to configure the layered protocol as a programmable target processing object, and outputting each wide instruction corresponding to the layered protocol to the decoding module, the execution module and the update module respectively;
[0016] The header alignment submodule is used to perform header alignment processing on the layered protocol to obtain aligned layered header data corresponding to the layered protocol, and output the aligned layered header data to the decoding module.
[0017] In some embodiments of the present application, the decoding module includes:
[0018] A hierarchical jump register extraction submodule, used for extracting a hierarchical jump register from the aligned hierarchical header data, and outputting the hierarchical jump register to the execution module;
[0019] A layer length calculation register extraction submodule, used for extracting a layer length calculation register from the aligned layer header data, and outputting the layer length calculation register to the execution module;
[0020] The domain value field extraction and decoding submodule is used to extract each domain value field from the current parsing range based on the domain value byte mark field in the wide instruction corresponding to the layered protocol, and decode and convert each domain value field to obtain a corresponding domain value extraction control signal, and output the domain value extraction control signal to the execution module.
[0021] In some embodiments of the present application, the execution module includes:
[0022] A hierarchical jump submodule, configured to perform fuzzy matching comparisons of multiple masked features simultaneously based on a comparison array according to the hierarchical jump register to obtain a next hierarchical jump result corresponding to the hierarchical protocol, and output the next hierarchical jump result to the update module;
[0023] A layered length calculation submodule, used for calculating the length of the layered protocol according to the layered length calculation register to obtain a corresponding length calculation result, and outputting the length calculation result to the update module;
[0024] The domain value extraction submodule is used to extract and compress the corresponding field information in the aligned layered header data from the current parsing range according to the domain value extraction control signal to obtain corresponding field compressed data, and output the field compressed data to the update module.
[0025] In some embodiments of the present application, the update module includes:
[0026] A type updating submodule, used for updating the type indication of the target processing object according to the next layer jump result;
[0027] An offset update submodule, used for updating the parsing progress of the target processing object according to the length calculation result;
[0028] A protocol structure updating submodule, used for recording the layered protocol characteristics for the target processing object according to the next layer jump result and the length calculation result;
[0029] The domain value field update submodule is used to update the fields extracted within the current parsing range according to the field compression data.
[0030] In some embodiments of the present application, a linkage loading submodule is provided in the decoding module or the execution module;
[0031] Correspondingly, if the linkage loading submodule is provided in the decoding module, the execution module and the update module are both provided with a linkage transmission submodule;
[0032] If the linkage loading submodule is provided in the execution module, the linkage transmission submodule is provided in the update module;
[0033] The linkage loading submodule is used to load the processing instructions and data of other modules before the current module into the current module;
[0034] The linkage transmission submodule is used to transmit the processing instructions and data.
[0035] Another aspect of the present application provides a programmable message parsing device based on a layered protocol, comprising: one or more of the programmable message parsing basic processing units based on a layered protocol;
[0036] If there are multiple programmable message parsing basic processing units based on the layered protocol, each of the programmable message parsing basic processing units based on the layered protocol is connected end to end to form a corresponding parsing pipeline;
[0037] If there is one programmable message parsing basic processing unit based on layered protocol, the output of the programmable message parsing basic processing unit based on layered protocol is returned to its own input, and on the input side, it is determined by indication whether to input load a new message or continue to parse the current message to parse the entire message based on a multi-cycle and single-stage processing manner.
[0038] The third aspect of the present application provides an electronic device, including a network card, an intelligent network card or a DPU, in which the electronic device is provided with the programmable message parsing basic processing unit based on the layered protocol or the programmable message parsing device based on the layered protocol.
[0039] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the functions of the programmable message parsing basic processing unit based on a layered protocol or the programmable message parsing device based on a layered protocol.
[0040] The programmable message parsing basic processing unit based on layered protocol provided in the present application includes: a multi-stage pipeline unit based on a VLIW wide instruction architecture, a configuration bus interface arranged on the input side of the multi-stage pipeline unit, and the same interface group respectively arranged on the input side and output side of the multi-stage pipeline unit; the multi-stage pipeline unit is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface, perform preset programmable message parsing actions on the target processing object in parallel based on various preset special function registers to obtain corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side. The present application designs a basic processing unit to implement parsing of a single layered protocol, which can effectively reduce the complexity of a single basic processing unit, can implement complex layered parsing through a simple single-stage capability combination, and can effectively control the circuit area of a single processing unit; the present application adopts a multi-stage pipeline architecture to enable the basic processing unit to have flexible programmability, and can effectively improve the adaptability and versatility of message parsing when requirements change; the present application adopts a VLIW wide instruction architecture to parallelize the execution of parsing actions, which can effectively improve the processing efficiency of message parsing and improve the performance of the basic processing unit, and can obtain deterministic latency, so that the programmable message parsing basic processing unit based on the layered protocol provided by the present application has the advantages of versatility, programmability, deterministic latency, high performance, and parameterizability.
[0041] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.
[0042] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:
[0044] Figure 1 A schematic diagram of the basic architecture of a programmable message parsing basic processing unit based on a layered protocol in one embodiment of the present application.
[0045] Figure 2 A schematic diagram of a preferred architecture of a programmable message parsing basic processing unit based on a layered protocol in one embodiment of the present application.
[0046] Figure 3 A schematic diagram of a second preferred architecture of a programmable message parsing basic processing unit based on a layered protocol in an embodiment of the present application.
[0047] Figure 4 A schematic diagram of a third preferred architecture of a programmable message parsing basic processing unit based on a layered protocol in an embodiment of the present application.
[0048] Figure 5 A schematic diagram of the processing logic of a programmable message parsing basic processing unit based on a layered protocol in one embodiment of the present application.
[0049] Figure 6 This is a logical diagram of IPv4 layered protocol parsing that supports fragmentation in the application example of this application.
[0050] Figure 7 A logical diagram of extracting 40B field layered protocol parsing for IPv6 in the application example of this application.
[0051] Figure 8This is a logical diagram of IPv4 jumping to multiple next-layer protocols in the application example of this application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.
[0053] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.
[0054] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0055] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0056] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0057] Message parsing is generally implemented in two ways: fixed and programmable.
[0058] The fixed method supports fixed network topology protocol analysis and has excellent performance. It is generally used in fixed scenarios and supports new protocols with the help of hardware upgrades or FPGA reconfiguration capabilities.
[0059] Programmable methods emerged with the development of software-defined networks (SDN) and the P4 programming language (protocol-independent), which can dynamically change the supported network topology and protocol parsing. Its implementation is generally achieved by using two technical routes: parallel processors (NPU network processor multi-core) and pipelines (domain-specific architectures (DSA)).
[0060] Parallel processors can process all layers of a message. After a message enters the processor, it can complete the complete header parsing and then process the next message. By having a certain number of processors working in parallel, the expected processing performance can be achieved.
[0061] The pipeline method uses a series of processing modules, each module only parses certain layers, and completes the entire header parsing in a cascade manner. Different messages can enter the pipeline for processing in sequence.
[0062] However, the existing hardware architecture such as the basic processing unit structure of the scalable and reconfigurable switch packet parser usually has the following problems:
[0063] 1. The processing unit capacity needs to be customized according to the complexity of the message, resulting in a waste of area;
[0064] 2. The reconfigurable capabilities of FPGA are needed to support different network topologies;
[0065] 3. Single-build hardware is protocol-dependent and cannot achieve the programmability of more advanced software-defined networks (SDN) and P4 programming languages (Programming Protocol-Independent Packet Processors).
[0066] Based on this, in order to solve the problems of poor versatility, waste of area, poor flexibility of use, long message parsing time and difficult to estimate delay in the existing message parsing hardware architecture, the embodiments of the present application respectively provide a programmable message parsing basic processing unit based on a layered protocol, a programmable message parsing device based on a layered protocol, an electronic device and a computer-readable storage medium, etc., which can reduce the complexity of a single basic processing unit and have flexible programmability, and can improve the adaptability and versatility of message parsing when requirements change, and can effectively improve the processing efficiency of message parsing and improve the performance of the basic processing unit and obtain deterministic delay.
[0067] The details are described in detail through the following examples.
[0068] Based on this, the embodiment of the present application provides a programmable message parsing basic processing unit based on a layered protocol, see Figure 1 The programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0069] A multi-stage pipeline unit 10 based on a VLIW wide instruction architecture, a configuration bus interface 11 arranged at the input side of the multi-stage pipeline unit, and the same interface group arranged at the input side and the output side of the multi-stage pipeline unit respectively.
[0070] It can be understood that the configuration bus interface 11 is used to receive preset configuration information from the configuration bus.
[0071] The interfaces of the basic processing units for programmable message parsing based on the layered protocol are identical except for the configuration bus. The overall message parsing framework with diverse designs can be realized through the consistent interfaces. For example, a pipeline structure is realized by connecting multiple levels of basic processing units end to end; or a multi-cycle processing architecture in which the output bus is looped back to the input bus of the basic processing unit at the same level. The same parameterizable and programmable basic processing unit is applied to different project scenarios.
[0072] The interface groups include a message data bus interface 12 , a parsing indication bus interface 13 , a protocol structure (Struct) bus interface 14 , a field (Fields) bus interface 15 and a linkage bus interface 16 .
[0073] Specifically, the message data bus interface 12 is used to receive the target message transmitted by the message data bus, and the parsing indication bus interface 13 is used to receive the parsing instruction transmitted by the parsing indication bus, so that the multi-stage pipeline unit 10 starts execution processing according to the parsing instruction; the protocol structure bus interface 14 is used to receive the layered protocol characteristics transmitted by the protocol structure bus (which can be abbreviated as Struct bus), mainly Type representing the type, offset representing the position, and len representing the length; the field (Fields) bus interface 15 is used to receive the corresponding field information extracted from the parsing range of the previous basic processing unit according to the decoding configuration transmitted by the field bus (which can be abbreviated as Fields bus); the linkage bus interface 16 is used to receive necessary information loaded from the previous basic processing unit, etc.
[0074] The multi-stage pipeline unit 10 is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and according to the configuration information obtained from the configuration bus interface 11, execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side.
[0075] It is understandable that the multi-stage pipeline unit 10 is used to take the layered protocol of the target message received from the message data bus interface 12 of the input side as the current target processing object. The special function registers therein may at least include a layered jump register, a layered length calculation register, and the like.
[0076] Through the pipeline design of multi-stage pipeline units and VLIW wide instruction DSA architecture. The pipeline structure is divided into multiple stages, so that the programmable message parsing basic processing unit based on the layered protocol provided in the embodiment of the present application is similar to the general CPU architecture, but the programmable message parsing basic processing unit based on the layered protocol adopts wide instructions, has no general registers, and all are special registers to realize parallel processing. In other words, the architectural features of the programmable message parsing basic processing unit based on the layered protocol provided by the present application determine that the programmable message parsing basic processing unit based on the layered protocol has both the flexibility of the general CPU architecture (VLIW wide instruction programmable) and the high performance of the pipeline (parallel high performance and deterministic delay) characteristics.
[0077] In one or more embodiments of the present application, the number of stages of the multi-stage pipeline unit can be set according to actual application requirements, for example, it can be set to 3 or 4 stages.
[0078] That is to say, the programmable message parsing basic processing unit based on the layered protocol provided in the embodiment of the present application can realize different scenario requirements with a unified message parsing processing unit through the characteristics of programmability (fixed hardware supports programmable network protocols), deterministic latency (internal pipeline architecture), high performance (wide instruction parallel execution), parameterizability (performance and area can be tailored), etc., and is suitable for various requirements of DPU functional verification and product performance upgrading process.
[0079] In one or more embodiments of the present application, the layered protocol-based programmable message parsing basic processing unit specifically refers to a basic processing unit architecture of a programmable message parsing method that is executed using the layered protocol of the message as a processing object.
[0080] From the above description, it can be seen that the programmable message parsing basic processing unit based on the layered protocol provided in the embodiment of the present application can effectively reduce the complexity of a single basic processing unit by designing a basic processing unit to implement parsing of a single layered protocol, can implement complex layered parsing through a simple single-stage capability combination, and can effectively control the circuit area of a single processing unit; the multi-stage pipeline architecture adopted in the present application can enable the basic processing unit to have flexible programmability, and can effectively improve the adaptability and versatility of message parsing when the demand changes; the present application adopts a VLIW wide instruction architecture to parallelize the execution of parsing actions, which can effectively improve the processing efficiency of message parsing and improve the performance of the basic processing unit, and can obtain deterministic delay, so that the programmable message parsing basic processing unit based on the layered protocol provided in the present application has the advantages of versatility, programmability, deterministic delay, high performance, and parameterizability.
[0081] In order to further improve the application reliability, flexibility and efficiency of the multi-stage pipeline unit in the process of programmable message parsing based on the layered protocol, in a basic processing unit for programmable message parsing based on the layered protocol provided in an embodiment of the present application, see Figure 2 The multi-stage pipeline unit 10 in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0082] An instruction fetch and alignment module 20 and a programmable message parsing group 30 are sequentially arranged from the input side.
[0083] The instruction fetch and alignment module 20 is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and to hit and output the wide instruction corresponding to the layered protocol based on the VLIW wide instruction architecture;
[0084] At the same time, the instruction fetch and alignment module 20 is also used to perform header alignment processing on the layered protocol and output corresponding aligned layered header data, so that the programmable message parsing group 30 executes preset programmable message parsing actions on the target processing object in parallel based on each preset special function register according to the wide instructions corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain corresponding layered protocol parsing result data.
[0085] In order to further improve the application reliability, flexibility and efficiency of the programmable message parsing group in the programmable message parsing process based on the layered protocol, in a programmable message parsing basic processing unit based on the layered protocol provided in an embodiment of the present application, see Figure 3 The programmable message parsing group 30 in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0086] A decoding module 40, an execution module 50 and an update module 60 connected in sequence; wherein the output end of the instruction fetch and alignment module 20 is connected to the decoding module 40, the execution module 50 and the update module 60 respectively;
[0087] The decoding module 40 is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol;
[0088] The execution module 50 is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields;
[0089] The update module 60 is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.
[0090] In order to further improve the application reliability, flexibility and efficiency of the instruction fetch and alignment module in the process of programmable message parsing based on the layered protocol, in a basic processing unit for programmable message parsing based on the layered protocol provided in an embodiment of the present application, see Figure 4 The instruction fetch and alignment module 20 as the first stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0091] The VLIW random access memory submodule 21 is used to store a plurality of wide instructions for processing layered protocols.
[0092] Specifically, the VLIW random access memory submodule 21 implements the storage of multiple wide instructions required for processing specific layered protocols. Simple layered protocols are executed by one wide instruction, and complex layered protocols are broken down into multiple wide instructions for combined execution. By storing multiple wide instructions, it is possible for a single basic processing end element to process multiple layered protocols, realizing the programmable characteristics of the basic processing unit structure.
[0093] The hit submodule 22 is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface. If the identification is successful, the various wide instructions corresponding to the layered protocol are indexed from the VLIW random access memory submodule to configure the layered protocol as a programmable target processing object, and the various wide instructions corresponding to the layered protocol are output to the decoding module 40, the execution module 50 and the update module 60 respectively via the VLIW random access memory submodule 21.
[0094] Specifically, the hit submodule can determine whether the current input layered protocol data can be recognized and processed. Since the message parsing basic processing unit is configured with the layered protocol as the object and is programmable, hit processing is required. When the input layered protocol data can be processed, the hit module outputs the VLIW RAM type corresponding index width instruction to achieve the hit of the layered protocol.
[0095] The header alignment submodule 23 is used to perform header alignment processing on the layered protocol to obtain aligned layered header data corresponding to the layered protocol, and output the aligned layered header data to the decoding module 40 .
[0096] Specifically, the header alignment submodule can realize the alignment of layered protocol data starting with bit 0. Data is transmitted from the message data bus, and the starting position of each layer is located at a different position on the bus. The message parsing basic processing unit takes the layered protocol as the object, so the header alignment submodule is used to realize the alignment of each layered protocol data during processing and simplify the processing behavior.
[0097] In order to further improve the application reliability, flexibility and efficiency of the decoding module in the process of programmable message parsing based on the layered protocol, in a basic processing unit for programmable message parsing based on the layered protocol provided in an embodiment of the present application, see Figure 4 The decoding module 40 as the second stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0098] The hierarchical jump register extraction submodule 41 is used to extract the hierarchical jump register from the aligned hierarchical header data and output the hierarchical jump register to the execution module 50 .
[0099] Specifically, the layer jump register extraction submodule can extract the layer jump register from the aligned layer header data. For example, the layer jump register of IPv4 is a 1-byte protocol field of bits 72-79.
[0100] In one or more embodiments of the present application, the hierarchical jump register may be abbreviated as a Type register.
[0101] The layer length calculation register extraction submodule 42 is used to extract the layer length calculation register from the aligned layer header data and output the layer length calculation register to the execution module 50 .
[0102] Specifically, the layer length calculation register extraction submodule extracts the layer length calculation register from the aligned layer header data. For example, the layer length calculation register of IPv4 is the 4-bit IHL field of bits 4-7.
[0103] In one or more embodiments of the present application, the layer length calculation register may be abbreviated as a Len register.
[0104] The domain value field extraction and decoding submodule 43 is used to extract each domain value field from the current parsing range based on the domain value byte mark field in the wide instruction corresponding to the layered protocol, and decode and convert each domain value field to obtain a corresponding domain value extraction control signal, and output the domain value extraction control signal to the execution module 50.
[0105] Specifically, the domain value field extraction and decoding submodule realizes the decoding conversion of the required fields extracted from the current parsing range. The programmable message parsing basic processing unit realizes the extraction of various domain value fields required by the subsequent matching action flow while parsing the layered protocol, thereby accelerating the subsequent processing. The domain value field extraction and decoding submodule receives the domain value byte tag field in the VLIW wide instruction and decodes it into a control signal of the domain value extraction submodule in the execution module 50 of the next level.
[0106] In one or more embodiments of the present application, the domain value field extraction and decoding submodule can be abbreviated as Fields extraction and decoding submodule.
[0107] In order to further improve the application reliability, flexibility and efficiency of the execution module in the programmable message parsing process based on the layered protocol, in a programmable message parsing basic processing unit based on the layered protocol provided in an embodiment of the present application, see Figure 4 The execution module 50 as the third stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0108] The hierarchical jump submodule 51 is used to perform fuzzy matching comparisons with multiple masked features based on the comparison array according to the hierarchical jump register to obtain the next hierarchical jump result corresponding to the hierarchical protocol, and output the next hierarchical jump result to the update module.
[0109] Specifically, the hierarchical jump submodule realizes the fuzzy matching comparison of multiple masked features by comparing the array at the same time to obtain the next hierarchical jump result. For jump matching, simultaneous matching will become more complicated as the jump possibility increases. The hierarchical jump submodule uses a limited number of comparisons to achieve jump coverage for most hierarchical protocols. For hierarchical protocols that exceed the number of jumps, a multi-level combination is used to implement it. In this way, the jump submodule is guaranteed to compare the performance of the array circuit area and timing.
[0110] In one or more embodiments of the present application, the hierarchical jump submodule can be abbreviated as a Type jump submodule.
[0111] The layer length calculation submodule 52 is used to calculate the length of the layered protocol according to the layer length calculation register to obtain a corresponding length calculation result, and output the length calculation result to the update module.
[0112] Specifically, the layered length calculation submodule realizes the calculation of the layered protocol length. A simplified general ALU calculation unit is used to realize the operation of the operand. When the layered protocol length is fixed, the immediate number in the direct load wide instruction is used. When the layered protocol needs to be calculated, the LEN register is used to perform a certain operation through Len to obtain the length result.
[0113] In one or more embodiments of the present application, the layer length calculation submodule can be abbreviated as a Len calculation submodule.
[0114] The domain value extraction submodule 53 is used to extract and compress the corresponding field information in the aligned layered header data from the current parsing range according to the domain value extraction control signal to obtain corresponding field compressed data, and output the field compressed data to the update module.
[0115] Specifically, the domain value extraction submodule realizes the extraction of corresponding fields from the current parsing range according to the decoding configuration. By loading the Fields extraction control signal from the domain value field extraction decoding submodule, the field information required by the subsequent stage is extracted from the layered protocol header data for compression output, which speeds up the time for the subsequent stage to re-extract the field.
[0116] In one or more embodiments of the present application, the field value extraction submodule can be abbreviated as Fields extraction submodule.
[0117] In order to further improve the application reliability, flexibility and efficiency of the update module in the process of programmable message parsing based on the layered protocol, in a basic processing unit for programmable message parsing based on the layered protocol provided in an embodiment of the present application, see Figure 4 The update module 60 as the fourth stage of the pipeline in the programmable message parsing basic processing unit based on the layered protocol specifically includes the following contents:
[0118] The type updating submodule 61 is used to update the type indication of the target processing object according to the next layer jump result.
[0119] Specifically, the type update submodule implements the update of the layered protocol type indication, such as jumping or continuing parsing after parsing is completed. According to whether the jump comparison matches, whether the current layered protocol is parsed, the actual jump of Type is implemented. If multi-level parsing is required, the jump will take effect when the parsing is completed.
[0120] In one or more embodiments of the present application, the type update submodule may be abbreviated as a Type update submodule.
[0121] The offset updating submodule 62 is used to update the parsing progress of the target processing object according to the length calculation result.
[0122] Specifically, the offset update submodule implements the update of the hierarchical protocol parsing progress. The offset is in bytes, indicating the byte offset in the parsing of the entire message. When multiple levels are linked, the offset can be set to 0 to continue parsing the current range; the offset can be set to the parsed length to incrementally parse the subsequent range of this hierarchical protocol; the offset can be set to the length of this hierarchical protocol to complete this hierarchical parsing.
[0123] In one or more embodiments of the present application, the offset update submodule may be abbreviated as an Offset update submodule.
[0124] The protocol structure updating submodule 63 is used to record the layered protocol characteristics for the target processing object according to the next layer jump result and the length calculation result.
[0125] Specifically, the protocol structure update submodule realizes recording of layered protocol features after the layered protocol is parsed. It mainly includes Type representing type, offset representing position, and len representing length. Each layered protocol has only one result. When single-level parsing or linkage parsing is performed, the update occurs at the parsed level and is finally transmitted by the Struct bus.
[0126] In one or more embodiments of the present application, the protocol structure update submodule may be abbreviated as a Struct update submodule.
[0127] The domain value field updating submodule 64 is used to update the fields extracted within the current parsing range according to the field compression data.
[0128] Specifically, the domain value field update submodule realizes the update of the useful fields extracted within the current parsing range. When there are multiple levels of linkage, if there are fields extracted, they are updated and transmitted, and finally transmitted by the Fields bus.
[0129] In one or more embodiments of the present application, the domain value field update submodule can be abbreviated as the Fields update submodule.
[0130] That is to say, the basic processing unit provided in the embodiment of the present application can realize the overall and local parsing of the layered protocol, and realizes the parsing of the message layered protocol as the object. The basic processing unit is a 4-stage pipeline and a VLIW wide instruction architecture. Through the pipeline method, multiple execution sub-modules are used to realize the parallel execution of message parsing actions. The layered protocol within the processing capacity of the basic processing unit is parsed through the capacity of a basic processing unit; for complex layered protocols, they are parsed through a combination of the capabilities of multiple basic processing units. Compared with the NPU network processor with a RISC reduced instruction architecture, it implements the parsing of layered protocols of different complexities through the number of instructions, and there is uncertainty in the processing time. The programmable message parsing basic processing unit structure implemented by the present application is designed through a 4-stage pipeline, and parallelization is achieved through VLIW wide instructions to obtain deterministic latency results.
[0131] In order to further improve the reliability and flexibility of the programmable message parsing process based on the layered protocol, in a basic processing unit for programmable message parsing based on the layered protocol provided in an embodiment of the present application, the decoding module 40 or the execution module 50 in the basic processing unit for programmable message parsing based on the layered protocol specifically includes a linkage loading submodule 70;
[0132] Correspondingly, if the linkage loading submodule 70 is provided in the decoding module 40 , the linkage transmission submodule 71 is provided in both the execution module 50 and the update module 60 .
[0133] See also Figure 4 If the linkage loading submodule 70 is set in the execution module 50, the update module 60 is provided with a linkage transmission submodule 71.
[0134] The linkage loading submodule 70 is used to load the processing instructions and data of other modules before the current module into the current module, so that a single basic processing unit of programmable message parsing based on the layered protocol can be used to implement complex layered parsing and control the circuit area of the basic processing unit of programmable message parsing based on the layered protocol.
[0135] Among them, the complex hierarchical parsing refers to the programmable message parsing basic processing unit based on the layered protocol, which can be used to continue parsing the next layered protocol or new message of the current message because the linkage loading submodule 70 is set. Therefore, complex hierarchical parsing can be achieved through a simple single-stage capability combination, effectively controlling the circuit area of a single processing module. Specifically, the linkage loading submodule realizes loading the necessary combination processing information from the previous stage. When the capacity of a single-stage basic processing unit is less than that required to parse a complex layered protocol, a multi-stage cascade method can be used to combine and load the necessary information from the previous stage to continue parsing. When the number of jump comparisons or the domain value extraction range is insufficient, multi-stage processing is used to achieve parsing.
[0136] The linkage transmission submodule 71 is used to transmit the processing instructions and data.
[0137] Specifically, the linkage transmission submodule 71 transmits the instructions and data required for multi-level linkage, and solves the analysis of complex layered protocols by linkage, ensuring that the basic processing unit can solve complex layered protocols while maintaining a small circuit area scale.
[0138] In addition, based on the above-mentioned embodiment of the programmable message parsing basic processing unit based on the layered protocol, the present application also provides an embodiment of a programmable message parsing device based on the layered protocol, and the programmable message parsing device based on the layered protocol specifically includes: one or more programmable message parsing basic processing units based on the layered protocol mentioned in the above-mentioned embodiments;
[0139] If there are multiple programmable message parsing basic processing units based on the layered protocol, each of the programmable message parsing basic processing units based on the layered protocol is connected end to end to form a corresponding parsing pipeline;
[0140] If there is one programmable message parsing basic processing unit based on layered protocol, the output of the programmable message parsing basic processing unit based on layered protocol is returned to its own input, and on the input side, it is determined by indication whether to input load a new message or continue to parse the current message to parse the entire message based on a multi-cycle and single-stage processing manner.
[0141] Specifically, the programmable message parsing device based on the layered protocol can change the organizational structure used by the basic unit:
[0142] 1. Pipeline form: connect the basic processing units for packet parsing end to end to form a packet parsing pipeline;
[0143] 2. Processor form: The output of the basic unit for parsing the message is returned to its own input. At the input, it is determined by indicating whether the input is to load a new message or continue to parse the current message, so that a single-stage processing module spends multiple cycles to parse the entire message.
[0144] That is to say, the programmable message parsing device based on the layered protocol provided in the embodiment of the present application adopts the capabilities of one or more hardware basic processing units to realize the parsing of a single layered protocol, thereby reducing the complexity of a single basic processing unit; adopts a multi-stage pipeline architecture similar to a general-purpose processor to achieve flexible programmability; adopts wide instruction parallelization to execute parsing actions to improve performance and obtain deterministic latency; adopts parameterized design to expand the applicable scenarios of the basic processing unit; through the above features, the present application has the characteristics of programmability, deterministic latency, high performance, and parameterizability.
[0145] Further, based on the above-mentioned embodiments of the programmable message parsing basic processing unit based on layered protocol and / or the programmable message parsing device based on layered protocol, the present application also provides an embodiment of an electronic device. The electronic device is provided with the programmable message parsing basic processing unit based on layered protocol or the programmable message parsing device based on layered protocol mentioned in the above-mentioned embodiments.
[0146] The electronic device may include a processor, a memory, a receiver and a transmitter, wherein the processor is used to execute the basic processing unit for programmable message parsing based on the layered protocol mentioned in the above embodiment, wherein the processor and the memory may be connected via a bus or other means, for example, via a bus. The receiver may be connected to the processor and the memory via a wired or wireless manner.
[0147] The electronic device can also refer in particular to a network processing device, in particular to a network card, an intelligent network card, and a DPU, etc., so that the electronic device can solve the problems faced by existing network cards, intelligent network cards, or DPUs in the programmability and performance iteration of message parsing functions; in the early stages of DPU definition and when product generations have leapt in performance, changes in performance requirements have led to major changes in the hardware architecture. The programmable message parsing basic processing unit, parsing device, and electronic device based on a layered protocol provided in this application can solve the problem that existing hardware solutions cannot adapt to message parsing and cannot be universal when requirements change through their programmable, deterministic latency, high performance, and parameterizable characteristics.
[0148] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the functions of the aforementioned programmable message parsing basic processing unit based on the layered protocol are realized. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0149] In summary, the programmable message parsing basic processing unit, parsing device and electronic device based on layered protocol provided in the embodiment of the present application take layered protocol as the parsing object, can disassemble complex layered protocol into multi-level parsing, and realize relatively simple basic processing unit to handle complex layered protocol parsing; take layered protocol as the processing object, the overall message parsing structure can be organized in pipeline or parallel processor mode. The lowest delay can be obtained through pipeline mode, and the best throughput performance can be obtained through multi-packet interleaving; the programmable characteristics have flexibility, and new protocols can be programmed to support without hardware reconstruction; high performance and deterministic delay calculation can be achieved through wide instructions and pipeline design; parameterized capability setting can realize the setting of the parsing capability boundary of a single-level basic processing unit, and support for different performance requirement scenarios can be achieved.
[0150] For the general pipeline structure, the first-level basic unit parses the first-level layered protocol without distinguishing between simple or complex layered protocols, which leads to the problem of area waste. The programmable message parsing basic processing unit, parsing device and electronic device based on the layered protocol provided by the present application take the layered protocol as the object, and through disassembly, a smaller circuit area can be used to realize programmable support parsing of various protocols. The parameterization capability can also be used to tailor the lower limit of the single-level parsing capability according to project requirements to support performance. Different hardware architectures can be designed using basic processing units according to project requirements. The specific beneficial effects of the programmable message parsing basic processing unit, parsing device and electronic device based on the layered protocol provided in the embodiments of the present application are as follows:
[0151] 1) According to the programmable and multi-level parsable characteristics of the layered protocol of the present application, a relatively simple basic processing unit is obtained to adapt to various customized and complex layered protocol parsing, which solves the problem that other solutions require complex basic processing units for complex protocols or require reconstruction of basic processing units (adding an additional dimension of complexity, adding corresponding dedicated processing logic, and ultimately the circuit area becomes larger and larger, and patches are constantly applied).
[0152] 2) Based on the structural design with consistent input and output interfaces of this application, the basic processing unit can support the diverse possibilities of designing a single message pipeline or a multi-message interleaving architecture, solving the problem that other solutions generally cannot adapt to different project scenarios and market demands by processing a single message in sequence.
[0153] 3) According to the characteristics of parameterizable basic processing unit capabilities of this application, it is supported to adapt to the iterative upgrade of different projects, solving the problem of long cycle of hardware architecture reconstruction due to performance demand changes of other solutions. For example, the performance of FPGA products in the initial stage and the doubling of performance when the ASIC product line is updated in the later stage.
[0154] 4) Through the complex hierarchical disassembly characteristics of the present application, the scale of the fuzzy matching parallel comparison array is controlled, solving the problem of complex message parsing jump design in other solutions.
[0155] In order to further illustrate the above embodiments provided in this application, based on Figure 5 The processing logic of the programmable message parsing basic processing unit based on the layered protocol shown in the present application is described in detail in the following four specific application examples. Figure 5 The overall architecture and Figure 4 Provides the exact same architecture, and Figure 5 The various function boxes in Figure 4 The functional modules at corresponding positions correspond one to one.
[0156] (1) Application example of layer 1 protocol analysis
[0157] Used to implement Ethernet II layered protocol parsing (a general layered protocol application example).
[0158] As shown in Table 1, this application example will perform Ethernet II layered analysis through the capabilities of a single-level basic processing unit.
[0159] Table 1
[0160]
[0161]
[0162] Most of the layered protocol parsing is similar and simple, so the basic processing unit capability boundary is controlled within a certain range, so that a small circuit area can solve most of the problems. Others can achieve multi-level combined parsing through the linkage mechanism of this application example.
[0163] (2) Application example of layer 2 protocol analysis
[0164] Used to implement the parsing of IPv4 layered protocols that support fragmentation judgment (adding a pseudo-layer layered protocol application example).
[0165] Whether IPv4 is fragmented is determined by its Fragment Offset field. If it is 0, it is a regular IPv4, and it will continue to jump to the next layer according to the protocol field. If it is not 0, after parsing the IPv4, the protocol field is ignored and no jump comparison is performed, and it jumps directly to the payload. IPv4 parsing originally required extracting the Fragment offset and protocol fields at the same time for parsing. This exceeds the ability of comparing one field conventionally.
[0166] See also Figure 6 This application example will use the two-level basic processing unit capabilities and add a front pseudo layer to perform IPv4 layered analysis that supports fragmentation judgment. The details are as follows:
[0167] a) The first-level capability configuration (note that only the parsing capabilities of interest are listed below) is as follows:
[0168] See Table 2 to implement IPv4_Pseudo pseudo layer parsing:
[0169] Only parse and check the Fragment offset field. If it is 0, jump to IPv4. If it is not all 0, jump to IPv4_frag.
[0170] If Offset is not updated, it means that the next parsing module will continue parsing at the original position.
[0171] Table 2
[0172]
[0173]
[0174] b) The second level capability is configured as follows. There are two ways to analyze the first level results:
[0175] First, see Table 3 to implement IPv4_Frag layer parsing.
[0176] Table 3
[0177]
[0178] Second, see Table 4 to implement IPv4 layer resolution.
[0179] Table 4
[0180]
[0181] By adding a pseudo-layer, it is possible to check the current range once without updating the offset. This method can also handle special layered protocols that need to be parsed based on multiple fields, such as the last layer of MPLS (need to check the IPv4 / 6version field immediately following), GRE (additional check of the cks field), IGMPv3, IPv6 fragment extension header, etc.
[0182] (3) Application Example of Layer 3 Protocol Analysis
[0183] Used to implement the parsing of IPv6 layered protocols (a layered protocol application example with two-level module field extraction capabilities).
[0184] IPv6 has a total header length of 40B. Assuming that the field extraction capability of the basic processing module is 32B, when extracting fields for IPv6, 8B will exceed the capability of the basic processing module and need to be combined and resolved.
[0185] See also Figure 7 This application example will perform field parsing in the IPv6 40B range through two-level basic processing unit capabilities and two-level field extraction capabilities:
[0186] a) The first level capability configuration is shown in Table 5 (Note that only the parsing capabilities of interest are listed below).
[0187] Table 5
[0188]
[0189] b) The second level capability configuration is shown in Table 6.
[0190] Table 6
[0191]
[0192] c) By advancing the offset twice, the combined analysis within the capability range can be achieved.
[0193] (4) Application Example of Layer 4 Protocol Analysis
[0194] See also Figure 8 , used to implement IPv4 layered protocol jump to multiple next-layer layered protocol parsing (a layered protocol application example with two-level comparison capability).
[0195] a) The first-level capability configuration (note that only the parsing capabilities of interest are listed below) is as follows:
[0196] See Table 7 for a comparison of redirection of TCP, UDP, ICMP, and IGMP.
[0197] Table 7
[0198]
[0199]
[0200] b) The second level capability configuration is as follows:
[0201] See Table 8, loading from the upper linkage, protocol field, Len result, and comparison of jump SCTP, Payload.
[0202] Table 8
[0203]
[0204] The above introduces several application examples of layered parsing by the basic processing unit for packet parsing. In addition, multiple mixed situations can also be achieved through linkage. Through the above application examples, it is demonstrated that this application example can achieve layered parsing of various complex protocols using a simple basic processing unit.
[0205] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0206] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0207] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0208] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A programmable message parsing basic processing unit based on a layered protocol, characterized in that: include: A multi-stage pipeline unit based on a VLIW wide instruction architecture, a configuration bus interface arranged at the input side of the multi-stage pipeline unit, and a same interface group arranged at the input side and the output side of the multi-stage pipeline unit respectively; The multi-stage pipeline unit is used to take the layered protocol of the target message received from the interface group on the input side as the current target processing object, and execute the preset programmable message parsing action on the target processing object in parallel based on each preset special function register according to the configuration information obtained from the configuration bus interface to obtain the corresponding layered protocol parsing result data, and output the layered protocol parsing result data from the interface group on the output side; The multi-stage pipeline unit comprises: an instruction fetch and alignment module and a programmable message parsing group arranged in sequence from the input side; The instruction fetch and alignment module is used to identify the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and hit and output the corresponding wide instruction corresponding to the layered protocol based on the VLIW wide instruction architecture; at the same time, the instruction fetch and alignment module is also used to perform header alignment processing on the layered protocol and output the corresponding aligned layered header data, so that the programmable message parsing group performs the preset programmable message parsing action on the target processing object in parallel based on each preset special function register according to the wide instruction corresponding to the layered protocol output by the instruction fetch and alignment module and the aligned layered header data, so as to obtain the corresponding layered protocol parsing result data; The programmable message parsing group includes a decoding module, an execution module and an update module connected in sequence; wherein the output end of the instruction fetch and alignment module is connected to the decoding module, the execution module and the update module respectively; The decoding module is used to extract various preset special function registers and various domain value fields within the current parsing range in parallel from the aligned layered header data based on the wide instruction corresponding to the layered protocol; The execution module is used to execute corresponding processing corresponding to each of the special function registers and each of the domain value fields in parallel based on the wide instruction corresponding to the layered protocol, so as to obtain calculation result data corresponding to each of the special function registers and field extraction result data corresponding to each of the domain value fields; The update module is used to update the target processing object according to the calculation result data corresponding to each of the special function registers and the field extraction result data corresponding to each of the domain value fields, so as to obtain the corresponding layered protocol parsing result data.
2. The programmable message parsing basic processing unit based on layered protocol according to claim 1 is characterized in that: The instruction fetch and alignment module comprises: A VLIW random access memory submodule for storing a plurality of wide instructions for processing layered protocols; A hit submodule, used for identifying the layered protocol of the target message received from the interface group on the input side according to the configuration information obtained from the configuration bus interface, and if the identification is successful, indexing each wide instruction corresponding to the layered protocol from the VLIW random access memory submodule to configure the layered protocol as a programmable target processing object, and outputting each wide instruction corresponding to the layered protocol to the decoding module, the execution module and the update module respectively; The header alignment submodule is used to perform header alignment processing on the layered protocol to obtain aligned layered header data corresponding to the layered protocol, and output the aligned layered header data to the decoding module.
3. The programmable message parsing basic processing unit based on layered protocol according to claim 2 is characterized in that: The decoding module comprises: A hierarchical jump register extraction submodule, used for extracting a hierarchical jump register from the aligned hierarchical header data, and outputting the hierarchical jump register to the execution module; A layer length calculation register extraction submodule, used for extracting a layer length calculation register from the aligned layer header data, and outputting the layer length calculation register to the execution module; The domain value field extraction and decoding submodule is used to extract each domain value field from the current parsing range based on the domain value byte mark field in the wide instruction corresponding to the layered protocol, and decode and convert each domain value field to obtain a corresponding domain value extraction control signal, and output the domain value extraction control signal to the execution module.
4. The programmable message parsing basic processing unit based on layered protocol according to claim 3 is characterized in that: The execution module includes: A hierarchical jump submodule, configured to perform fuzzy matching comparisons of multiple masked features simultaneously based on a comparison array according to the hierarchical jump register to obtain a next hierarchical jump result corresponding to the hierarchical protocol, and output the next hierarchical jump result to the update module; A layered length calculation submodule, used for calculating the length of the layered protocol according to the layered length calculation register to obtain a corresponding length calculation result, and outputting the length calculation result to the update module; The domain value extraction submodule is used to extract and compress the corresponding field information in the aligned layered header data from the current parsing range according to the domain value extraction control signal to obtain corresponding field compressed data, and output the field compressed data to the update module.
5. The programmable message parsing basic processing unit based on layered protocol according to claim 4 is characterized in that: The update module includes: A type updating submodule, used for updating the type indication of the target processing object according to the next layer jump result; An offset update submodule, used for updating the parsing progress of the target processing object according to the length calculation result; A protocol structure updating submodule, used for recording the layered protocol characteristics for the target processing object according to the next layer jump result and the length calculation result; The domain value field update submodule is used to update the fields extracted within the current parsing range according to the field compression data.
6. The programmable message parsing basic processing unit based on layered protocol according to any one of claims 1 to 5, characterized in that: The decoding module or the execution module is provided with a linkage loading submodule; Correspondingly, if the linkage loading submodule is provided in the decoding module, the execution module and the update module are both provided with a linkage transmission submodule; If the linkage loading submodule is provided in the execution module, the linkage transmission submodule is provided in the update module; The linkage loading submodule is used to load the processing instructions and data of other modules before the current module into the current module; The linkage transmission submodule is used to transmit the processing instructions and data.
7. A programmable message parsing device based on a layered protocol, characterized in that: include: One or more programmable message parsing basic processing units based on layered protocols as described in any one of claims 1 to 6; If there are multiple programmable message parsing basic processing units based on the layered protocol, each of the programmable message parsing basic processing units based on the layered protocol is connected end to end to form a corresponding parsing pipeline; If there is one programmable message parsing basic processing unit based on layered protocol, the output of the programmable message parsing basic processing unit based on layered protocol is returned to its own input, and on the input side, it is determined by indication whether to input load a new message or continue to parse the current message to parse the entire message based on a multi-cycle and single-stage processing manner.
8. An electronic device, comprising a network card, a smart network card or a DPU, characterized in that: The electronic device is provided with a basic processing unit for programmable message parsing based on a layered protocol as described in any one of claims 1 to 6 or a programmable message parsing device based on a layered protocol as described in claim 7.
Citation Information
Patent Citations
Extensible reconfigurable switch packet parser basic processing unit structure
CN110933001A
Message analysis method and network equipment
CN113824706A
