Encoding and matching method of range information and computer storage medium

By acquiring a new basic range in TCAM and using pre-stored basic ranges to expand operations, the TCAM range expansion problem is solved, and resource utilization and processing efficiency are improved.

CN112216327BActive Publication Date: 2025-08-15SANECHIPS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910622597.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-11
Publication Date
2025-08-15
Estimated Expiration
2039-07-11

AI Technical Summary

Technical Problem

In the prior art, TCAM has low resource utilization due to scope expansion problems when performing packet classification, especially during the use of rulesets, and the universal coding scheme cannot meet product needs.

Method used

By acquiring a new basic range, expanding it with the pre-stored basic range, determining encoded information, reducing storage consumption and improving resource utilization.

Benefits of technology

It effectively overcomes the problem of TCAM range expansion, improves resource utilization, reduces storage consumption, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112216327B_ABST
    Figure CN112216327B_ABST
Patent Text Reader

Abstract

The present application discloses a range information encoding and matching method and a computer storage medium. The method comprises: obtaining a new basic range, wherein the new basic range is used to decompose the range information of entries stored in a ternary content addressable memory (TCAM); performing an expansion operation on the new basic range based on pre-stored basic ranges to obtain an expansion result, wherein each pre-stored basic range has its own encoding information; and determining the encoding information corresponding to the new basic range based on the expansion result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing, and in particular to a method for encoding and matching range information and a computer storage medium. Background Art

[0002] When TCAM (ternary content addressable memory) performs packet classification, if a range-type field is required in a storage entry, the range must be decomposed and converted into prefixes. Converting ranges into prefixes significantly increases the number of storage entries. For example, a single 16-bit range can be decomposed into a maximum of 31 prefixes. A typical packet classification entry typically contains two 16-bit ranges, which can be decomposed into a maximum of 31 * 31 = 961 prefixes. This situation is called range expansion. In product applications, range expansion can cause a sharp decrease in TCAM resource utilization corresponding to certain packet classification rule sets.

[0003] In related technologies, the solution to the range expansion problem is to use optimized general range coding technology to encode the range by using additional TCAM resources to reduce the cost of range expansion. Its focus is on any type of rule set, not based on the observation of the rule set.

[0004] In the actual use of the rule set, due to its universal characteristics, the scope expansion cost is still very high, and the average expansion degree of the two scope domains cannot meet product requirements. Summary of the Invention

[0005] In order to solve the above technical problems, the present application provides a method and device for encoding range information in a ternary content addressable memory, which can overcome the TCAM range expansion problem existing in the prior art.

[0006] To achieve the purpose of this application, this application provides a range information encoding method, including:

[0007] Acquire a new basic range, wherein the new basic range is used to decompose range information of entries stored in the ternary content addressable memory (TCAM);

[0008] performing an expansion operation on the new basic range according to pre-stored basic ranges to obtain an expansion result, wherein each pre-stored basic range has its own encoding information;

[0009] According to the expansion result, the coding information corresponding to the new basic range is determined.

[0010] In an exemplary embodiment, before performing the expansion operation on the new basic range according to the pre-stored basic range and obtaining the expansion result, the method further includes:

[0011] determining the number of entries to which the new base range is expanded as a prefix;

[0012] When the number of entries expanded into prefixes in the new basic range is not 1, the expansion operation is performed on the new basic range.

[0013] In an exemplary embodiment, performing an expansion operation on the new basic range according to the pre-stored basic range to obtain an expansion result includes:

[0014] When each pre-stored basic range has its own corresponding domain, a domain including the largest number of basic ranges is selected as the target domain;

[0015] The new basic range is expanded using the basic range on the target domain to obtain expanded partial ranges.

[0016] In an exemplary embodiment, the expanding the new basic range using the basic range on the target domain to obtain the expanded partial ranges includes:

[0017] All basic ranges of the target domain are traversed, and a minimum number of basic ranges are used to perform an expansion operation on the new basic range, wherein the basic ranges used do not exceed the coverage range of the new basic range for the expansion operation.

