Programmable hardware logic architecture and logic implementation method based on P4 language

Through the programmable hardware logic architecture based on P4 language, it solves the problem that traditional switching chips cannot support customized processing of network protocol control plane, realizes flexible processing of network messages and expansion of chip usage scenarios, and improves development efficiency and applicability. sex.

CN114296707BActive Publication Date: 2024-08-23WELL CORE MICROELECTRONICS TECH (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210059260.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-02-20
Filing Date
2022-01-19
Publication Date
2024-08-23
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

Traditional switching chips cannot support users to customize the network protocol control plane and cannot carry out secondary development, which limits the innovation and evolution of network architecture and protocols.

Method used

It adopts a programmable hardware logic architecture based on P4 language, including message receiving, data caching, message sending module and programmable logic unit. It processes network messages through extraction, matching and action instructions, allowing users to use P4 language to perform secondary processing on the chip. development.

Benefits of technology

It realizes the identification and processing of any network packets, increases the usage scenarios of the chip, improves the efficiency of hardware code development, supports richer application scenarios, and does not need to rewrite the code for each new project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296707B_ABST
    Figure CN114296707B_ABST
Patent Text Reader

Abstract

The present invention discloses a programmable hardware logic architecture and logic implementation method based on P4 language. The programmable hardware logic architecture includes: a message receiving module, a data cache module, a message sending module and a programmable logic unit; the programmable logic unit further includes: an extraction instruction storage module, an extraction data module, a matching module, an action instruction storage module and an action module. The programmable hardware logic architecture of the present invention allows users to use the P4 language to perform secondary development on chips using the architecture, identify any network message, assign, shift, and perform common ALU operations on any bit field, and increase the use scenarios of the chip. By adopting the programmable hardware logic architecture of the present invention, there is no need to rewrite the code for each new project as a whole, which is conducive to improving the efficiency of hardware code development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of programmable hardware, and in particular to a programmable hardware logic architecture and logic implementation method implemented based on the P4 language. Background Art

[0002] With the development of modern communication technology, the demand for high-speed real-time communication between different networks is becoming more and more complex. Sometimes it is necessary to perform control plane processing on network protocol messages according to the actual Internet network. Traditional switching chips cannot support users' customized processing of network protocol control plane after tape-out, that is, they cannot perform secondary development operations.

[0003] In order to fully unleash the programming capabilities of the data plane, Professor Nick McKeown of Stanford University first designed and proposed the data plane domain-specific programming language P4 in 2014. It has received widespread attention and recognition from academia and industry since its proposal. The industry has followed up and started to develop a series of high-performance programmable hardware. On the one hand, based on the customizable characteristics of programmable hardware, some new network architectures, functions and protocols can be quickly implemented and verified, greatly accelerating network evolution and innovation; on the other hand, based on the high-performance characteristics of programmable hardware, some relatively simple network functions such as firewalls and load balancing that are traditionally implemented by flexible but low-performance middleware can be offloaded to the programmable data plane to obtain considerable performance improvements. Summary of the invention

[0004] The main technical problem solved by the present invention is to provide a programmable hardware logic architecture based on the P4 language, allowing users to use the P4 language to perform secondary development on chips using this architecture, thereby increasing the use scenarios of the chips. The present invention also provides a logic implementation method for programmable hardware.

[0005] In a first aspect, the present disclosure provides a programmable hardware logic architecture implemented based on the P4 language, including: a message receiving module, a data caching module, a message sending module and a programmable logic unit; the programmable logic unit includes: an extraction instruction storage module, an extraction data module, a matching module, an action instruction storage module and an action module; wherein the message receiving module is used to receive a message, identify whether the message is valid, store the valid message in the data caching module, and generate a descriptor according to the received message and output it to the programmable logic unit, wherein the descriptor includes an agreed partial message information and a storage address of the extraction instruction; the data caching module is used to cache the message stored in the message receiving module, and provide the cached message to the message sending module; the data extraction module is used to generate a descriptor according to the received message and output it to the programmable logic unit. The storage address carried by the descriptor is used to obtain the extraction instruction from the extraction instruction storage module, extract the data at the specified position from the descriptor according to the obtained extraction instruction, and output the obtained extraction data to the matching module; the matching module is used to compare the extracted data with the stored matching data, and output the storage address of the action instruction to the action module according to the comparison result; the action module is used to obtain the action instruction from the action instruction storage module according to the received storage address, modify the descriptor accordingly according to the obtained action instruction, and output the modified descriptor to the message sending module; the message sending module is used to obtain the message from the data cache module, obtain the modified descriptor from the action module, and output the modified descriptor and the message after splicing.

[0006] In some optional implementations, the message receiving module is specifically configured to: when an ingress data message and a loopback data message are received simultaneously, give priority to processing the loopback data message.

[0007] In some optional implementations, the agreed partial message information refers to message header information.

[0008] In some optional implementations, the message sending module is specifically used to output the message after the packetization processing to the lower-level module, or to re-output it to the message receiving module as a loopback data message.

[0009] In some optional implementations, the data extraction module specifically uses a register extraction method and / or an immediate value extraction method to extract data at a specified position from the descriptor.

[0010] In some optional implementations, the matching module uses a register with a two-dimensional array structure to store the matching data.

[0011] In some optional implementations, the action module is specifically used to modify the descriptor through assignment, shift or arithmetic logic unit ALU operation.

[0012] In some optional implementations, the bit widths of the message receiving module, the data buffer module, and the message sending module are consistent.

[0013] In a second aspect, the present disclosure provides a method for implementing logic of programmable hardware, which is used for the programmable hardware logic architecture implemented based on the P4 language as described above, and comprises the following steps:

[0014] S1, the message receiving module stores the received valid message into the data buffer module;

[0015] S2, the message receiving module generates a descriptor according to the received message, and outputs the descriptor to the programmable logic unit, wherein the descriptor includes the agreed partial message information and the storage address of the extraction instruction;

[0016] S3, the data extraction module obtains the extraction instruction from the extraction instruction storage module according to the storage address carried by the descriptor, extracts the data at the specified position from the descriptor according to the obtained extraction instruction, and outputs the obtained extracted data to the matching module;

[0017] S4, the matching module compares the extracted data with the stored matching data, and outputs the storage address of the action instruction to the action module according to the comparison result;

[0018] S5, the action module obtains the action instruction from the action instruction storage module according to the received storage address, modifies the descriptor accordingly according to the obtained action instruction, and outputs the modified descriptor to the message sending module;

[0019] S6. The message sending module obtains the message from the data cache module, obtains the modified descriptor from the action module, and packages the modified descriptor and the message and then outputs them.

[0020] In some optional implementations, the method further includes: if the bit field length of the message that needs to be modified is greater than the carrying length of the descriptor, the message modified by the packet splicing processing is used as a loopback data message and re-output to the message receiving module.

[0021] It can be seen from the above technical solutions that the present invention has the following advantages:

[0022] The programmable hardware logic architecture provided by the present invention allows users to use the P4 language to perform secondary development on chips adopting the architecture, identify any network message, assign, shift, and perform common ALU operations on any bit field, thereby increasing the use scenarios of the chip.

[0023] The programmable hardware logic architecture of the present invention does not need to rewrite the code for each new project, which is conducive to improving the efficiency of hardware code development. The software can generate extraction instructions, matching instructions and action instructions based on the P4 language, control the hardware logic to process the message accordingly, and increase the applicable scenarios of the chip.

[0024] In order to support programmable functions, the present invention can instantiate more RAM (Random Access Memory) inside the hardware to store programmable instructions, providing richer applications at the cost of occupying some resources. Users only need to be familiar with the programmable hardware logic architecture and the use steps of the compiler based on the P4 language to carry out secondary development conveniently and quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0026] Figure 1 It is a structural block diagram of a programmable hardware logic architecture implemented based on the P4 language provided by an embodiment of the present invention;

