Packet processing apparatus and method
By using software-configurable message processing devices and methods, the problems of lack of flexibility and programmability in message parsing are solved. Flexible parsing and forwarding of custom and unknown protocols are realized, saving flow table cache space and improving the flexibility and programmability of message processing.
Patent Information
- Application Number
- CN202510223631.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-02-27
AI Technical Summary
Existing technologies lack flexibility and programmability in message parsing, and cannot effectively handle messages with user-defined or unknown protocols.
The system employs a software-configurable message parsing unit, field extraction unit, keyword organization unit, and action data acquisition unit. It parses protocol header information, extracts key fields, organizes target keywords, and acquires action data through software configuration. It supports user-defined protocol parsing and forwarding.
It enables flexible parsing and forwarding of custom and unknown network protocols, saves flow table cache space, and improves the flexibility and programmability of packet processing.
Smart Images

Figure CN120091060B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer networks, and specifically relates to a message processing apparatus and method. Background Technology
[0002] See Figure 1 As shown, in network devices, the basic message processing flow can be divided into: message protocol header parsing, table entry matching, and action execution. That is, after the network packet is parsed by the parser, the obtained metadata is matched with the lookup table, and the matching result is then matched with the action table to finally obtain the action data to be executed on the network packet. Summary of the Invention
[0003] The purpose of this application is to provide a message processing apparatus and method, which aims to solve the problems of lack of flexibility and programmability in message parsing in related technologies.
[0004] According to a first aspect of this application, a message processing apparatus is provided, comprising:
[0005] The message parsing unit is used to parse the protocol header information from the message to be processed based on the first configuration information of the software configuration;
[0006] The field extraction unit is used to extract key field fields from the message to be processed based on the second configuration information of the software configuration and the protocol header information.
[0007] A keyword organization unit is used to organize target keywords from the keyword field based on third configuration information configured by the software.
[0008] The action data acquisition unit is used to acquire the action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software.
[0009] This device is easy to implement, compatible with traditional fixed-tuple flow table engines, and supports flow forwarding behaviors defined by protocols such as OpenFlow and OVS. It also supports the parsing and forwarding of user-defined protocols by parsing the protocol header information of packets through software-configurable first configuration information. It employs a software-configurable parser, with the parsing process controlled by software configuration, capable of meeting the parsing requirements of custom and unknown network protocols. Furthermore, it utilizes a software-configurable flow table cache, saving cache space and providing greater flexibility for data flow forwarding, thus meeting the needs of complex and diverse network packet editing and forwarding.
[0010] In an optional implementation, the first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and a mapping relationship between message types and protocol identifiers; the message types are classified based on one or more combinations of the protocol identifiers.
[0011] The message parsing unit matches the protocol identification keyword with the message to be processed, and determines the protocol header offset and the corresponding hit protocol identifier in the message to be processed based on the matched protocol identification keyword. The message type of the message to be processed is determined according to the hit protocol identifier and the mapping relationship.
[0012] By configuring the protocol identifier, protocol identification keywords, and the mapping relationship between message type and protocol identifier through software configuration, the parsing and forwarding of user-defined protocols can be supported.
[0013] In an optional implementation, the software is configured with one or more sets of second configuration information including the following: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier;
[0014] The field extraction unit obtains the second configuration information corresponding to the message type of the message to be processed, matches the hit protocol identifier with the configuration protocol identifier in the obtained second configuration information, and extracts the key field from the message to be processed based on the configuration offset corresponding to the matched configuration protocol identifier and the protocol header offset.
[0015] Because the software can be configured to extract information from key fields for different protocols, it can better support the parsing and forwarding of user-defined protocols.
[0016] In an optional implementation, the software is configured with one or more sets of third configuration information including the following: keyword length, keyword index, and keyword mask table;
[0017] The keyword organization unit obtains the third configuration information corresponding to the message type of the message to be processed, extracts candidate keywords with keyword length from the key field based on the keyword index in the obtained third configuration information, and obtains the target keyword by masking the candidate keywords using the mask table.
[0018] Because the keyword length and mask can be dynamically configured, the flow table cache only stores the necessary key fields, significantly saving storage space.
[0019] In an optional implementation, the fourth configuration information includes keywords and the action data corresponding to the keywords;
[0020] The action data acquisition unit matches the target keyword with the keyword in the fourth configuration information and acquires the matched action data.
[0021] Because the keyword and action data are configured by software, the device offers good scalability and strong software controllability. In an optional implementation, the device further includes:
[0022] An action execution unit is used to perform the action indicated by the action data on the message to be processed.
[0023] Because the software configures action data corresponding to different key fields, the hardware logic can automatically execute the corresponding action after matching the configured action data based on the key fields.
[0024] According to a second aspect of this application, a message processing method is provided, comprising:
[0025] The protocol header information is parsed from the message to be processed based on the first configuration information of the software configuration.
[0026] Based on the second configuration information of the software configuration and the protocol header information, key field fields are extracted from the message to be processed.
[0027] Based on the third configuration information of the software configuration, the target keyword is obtained from the keyword field organization;
[0028] Based on the fourth configuration information pre-written into the flow table cache by the software, the action data corresponding to the target keyword is obtained.
[0029] In an optional implementation, the first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and a mapping relationship between message types and protocol identifiers; the message types are classified based on one or more combinations of the protocol identifiers; the first configuration information based on software configuration parses protocol header information from the message to be processed, including:
[0030] Match the protocol identification keywords with the message to be processed;
[0031] Based on the matched protocol identification keywords, the protocol header offset and the corresponding matched protocol identifier in the message to be processed are determined.
[0032] The message type of the message to be processed is determined based on the hit protocol identifier and the mapping relationship.
[0033] In an optional implementation, the software is configured with one or more sets of second configuration information including the following: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier; based on the second configuration information configured by the software and the protocol header information, key field fields are extracted from the message to be processed, including:
[0034] Obtain the second configuration information corresponding to the message type of the message to be processed;
[0035] The hit protocol identifier is matched with the configuration protocol identifier in the obtained second configuration information;
[0036] Based on the configuration offset corresponding to the matched configuration protocol identifier and the protocol header offset, the key field is extracted from the message to be processed.
[0037] In an optional implementation, the software is configured with one or more sets of third configuration information including the following: keyword length, keyword index, and keyword mask table; the target keyword is obtained from the keyword field based on the third configuration information configured by the software, including:
[0038] Obtain the third configuration information corresponding to the message type of the message to be processed;
[0039] Based on the keyword index in the obtained third configuration information, candidate keywords with keyword lengths are extracted from the key field domain;
[0040] The target keyword is obtained by masking the candidate keywords using the mask table.
[0041] In an optional implementation, the fourth configuration information includes keywords and action data corresponding to the keywords; the step of obtaining the action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software includes:
[0042] The target keyword is matched with the keyword in the fourth configuration information, and the action data of the match is obtained.
[0043] In an optional implementation, the method further includes:
[0044] Perform the action indicated by the action data on the message to be processed.
[0045] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures and processes shown in the description and the accompanying drawings. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 It is a schematic diagram of the message processing flow based on relevant technologies.
[0048] Figure 2 This is a schematic diagram of the structure of a message processing apparatus according to an exemplary embodiment of this application.
[0049] Figure 3 This is a schematic diagram of the processing flow of a message parsing unit according to an exemplary embodiment of this application.
[0050] Figure 4 This is a schematic diagram of the processing flow of the field extraction unit according to an exemplary embodiment of this application.
[0051] Figure 5 This is a schematic diagram of the processing flow of the keyword organization unit according to an exemplary embodiment of this application.
[0052] Figure 6 This is a schematic diagram of the processing flow of the motion data acquisition unit according to an exemplary embodiment of this application.
[0053] Figure 7 This is a schematic diagram of a flow table structure according to an exemplary embodiment of this application.
[0054] Figure 8 This is a flowchart illustrating a message processing method according to an exemplary embodiment of this application. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] With the development of network protocols and technologies such as OpenFlow, virtualization, and Overlay (e.g., VXLAN), the number of entries to be processed can be enormous. Matching methods can be diverse (exact matching, fuzzy matching, etc.), and the matched segments can be any segment of the L2-L4 protocol header inside or outside the tunnel, or any metadata. The actions performed can also be varied. Therefore, to meet or balance different application requirements, it is necessary to propose a flexible and programmable flow table engine to process packets.
[0057] The existing flow table engine design has at least the following problems:
[0058] 1. The message parsing lacks flexibility and / or programmability, and cannot parse user-defined or unknown protocols.
[0059] 2. Lookup tables typically only include fixed fields of the message to be processed, lacking programmability, and cannot extract arbitrary fields of the message, nor can they define custom matching rules.
[0060] 3. The action table only includes a limited number of action data, lacking flexibility and programmability, making it difficult to meet the diverse message editing and forwarding needs of various services.
[0061] See Figure 2 As shown, this application exemplarily provides a message processing apparatus, including:
[0062] Message parsing unit 201 is used to parse protocol header information from the message to be processed based on the first configuration information of the software configuration;
[0063] The field extraction unit 202 is used to extract key field fields from the message to be processed based on the second configuration information and protocol header information of the software configuration.
[0064] Keyword organization unit 203 is used to organize target keywords from keyword field segments based on third configuration information of software configuration;
[0065] The action data acquisition unit 204 is used to acquire action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software.
[0066] For example, the message processing apparatus includes various units implemented by hardware logic units, which can obtain first configuration information to fourth configuration information pre-configured by the user through software. The first configuration information to fourth configuration information can be configured as a template, which the user can configure based on the processing requirements of the messages to be processed.
[0067] For example, after receiving a message to be processed, the message parsing unit obtains first configuration information and parses the protocol header information from the message based on the first configuration information. It is understood that the message to be processed may include protocol header information for one or more protocols, including but not limited to MAC, VLAN, IPv4, IPv6, GRE, TCP, UDP, SCTP, VXLAN, etc. To identify the protocol header information carried in the message to be processed, the user can configure protocol identification keywords for different protocols to be identified in the first configuration information via software.
[0068] In some embodiments, the protocol header information is protocol-related information parsed from the message to be processed, which may include, but is not limited to, the protocol header offset, the matched protocol identifier, and the message type. The protocol header offset is the offset position of the matched protocol identification keyword in the message to be processed; the matched protocol identifier is the protocol identifier corresponding to the matched protocol identifier keyword in the message to be processed; both the protocol identifier keyword and the corresponding protocol identifier are configured by the software in the first configuration information; and the message type is determined by the protocol identifier corresponding to the matched protocol identifier keyword in the message to be processed. One or more protocol identifier keywords can be matched in the message to be processed, and the message type of the message to be processed can be determined by the combination of these one or more protocol identifier keywords. The combination of one or more protocol identifier keywords corresponding to each message type is also configured in the first configuration information.
[0069] For example, the field extraction unit extracts relevant key field fields from the message to be processed based on the protocol header information parsed from the message to be processed by the message parsing unit and the second configuration information pre-configured by the user through the software. It is understood that the message parsing unit can parse protocol header information corresponding to multiple protocols from the message to be processed, and the protocol header corresponding to each protocol may include multiple key field segments. The user may only need to extract a portion of the key field segments from the protocol headers of a subset of protocols. Therefore, the user can configure the protocol identifier of the protocol to be extracted from the message to be processed, as well as the configuration offset of the key field segments to be extracted from that protocol header, through the second configuration information in the software.
[0070] For example, the keyword field segment extracted by the field extraction unit from the message to be processed may include multiple keywords, while the keyword actually needed by the user may be only a portion of them. Therefore, the keyword organization unit can match and organize the keyword from the keyword field segment into the final target keyword based on the third configuration information pre-configured by the user through software. The third configuration information may include keyword length, keyword index, and keyword mask table to identify the target keyword in the keyword field segment. The keyword length controls the total length of the organized keywords, the keyword index is used to match the keyword needed by the user from the keyword field segment, and the keyword mask table is used to further extract the target keyword from the candidate keywords matched by the keyword index. For example, if the keyword field segment includes the destination address and source address of the MAC protocol, and the destination address is matched from it using the keyword index, but the user actually needs only a portion of the destination address's bits, the keyword mask table can be used to match the required portion of the bits from the destination address.
[0071] For example, users can pre-write fourth configuration information to the flow table cache through software. The fourth configuration information may include keywords and corresponding action data. The action data may be the action to be performed on the message to be processed after the corresponding keyword is matched, such as writing the virtual machine ID to which the message to be processed is to be processed into the message to be processed.
[0072] This device is easy to implement, compatible with traditional fixed-tuple flow table engines, and supports flow forwarding behaviors defined by protocols such as OpenFlow and OVS. It also supports the parsing and forwarding of user-defined protocols by parsing the protocol header information of packets through software-configurable first configuration information. It employs a software-configurable parser, with the parsing process controlled by software configuration, capable of meeting the parsing requirements of custom and unknown network protocols. Furthermore, it utilizes a software-configurable flow table cache, saving cache space and providing greater flexibility for data flow forwarding, thus meeting the needs of complex and diverse network packet editing and forwarding.
[0073] In some optional embodiments, the first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and the mapping relationship between message types and protocol identifiers; message types are classified based on one or more combinations of protocol identifiers.
[0074] The message parsing unit matches the protocol identification keywords with the message to be processed, and determines the protocol header offset and the corresponding hit protocol identifier in the message to be processed based on the matched protocol identification keywords. Based on the hit protocol identifier and the mapping relationship, the message type of the message to be processed is determined.
[0075] For example, users can configure the protocol identifiers (prot id) of protocols such as MAC, VLAN, IPv4, IPv6, GRE, TCP, UDP, SCTP, and VXLAN through software, set the protocol identification keywords for each protocol, and configure the packet type pty. The packet type is divided into packet types according to the combination of prot ids.
[0076] By configuring the protocol identifier, protocol identification keywords, and the mapping relationship between message type and protocol identifier through software configuration, the parsing and forwarding of user-defined protocols can be supported.
[0077] See Figure 3 As shown, for example, the message parsing unit performs sliding window matching on the packet to be processed to identify the protocol identification keywords. If a protocol identification keyword is matched, the corresponding protocol header offset (prot off), as well as the protocol identifier prot id and the message type pty corresponding to the protocol identification keyword are obtained. If multiple protocol identification keywords are matched in the packet to be processed, there are also multiple prot id and prot off.
[0078] In some optional implementations, the software configuration includes one or more sets of second configuration information including: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier;
[0079] The field extraction unit obtains the second configuration information corresponding to the message type of the message to be processed, matches the hit protocol identifier with the configuration protocol identifier in the obtained second configuration information, and extracts the key field fields from the message to be processed based on the configuration offset and keyword offset corresponding to the matched configuration protocol identifier.
[0080] For example, the user configures second configuration information through software. Each message type can be configured with a corresponding set of second configuration information (e.g., configured in a message type table). This second configuration information specifies the configuration protocol identifier (cfg id) to be extracted and the configuration offset (cfg off) within the protocol header (e.g., cfg id and cfg off can be configured in a cfg id+cfgoff table). See also... Figure 4As shown, for example, the field extraction unit determines the template identifier (pattern id) of the second configuration information to be used by the message type pty of the message to be processed, and then obtains the cfg id and cfg off in the second configuration information corresponding to the template identifier. The unit matches the protocol identifier prot id in the protocol header information identified by the message parsing unit with the cfg id in the second configuration information. If a match is found, the protocol header offset prot off in the protocol header information is added to the configuration offset cfg off as the keyword offset offset for extracting the keyword field. The corresponding keyword field key field is extracted from the message to be processed using this keyword offset offset.
[0081] Because the software can be configured to extract information from key fields for different protocols, it can better support the parsing and forwarding of user-defined protocols.
[0082] In some optional implementations, the software is configured with one or more sets of third configuration information including the following: keyword length, keyword index, and keyword mask table;
[0083] The keyword organization unit obtains the third configuration information corresponding to the message type of the message to be processed, extracts candidate keywords with keyword length from the key field based on the keyword index in the obtained third configuration information, and obtains the target keyword by masking the candidate keywords using a mask table.
[0084] For example, users configure third configuration information via software, with a corresponding set of third configuration information configured for each message type. This third configuration information can configure the key length (e.g., in the Key Length table), the key index of the group key (e.g., in the Key Index table), and the mask index (e.g., in the Mask Index table). See also Figure 5As shown, for example, the keyword organization unit determines the template identifier (pattern id) of the third configuration information to be used by the message type pty of the message to be processed. This template identifier can be the same as the template identifier of the second configuration information to be used by the field extraction unit. That is, each message type can use the same template identifier. Thus, the key length, key index, and maskindex in the third configuration information to be used can be obtained directly using the template identifier determined by the field extraction unit. After extracting the key field corresponding to the key index from the message to be processed, it can be reordered (that is, the extracted key fields are sorted according to the key index). The reordered key fields are masked using the maskindex to obtain the final target keyword key.
[0085] In the above embodiments, the key length and mask are configurable. Given the diverse metadata requirements of various services, the key length naturally varies considerably, thus meeting the flow lookup and forwarding needs of different services. Furthermore, because the key length and mask are dynamically configurable, the flow table cache only stores the necessary key fields, significantly saving storage space.
[0086] In some optional embodiments, the fourth configuration information includes keywords and the corresponding action data for those keywords;
[0087] The action data acquisition unit matches the target keyword with the keyword in the fourth configuration information and obtains the matched action data.
[0088] For example, when the software generates flow tables, users can use the software to populate the flow table cache with keywords and action data (AD data). Since the keywords and action data are configured by the software, it has good scalability and strong software controllability.
[0089] See Figure 6 As shown, exemplarily, the action data acquisition unit uses a double hash algorithm to precisely match the target keyword obtained by the keyword organization unit with the keyword key in the flow table cache, thereby obtaining the action data corresponding to the target keyword. This action data can control the action execution unit to perform corresponding actions on the packets to be processed.
[0090] In some alternative embodiments, the apparatus further includes:
[0091] The action execution unit is used to perform the action data instructions for the message to be processed.
[0092] For example, if the keyword organization unit can hit the target keyword, the action data acquisition unit can acquire the corresponding action data (AD data), and the action execution unit can perform the corresponding message processing behavior according to the action data.
[0093] Because the software configures action data corresponding to different key fields, the hardware logic can automatically execute the corresponding action after matching the configured action data based on the key fields.
[0094] Due to the diversity of business operations, the processing behavior of pending messages varies greatly. AD data may include: packet loss, adding or removing tunnel headers, calculating or verifying checksums for IP, TCP, UDP, etc., adding or removing L2 tags such as VLAN, TCP packet aggregation (TSO), specifying the virtual machine ID to which the packet is destined, specifying the queue ID to which the packet is destined, etc.
[0095] See one feasible flow table structure. Figure 7 As shown, for example, the software can define tab IDs (entry identifiers) for supported actions, use tab IDs to define different processing actions, or define a combination of different actions as a tab ID.
[0096] Since the hardware logic unit in this application is not aware of the specific key and AD data, and the content and length of the key and AD data are defined by software, the processing of the streaming engine is given more flexibility.
[0097] Accordingly, see Figure 8 As shown, this application also provides an exemplary message processing method, including:
[0098] Step 801: Parse the protocol header information from the message to be processed based on the first configuration information of the software configuration;
[0099] Step 802: Based on the second configuration information and protocol header information of the software configuration, extract key field fields from the message to be processed;
[0100] Step 803: Based on the third configuration information of the software configuration, obtain the target keyword from the keyword field organization;
[0101] Step 804: Based on the fourth configuration information pre-written into the flow table cache by the software, obtain the action data corresponding to the target keyword.
[0102] In some optional embodiments, the first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and a mapping relationship between message types and protocol identifiers; message types are classified based on one or more combinations of protocol identifiers; and the first configuration information configured by the software is used to parse protocol header information from the message to be processed, including:
[0103] Match protocol identification keywords with the messages to be processed;
[0104] Based on the matched protocol identification keywords, determine the protocol header offset and the corresponding matched protocol identifier in the message to be processed;
[0105] The message type of the message to be processed is determined based on the hit protocol identifier and the mapping relationship.
[0106] In some optional embodiments, the software is configured with one or more sets of second configuration information including: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier; based on the second configuration information and protocol header information of the software configuration, key field fields are extracted from the message to be processed, including:
[0107] Obtain the second configuration information corresponding to the message type of the message to be processed;
[0108] Match the hit protocol identifier with the configuration protocol identifier in the obtained second configuration information;
[0109] Based on the configuration offset and protocol header offset corresponding to the matched configuration protocol identifier, key field fields are extracted from the message to be processed.
[0110] In some optional embodiments, the software is configured with one or more sets of third configuration information including: keyword length, keyword index, and keyword mask table; the target keyword is obtained from the keyword field based on the third configuration information configured by the software, including:
[0111] Obtain the third configuration information corresponding to the message type of the message to be processed;
[0112] Based on the keyword index in the obtained third configuration information, candidate keywords with keyword lengths are extracted from the key field domain;
[0113] The target keyword is obtained by masking the candidate keywords using a mask table.
[0114] In some optional embodiments, the fourth configuration information includes keywords and action data corresponding to the keywords; the step of obtaining the action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software includes:
[0115] The target keyword is matched with the keyword in the fourth configuration information, and the action data of the match is obtained.
[0116] In some optional embodiments, the method further includes:
[0117] Perform the action indicated by the action data for the processed message.
[0118] The above method can be implemented by the message processing device provided in the above embodiments. For specific implementation details, please refer to the description of the message processing device in the above embodiments, which will not be repeated here.
[0119] It is understood that the circuit structures, names, and parameters described in the above embodiments are merely examples. Those skilled in the art can also make readily conceived combinations and adjustments to the structural features of the above embodiments according to their needs, and the concept of this application should not be limited to the specific details of the above examples.
[0120] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A message processing apparatus, characterized in that, The message processing device is implemented by hardware logic, including: The message parsing unit is used to parse the protocol header information from the message to be processed based on the first configuration information of the software configuration; The field extraction unit is used to extract key field fields from the message to be processed based on the second configuration information of the software configuration and the protocol header information. The field extraction unit determines the template identifier of the second configuration information to be used based on the message type of the message to be processed, then obtains the configuration protocol identifier and the configuration offset in the protocol header of the second configuration information corresponding to the template identifier. It then matches the matched protocol identifier in the protocol header information identified by the message parsing unit with the configuration protocol identifier in the second configuration information. If a match is found, the protocol header offset in the protocol header information is added to the configuration offset to obtain the keyword offset for extracting the keyword field segment. The corresponding keyword field segment is then extracted from the message to be processed using this keyword offset. A keyword organization unit is used to organize target keywords from the keyword field based on third configuration information configured by the software. The action data acquisition unit is used to acquire the action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software.
2. The message processing apparatus according to claim 1, characterized in that, The first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and the mapping relationship between message types and protocol identifiers; the message types are classified based on one or more combinations of the protocol identifiers. The message parsing unit matches the protocol identification keyword with the message to be processed, and determines the protocol header offset and the corresponding hit protocol identifier in the message to be processed based on the matched protocol identification keyword. The message type of the message to be processed is determined according to the hit protocol identifier and the mapping relationship.
3. The message processing apparatus according to claim 2, characterized in that, The software configuration includes one or more sets of second configuration information including the following: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier; The field extraction unit obtains the second configuration information corresponding to the message type of the message to be processed, matches the hit protocol identifier with the configuration protocol identifier in the obtained second configuration information, and extracts the key field from the message to be processed based on the configuration offset corresponding to the matched configuration protocol identifier and the protocol header offset.
4. The message processing apparatus according to claim 1, characterized in that, The software configuration includes one or more sets of third configuration information, including the following: keyword length, keyword index, and keyword mask table; The keyword organization unit obtains the third configuration information corresponding to the message type of the message to be processed, extracts candidate keywords with keyword length from the key field based on the keyword index in the obtained third configuration information, and obtains the target keyword by masking the candidate keywords using the mask table.
5. The message processing apparatus according to claim 1, characterized in that, The fourth configuration information includes keywords and the action data corresponding to the keywords; The action data acquisition unit matches the target keyword with the keyword in the fourth configuration information and acquires the matched action data.
6. The message processing apparatus according to any one of claims 1-5, characterized in that, The device further includes: An action execution unit is used to perform the action indicated by the action data on the message to be processed.
7. A message processing method, characterized in that, Executed on the message processing device implemented by hardware logic, including: The protocol header information is parsed from the message to be processed based on the first configuration information of the software configuration. Based on the second configuration information of the software configuration and the protocol header information, key field fields are extracted from the message to be processed. Specifically, the template identifier of the second configuration information to be used is determined by the message type of the message to be processed. Then, the configuration protocol identifier and the configuration offset in the protocol header of the second configuration information corresponding to the template identifier are obtained. The matching protocol identifier in the protocol header information identified by the message parsing unit is matched with the configuration protocol identifier in the second configuration information. If a match is found, the protocol header offset in the protocol header information is added to the configuration offset as the keyword offset for extracting the keyword field segment. The corresponding keyword field segment is extracted from the message to be processed using this keyword offset. Based on the third configuration information of the software configuration, the target keyword is obtained from the keyword field organization; Based on the fourth configuration information pre-written into the flow table cache by the software, the action data corresponding to the target keyword is obtained.
8. The message processing method according to claim 7, characterized in that, The first configuration information includes protocol identifiers for different protocols, protocol identification keywords, and the mapping relationship between message types and protocol identifiers; the message types are classified based on one or more combinations of the protocol identifiers. The first configuration information based on software configuration parses protocol header information from the message to be processed, including: Match the protocol identification keywords with the message to be processed; Based on the matched protocol identification keywords, the protocol header offset and the corresponding matched protocol identifier in the message to be processed are determined. The message type of the message to be processed is determined based on the hit protocol identifier and the mapping relationship.
9. The message processing method according to claim 8, characterized in that, The software configuration includes one or more sets of second configuration information including the following: a configuration protocol identifier and a configuration offset corresponding to the configuration protocol identifier; The second configuration information based on software configuration and the protocol header information are used to extract key field fields from the message to be processed, including: Obtain the second configuration information corresponding to the message type of the message to be processed; The hit protocol identifier is matched with the configuration protocol identifier in the obtained second configuration information; Based on the configuration offset corresponding to the matched configuration protocol identifier and the protocol header offset, the key field is extracted from the message to be processed.
10. The message processing method according to claim 7, characterized in that, The software configuration includes one or more sets of third configuration information, including the following: keyword length, keyword index, and keyword mask table; The third configuration information based on software configuration, which derives the target keyword from the keyword field organization, includes: Obtain the third configuration information corresponding to the message type of the message to be processed; Based on the keyword index in the obtained third configuration information, candidate keywords with keyword lengths are extracted from the key field domain; The target keyword is obtained by masking the candidate keywords using the mask table.
11. The message processing method according to claim 7, characterized in that, The fourth configuration information includes keywords and corresponding action data; the step of obtaining the action data corresponding to the target keyword based on the fourth configuration information pre-written into the flow table cache by the software includes: The target keyword is matched with the keyword in the fourth configuration information, and the action data of the match is obtained.
12. The message processing method according to any one of claims 7-11, characterized in that, The method further includes: Perform the action indicated by the action data on the message to be processed.
Citation Information
Patent Citations
System for flexible and extensible flow processing in software-defined networks
CN103999431A
Controller for flexible and extensible flow processing in software-defined networks
CN104012063A