[0018] In an exemplary embodiment, the expanding the new basic range using the basic range on the target domain to obtain the expanded partial ranges includes:

[0019] After expanding the new basic range using the basic range of the target domain, determining whether the used basic range completely covers the new basic range;

[0020] If the used basic range cannot cover the new basic range, obtaining the part of the new basic range that cannot be covered;

[0021] Perform prefix expansion on the partial range to obtain an entry corresponding to the partial range.

[0022] In an exemplary embodiment, performing an expansion operation on the new basic range according to the pre-stored basic range to obtain an expansion result includes:

[0023] Obtain the number of entries in the new basic range after performing an expansion operation according to the pre-obtained basic range;

[0024] Compare the number of entries after the expansion operation is performed on the new basic range with the number of entries obtained in advance after the new basic range is converted into prefixes;

[0025] If the number of entries converted from the prefix of the new basic range is less than the number of entries after the expansion operation is performed on the new basic range, the prefix after the expansion operation is used as the entry information corresponding to the new basic range; otherwise, the entry information of the new basic range is determined based on the entry information corresponding to each component in the expansion result of the new basic range.

[0026] In an exemplary embodiment, the pre-stored encoding information of the basic range includes encoding information corresponding to the domain information and encoding information corresponding to the range information.

[0027] In order to achieve the purpose of this application, this application provides a computer storage medium, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to call the computer program in the memory to implement any of the methods described above.

[0028] To achieve the purpose of this application, this application provides a range information matching method, including:

[0029] Obtaining range information carried by the data packet from the obtained data packet;

[0030] Matching the range information with a basic range obtained by using any of the above encodings to obtain a matching result;

[0031] The data packet is processed according to the matching result.

[0032] In order to achieve the purpose of this application, the present application provides a computer storage medium, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to call the computer program in the memory to implement the method described above.

[0033] The technical solution provided in the embodiment of the present application obtains a new basic range, performs an expansion operation on the new basic range based on a pre-stored basic range, obtains an expansion result, and then determines the encoding information corresponding to the new basic range based on the expansion result, thereby achieving the purpose of encoding the new basic range using the existing basic range, overcoming the TCAM range expansion problem existing in the prior art, and improving resource utilization.

[0034] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be achieved and obtained through the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings are used to provide a further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0036] Figure 1 A flowchart of a method for encoding range information provided in an embodiment of the present application;

[0037] Figure 2 A flowchart of a range encoding method provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of a new basic range provided for an embodiment of the present application;

[0039] Figure 4 for Figure 3 Schematic diagram of the expanded result of the new basic information shown;

[0040] Figure 5 for Figure 3 Another schematic diagram of the expanded result of the new basic information shown;

[0041] Figure 6 A flowchart of a range information matching method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] To make the purpose, technical solutions and advantages of this application more clear, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any way.

[0043] The steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.

[0044] Figure 1 A flowchart of a method for encoding range information provided in an embodiment of the present application. Figure 1 The methods shown include:

[0045] Step 101: Acquire a new basic range, where the new basic range is used to decompose range information of entries stored in the TCAM;

[0046] In an exemplary embodiment, a basic range is used to decompose range information of entries stored in a TCAM. Different basic ranges may not overlap with each other, or may partially overlap with each other.

[0047] Step 102: Perform an expansion operation on the new basic range according to the pre-stored basic ranges to obtain an expansion result, wherein each pre-stored basic range has its own encoding information;

[0048] In an exemplary embodiment, the pre-stored basic range is obtained by:

[0049] When the basic range is not stored locally, when the basic range is received, the basic range may be converted into a prefix, and the basic range may be stored with the entry information corresponding to the prefix;

[0050] When the obtained basic range reaches a pre-stored quantity threshold, the method provided in the embodiment of the present application can be used to process the newly received basic range.

[0051] In an exemplary embodiment, performing an expansion operation on the new basic range according to the pre-stored basic range to obtain an expansion result includes:

[0052] When each pre-stored basic range has its own corresponding domain, a domain including the largest number of basic ranges is selected as the target domain;

[0053] The new basic range is expanded using the basic range on the target domain to obtain expanded partial ranges.

[0054] Traverse all domains that have been assigned basic scopes and find the domain with the most expanded entries among these domains as the target domain. Then use the basic scope on the target domain to expand the new basic scope.

[0055] Step 103: Determine the coding information corresponding to the new basic range according to the expansion result.

[0056] In an exemplary embodiment, unlike the related art in which range information is first decomposed and then converted into a prefix, the embodiment of the present application uses the stored basic range to expand a new basic range, thereby achieving the purpose of using the existing basic range to mark the new basic range and reducing the storage consumption of the basic range.

[0057] The method provided in the embodiment of the present application obtains a new basic range, performs an expansion operation on the new basic range based on a pre-stored basic range, obtains an expansion result, and then determines the encoding information corresponding to the new basic range based on the expansion result, thereby achieving the purpose of encoding the new basic range using the existing basic range, overcoming the TCAM range expansion problem existing in the prior art, and improving resource utilization.

[0058] The method provided in this application is further described below:

[0059] In an exemplary embodiment, before performing the expansion operation on the new basic range according to the pre-stored basic range and obtaining the expansion result, the method further includes:

[0060] determining the number of entries to which the new base range is expanded as a prefix;

[0061] When the number of entries expanded into prefixes in the new basic range is not 1, the expansion operation is performed on the new basic range.

[0062] By determining whether the number of entries expanded into prefixes of the new basic range is 1, when performing the expansion operation based on the basic range, the number of executions of the expansion operation based on the basic range can be effectively controlled, thereby improving processing efficiency.

[0063] In an exemplary embodiment, the expanding the new basic range using the basic range on the target domain to obtain the expanded partial ranges includes:

[0064] All basic ranges of the target domain are traversed, and a minimum number of basic ranges are used to perform an expansion operation on the new basic range, wherein the basic ranges used do not exceed the coverage range of the new basic range for the expansion operation.

[0065] When the target domain includes at least two basic ranges, the basic ranges in the target domain can be combined so that the coverage of the combination does not exceed the new basic range; by adopting the minimum number of basic ranges, the number of entries in the new basic range can be minimized, thereby improving management efficiency.

[0066] In an exemplary embodiment, the expanding the new basic range using the basic range on the target domain to obtain the expanded partial ranges includes:

[0067] After expanding the new basic range using the basic range of the target domain, determining whether the used basic range completely covers the new basic range;

[0068] If the used basic range cannot cover the new basic range, obtaining the part of the new basic range that cannot be covered;

[0069] Perform prefix expansion on the partial range to obtain an entry corresponding to the partial range.

[0070] By judging the coverage range of the expansion result, performing prefix expansion on the uncovered partial range, and combining the expansion of the basic range with the expansion of the prefix, the new basic range can be fully covered.

[0071] In an exemplary embodiment, performing an expansion operation on the new basic range according to the pre-stored basic range to obtain an expansion result includes:

[0072] Obtain the number of entries in the new basic range after performing an expansion operation according to the pre-obtained basic range;

[0073] Compare the number of entries after the expansion operation is performed on the new basic range with the number of entries obtained in advance after the new basic range is converted into prefixes;

[0074] If the number of entries converted from the prefix of the new basic range is less than the number of entries after the expansion operation is performed on the new basic range, the prefix after the expansion operation is used as the entry information corresponding to the new basic range; otherwise, the entry information of the new basic range is determined based on the entry information corresponding to each component in the expansion result of the new basic range.

[0075] Figure 2 This is a flow chart of the range coding method provided in the embodiment of the present application. Figure 2 As shown, the method includes:

[0076] Step 201: Perform a basic prefix range expansion process and count the number of prefixes converted from the current entry range, recorded as p_range_num;

[0077] Step 202: Determine whether p_range_num is 1. If it is 1, proceed to step 206; otherwise, proceed to step 203.

