Flow table rule compression optimization and data packet processing method and device for multi-protocol network scene

By cutting redundant matching domain fields in multi-protocol network scenarios and merging flow tables, introducing protocol identifiers to eliminate semantic ambiguity, and building a multi-level multi-protocol flow table storage structure, it solves the storage consumption problem caused by the expansion of flow table scale in multi-protocol network scenarios, and realizes the sharing and efficient compression of flow table storage.

CN119766723AActive Publication Date: 2025-04-04Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411833666.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-04
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

In multi-protocol network scenarios, the expansion of the flow table scale leads to serious storage consumption problems, and there is semantic ambiguity between different protocol fields, so sharing of flow table storage cannot be achieved.

Method used

Design a flow table rule compression optimization method for multi-protocol network scenarios. By cutting redundant matching domain fields, merging flow tables that meet preset conditions, introducing protocol identifiers to eliminate semantic ambiguity, and building a multi-level multi-protocol flow table storage structure.

Benefits of technology

The stream table scale and storage consumption in multi-protocol scenarios are effectively reduced, and the stream table storage sharing of different network protocol fields is realized, the storage consumption problem caused by the expansion of stream table scale is solved, and efficient storage is maintained through the recompression algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766723A_ABST
    Figure CN119766723A_ABST
Patent Text Reader

Abstract

The invention provides a flow table rule compression optimization and data packet processing method and device for a multi-protocol network scene, and relates to the technical field of computer networks. The flow table rule compression optimization method comprises the following steps: for an original flow table of each protocol, cutting redundant matching field fields in the original flow table to obtain an optimal matching rule flow table of each protocol; performing pairwise combination on the optimal matching rule flow tables of all the protocols, continuously combining two flow tables meeting a preset condition into the same flow table until the final flow table number meets the stage number constraint, and obtaining a multi-stage multi-protocol flow table supporting coexistence of multiple protocols; wherein when the flow tables are combined, protocol identifiers are introduced, and the protocol identifiers of the same protocol are associated with all corresponding matching domains; the preset condition comprises that all matching domains of the to-be-merged flow table can coexist in the same flow table, and the storage overhead of the merged flow table is smaller than the sum of the storage overhead of the two flow tables before the merging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network technology, and in particular to a flow table rule compression optimization and data packet processing method and device for multi-protocol network scenarios. Background Art

[0002] Since the network forwarding device completes the mapping of input data packets to forwarding results through flow table matching, the efficiency of flow table matching directly affects the performance of network forwarding. The three-state content addressable memory TCAM can output the search result within one clock cycle and has excellent performance in flow table search. Therefore, TCAM is widely used in programmable switches for flow table storage and table lookup processing. However, TCAM resources have disadvantages such as high price, high energy consumption, and large backplane space consumption, which limits the size of TCAM in the switch. Due to these limitations of TCAM resources, the size of the table entry matching domain is fixed and the same.

[0003] The addition of various network protocols or technologies to adapt to diverse and uncertain network services, and the advancement of programmable switches allow network administrators to develop new network protocols, such as Named-Data Networking (NDN), Mobility First (MF), etc. However, the number of matching domains for multi-protocol packet forwarding increases and the flow table structures are different, which is reflected in the number and length of matching domains and action types defined. The increase in matching domains directly increases the storage width of flow table rules, puts pressure on TCAM resource capabilities, and has a high implementation complexity. At the same time, multi-protocol forwarding will lead to serious flow table scale expansion problems, and due to the semantic ambiguity between different protocol fields, fields of different protocols cannot share flow table storage. The existing flow table compression algorithm mainly targets the storage compression requirements in single-protocol scenarios, and cannot solve the serious storage consumption caused by the expansion of flow table scale in multi-protocol scenarios. Summary of the invention

[0004] In order to improve the flow table storage efficiency in a multi-protocol network scenario, the present invention provides a flow table rule compression optimization and data packet processing method and device for a multi-protocol network scenario.

[0005] In a first aspect, the present invention provides a flow table rule compression optimization method for a multi-protocol network scenario, comprising:

[0006] Step 1: Receive original flow tables of multiple protocols sent by the controller; one protocol corresponds to one original flow table;