[0027] Figure 2 It is a structural block diagram of a programmable hardware logic architecture implemented based on the P4 language in an application scenario example of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] The following is a detailed description through specific embodiments.

[0030] An embodiment of the present invention provides a programmable hardware logic architecture (or programmable hardware device) implemented based on the P4 language. The P4 language has language characteristics such as reconfigurability, protocol independence, and platform independence, and its basic processing flow is: extraction, matching, and action. The programmable hardware logic architecture provided by the present invention also adopts the processing flow of extraction, matching, and action to support the redevelopment of hardware logic using the P4 language, and increase the scope of application of chips (such as switching chips) using this programmable hardware logic architecture.

[0031] Please refer to Figure 1 As shown in the structural block diagram, in one embodiment of the present invention, the programmable hardware logic architecture includes: a message receiving module (Rx_Pkt) 10, a data buffer module (Buffer) 20, a message sending module (Tx_Pkt) 30, and a programmable logic unit (SLICE) 40.

[0032] Among them, the programmable logic unit (SLICE) 40 as a core component further includes: extraction instruction storage module (Extract_Ram) 41, extraction data module (Extract_Key) 42, matching module (Cmp) 43, action instruction storage module (Action_Ram) 44, action module (Action) 45 and other sub-modules.

[0033] Next, each unit and module will be described in detail.