[0078] Step 203: Perform the basic range expansion process and count the number of basic range expansions for the current entry, recorded as b_range_num;

[0079] Step 204: Compare p_range_num with b_range_num. If p_range_num is less than b_range_num, proceed to step 206; otherwise, proceed to step 205.

[0080] Step 205: Use basic range coding to store in the TCAM storage module;

[0081] Step 206: directly use the decomposed prefix to store in the TCAM storage module.

[0082] Through the above method, coding management of the new basic range can be achieved.

[0083] In an exemplary embodiment, the pre-stored encoding information of the basic range includes encoding information corresponding to the domain information and encoding information corresponding to the range information.

[0084] The domain can be identified by using the encoding information of the domain information within the basic range; the encoding information of the range information can be marked with 1 bit to simplify the occupation of the encoding of the basic range.

[0085] The following describes the method provided in the embodiment of the present application:

[0086] For range-based packet classification rule sets, a single basic range is encoded as a single bit, and an optimized encoding strategy is provided. Combined with hardware parallel comparison capabilities, this solves the TCAM range expansion problem. Since a small number of basic ranges can be reorganized into multiple synthetic ranges, resource utilization can be maximized when TCAM resources are limited.

[0087] The range coding method of the present invention comprises the following steps:

[0088] An IPv4 rule set consists of N K-bit range fields, designated R_FIELD_0, R_FIELD_1, ..., R_FIELD_N. Given an additional M bits of width available for range encoding, the N range fields are expanded to share 32 bits. The range encoding process is as follows:

[0089] Step 1: It can be dynamically issued or issued all at once, and the basic range represented by all M bits is pre-configured, where the basic range distinguishes the domain in which it is located; if not configured, the first M ranges encountered that cannot be directly converted into prefix representation (that is, the number of entries after the prefix is expanded is not 1) are used as the basic range.

[0090] Step 2: After all M basic ranges are allocated, the expansion of each issued rule is as follows:

[0091] a) First, count the number of prefix expansions. If the prefix expansion can be performed directly, store it directly in the TCAM and end; otherwise, continue to step b);

[0092] b) Traverse all domains that have been allocated basic ranges and find the domain with the most expanded entries in these domains. If the maximum number of expanded entries is 1, directly store it in the TCAM; if the maximum number of expanded entries is greater than 1, continue with step c);

[0093] c) The mapping of the rule to the domain is recorded as range, and the range is expanded using the basic ranges on the domain. All basic ranges of the domain are traversed to find the minimum number of basic ranges that cover the domain to the greatest extent but do not exceed the range boundary. The parts that cannot be covered are expanded using prefix expansion;

[0094] d) Compare the total number of entries in the domain expanded using the basic range with the number of entries expanded directly using the prefix, select the smaller one, and store it in the TCAM after expansion.

[0095] The steps to expand range using the basic range on the domain are as follows:

[0096] The basic range expansion is carried out by traversing all basic ranges to build a tree, so as to find the optimal expansion combination. <range>If a basic range is within <range>If the range is within, the tree is built using the range as the root node and the number of expanded entries after the complete expansion is counted.

[0097] Figure 3 Schematic diagram of the new basic range provided by the embodiment of the present application. Figure 3 As shown, select <e1>As the root node, <range>Expand. <range>The left and right endpoints are original_min and original_max respectively. If <range>Include <e1>, but original_min is less than <e1>The left endpoint of , it means that there is an uncovered part on the left, and the remaining range is recorded as<left_field> ; Similarly, there is an uncovered part on the right, recorded as<right_field> .

[0098] exist Figure 3 In the range shown, create left and right child nodes and store them respectively<left_field> and<right_field> The number of expansions; at this time <e1>There is a root node, and the expansion number of the root node is 1; then <range>The total number of expansions is 1+num(left)+num(right), where num(left) and num(right) are the expansion numbers of the left and right child nodes storage range respectively.