[0007] Step 2: For the original flow table of each protocol, the redundant matching domain fields in the original flow table are trimmed to obtain the optimal matching rule flow table of each protocol;

[0008] Step 3: Combine the optimal matching rule flow tables of all protocols in pairs, and continuously merge two flow tables that meet the preset conditions into the same flow table until the final number of flow tables meets the level constraint, thereby obtaining a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merge.

[0009] Furthermore, the redundant matching domain fields in the original flow table are trimmed to obtain the optimal matching rule flow table for each protocol, specifically including:

[0010] Traversing the rule set in the original flow table to solve and obtain an independent rule set; the independent rule set refers to a set of independent rules; wherein, for any rule, if it does not intersect with other rules in the rule set, the rule is said to be independent;

[0011] Traversing all the matching domains in the independent rule set, selecting a matching domain combination, and if the current matching domain combination meets the discrimination threshold requirement, adding the current matching domain combination to the candidate combination scheme; if not, selecting the next matching domain combination until all matching domain combinations are traversed; wherein the discrimination threshold is set to the ratio of the number of rules covered by the matching domain combination to the total number of rules;

[0012] Among the candidate combination schemes, the matching domain combination with the smallest rule bit width is selected as the optimal matching rule flow table.

[0013] Furthermore, it also includes: pre-building a matching domain relationship matrix of the two protocols, and using the matching domain relationship matrix to determine whether all matching domains of the flow table to be merged can coexist in the same flow table; wherein, if the element m in the matching domain relationship matrix xy =1, indicating that the xth matching domain and the yth matching domain can coexist in the same flow table. xy =0, it means they cannot coexist.

[0014] Furthermore, the storage overhead of a single flow table is calculated using the following formula:

[0015]

[0016] Among them, δ is the normalization coefficient, H and W represent the minimum storage width and depth respectively, f′(R i ,F i,j ) represents the sampling result of the flow table entry, p represents the bit width of the PID, R irepresents the rule set of the i-th protocol, Fi ,j Indicates the field storage of the i-th protocol in the j-th flow table, b i represents the bit width vector of the matching field in the i-th protocol, and M represents the number of protocol types.

[0017] Furthermore, it also includes: when the number of table entry updates reaches a preset threshold, the multi-level multi-protocol flow table is re-compressed, specifically including: combining the multi-protocol flow tables at each level in pairs, calculating the storage compression effect corresponding to each combination, selecting the combination with the worst storage compression effect, using the rules in the combination as the original rule set, executing steps 2 and 3, outputting the updated multi-level multi-protocol flow table, and clearing the number of table entry updates.

[0018] Furthermore, the calculation of the storage compression effect corresponding to each combination specifically includes:

[0019] Calculate the ratio of the sum of the storage overhead of the two flow tables before merging for each combination to the storage overhead when the rules of the two flow tables are merged and stored in a single table. The larger the ratio, the worse the storage compression effect corresponding to the combination.

[0020] In a second aspect, the present invention also provides a data packet processing method, which is applied to a multi-protocol network scenario, including: receiving a data packet, extracting a to-be-matched domain in the data packet, using a flow table rule compression optimization method for a multi-protocol network scenario as described in the first aspect to trim and merge all the extracted to-be-matched domains, and performing action matching based on the merged matching domains to execute corresponding actions on the data packet.

[0021] In a third aspect, the present invention provides a flow table rule compression optimization device for a multi-protocol network scenario, comprising:

[0022] A flow table receiving module, used to receive original flow tables of multiple protocols sent by the controller; wherein one protocol corresponds to one original flow table;

[0023] A horizontal matching domain trimming module is used to trim redundant matching domain fields in the original flow table of each protocol to obtain an optimal matching rule flow table for each protocol;

[0024] A vertical matching domain merging module is used to combine the optimal matching rule flow tables of all protocols in pairs, and continuously merge two flow tables that meet the preset conditions into the same flow table until the final number of flow tables meets the level constraint, thereby obtaining a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merge.

[0025] In a fourth aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect and / or the second aspect when executing the program.

[0026] In a fifth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the first aspect and / or the second aspect.

