General verification method and system for multiple lookup table entry hitting configuration table entry

By generating template configuration entries, the problem of low hit rate when looking up the same message multiple times is solved, achieving accurate matching and flexible configuration of messages, and improving the hit rate and testing efficiency of multiple lookups.

CN120186016BActive Publication Date: 2026-02-24WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510328079.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-02-24
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

During network packet forwarding, different full key contents of the same packet are prone to overlap and overwrite, resulting in a reduced hit rate for multiple table lookups. Existing technologies struggle to achieve accurate matching and flexible configuration.

Method used

The table entries are configured using a template generation method. Random strings are generated as configuration table entry templates, and characters at offset positions are obtained based on the offset set as table entry configuration data. Adaptation messages are generated to achieve multiple table lookup hits, supporting flexible configuration for different project needs.

Benefits of technology

It achieves accurate table matching for multiple lookups of the same message, improving the hit rate and testing efficiency. It supports simultaneous matching of multiple flow tables, and has high flexibility and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120186016B_ABST
    Figure CN120186016B_ABST
Patent Text Reader

Abstract

The application discloses a general verification method and system for multiple lookup table item hit configuration table items, wherein the method comprises the following steps: generating a random character string as a configuration table item template, and obtaining multiple sets of offset collections; obtaining multiple configuration table items corresponding to the multiple sets of offset collections based on the configuration table item template and the multiple sets of offset collections; specifying multiple configuration table items associated with an original message from the obtained configuration table items; and configuring the original message based on the associated configuration table items to obtain an adapted message, which is used for subsequent verification. The application can obtain multiple configuration table items by using the same template, associate the configuration table items with the message, support multiple different lookup table full keys generated from the same message, simultaneously match multiple flow tables, and accurately constrain the hit rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a general verification method and system for matching multiple lookup table entries with configuration entries. Background Technology

[0002] When forwarding packets over a network, it's necessary to extract packet header information to form a full key for forwarding table lookup. Based on this full key, an exact match is performed in the forwarding table to find the corresponding forwarding action. When performing verification for modules unrelated to business logic, packets need to be matched against multiple flow tables to achieve various functions such as forwarding, filtering, mirroring, and flow statistics. Therefore, for the same packet, different positions of the packet header information need to be extracted to form different full keys for multiple table lookups. It is required that all different full keys for the same packet can be matched in the table lookup. Figure 1 As shown. However, during module verification, the message header information can be arbitrarily randomized, and the extracted full key may be any value with a bit width ranging from tens to hundreds. If the message and table entry are not configured to be correlated, and the message content is sent randomly, it is difficult to achieve an accurate match between multiple full keys extracted from the message header when performing multiple flow table matching.

[0003] When configuring the correlation between messages and table entries, there are usually two methods:

[0004] 1) First, randomly generate packets and extract the full key from the packets to configure the table entries. However, this method is affected by the number of packets sent: if the number of packets sent is small, there will be few table entries configured and the table entries will be relatively empty; if the number of packets sent is too large, the configuration of extra table entries will fail and the hit rate will be uncontrollable.

[0005] 2) First, configure the table entries and generate the initial message, select the table entries to be matched, and then modify part of the message content according to the content of the table entries. However, if a message needs to match multiple table entries multiple times, the full key of the table lookup has overlapping content, and different table entries have no related rows, then the modified message content will overwrite the previous content, resulting in a decrease in the hit rate. Summary of the Invention

[0006] Therefore, the main purpose of this application is to provide a general verification method and system for matching multiple lookup table entries with configuration entries. This method can achieve accurate matching of full keys in packets when matching multiple flow tables. It can also flexibly configure the matching flow tables according to project requirements to achieve different testing purposes.

[0007] In a first aspect, embodiments of this application provide a general verification method for matching configuration table entries across multiple lookup tables, the method comprising the following steps:

[0008] Generate a random string as a template for the configuration table entry;

[0009] Obtain multiple sets of offsets, each set containing several offsets;