[0034] The message receiving module (Rx_Pkt) 10 is used to receive messages and implement message error detection functions: identify valid messages, discard invalid messages, and store valid messages completely in the data cache module 20. When the module 10 schedules received messages such as inlet data messages (Pkt_in) and loopback data messages (Pkt_lp), the loopback data message is prioritized. The loopback data message is a message that is re-input into the message receiving module by the message sending module. The module 10 is also used to generate a corresponding descriptor (MF) according to the received message, fill the agreed part of the message information into the descriptor and output it to the programmable logic unit 40. Among them, the agreed part of the message information can specifically refer to the message header information of the message, which can be the complete message header information or a part of the message header information.

[0035] The data buffer module (Buffer) 20 is used to buffer the messages stored in the message receiving module 10, including the ingress data messages and / or the loopback data messages, and provide the buffered messages to the message sending module (Tx_Pkt) 30.

[0036] The extract instruction cache module (Extract_Ram) 41 is responsible for storing the extract instruction. The descriptor output by the message receiving module 10 also carries the storage address of the required extract instruction, which can be used to extract the corresponding storage location of the instruction cache module to obtain different extract instructions. This address is issued by the software.

[0037] The data extraction module (Extract_Key) 42 is used to first obtain the corresponding extraction instruction according to the storage address carried by the descriptor, then extract the data (field) at the specified position from the descriptor according to the extraction instruction, and finally output the obtained extracted data to the matching module 43. It is easy to understand that data (field) at any position in the descriptor can be extracted through different extraction instructions. The data extraction module 42 can support two methods of register extraction and immediate value extraction to extract the fields in the descriptor, and can also support mixed extraction of the two methods. The register extraction method uses register addressing, that is, it relies on the relative offset position of the field in the descriptor for extraction. The immediate value extraction method does not rely on the descriptor field, and directly uses the immediate value in the extraction instruction as the extraction value.

[0038] The matching module (Cmp) 43 stores matching data and is used to compare the extracted data output by the data extraction module 42 with the matching data one by one as the data to be matched, and output the storage address of the action instruction to the action module 45 according to the result of the matching comparison, and the address is used to query the action instruction. In order to ensure full pipeline processing, different extracted data need to ensure that the data matching results are counted in the same beat. If the Ram structure is used, the number of Ram readings is not fixed. Therefore, the present invention preferably uses a register with a two-dimensional array structure to save the matching data to ensure that the matching results are obtained in the same beat.

[0039] The action instruction storage module (Action_Ram) 44 is used to cache the action instruction set. The matching module will output the action table lookup address (ie, the storage address of the action instruction), and this address can be used to obtain different action instructions from different storage locations.

[0040] The action module (Action) 45 is used to first obtain the action instruction from the action instruction storage module according to the storage address of the received action instruction, then modify the descriptor accordingly according to the obtained action instruction, and finally output the modified descriptor to the message sending module 30. The modification can be assignment (i.e. setting), shifting (i.e. moving) and common ALU (arithmetic and logic unit) operations on the descriptor.

[0041] The message sending module (Tx_Pkt) 30 is used to perform packet processing on the modified descriptor and the message in the data cache module 20 and then output it to the lower module, or it can be re-output as a loopback data message to the message receiving module 10. The packet processing can be understood as modifying and replacing the corresponding bit field (field) in the message according to the modified descriptor, such as mask processing.