[0027] Beneficial effects of the present invention:

[0028] (1) The present invention effectively reduces the flow table size and storage consumption in multi-protocol scenarios by designing a two-dimensional matching domain reduction and merging algorithm to support "horizontal" splitting within a single protocol field and optimize the "vertical" merging between different protocol fields. At the same time, by introducing protocol identifiers to eliminate semantic ambiguity between multiple network protocol fields, a multi-level flow table storage structure in which multiple network protocols coexist is constructed, thus avoiding multi-protocol flow table conflicts. Ultimately, flow table storage sharing of different network protocol fields is achieved, solving the serious storage consumption problem caused by the expansion of flow table size in multi-protocol network scenarios.

[0029] (2) By analyzing the storage compression effect, the present invention further proposes a simple and fast multi-protocol flow table re-compression algorithm. The controller runs the flow table re-compression algorithm during the flow table update process to maintain a high flow table storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A flow chart of a method for compressing and optimizing flow table rules for a multi-protocol network scenario provided by an embodiment of the present invention;

[0031] Figure 2 A code of a horizontal matching domain reduction algorithm provided by an embodiment of the present invention;

[0032] Figure 3 A code of a vertical matching domain merging algorithm provided by an embodiment of the present invention;

[0033] Figure 4 A code of a flow table recompression algorithm in a flow table update phase provided by an embodiment of the present invention;

[0034] Figure 5 A block diagram of a data packet processing method provided by an embodiment of the present invention;

[0035] Figure 6 A schematic diagram of the structure of a data packet processing device provided by an embodiment of the present invention;

[0036] Figure 7 A multi-protocol pipeline matching structure diagram provided by an embodiment of the present invention;

[0037] Figure 8 A structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] like Figure 1 As shown, an embodiment of the present invention provides a flow table rule compression optimization method for a multi-protocol network scenario, comprising the following steps:

[0040] S101: receiving original flow tables of multiple protocols sent by a controller; wherein one protocol corresponds to one original flow table;

[0041] S102: for an original flow table of each protocol, trimming redundant matching domain fields in the original flow table to obtain an optimal matching rule flow table for each protocol;

[0042] S103: The optimal matching rule flow tables of all protocols are combined in pairs, and two flow tables that meet the preset conditions are continuously merged into the same flow table until the final number of flow tables meets the level constraint, thereby obtaining a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merge.

[0043] Specifically, the present invention constructs a new flow table structure (i.e., multi-protocol flow table) that supports the coexistence of multiple protocols by introducing protocol identifiers. Figure 7 As shown in the figure, in each level of the multi-protocol flow table, PID is used as an identifier to distinguish different protocols. Define PID i Represents the identifier of the i-th protocol, V i j The matching domain value of the jth field of the ith protocol is combined with the PID and the field matching domain and added to each flow table to eliminate the semantic ambiguity between the field matching domains of different protocols, so that the matching domains of different protocols can be merged and stored in the same flow table.

[0044] The present invention provides a flow table rule compression optimization method for multi-protocol network scenarios. By designing a two-dimensional matching domain reduction and merging algorithm (two-dimensional field-trimming and merging, 2D-FTM), it supports "horizontal" trimming within a single network protocol field and optimizes the "vertical" merging between different network protocol fields, effectively reducing the flow table scale and storage consumption in multi-protocol scenarios. At the same time, by introducing protocol identifiers to eliminate semantic ambiguity between multiple network protocol fields, a multi-level flow table storage structure with coexistence of multiple network protocols is constructed to avoid multi-protocol flow table conflicts. Finally, flow table storage sharing of different network protocol fields is achieved, solving the serious storage consumption problem caused by the expansion of flow table scale in multi-protocol network scenarios.

[0045] On the basis of the above-mentioned embodiments, in the embodiments of the present invention, a matching domain clipping algorithm is established to solve the problem of horizontal clipping of fields in a single protocol, so as to realize matching domain merging and fusion and reduce redundant matching domain information in the matching process. Without affecting the matching results, the use of matching domains is reduced, thereby further reducing the consumption of TCAM resources. The matching domain clipping algorithm specifically includes the following steps:

[0046] Traversing the rule set in the original flow table to solve and obtain an independent rule set; the independent rule set refers to a set of independent rules; wherein, for any rule, if it does not intersect with other rules in the rule set, the rule is said to be independent;

[0047] Specifically, matching domain pruning requires that the executed rule set has independence so that the pruned rule set can cover all rules. Therefore, it is necessary to first traverse all rules and extract independent rule sets based on rule independence.

[0048] Traversing all the matching domains in the independent rule set, selecting a matching domain combination, and if the current matching domain combination meets the discrimination threshold requirement, adding the current matching domain combination to the candidate combination scheme; if not, selecting the next matching domain combination until all matching domain combinations are traversed; wherein the discrimination threshold is set to the ratio of the number of rules covered by the matching domain combination to the total number of rules;

[0049] Among the candidate combination schemes, the matching domain combination with the smallest rule bit width is selected as the optimal matching rule flow table.

[0050] Based on the above algorithm concept, the embodiment of the present invention also provides a corresponding matching domain clipping algorithm code, such as Figure 2As shown. In the initial state, the rule set contains all matching domains (lines 1-2). First, traverse the matching domains to select the number of matching domains to be retained; second, select the matching domain combination (lines 3-4); finally, traverse all matching domain combinations, and for any two rules, if the independence requirement is not met, terminate the reduction (lines 5-11); otherwise, if the current combination meets the discrimination threshold requirement, output the matching domain clipping result; finally, select the combination with the smallest rule bit width in the combination that meets the discrimination threshold, and update the combination (lines 12-17). Figure 2 In the above formula, IR, n, and α represent the independent rule set, the number of matching domains, and the discrimination threshold, respectively; X(γ) represents all matching domains contained in the rule set γ, and X wid Represents the matching domain set, L wid Represents the matching domain mark vector. When the value of an element in the vector is 1, it means that the corresponding matching domain is retained. If the value is 0, it means that the corresponding matching domain is cropped.

[0051] On the basis of the above-mentioned embodiments, in an embodiment of the present invention, according to the optimal matching rule flow table after trimming for each protocol, this embodiment proposes an efficient search and merging scheme, executes a "vertical" merging algorithm between multi-protocol fields, and reduces the size of the flow table in a multi-protocol scenario.

[0052] In this “vertical” merging algorithm, it is necessary to pre-build the matching domain relationship matrix of the two protocols, and use the matching domain relationship matrix to determine whether all matching domains of the flow table to be merged can coexist in the same flow table; wherein, if the element m in the matching domain relationship matrix xy =1, indicating that the xth matching domain and the yth matching domain can coexist in the same flow table. xy = 0, it means they cannot coexist. Assuming that each field match is stored separately in each flow table, each time two flow tables with the smallest increase in storage redundancy after merging are selected to merge the field match domains until the final number of flow tables meets the level constraint.

[0053] The code for the "vertical" merging algorithm is as follows Figure 3 First, according to the number of flow table stages T.Stage, it is determined whether the flow tables need to be merged (lines 1-3); if no merging is required, the multi-level flow table T is directly output. Otherwise, the initialization operation is performed (lines 5-6), including the storage overhead difference ΔC before and after the merge, the number of flow table combinations l, and the flow table content T temp Then, the N-level flow tables are combined in pairs and the i-th flow table T is selected. i and the jth flow table T j Merge (lines 7-9). If the fields of the merged flow table can coexist, query or calculate the storage cost C of the flow table before and after the merge. m , C i and C j(Lines 10-15). If the storage cost of the merged flow table is C m If the total storage cost of the original flow table is less than the sum of the storage costs of the original flow table, the merged flow table is output (lines 16-18). If the fields of the merged flow table cannot coexist, a new flow table combination is selected for merging (lines 19-22). Finally, the flow table content is updated and the two merged flow tables are removed (lines 23-25).

[0054] In the above algorithm, for the i-th protocol, let the rule set be R i , containing N i Matching fields, each field width is determined by vector b i =(b1,b2,…,b Ni ) means that b k Indicates the bit width of the kth field, k∈(1,N i ). The storage of the fields of the i-th protocol in the j-th flow table is represented as a column vector F i,j =(f1,f2,…f Ni ), where f i =1 means that the i-th field is stored in the table, f i =0 means it does not exist. Based on the above settings, the storage overhead calculation formula of the jth flow table is as follows:

[0055]

[0056] δ is the normalization coefficient, H and W represent the minimum storage width and depth respectively, f′(R i ,F i,j ) represents the sampling result of the flow table entry, p represents the bit width of the PID, R i represents the rule set of the i-th protocol, F i,j Indicates the field storage of the i-th protocol in the j-th flow table, b i represents the bit width vector of the matching field in the i-th protocol, and M represents the number of protocol types.

[0057] On the basis of the above-mentioned embodiments, during the operation stage of the forwarding device, the table entries of the flow tables at all levels are constantly updated, and the controller needs to run the compression algorithm in real time to maintain the high flow table storage efficiency of the forwarding device. The flow table compression algorithm used in the table entry update stage should be simple and fast to ensure the table entry update speed. Therefore, in order to improve the flow table storage efficiency in the table entry update stage, the embodiment of the present invention also provides a flow table re-compression algorithm in the table entry update process, and when the number of table entry updates reaches a preset threshold, the multi-level multi-protocol flow table is re-compressed. The algorithm is conceived as follows: combine the multi-protocol flow tables at each level in pairs, calculate the ratio of the sum of the current storage overhead of each combination to the storage overhead when the rules of the two tables are combined and stored in a single table, the larger the ratio, the worse the storage compression effect of the two tables; each time the recompression is performed, the combination with the largest current storage overhead ratio (i.e., the combination with the worst compression effect) is selected for field reorganization, that is: run Algorithm 1 and Algorithm 2 in the above embodiment with the rules in the two tables as the original rule set; finally, output the updated multi-level multi-protocol flow table, and clear the number of table item updates so that the number of table item updates can be recorded in real time again to prepare for the next recompression.

[0058] Based on the above algorithm concept, the embodiment of the present invention also provides corresponding algorithm code, such as Figure 4 As shown. First, calculate the storage overhead of each level of flow tables, and perform initialization operations (lines 1-2), including flow table content, storage efficiency (γ), and flow table combination (l). Then, select the current i-th and j-th flow tables for merging, and calculate the storage overhead of the merged flow table (lines 3-6). If the ratio of the sum of the storage overhead of the current two flow tables to the storage overhead when the rules of the two tables are merged and stored in a single table is greater than γ, set the γ value to the storage consumption ratio (lines 7-9). If the storage consumption ratio is less than γ, reselect the flow table combination (lines 10-12). After that, take the two flow tables as the original flow tables, and execute Algorithm 1 to reduce the horizontal matching domain fields and execute Algorithm 2 to merge the flow tables in sequence (lines 13-15). Finally, update the flow table rules and return the recompressed multi-level flow table (lines 16-19).

[0059] Corresponding to the above-mentioned flow table rule compression optimization method for multi-protocol network scenarios, an embodiment of the present invention provides a flow table rule compression optimization device for multi-protocol network scenarios, which can be integrated in Figure 6 In the middle layer shown in the figure, the device mainly includes: a flow table receiving module, a horizontal matching domain cutting module and a vertical matching domain merging module.

[0060] Among them, the flow table receiving module is used to receive the original flow tables of multiple protocols issued by the controller; wherein, one protocol corresponds to one original flow table; the horizontal matching domain trimming module is used to trim the redundant matching domain fields in the original flow table for each protocol to obtain the optimal matching rule flow table for each protocol; the vertical matching domain merging module is used to combine the optimal matching rule flow tables of all protocols in pairs, and continuously merge two flow tables that meet the preset conditions into the same flow table until the final number of flow tables meets the level constraint, and obtain a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merger.

[0061] It should be noted that the flow table rule compression optimization device provided in the embodiment of the present invention is for the purpose of implementing the above method. Its specific functions can be referred to the above method embodiments and will not be repeated here.