[0010] For each set of offsets, based on the multiple offsets contained in the set of offsets, multiple offset positions corresponding to the values ​​of the offsets in the configuration entry template are obtained, the characters at the offset positions are extracted as entry configuration data, and configuration entries corresponding to each set of offsets are generated.

[0011] The original message is generated based on the testcase validation constraints, and the configuration table entry associated with each original message is specified from the multiple configuration table entries obtained in S203.

[0012] Based on the value of the offset in the offset set of the associated configuration table entry, obtain multiple offset positions in the original message corresponding to the value of the offset, replace the original message data at the multiple offset positions with the table entry configuration data, and obtain the adapted message;

[0013] The packet sender sends the adaptation message to the test device.

[0014] In an optional embodiment, the method further includes,

[0015] The random string contains M random characters.

[0016] In an optional embodiment, the method further includes,

[0017] The value of each offset is a natural number less than or equal to M.

[0018] In an optional embodiment, the method further includes,

[0019] The number of offset sets depends on the space size of the table entries, and no two offset sets are exactly the same.

[0020] The general verification method disclosed in this application sets the number of offset sets based on the space size of the table entries. This allows for flexible configuration of the packet length and the size of the table entry space, while also making full use of the table entry space, resulting in high flexibility and resource utilization.

[0021] Secondly, embodiments of this application provide a general verification system for matching configuration entries in multiple lookup tables, the system comprising:

[0022] The generation module is used to generate a random string as a template for the configuration table entry.

[0023] In addition, multiple sets of offsets are obtained, each set of offsets containing several offsets;

[0024] The configuration module is used to, for each set of offsets, obtain multiple offset positions in the configuration entry template corresponding to the value of the offset based on the multiple offsets contained in the set of offsets, extract the characters at the offset positions as entry configuration data, and generate configuration entries corresponding to each set of offsets.

[0025] The message module is used to generate raw messages based on testcase validation constraints and to specify the configuration entries associated with each raw message from a plurality of configuration entries;

[0026] And, based on the value of the offset in the offset set of the associated configuration table entry, obtain multiple offset positions in the original message corresponding to the value of the offset, replace the original message data at the multiple offset positions with the table entry configuration data, and obtain the adapted message;

[0027] A packet sender is used to send the adaptation message to the test device.

[0028] In an optional embodiment, the system further includes,

[0029] The random string contains M random characters.

[0030] In an optional embodiment, the system further includes,

[0031] The value of each offset is a natural number less than or equal to M.

[0032] In optional embodiments, in the above-described method embodiments of this application, the system further includes,

[0033] The number of offset sets depends on the space size of the table entries, and no two offset sets are exactly the same.

[0034] Thirdly, embodiments of this application provide a general verification device for multiple lookup table entries hitting configuration table entries. The device includes a memory and a processor, the memory and the processor being coupled. The memory stores program instructions, which, when executed by the processor, cause the device to perform the aforementioned general verification method for multiple lookup table entries hitting configuration table entries.

[0035] Fourthly, embodiments of this application provide a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to execute the aforementioned general verification method for matching configuration entries in a multi-lookup table.

[0036] To address the issue of multiple table lookups for the same message resulting in a match, this application employs a template generation method for table configuration. This method can generate one or more templates based on project specifications. For each message sent, a template number is selected based on an algorithm / random selection, and the full key is extracted from the corresponding template number for table configuration. Compared to related technologies, the technical solution of this application has at least the following advantages:

[0037] 1. The general verification method disclosed in this application ensures that the extraction of identical content between configuration entries obtained based on the same template remains consistent, thus solving the problem that different full key contents of the same message may overlap and cover each other.

[0038] 2. The general verification method disclosed in this application can randomly generate configuration table item templates, which do not depend on the full key content, nor on the extraction position and order. It can arbitrarily combine the characters of the configuration table item templates to quickly obtain multiple offset sets and corresponding table item configuration data. It can accurately generate the corresponding number of configuration table item templates according to the project size, and can support multiple configuration table items for different testing purposes according to project requirements, which greatly improves testing efficiency and flexibility.