[0042] Furthermore, the message receiving module (Rx_Pkt) 10, the data buffer module (Buffer) 20, and the message sending module (Tx_Pkt) 30 have the same bit width to avoid back pressure scenarios and increase system work efficiency.

[0043] The programmable hardware logic architecture provided by the present invention is described in detail above.

[0044] One embodiment of the present invention further provides a method for implementing logic of programmable hardware, which is applied to the programmable hardware logic architecture implemented based on the P4 language as described above and a chip using the architecture, such as a programmable switching chip. The method comprises the following steps:

[0045] S0: The message receiving module receives the message and performs message scheduling. To ensure the order of message processing, the loopback message has the highest priority. When the message receiving module (Rx_Pkt) receives the inbound data message and the loopback data message at the same time, the loopback data message is processed first.

[0046] S1: The message receiving module performs message parsing and error detection on the received message, identifies the valid message, discards the invalid message, and stores the valid message into the data cache module.

[0047] S2: The message receiving module generates a descriptor MF, such as a 1024-bit descriptor information, which contains the agreed partial message information and the lookup table address of the extraction instruction storage module (Extract_Ram), which is the storage address of the required extraction instruction. Optionally, if this message only needs to be transparently transmitted, the Extract_Ram lookup table address can be configured as an invalid address, and step S6 is executed.

[0048] S3: The data extraction module (Extract_Key) obtains the extraction instruction from the corresponding storage location of the extraction instruction storage module according to the storage address carried by the descriptor, and then extracts the data at the specified location from the descriptor according to the obtained extraction instruction. Specifically, 5 groups of 8-bit data totaling 40 bits can be extracted to output to the matching module for matching calculation. This module supports two modes: register extraction and immediate value extraction.

[0049] Register extraction instruction: The 1024-bit descriptor MF is divided into 128 groups, each with 8 bits, and two adjacent groups are concatenated to form a 16-bit data. The register extraction instruction is 10 bits, the upper 7 bits are used to select the group number of the 128 groups, and the lower 3 bits are used to select the starting bit of the 16-bit extraction, so that continuous 8-bit data at any position can be extracted.

[0050] Immediate value extraction instruction: The high 8 bits of the 10-bit extraction instruction are sent to the matching module as an immediate value.

[0051] S4: The matching module (Cmp) is responsible for storing matching data. Each matching data corresponds to a storage address. If the extracted data is consistent with the matching data, this storage address is used as the lookup address of the action instruction storage module (Action_Ram) (i.e., the storage address of the action instruction) and output to the action module; if the match is inconsistent, the agreed default unprocessed lookup address is output to the action module.

[0052] S5: The action module (Action) obtains the action instruction from the corresponding storage location of the action instruction storage module according to the received storage address, and then modifies the descriptor according to the obtained action instruction. The modification method may include setting (SET), shifting (MOV) and common ALU operations. Finally, the modified descriptor is output to the message sending module (Tx_Pkt).

[0053] SET instruction: This instruction divides the 1024-bit descriptor into 32 groups of 32-bit data, and can set any 4 bits in the 32-bit data to 1 or 0.

[0054] MOV instruction: This instruction divides the 1024-bit descriptor into 128 groups of 8-bit data. Any group of data can be moved to another group of data to overwrite it.

[0055] ALU instructions: can support addition, subtraction, XOR, XNOR, AND, OR, and NOT calculations, and the operand length is 1 to 32 bits.

[0056] S6: The message sending module (Tx_Pkt) obtains the modified descriptor from the action module, and replaces the message cached in the data buffer module (Buffer) with the processed message information in the modified descriptor, thereby realizing the modification function of the inbound data message, which is the so-called packet processing. Optionally, if the length of the bit field to be modified in the inbound message is greater than the length that the descriptor can carry and cannot be processed at one time, the modified inbound data message needs to be re-input as a loopback data message to the message sending module (Rx_Pkt) and processed again until the message information processing is completed.

[0057] The above is a detailed description of the logic implementation method of the programmable hardware provided by the present invention.

[0058] To facilitate a deeper understanding of the present invention, the specific implementation method and practical application of the present invention are further explained below in combination with actual products or systems in specific application scenarios as examples.