[0099] Recursively process the expansion of the left and right remaining ranges to obtain num(left) and num(right);<left_field> For example, we first try to expand it using the prefix expansion method. If the prefix expansion number is 1, we stop building the tree downwards. If the prefix expansion number is not 1, we look for a tree that can completely contain<left_field> And in <range>The basic range within the range, as shown in the figure <e2>, then stop building the tree downwards; if it still cannot be found, as shown in the figure<right_field> , then continue to traverse all partial covers<right_field> And <range>The included range, and continue to try to expand (as shown in the figure <e3>+<right_field’> ) until the expansion is completed or the number of expansions is greater than the number of expansions using the prefix directly, then the tree construction stops.

[0100] The encoding process of range information includes:

[0101] When TCAM is stored, each time an EI is used, an entry is generated. <range>Basic range expansion is used. Assuming that the range field width is 8, an additional 4 bits are used to encode the basic range of the field, and Ei (i>1) corresponds to the (i-1)th bit.

[0102] Figure 4 for Figure 3 The schematic diagram of the expanded result of the new basic information is shown in FIG. Figure 4 As shown, <range>The final solution is to use E1, E2, and E3 to expand, which will result in three entries that need to be stored in the TCAM, as follows:

[0103] Entry 1: *********1***

[0104] Entry 2: ************1**

[0105] Entry 3: **********1*

[0106] Figure 5 for Figure 3 Another schematic diagram of the expanded result of the new basic information shown in FIG. Figure 5 As shown, <range>The final solution is to use E1, E2, and two additional prefix ranges for expansion. This will result in four entries that need to be stored in the TCAM, as follows:

[0107] Entry 1: *********1***

[0108] Entry 2: ************1**

[0109] Entry 3: xxxx xxxx****

[0110] Entry 4: xxxx xxxx****

[0111] The sequence of x represents a three-state bit string in a prefix form, and * represents "don't care" in the three states.

[0112] In the method provided by the embodiment system of the present application, in a real rule set, the number of different ranges is usually relatively limited. The present invention combines the characteristics of the rule set and performs targeted range encoding based on the prefix expansion method, but the performance is significantly better than the prefix expansion method, and the number of expansions is optimized to varying degrees for different rule sets. When the system load is large and preprocessing fails, the present method is fully compatible with the prefix expansion encoding and rule delivery method, and there is a theoretical lower bound. Compared with the prior art, by using a small amount of additional TCAM resources, the problem of low resource utilization caused by the range expansion problem is significantly reduced. At the same time, due to the ability to utilize the characteristics of simultaneous encoding of multiple basic ranges, the stability of resource utilization is also significantly increased.

[0113] The embodiment of the present application provides a computer storage medium, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to call the computer program in the memory to implement the above Figures 1 to 5 Any of the methods described.

[0114] The computer storage medium provided in the embodiment of the present application obtains a new basic range, performs an expansion operation on the new basic range based on a pre-stored basic range, obtains an expansion result, and then determines the encoding information corresponding to the new basic range based on the expansion result, thereby achieving the purpose of encoding the new basic range using the existing basic range, overcoming the TCAM range expansion problem existing in the prior art, and improving resource utilization.

[0115] Figure 6 A flowchart of a range information matching method provided in an embodiment of the present application. Figure 6 The method shown comprises:

[0116] Step 601: Obtain range information carried in the obtained data packet from the obtained data packet;

[0117] Step 602: Match the range information with a basic range obtained by using any of the above encodings to obtain a matching result.

[0118] In an exemplary embodiment, the range field in the input key value is compared in parallel with N preset basic ranges. The key value is calculated by comparing the range field of the packet with the basic ranges of all corresponding domains. If the range falls within the range, the corresponding bit is encoded as 1; if not, it is encoded as 0. All bits of the key value sent to the TCAM for comparison are fixed binary values (0 or 1).

[0119] Step 603: Process the data packet according to the matching result.

[0120] The method provided in an embodiment of the present application obtains the range information carried by the data packet from the obtained data packet, matches the range information with the basic range obtained by using any of the above-mentioned encodings to obtain a matching result, and processes the data packet based on the matching result, uses the basic range encoding to match the range information, and improves the efficiency of searching for the range information.