[0039] 3. The general verification method disclosed in this application supports generating multiple different full keys for table lookup from the same message, and can match multiple flow tables simultaneously, accurately constraining the hit rate.

[0040] 4. The general verification method disclosed in this application can compare the full key lookup and the lookup result of each message in real time, achieving white-box verification of the lookup. For multi-level lookup logic, real-time comparison can detect problems early.

[0041] 5. The general verification method disclosed in this application sets the number of offset sets based on the space size of the table entries. This method can flexibly configure the packet length and the size of the table entry space, and can make full use of the table entry space, thus having high flexibility and resource utilization.

[0042] The 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

[0043] 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.

[0044] Figure 1 This is a diagram illustrating how different full keys are used to perform multiple table lookups for the same message in related technologies.

[0045] Figure 2 This is a flowchart illustrating a general verification method for matching multiple lookup table entries with configuration entries, provided in an exemplary embodiment of this application.

[0046] Figure 3 This is a schematic diagram of the configuration message flow provided in an exemplary embodiment of this application.

[0047] Figure 4 This is a schematic diagram of the structure of a general verification system for multi-lookup table entries matching configuration entries provided in an exemplary embodiment of this application. Detailed Implementation

[0048] 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.

[0049] Example 1

[0050] like Figure 2 As shown, exemplarily, this application provides a general verification method for multiple lookup table entries to match configuration table entries, including the following steps:

[0051] S201: Generate a random string as a configuration table entry template. The random string contains M random characters.

[0052] To address the issue of multiple table lookups for the same message consistently yielding the same result, a template-based approach can be used for table entry configuration. One or more templates are pre-generated, each corresponding to a random string. During module verification, based on the project's specifications, the maximum offset of the full key in the message header and form is calculated to be M. Therefore, each random string is set to contain M random characters. S202: Obtain multiple offset sets, each containing several offsets; the value of each offset is a natural number less than or equal to M.

[0053] The method for obtaining the offset set can be specified by the user or configured through the configuration register; there are no specific limitations on this.

[0054] The number of offset sets depends on the space size of the table entries. Each offset set can contain the same or different number of offsets, and no two offset sets are exactly the same.

[0055] S203: For each offset set, based on the multiple offsets contained in the offset set, obtain multiple offset positions in the configuration table template corresponding to the offset value, extract the characters at the offset positions as table configuration data, and generate configuration table entries corresponding to each offset set.

[0056] Assume the generated configuration table template is {TD1, TD2, ..., TD...} n , ..., TD M-1 TD M If the table entry space size is 4, then 4 offset sets need to be generated. Each offset set contains several offsets. Based on the value of each offset, multiple offset positions corresponding to the configuration entry template are obtained. For example, if the offset is 5, then the 5th random character in the configuration entry template is obtained. Therefore, the random characters corresponding to offset set 1 (2, 3, 4, 5) are (TD2, TD3, TD4, TD5). This is used as the table entry configuration data to obtain configuration entry 1. The Action corresponding to configuration entry 1 can be set to forwarding, that is, when the fullkey extracted from the packet matches the table entry configuration data corresponding to entry 1, the packet is forwarded. As shown in Table 1, configuration entry 1, configuration entry 2, configuration entry 3, and configuration entry 4 can be obtained sequentially based on the 4 offset sets. Each configuration entry can correspond to different forwarding behaviors.

[0057] Table 1 Example of the correspondence between configuration items and offset sets

[0058] Serial Number Offset set Table Entry Configuration Data Action Table 1 Offset set 1 (2, 3, 4, 5) <![CDATA[TD2,TD3,TD4,TD5]]> Forward Table 2 Offset set 2 (1, 5, 7) <![CDATA[TD1,TD5,TD7]]> filter Table 3 Offset set 3 (9, 12, 15, 21) <![CDATA[TD9,TD 12 ,TD 15 ,TD 21 ]]> Mirror Table 4 Offset set 4(5, M) <![CDATA[TD5,TD M ]]> Flow statistics