[0062] Combination Figure 5 , Figure 6 and Figure 7 As shown, an embodiment of the present invention also provides a data packet processing method, which is applied to a multi-protocol network scenario, including: receiving a data packet, extracting a to-be-matched domain in the data packet, using a flow table rule compression optimization method for a multi-protocol network scenario provided by the above embodiments to trim and merge all the extracted to-be-matched domains, and performing action matching according to the merged matching domains to execute corresponding actions on the data packet.

[0063] Specifically, different protocols are distinguished by parsing the input data packets. For data packets of different protocols, their corresponding PIDs (carried on metadata) are obtained, and then the extracted packet header fields and PIDs are combined to form a search word, which participates in the matching of flow tables at all levels and executes corresponding actions.

[0064] In the 2D-FTM algorithm implementation structure, each level of flow table is composed of a TCAM and a RAM connected together. The TCAM of each level of flow table is used to store the merged and compressed flow table matching domain, and the RAM is used to store intermediate variables for searching the matching domain, such as flow table jump relations, clipping sets, etc. Each level of flow table will pass the clipping results of the matching domain within a single protocol to the centralized computing unit for vertical merging between multiple protocols. After the matching domain is merged, the packet header domain is sent to the TCAM for search and matching operations, and the final matching result is obtained based on this information.

[0065] Correspondingly, if Figure 6As shown, an embodiment of the present invention further provides a data packet processing device, which is applied to a multi-protocol network scenario, including a packet processor and a multi-protocol pipeline; a matching domain preprocessing circuit and a RAM are provided in the packet processor.

[0066] Among them, the matching domain preprocessing circuit analyzes the matching domain logical relationship, which can be implemented by hardware such as FPGA and network processor, and needs to be combined with the corresponding RAM storage information to extract the logical relationship and status information required for the merging of specific matching domains; based on the matching domain logical relationship and status information, a two-dimensional matching domain reduction and merging algorithm is executed, that is: a horizontal matching domain trimming algorithm is executed to achieve "horizontal" splitting of each field in a single protocol, reducing redundant matching domain information during the matching process; at the same time, the trimming information stored in the RAM is queried for false positive verification, and the optimal matching rules for each protocol are extracted, thereby executing a vertical merging algorithm based on the extracted optimal matching rules for each protocol.

[0067] In the embodiment of the present invention, the matching domain preprocessing circuit is responsible for executing the corresponding matching domain operation according to the matching domain reduction and merging scheme configured in the middle layer, thereby changing the width of the packet header domain and reducing the actual number of matching domains in the packet header domain. After the packet header domain is processed by the above matching domain operation, it is then sent to the multi-protocol pipeline for search and matching operation.

[0068] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804. The processor 801 may call the logic instructions in the memory 803 to execute the flow table rule compression optimization method or the data packet processing method in the above-mentioned embodiments.

[0069] In addition, when the logic instructions in the above-mentioned memory 803 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0070] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the flow table rule compression optimization method or data packet processing method provided in the above-mentioned method embodiments.

[0071] An embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the flow table rule compression optimization method or the data packet processing method provided by the above-mentioned method embodiments is implemented.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A flow table rule compression optimization method for multi-protocol network scenarios, characterized in that: include: Step 1: Receive original flow tables of multiple protocols sent by the controller; one protocol corresponds to one original flow table; Step 2: For the original flow table of each protocol, the redundant matching domain fields in the original flow table are trimmed to obtain the optimal matching rule flow table of each protocol; Step 3: Combine the optimal matching rule flow tables of all protocols in pairs, and continuously merge two flow tables that meet the preset conditions into the same flow table until the final number of flow tables meets the level constraint, thereby obtaining a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merge.

2. According to a method for compressing and optimizing flow table rules for multi-protocol network scenarios according to claim 1, it is characterized in that: The trimming of the redundant matching domain fields in the original flow table to obtain the optimal matching rule flow table for each protocol specifically includes: Traversing the rule set in the original flow table to solve and obtain an independent rule set; the independent rule set refers to a set of independent rules; wherein, for any rule, if it does not intersect with other rules in the rule set, the rule is said to be independent; Traversing all the matching domains in the independent rule set, selecting a matching domain combination, and if the current matching domain combination meets the discrimination threshold requirement, adding the current matching domain combination to the candidate combination scheme; if not, selecting the next matching domain combination until all matching domain combinations are traversed; wherein the discrimination threshold is set to the ratio of the number of rules covered by the matching domain combination to the total number of rules; Among the candidate combination schemes, the matching domain combination with the smallest rule bit width is selected as the optimal matching rule flow table.