[0059] This example uses the programmable hardware logic architecture of the present invention in an Ethernet security chip to implement classification, identification and processing of Ethernet messages.

[0060] like Figure 2 , which is a structural block diagram of the programmable hardware logic architecture of this example, including a message receiving module (Rx_Pkt), a data buffer module (Buffer), a message sending module (Tx_Pkt), a first-level programmable logic unit (SLICE0) and a second-level programmable logic unit (SLICE1).

[0061] The programmable hardware logic architecture is used to implement the classification and masking function of input Ethernet TCP (Transmission Control Protocol), UDP (User Datagram Protocol) and other Layer 2 and Layer 3 Ethernet messages.

[0062] Next, taking the RIP (Routing Information Protocol) message in the UDP protocol as an example, the steps of the programmable hardware logic architecture identifying the RIP message are described.

[0063] This example adopts a programmable architecture mainly to increase the scope of application. If after tape-out, it is found that the UDP protocol to be supported needs to be expanded in application, the software only needs to add instructions for the corresponding protocol to support application expansion.

[0064] First, the IPv4 RIP message format is introduced, as shown in Table 1.

[0065] Table 1 IPV4 RIP message format

[0066]

[0067]

[0068] The following describes the steps for implementing the RIP message classification mask, including:

[0069] 1. After the message receiving module (Rx_Pkt) fills the RIP message header information into the descriptor MF, the descriptor is sent to the first-level programmable logic unit (SLICE0), and the message is sent to the data buffer module (Buffer).

[0070] 2. SLICE0, the software extracts the TYPE[15:0], Version[3:0], IHL[3:0], and Protocol[7:0] fields in the message by issuing a configuration extraction instruction (Extract_Key) and sends it to the first-level matching module (CMP) in SLICE0.

[0071] 3. The first-level matching module compares the input extraction field (i.e., the field to be compared) with the comparison field issued by the software. If TYPE[15:0]=0x0800, Version[3:0]=0x4, IHL[3:0]=0x5, and Protocol[7:0]=0x11, the matching address is sent to the action instruction storage module (Action_Ram) in SLICE0 to extract the action instruction.

[0072] 4. The first-level action module (ACTION) in SLICE0 modifies the descriptor to query the second-level extraction instruction lookup table address, and then sends the modified descriptor to the second-level programmable logic unit (SLICE1).

[0073] 5. SLICE1 extracts the Source Port[15:0] field in the message through the extraction instruction and sends it to the second-level matching module (CMP) in SLICE1.

[0074] 6. The second-level matching module compares the input field to be compared with the comparison field issued by the software. If Source Port[15:0]=16'h0208, the matching address is sent to the action instruction storage module (Action_Ram) in SLICE1 to extract the action instruction.

[0075] 7. The second-level action module (ACTION) in SLICE1 modifies the descriptor according to the action instruction, sets all the values ​​of the Checksum[15:0] field to 0, and then sends the modified descriptor to the message sending module (Tx_Pkt).

[0076] 8. The message sending module reads the message in the data buffer module (Buffer), and covers the original message with the message header masked by the descriptor, thereby realizing the classification mask function of the Ethernet (ethnet, ETH) message.

[0077] Furthermore, if it is necessary to expand support for other UDP messages, the software only needs to add a matching instruction to the matching module of the second-level programmable logic unit (SLICE1) to make Sourc Port[15:0] = the corresponding protocol number, thereby realizing the expansion of the applicable message types.

[0078] An application scenario example provided by the present invention is described in detail above.

[0079] In summary, the present invention discloses a programmable hardware logic architecture implemented based on the P4 language, and a logic implementation method applied to the programmable hardware logic architecture.

[0080] The beneficial effects of the technical solution of the present invention are:

[0081] The programmable hardware logic architecture based on the P4 language provided by the present invention allows users to use the P4 language to perform secondary development on chips adopting the architecture, identify any network message, assign, shift, and perform common ALU operations on any bit field, thereby increasing the use scenarios of the chip.

[0082] The programmable hardware logic architecture of the present invention does not need to rewrite the code for each new project, which is conducive to improving the efficiency of hardware code development. The software can generate extraction instructions, matching instructions and action instructions based on the P4 language, control the hardware logic to process the message accordingly, and increase the applicable scenarios of the chip.