[0059] This embodiment only illustrates the case where the table space size is 4, corresponding to 4 offset sets. In practical applications, the table space size can be flexibly set according to actual needs, so that any number of configuration table entries can be obtained based on the above process, thereby meeting various testing purposes.

[0060] S204: Generate raw messages based on testcase validation constraints, and specify the configuration entries associated with each raw message from the multiple configuration entries obtained in S203.

[0061] For example, when performing module verification, the message needs to implement the functions of forwarding and filtering. The configuration entries associated with the message are configuration entry 1 and configuration entry 2.

[0062] S205: Based on the offset values ​​in the offset set of the associated configuration table entries, obtain multiple offset positions in the original message corresponding to the offset values, replace the original message data at the multiple offset positions with the table entry configuration data, and obtain the adapted message.

[0063] For example, when the configuration entries associated with the message are configuration entry 1 and configuration entry 2, the original message is first configured using configuration entry 1, with an offset set of (2, 3, 4, 5). Therefore, the 2nd, 3rd, 4th, and 5th characters in the original message are replaced with TD2, TD3, TD4, and TD5 respectively. Then, configuration entry 2 is used to continue the configuration, with an offset set of (1, 5, 7). Therefore, the 1st, 5th, and 7th characters in the message are replaced with TD1, TD5, and TD7 respectively, resulting in the final adapted message, such as... Figure 3 As shown. According to the technical solution of this application, when multiple configuration entries are used to configure the same message, since the multiple configuration entries are generated based on the same template and the corresponding content is the same, when the message is configured multiple times, the result of the later configuration will not overwrite the result of the previous configuration. Therefore, the situation where the content of the message modified later will overwrite the content of the message modified earlier will not occur, thus solving the problem of overlapping and overwriting of different full key contents of the same message.

[0064] S206: The packet sender sends the adaptation message to the test device.

[0065] According to S205, multiple adaptation messages are obtained, and the packet sender sends these adaptation messages to the test device for subsequent verification steps. Besides module verification, the obtained adaptation messages can also be used for other general verification functions, which are not specifically limited herein.

[0066] The general verification method disclosed in this application can randomly generate configuration table entry templates, independent of full key content, extraction position and order. It can arbitrarily combine the characters of the configuration table entry template to quickly obtain multiple offset sets and corresponding table entry configuration data. According to project requirements, it can support multiple configuration table entries for different testing purposes.

[0067] The general verification method disclosed in this application supports generating multiple different full keys for the same message, and can match multiple flow tables simultaneously, accurately constraining the hit rate.

[0068] The general verification method disclosed in this application can be flexibly configured according to the test case, including packet length, table space size, length of each full key, and scenarios of table lookup hit and miss, and has universal applicability.

[0069] Example 2

[0070] like Figure 4 As shown, exemplarily, this embodiment provides a general verification system for multiple lookup table entries hitting configuration table entries, used to implement the above-mentioned general verification method for multiple lookup table entries hitting configuration table entries, including the following modules:

[0071] The generation module 401 is used to obtain a random string as a configuration table item template;

[0072] In addition, multiple offset sets are generated, each offset set containing several offsets;

[0073] The configuration module 402 is used to, for each offset set, obtain multiple offset positions corresponding to the values ​​of the offsets in the configuration table template based on the multiple offsets contained in the offset set, extract the characters at the offset positions as table configuration data, and generate configuration table entries corresponding to each offset set.

[0074] The message module 403 is used to generate raw messages based on testcase validation constraints and to specify the configuration entries associated with each raw message from multiple configuration entries.

[0075] Additionally, based on the offset values ​​in the offset set of the associated configuration entries, multiple offset positions corresponding to the offset values ​​in the original message are obtained, and the original message data at the multiple offset positions is replaced with the entry configuration data to obtain the adapted message.

[0076] Packet sender 404 is used to send adaptation messages to the test device.

[0077] Example 3