3. According to a method for compressing and optimizing flow table rules for multi-protocol network scenarios according to claim 1, it is characterized in that: Also includes: Pre-build a matching domain relationship matrix of the two protocols, and use the matching domain relationship matrix to determine whether all matching domains of the flow table to be merged can coexist in the same flow table; wherein, if the element m in the matching domain relationship matrix xy =1, indicating that the xth matching domain and the yth matching domain can coexist in the same flow table. xy =0, it means they cannot coexist.

4. According to a method for compressing and optimizing flow table rules for multi-protocol network scenarios according to claim 1, it is characterized in that: It also includes the calculation of the storage overhead of a single flow table using the following formula: Among them, δ is the normalization coefficient, H and W represent the minimum storage width and depth respectively, f′(R i ,F i,j ) represents the sampling result of the flow table entry, p represents the bit width of the PID, R i represents the rule set of the i-th protocol, F i,j Indicates the field storage of the i-th protocol in the j-th flow table, b i represents the bit width vector of the matching field in the i-th protocol, and M represents the number of protocol types.

5. A flow table rule compression optimization method for multi-protocol network scenarios according to any one of claims 1 to 4, characterized in that: It also includes: when the number of table entry updates reaches a preset threshold, the multi-level multi-protocol flow table is re-compressed, specifically including: combining the multi-protocol flow tables at each level in pairs, calculating the storage compression effect corresponding to each combination, selecting the combination with the worst storage compression effect, using the rules in the combination as the original rule set, executing steps 2 and 3, outputting the updated multi-level multi-protocol flow table, and clearing the number of table entry updates.

6. A method for compressing and optimizing flow table rules for multi-protocol network scenarios according to claim 5, characterized in that: The calculation of the storage compression effect corresponding to each combination specifically includes: Calculate the ratio of the sum of the storage overhead of the two flow tables before merging for each combination to the storage overhead when the rules of the two flow tables are merged and stored in a single table. The larger the ratio, the worse the storage compression effect corresponding to the combination.

7. A data packet processing method, characterized in that: Applied to multi-protocol network scenarios, the method includes: receiving a data packet, extracting a to-be-matched domain in the data packet, cutting and merging all the extracted to-be-matched domains using a flow table rule compression optimization method for multi-protocol network scenarios as described in any one of claims 1 to 6, and performing action matching according to the merged matching domains to execute corresponding actions on the data packet.

8. A flow table rule compression and optimization device for multi-protocol network scenarios, characterized in that: include: A flow table receiving module, used to receive original flow tables of multiple protocols sent by the controller; wherein one protocol corresponds to one original flow table; A horizontal matching domain trimming module is used to trim redundant matching domain fields in the original flow table of each protocol to obtain an optimal matching rule flow table for each protocol; A vertical matching domain merging module is used to combine the optimal matching rule flow tables of all protocols in pairs, and continuously merge two flow tables that meet the preset conditions into the same flow table until the final number of flow tables meets the level constraint, thereby obtaining a multi-level multi-protocol flow table that supports the coexistence of multiple protocols; wherein, when the flow tables are merged, the protocol identifier is introduced, and the protocol identifier of the same protocol is associated with all corresponding matching domains; the preset conditions include: all matching domains of the flow tables to be merged can coexist in the same flow table, and the storage overhead of the merged flow table is less than the sum of the storage overheads of the two flow tables before the merge.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Multi-domain flow table multi-level method and device, and multi-level flow table search method and device

    CN108011823A

  • Multi-level flow table design method based on repetition rate of matching field specific value

    CN108259353A

  • Multi-level flow table design method based on logical relationship between matching fields

    CN108259354A

  • Method and system for constructing software-defined network multi-protocol division table

    CN111431929A

  • Flow table compression method based on spanning tree folding routing in software defined network

    CN113098778A