[0121] The embodiment of the present application provides a computer storage medium, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to call the computer program in the memory to implement the above Figure 6 The method described.

[0122] The computer storage medium provided in an embodiment of the present application obtains range information carried by a data packet from the obtained data packet, matches the range information with a basic range obtained by using any of the above-mentioned encodings to obtain a matching result, and processes the data packet based on the matching result, matches the range information using the encoding of the basic range, thereby improving the efficiency of searching for the range information.

[0123] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.< / range> < / range> < / range> < / range> < / range> < / range> < / range> < / range> < / range> < / range> < / range>

Claims

1. A method for encoding range information, characterized in that: include: Acquire a new basic range, wherein the new basic range is used to decompose range information of entries stored in a ternary content addressable memory (TCAM); performing an expansion operation on the new basic range according to pre-stored basic ranges to obtain an expansion result, wherein each pre-stored basic range has its own encoding information; According to the expansion result, the coding information corresponding to the new basic range is determined.

2. The method according to claim 1, characterized in that Before performing the expansion operation on the new basic range according to the pre-stored basic range to obtain the expansion result, the method further includes: determining the number of entries to which the new base range is expanded as a prefix; When the number of entries expanded into prefixes of the new basic range is not 1, the expansion operation is performed on the new basic range.

3. The method according to claim 1 or 2, characterized in that The expansion operation is performed on the new basic range according to the pre-stored basic range to obtain an expansion result, including: When each pre-stored basic range has its own corresponding domain, a domain including the largest number of basic ranges is selected as the target domain; The new basic range is expanded using the basic range on the target domain to obtain expanded partial ranges.

4. The method according to claim 3, characterized in that The new basic range is expanded using the basic range on the target domain to obtain expanded partial ranges, including: All basic ranges of the target domain are traversed, and a minimum number of basic ranges are used to perform an expansion operation on the new basic range; wherein the coverage range of the basic ranges used in the expansion operation does not exceed the new basic range.

5. The method according to claim 3, characterized in that The new basic range is expanded using the basic range on the target domain to obtain expanded partial ranges, including: After expanding the new basic range using the basic range of the target domain, determining whether the used basic range completely covers the new basic range; If the used basic range cannot cover the new basic range, obtaining the part of the new basic range that cannot be covered; Perform prefix expansion on the partial range that cannot be covered in the new basic range to obtain an entry corresponding to the partial range.

6. The method according to claim 1 or 2, characterized in that The step of performing an expansion operation on the new basic range according to the pre-stored basic range to obtain an expansion result includes: Obtain the number of entries in the new basic range after performing an expansion operation according to the pre-obtained basic range; Compare the number of entries after the expansion operation is performed on the new basic range with the number of entries obtained in advance after the new basic range is converted into prefixes; If the number of entries converted from the prefix of the new basic range is less than the number of entries after the expansion operation is performed on the new basic range, the prefix after the expansion operation is used as the entry information corresponding to the new basic range; otherwise, the entry information of the new basic range is determined based on the entry information corresponding to each component in the expansion result of the new basic range.

7. The method according to claim 1, characterized in that The pre-stored coding information of the basic range includes coding information corresponding to the domain information and coding information corresponding to the range information.

8. A range information matching method, characterized in that: include: Obtaining range information carried by the data packet from the obtained data packet; Matching the range information with the encoding information corresponding to the new basic range to obtain a matching result; the encoding information corresponding to the new basic range is obtained using the range information encoding method according to any one of claims 1 to 7; The data packet is processed according to the matching result.

9. A computer storage medium, characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to call the computer program in the memory to implement the method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to call the computer program in the memory to implement the method according to claim 8.

Citation Information

Patent Citations

  • Matching method and device based on TCAM (ternary content addressable memory) for NFA (non-deterministic finite automaton)

    CN103226551A

  • BF_TCAM (Bloom Filter-Ternary Content Addressable Memory)-based high-efficiency range matching method for realizing zero range expansion

    CN105515997A