[0078] This application also provides a general verification device for multiple lookup table entries hitting configuration table entries, including a coupled memory and a processor; the memory stores program instructions, which, when executed by the processor, cause the device to perform the above-described general verification method for multiple lookup table entries hitting configuration table entries.

[0079] Example 4

[0080] This application also provides a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform the general verification method for matching configuration entries in a multi-lookup table.

[0081] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the specific details described above.

[0082] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0083] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0084] The methods and apparatus of this disclosure can be implemented in many ways. For example, they can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above, unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.

[0085] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps are decomposable and / or recombinable. Such decomposition and / or recombination should be considered equivalent to the present disclosure. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0086] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A general verification method for a multi-lookup table entry to hit a configuration table entry, characterized in that, The method comprises the following steps: generating a random string as a configuration table item template; obtaining multiple sets of offset values, each set of offset values containing a plurality of offset values; for each set of offset values, obtaining multiple offset positions in the configuration table item template corresponding to the values of the offset values in the set of offset values according to the plurality of offset values contained in the set of offset values, extracting characters at the offset positions as table item configuration data, and generating configuration table items corresponding to each set of offset values; generating original packets based on testcase verification constraints, and specifying the configuration table items associated with each original packet from the multiple configuration table items; obtaining multiple offset positions in the original packet corresponding to the values of the offset values according to the values of the offset values in the set of offset values of the associated configuration table item, and replacing the original data at the multiple offset positions with the table item configuration data to obtain adapted packets; sending the adapted packets to a test device by a packet sender.

2. The universal verification method for multiple lookup table item hit configuration table items according to claim 1, wherein the number of random characters contained in the random string is M.

3. The universal verification method for multiple lookup table item hit configuration table items according to claim 2, wherein the value of each offset value is a natural number less than or equal to M.

4. The universal verification method for multiple lookup table item hit configuration table items according to claim 3, wherein the number of sets of offset values depends on the space size of the table item, and any two sets of offset values are not completely identical. The system comprises: a generation module configured to generate a random string as a configuration table item template, and obtain multiple sets of offset values, each set of offset values containing a plurality of offset values; a configuration module configured to, for each set of offset values, obtain multiple offset positions in the configuration table item template corresponding to the values of the offset values in the set of offset values according to the plurality of offset values contained in the set of offset values, extract characters at the offset positions as table item configuration data, and generate configuration table items corresponding to each set of offset values; 5. A general verification system for multi-lookup table entry hit configuration entry, characterized in that, a packet module configured to generate original packets based on testcase verification constraints, and specify the configuration table items associated with each original packet from the multiple configuration table items, and obtain multiple offset positions in the original packet corresponding to the values of the offset values according to the values of the offset values in the set of offset values of the associated configuration table item, and replace the original data at the multiple offset positions with the table item configuration data to obtain adapted packets; a packet sender configured to send the adapted packets to a test device.

6. The universal verification system for multiple lookup table item hit configuration table items according to claim 5, wherein the number of random characters contained in the random string is M.

7. The universal verification system for multiple lookup table item hit configuration table items according to claim 6, wherein the value of each offset value is a natural number less than or equal to M. ​ ​ ​ ​ ​ 8. The universal verification system of multiple lookup table entry hit configuration table entry according to claim 7, wherein, The number of the offset sets depends on the space size of the table entry, and any two of the offset sets are not completely same.

9. A general verification device for multi-lookup table entry hit configuration table entry, characterized in that, The device comprises a memory and a processor, which are coupled; the memory stores program instructions, and the program instructions are executed by the processor to make the device execute the universal verification method of multiple lookup table entry hit configuration table entry according to any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The computer program comprises a computer program, which makes the electronic device execute the universal verification method of multiple lookup table entry hit configuration table entry according to any one of claims 1-4 when the computer program runs on the electronic device.

Citation Information

Patent Citations

  • Rapid table lookup method based on fuzzy matching

    CN104092613A

  • Face image display method and device, electronic equipment and storage medium

    CN111667518A