[0083] In order to support programmable functions, the present invention can instantiate more RAM inside the hardware to store programmable instructions, providing richer applications at the cost of occupying more resources. Users only need to be familiar with the programmable hardware logic architecture and the use steps of the compiler based on the P4 language to carry out secondary development conveniently and quickly.

[0084] The technical solution of the present invention is described in detail above through specific embodiments. In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0085] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. A person skilled in the art may modify the technical solutions described in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A programmable hardware device based on P4 language, It is characterized in that It includes: a message receiving module, a data buffering module, a message sending module and a programmable logic unit; The programmable logic unit includes: an extraction instruction storage module, an extraction data module, a matching module, an action instruction storage module and an action module; The message receiving module is used to receive a message, identify whether the message is valid, store the valid message in the data cache module, and generate a descriptor according to the received message and output it to the programmable logic unit, wherein the descriptor includes the agreed partial message information and the storage address of the extraction instruction; The data cache module is used to cache the messages stored by the message receiving module, and provide the cached messages to the message sending module; The data extraction module is used to obtain an extraction instruction from the extraction instruction storage module according to the storage address carried by the descriptor, extract data at a specified position from the descriptor according to the obtained extraction instruction, and output the obtained extracted data to the matching module; The matching module is used to compare the extracted data with the stored matching data, and output the storage address of the action instruction to the action module according to the comparison result; The action module is used to obtain an action instruction from the action instruction storage module according to the received storage address, modify the descriptor accordingly according to the obtained action instruction, and output the modified descriptor to the message sending module; The message sending module is used to obtain the message from the data cache module, obtain the modified descriptor from the action module, and output the modified descriptor and the message after packaging.

2. The programmable hardware device based on P4 language according to claim 1, characterized in that: The message receiving module is specifically used for: when receiving an ingress data message and a loopback data message at the same time, giving priority to processing the loopback data message.

3. The programmable hardware device based on P4 language according to claim 1, characterized in that: The agreed partial message information refers to the message header information.

4. The programmable hardware device based on P4 language according to claim 1, characterized in that: The message sending module is specifically used to output the message after the packet assembly process to the lower-level module, or to re-output it to the message receiving module as a loopback data message.

5. The programmable hardware device based on P4 language according to claim 1, characterized in that: The data extraction module specifically adopts a register extraction method and / or an immediate value extraction method to extract data at a specified position from the descriptor.

6. The programmable hardware device based on P4 language according to claim 1, characterized in that: The matching module uses a register with a two-dimensional array structure to store matching data.

7. The programmable hardware device based on P4 language according to claim 1, characterized in that: The action module is specifically used to modify the descriptor through assignment, shift or arithmetic logic unit ALU operation.

8. The programmable hardware device based on P4 language according to claim 1, characterized in that: The message receiving module, the data buffer module and the message sending module have the same bit width.

9. A method for implementing logic in programmable hardware, characterized in that: The programmable hardware device implemented based on the P4 language as claimed in claim 1 comprises the following steps: S1, the message receiving module stores the received valid message into the data buffer module; S2, the message receiving module generates a descriptor according to the received message, and outputs the descriptor to the programmable logic unit, wherein the descriptor includes the agreed partial message information and the storage address of the extraction instruction; S3, the data extraction module obtains the extraction instruction from the extraction instruction storage module according to the storage address carried by the descriptor, extracts the data at the specified position from the descriptor according to the obtained extraction instruction, and outputs the obtained extracted data to the matching module; S4, the matching module compares the extracted data with the stored matching data, and outputs the storage address of the action instruction to the action module according to the comparison result; S5, the action module obtains the action instruction from the action instruction storage module according to the received storage address, modifies the descriptor accordingly according to the obtained action instruction, and outputs the modified descriptor to the message sending module; S6. The message sending module obtains the message from the data cache module, obtains the modified descriptor from the action module, and packages the modified descriptor and the message and then outputs them.

10. The method according to claim 9, characterized in that Also includes: If the bit field length of the message that needs to be modified is greater than the carryable length of the descriptor, the message modified by the packet splicing process is used as a loopback data message and re-output to the message receiving module.