A method and device for finding a route with variable length addresses
By using Bloom filters and hash tables to store high-frequency routing sets and dictionary trees to store low-frequency routing sets in the routing lookup method, the problem of low routing efficiency for variable-length addresses is solved, and efficient routing lookup and data packet processing are achieved.
Patent Information
- Application Number
- CN202310281122.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2043-03-20
AI Technical Summary
Existing routing lookup methods are unable to efficiently process variable-length addresses, resulting in resource waste and decreased data packet processing performance, and are unable to meet the flexible and efficient requirements of future network applications.
Bloom filter and hash table are used to store high-frequency routing sets, and dictionary tree is used to store low-frequency routing sets. The routing prefix length is divided into multiple intervals through statistical analysis, and pre-screening is performed in the high-frequency set to reduce the number of hash table accesses and improve the search speed.
It realizes efficient routing lookup for variable-length addresses, reduces resource waste, improves data packet processing performance, and adapts to the diverse needs of future network applications.
Smart Images

Figure CN116582486B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the technical field of route lookup in a packet switching network, and more particularly, to a route lookup method and apparatus for variable-length addresses. Background Art
[0002] Currently, packet switching networks using "store-and-forward" technology are booming in the digital communications field. Packet switching technology divides the information payload into smaller, limited-length data segments and adds corresponding identification information (such as destination address, source address, and message type) to each data segment to form a data message.
[0003] However, when data is transmitted, after the network equipment in the packet switching network receives the data message, it first stores the message and parses it to obtain the corresponding identification information (such as the destination address) in the message header, and then searches the corresponding forwarding information database based on the identification information to obtain the next hop interface. Finally, the forwarding module transmits the data message from the queried interface, thereby completing the search and forwarding of the data message.
[0004] Network devices can establish a unified routing table for addresses of varying lengths. Therefore, data packets with network addresses of varying lengths can use the same routing table to find the next-hop interface. During forwarding, network devices perform a routing table lookup based on addresses of any length to determine the next-hop interface for the data packet. The efficiency of this lookup and forwarding significantly determines network transmission performance, and research on data packet routing lookup has garnered significant industry attention.
[0005] After decades of development, route lookup technology has been widely used in various packet-switched networks, particularly in computer networks, with a wide variety of route lookup methods being proposed. However, with the continuous growth of IP network applications and user demands, a growing number of new network applications are emerging, driving the demand for new business capabilities such as future intelligent machine communications, the Internet of Everything, and the Internet of Everything. The traditional Internet's interconnection and interoperability based on fixed, bounded IP addresses is gradually becoming less flexible and less scalable to accommodate the diverse and specialized business needs of the future.
[0006] Variable-length address technology is an effective solution to these problems. It can provide address structures with adaptable lengths based on network scale and application scenario requirements, thus meeting the needs of various heterogeneous networks and terminals to achieve the Internet of Everything. However, while variable-length addresses offer the advantage of flexibility and the ability to customize address lengths based on actual needs, they also introduce certain difficulties in route lookups. If all routing entries were still stored uniformly using the traditional longest prefix address length and route lookups were performed based on this, the storage space and performance of the route lookup algorithm would be significantly challenged.
[0007] Specifically for data packet routing, variable-length address routing entries are flexible and diverse. Existing routing methods rely on fixed-length address formats for search and forwarding. Directly using traditional routing methods designed for fixed-length addresses makes it difficult to meet the requirements for flexible and efficient routing for variable-length addresses. Alternatively, variable-length addresses can be classified and converted into multiple fixed-length addresses to accommodate traditional routing methods. However, these methods not only waste resources but also significantly reduce data packet processing performance, thereby impacting network communication quality.
[0008] Therefore, solutions for route lookup in the context of variable-length addresses have become a pressing challenge in the field. However, existing research on networks with variable-length addresses is still limited, and research on route lookup methods for variable-length addresses is even more lacking. This patented invention addresses this scenario by proposing a route lookup method and apparatus for variable-length addresses in a packet-switched network. Summary of the Invention
[0009] The present invention describes a routing lookup method and device for variable-length addresses, which can solve the above technical problems.
[0010] According to a first aspect, a route lookup method for variable-length addresses is provided. The method comprises: performing statistical analysis on a routing forwarding information base to obtain a range of route prefix lengths and the number of route prefixes corresponding to each route prefix length; dividing the range of route prefix lengths into N equal intervals and counting the number of route prefixes within each interval; sorting the intervals according to the number of route prefixes to obtain a high-frequency route set and a low-frequency route set; storing the high-frequency route set using a Bloom filter and a hash table, and storing the low-frequency route set using a dictionary tree; performing a route query on a data packet arriving at a router in the high-frequency route set, and if no matching item is found in the high-frequency route set, searching the low-frequency route set.
[0011] In one embodiment, using a Bloom filter and a hash table to store high-frequency routing prefixes includes: for each interval of the high-frequency routing prefixes, constructing a Bloom filter and a hash table thereof to store corresponding routing prefix information.
[0012] In one embodiment, using a Bloom filter and a hash table to store the high-frequency route set includes: dividing the high-frequency route set into a fixed-length part and a variable-length part, the fixed-length part is stored in the hash table, and the variable-length part points to a dictionary tree for storage.
[0013] In one embodiment, performing route query on a high-frequency routing set for a data packet arriving at the router includes: first performing pre-screening by constructing a Bloom filter on each hash table.
[0014] In one embodiment, if a matching entry is found in the high-frequency routing set, the next-hop port information is obtained for forwarding.
[0015] In one embodiment, the method further includes adding a routing prefix to the routing forwarding information base of the router. If the routing prefix length belongs to a high-frequency routing set, it is added to the hash table; if the routing prefix length belongs to a low-frequency routing set, it is stored in the dictionary tree.
[0016] According to a second aspect, a route search device for variable-length addresses is provided. The device includes: a route information statistics module, configured to perform statistical analysis on the route forwarding information base to obtain the route prefix length range and the number of route prefixes corresponding to each route prefix length; a route prefix length division module, configured to divide the route prefix length range into N equal intervals and count the number of route prefixes in each interval; a route prefix sorting module, configured to sort according to the number of route prefixes in each interval to obtain a high-frequency route set and a low-frequency route set; a route prefix storage module, configured to use a Bloom filter and a hash table to store the high-frequency route set, and a dictionary tree to store the low-frequency route set. A route prefix query module, configured to perform a route query on the high-frequency route set for a data packet arriving at the router. If no matching item is found in the high-frequency route set, the low-frequency route set is searched.
[0017] In one embodiment, the device further includes a routing prefix adding module.
[0018] In one embodiment, the routing prefix sorting module is specifically configured to:
[0019] The routing prefix entries in the first K intervals of sorting are regarded as the high-frequency routing set, and the routing prefix entries in the [K+1]-[N] interval of sorting are regarded as the low-frequency routing set.
[0020] In one embodiment, the routing prefix storage module is specifically configured to: for each interval of a high-frequency routing prefix, construct a Bloom filter and a hash table thereof to store corresponding routing prefix information.
[0021] In one embodiment, the routing prefix storage module is specifically used to: divide routing entries in the high-frequency routing set into a fixed-length part and a variable-length part, the fixed-length part is stored in a hash table, and the variable-length part points to a dictionary tree for storage.
[0022] In one embodiment, the routing prefix query module is specifically configured to: first perform pre-screening by constructing a Bloom filter on each hash table.
[0023] In the above-described method and apparatus provided in the embodiments of this specification, Bloom filters and dictionary trees are used to achieve efficient route lookups for variable-length addresses. This method primarily relies on statistical analysis and other techniques to divide routing entries in the forwarding information base into high-frequency and low-frequency categories, and then applies different data structures to process these routing entries. To accelerate route lookups, a Bloom filter is constructed on each hash table for pre-screening, reducing the number of hash table accesses. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 A schematic diagram illustrating a flow chart of a route lookup method for variable-length addresses provided in an embodiment of the present application is shown;
[0026] Figure 2 The distribution of variable-length address routing prefixes provided by the embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram showing the storage structure of high-frequency routing prefixes provided in an embodiment of the present application is shown;
[0028] Figure 4 The following shows the storage data structure of the low-frequency routing entries provided by the embodiment of the present application;
[0029] Figure 5 The following illustrates the architecture of the Bloom filter and dictionary tree search method provided by the embodiment of the present application;
[0030] Figure 6 The following is a flowchart of a routing prefix search process provided by an embodiment of the present application;
[0031] Figure 7 The following illustrates the process of adding a routing prefix entry provided by an embodiment of the present application;
[0032] Figure 8 Shows a deployment diagram of a variable-length routing lookup module provided in an embodiment of the present application;
[0033] Figure 9 A schematic structural diagram of a route lookup device for variable-length addresses provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0036] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0037] In the description of the embodiments of this application, the term "and / or" is merely a description of an association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more.
[0038] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0039] Figure 1 A flow chart of a method for finding a route for a variable-length address provided by an embodiment of this specification is shown. Figure 1 As shown, the method includes the following steps:
[0040] Step S110 , performing statistical analysis on the routing forwarding information base to obtain a routing prefix length range and the number of routing prefixes corresponding to each routing prefix length.
[0041] In order to distinguish the high-frequency and low-frequency nature of routing prefixes, the distribution of routing prefix entries in the router forwarding information base can be statistically analyzed to determine the difference. Figure 2 The distribution of variable-length address routing prefixes provided by the embodiment of the present application is shown as follows: Figure 2 As shown in the figure, the routing prefix distribution of a finite domain network element node in a variable-length address network shows that routing prefixes occupy a larger number in certain length ranges. Therefore, the routing lookup method should be designed based on this rule. In this network element node, the number of routing prefixes with lengths of 25-31 bits, 73-79 bits, 91-97 bits, and 103-115 bits is relatively large.
[0042] In some embodiments, the implementation of this step includes: first, performing classification and statistical analysis on the routing prefix set according to the prefix length to obtain the number of routing prefixes owned by each prefix length.
[0043] Step S120: Divide the range of routing prefix lengths into N equal intervals and count the number of routing prefixes in each interval.
[0044] In some embodiments, the routing prefix length statistics obtained in step S110 are evenly divided into N equal intervals, and the number of routing prefixes in each interval is counted, that is, the number corresponding to each routing prefix length in the interval is added up. The routing prefixes in each interval are sorted in descending order.
[0045] Step S130 : sorting the routing prefixes in each interval according to the number of the routing prefixes to obtain a high-frequency routing prefix set and a low-frequency routing prefix set.
[0046] The routing prefix entries in the first K intervals of sorting are regarded as the high-frequency routing set, and the routing prefix entries in the interval [K+1]-[N] are regarded as the low-frequency routing set.
[0047] In step S140 , a Bloom filter (Bloom filter for short) and a hash table are used to store a high-frequency route set, and a Trie tree (Trie tree for short) is used to store a low-frequency route set.
[0048] Figure 3 A schematic diagram of the storage structure of the high-frequency routing prefix provided in the embodiment of the present application is shown as follows: Figure 3As shown, a hash table is maintained for the route prefix length of each high-frequency route set. Each hash table corresponds to a range of route prefixes. The first K ranges in step S130 are: ranges with lengths [len1, len1+L], [len2, len2+L], [len3, len3+L]…[lenk, lenk+L]. The corresponding route prefixes are stored in hash table 1, hash table 2, hash table 3……hash table k, where the value of len is determined by the parameter passed in the function.
[0049] There are K hash tables, each storing several routing prefixes whose lengths fall within a range. Taking any of the first K ranges as an example, we'll illustrate the storage structure of high-frequency routing prefixes. Each routing prefix consists of a fixed-length portion F and a variable-length portion V. The fixed-length portion F is stored in the corresponding hash table, while the variable-length portion V is stored in a small Tier tree, which is stored using pointers pointing to a small Trie tree.
[0050] Use Trie tree to store low-frequency routing prefixes, Figure 4 The storage data structure of the low-frequency routing entries provided in the embodiment of the present application is as follows: Figure 4 As shown, at least one root node is constructed based on the routing prefix of the low-frequency routing prefix interval. The root node contains all the prefixes in the routing table. The left and right nodes of the tree are constructed through the value of the bit of the routing prefix, 0 represents the left child node, and 1 represents the right child node, and the next hop exit information is stored in the node. In one embodiment, the next hop port of route 110* is H, and the next hop port of route 011* is C.
[0051] Step S150: perform a route query on the high-frequency routing set for the data packet arriving at the router. If no matching item is found in the high-frequency routing set, search the low-frequency routing set.
[0052] Figure 5 The architecture of the Bloom filter and dictionary tree search method provided by the embodiment of the present application is shown as follows: Figure 5 As shown in the figure, after a network data packet enters a network element, it is first parsed and then handed over to the packet switching module for processing. The packet switching module performs statistical modeling analysis on the routing entries in the forwarding information base (i.e., variable-length routing sets), dividing the routing prefixes into high-frequency routing sets and low-frequency routing sets. The k high-frequency routing sets correspond to k hash tables. The low-frequency routing sets are searched using the corresponding Trie tree.
[0053] Figure 6 The process of finding a routing prefix entry provided by the embodiment of the present application is shown as follows: Figure 6As shown, in the high-frequency routing prefix lookup, the hash lookup first constructs a hash table corresponding to each routing prefix according to different routing prefix lengths, so that each routing prefix has a hash table. In step S120, K hash tables are created for each of the K intervals divided by the high-frequency routing part.
[0054] In one embodiment, a Bloom filter is an m-bit bit vector V that stores mapping information for set elements. K independent hash tables, Hash Table 1, Hash Table 2, Hash Table 3, ..., Hash Table K, correspond to k Bloom filters. Routing prefix entries in the hash tables are mapped into the bit vector V. A Bloom filter is constructed on each hash table for pre-screening, reducing the number of hash table accesses.
[0055] First, initialize the bit vector V, set each bit in V to zero, calculate m hash values of the routing prefix entries in the hash table, and set the corresponding bits in the bit vector V to 1 or 0 according to the calculated hash values.
[0056] In one embodiment, if a bit in V is already set to 1 before performing the mapping, then the bit is not changed when performing the mapping.
[0057] In one embodiment, each routing prefix interval corresponds to a Bloom filter. The routing prefix in the hash table is input into the filter for query. The query result is stored in a matching vector. Finally, the value of each bit is obtained according to the matching vector.
[0058] An element is mapped to a point on an m-length array through a hash function. When this point is 1, routing prefixes of different lengths are inserted into different Bloom filters.
[0059] If a match is found in the high-frequency route set, the routing information of the current matching prefix is recorded and the next-hop query result is returned.
[0060] If there is no match in hash table K, continue searching hash table K-1 until the last hash table 1 is traversed. Because hash table K has the most storage entries, the probability of obtaining a match is greater, which can reduce the number of queries.
[0061] During the high-frequency routing search phase, the routing information recorded here is the length of the fixed-length part F and the variable-length part V, and then the query flag field and the optimal flag field are checked.
[0062] 1) If the Flag field value is 0, it indicates that a matching routing entry is found, and the recorded routing information is read to forward the data packet.
[0063] 2) If the Flag field value is 1, it indicates that no matching routing entry is found, and the pointer S points to the next hash table.
[0064] 3) When a matching route is found, the Mark field is checked again to verify whether the route is the best route prefix. If the Mark field value is 0, the current route is the best prefix. If the Mark field value is 1, the current route is not the best prefix and a longer route prefix exists. Therefore, the search must continue until the best route prefix is found.
[0065] In one embodiment, if there is no matching entry in the high-frequency routing set, a search is performed in the Trie tree corresponding to the low-frequency routing set.
[0066] In the low-frequency route search phase, the search is performed in the Trie tree corresponding to the low-frequency route set.
[0067] This application uses the same filter for different routing address lengths, which reduces the total number of filters and the number of routing lookup processes.
[0068] The following is an explanation of the programmable address routing lookup method based on Bloom filter and Trie tree when adding routing prefixes. When packet switching data arrives, a pre-judgment is made based on the distribution pattern of variable-length routing prefixes, and the routing prefix is pushed to an appropriate place for storage. Figure 7 This is the process of adding a routing prefix entry provided in this embodiment. Figure 7 As shown,
[0069] If the prefix length is [len1, len1+L], then the prefix is stored in hash table 1.
[0070] If the prefix length belongs to [lenk, lenk+L], then the prefix is stored in the hash table k.
[0071] If the prefix length belongs to the low-frequency routing set, it is stored in the corresponding Trie tree.
[0072] The present invention is described below with reference to a deployment topology diagram in a network element device. Figure 8 The following diagram shows the deployment diagram of the variable length routing lookup module provided by the embodiment of the present application. According to one aspect of the present invention, a device module for implementing variable length address routing lookup based on a network element device through a Bloom filter and a Trie tree is provided. The deployment topology diagram of the module in the network element device is shown in FIG. Figure 7 As shown:
[0073] The network element device consists of three parts: input and output module, packet message switching module, and routing lookup module.
[0074] After the network data message enters the network element device from the input port, the data message is first parsed and handed over to the packet switching module for processing; then the variable-length route lookup module queries the routing table generated by the route generation module according to the routing protocol to establish the corresponding forwarding table to obtain the next hop and output interface; finally, it is handed over to the output port for queueing and output.
[0075] The input and output module is the starting point and end point of network element equipment processing. It is mainly used to receive and send data packets, that is, to restore data packet data from the transmission channel and store it in the corresponding queue for subsequent processing by the network element.
[0076] The packet switching module primarily uses the control information carried in data packets and the variable-length route lookup module to query the routing table of the routing module and generate a corresponding forwarding table to guide the forwarding of data packets. The variable-length route lookup module mainly implements a route lookup algorithm based on Bloom filters and Trie trees. It first statistically classifies the routing table generated by the routing protocol, then uses Bloom filters and Trie trees to store and generate a forwarding table for each category. Finally, the lookup module performs route lookup and forwarding in the forwarding table based on the address.
[0077] The main function of the route generation module is to obtain information about each network element node in the domain according to the configured routing protocol and generate corresponding routing table entries. When forwarding data messages, the corresponding forwarding table can be established through the routing table.
[0078] The above description is only an overview of the technical solution of the present invention. In order to be able to more clearly understand the technical means of the present invention, which can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following will be described based on the specific implementation of the present invention. The exemplary embodiments of the present disclosure will be described in more detail with reference to the above description. Although this embodiment shows an exemplary embodiment of the present disclosure, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiment described here. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to be able to fully convey the scope of the present disclosure to those skilled in the art.
[0079] The following will use an example of a specific routing forwarding information base to illustrate how the present invention searches and forwards variable-length routing prefixes. Figure 2 The distribution of variable-length address routing prefixes is shown in the figure. From this, we can see that routing prefixes occupy a larger number in certain length ranges, so we should design routing lookup methods based on this rule.
[0080] According to the steps of the present invention, the specific operations of this embodiment are as follows:
[0081] 1) By performing statistical analysis on the routing and forwarding information base of the network element node, the distribution of routing prefixes in the network and the number of routing prefixes at each prefix length are obtained. Then, the N equal intervals are counted and sorted by number. All routing prefix entries in the first K intervals are regarded as high-frequency routing prefixes, while the routing prefix entries in the remaining intervals are regarded as low-frequency routing prefixes. The specific function processing flow is as follows:
[0082]
[0083] 2) Based on the divided routes, for the high-frequency part, a corresponding hash table and Bloom filter are established in each interval to process it, and for the low-frequency part, a Trie tree is used to store it. The specific code is as follows;
[0084]
[0085] 3) Establish a routing lookup process. First, the variable-length address is searched in the longest hash table K. If it is found, the next hop query result is returned. Otherwise, the search continues in hash table K-1. If there is no match in the high-frequency routing part, the low-frequency routing prefix part is searched in the Trie tree. The code is as follows:
[0086]
[0087]
[0088] The code above is just one implementation of this solution. The inventive method can be implemented in hardware or software. In this demonstration, software coding is used to demonstrate the invention. Specifically, the embodiments of the present invention are developed using the C language, but other languages can also be used.
[0089] Corresponding to the above method provided by the present invention, the present invention also provides a device. Figure 9 A schematic structural diagram of a route lookup device for variable-length addresses provided in an embodiment of this specification is shown.
[0090] like Figure 9 As shown, the apparatus 900 includes:
[0091] The routing information statistics module 910 is used to perform statistical analysis on the routing forwarding information base to obtain the routing prefix length range and the number of routing prefixes corresponding to each routing prefix length;
[0092] a routing prefix length division module 920 configured to divide the routing prefix length range into N equal intervals and count the number of routing prefixes in each interval;
[0093] The route prefix sorting module 930 is configured to sort the route prefixes in each interval according to the number of the route prefixes, and obtain a high-frequency route set and a low-frequency route set;
[0094] The routing prefix storage module 940 is configured to use a Bloom filter and a hash table to store a high-frequency routing set, and use a Trie tree to store a low-frequency routing set.
[0095] The route prefix query module 950 is configured to perform route query on the data packet arriving at the router in the high-frequency route set, and if no matching item is found in the high-frequency route set, search the low-frequency route set.
[0096] Following the route query module 950, a route adding module 960 is further included, which is specifically used to add a route prefix to the route forwarding information base of the router. If the route prefix length belongs to a high-frequency route set, it is added to the hash table; if the route prefix length belongs to a low-frequency route set, it is stored in the dictionary tree.
[0097] The routing prefix sorting module 930 is specifically configured to: sort the routing prefix entries in the first K intervals as a high-frequency routing set, and sort the routing prefix entries in the [K+1]-[N] interval as a low-frequency routing set.
[0098] The routing prefix storage module 940 is specifically configured to construct a Bloom filter and a hash table thereof for each interval of a high-frequency routing prefix to store corresponding routing prefix information.
[0099] The route prefix storage module 940 is further used to: divide the routes in the high-frequency route set into a fixed-length part and a variable-length part, the fixed-length part is stored in a hash table, and the variable-length part points to a dictionary tree for storage.
[0100] The routing prefix query module 950 is specifically configured to: first perform pre-screening by constructing a Bloom filter on each hash table.
[0101] Need to explain, yes Figure 9 For the description of the device, please refer to the description of the aforementioned method.
[0102] According to another embodiment, there is also provided a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 1 The method described.
[0103] According to another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the system realizes the combination of Figure 1Those skilled in the art will appreciate that in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0104] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other device. Various general-purpose devices may also be used in conjunction with the teachings herein. Based on the above description, it is apparent that the structure required for constructing such devices is suitable. In addition, the present invention is not directed to any particular programming language. It should be understood that various programming languages may be utilized to implement the present invention described herein, and the above description of the invocation of specific languages and system function modules is merely for the purpose of disclosing the best mode of implementation of the invention.
[0105] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be implemented without these specific details. In some examples, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0106] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the present invention and its equivalents, the present invention is intended to include such modifications and variations.
Claims
1. A routing lookup method for variable-length addresses, characterized in that: The method comprises: Perform statistical analysis on the routing forwarding information base to obtain the routing prefix length range and the number of routing prefixes corresponding to each routing prefix length; Divide the route prefix length range into N equal intervals and count the number of route prefixes in each interval; Sort by the number of route prefixes in each interval to obtain a high-frequency route set and a low-frequency route set; Using a Bloom filter and a hash table to store the high-frequency route set, and using a dictionary tree to store the low-frequency route set; The data packet arriving at the router is subjected to route query in the high-frequency route set. If no matching item is found in the high-frequency route set, the low-frequency route set is searched.
2. The method according to claim 1, characterized in that The obtaining of the high-frequency route set and the low-frequency route set includes: taking the route prefix entries in the first K intervals of sorting as the high-frequency route set, and taking the route prefix entries in the interval [K+1]-[N] of sorting as the low-frequency route set.
3. The method according to claim 1, characterized in that The use of the Bloom filter and the hash table to store the high-frequency route set includes: for each interval of the high-frequency route set, constructing a Bloom filter and its hash table to store corresponding route prefix information.
4. The method according to claim 1, wherein The use of Bloom filter and hash table to store high-frequency route set includes: dividing the routes in the high-frequency route set into a fixed-length part and a variable-length part, storing the fixed-length part in the hash table, and pointing the variable-length part to a dictionary tree for storage.
5. The method according to claim 1, wherein The performing of route query on the high-frequency routing set for the data packet that will arrive at the router includes: firstly performing pre-screening by constructing a Bloom filter on each hash table.
6. The method according to any one of claim 1, characterized in that Also includes: If a matching entry is found in the high-frequency routing set, the next-hop port information is obtained for forwarding.
7. The method according to any one of claims 1 to 5, characterized in that The method also includes adding a routing prefix to the routing forwarding information base of the router, adding the routing prefix length belonging to the high-frequency routing set to the hash table, and storing the routing prefix length belonging to the low-frequency routing set in the dictionary tree.
8. A route search device for variable-length addresses, characterized in that: The device comprises: The routing information statistics module is used to perform statistical analysis on the routing forwarding information base to obtain the routing prefix length range and the number of routing prefixes corresponding to each routing prefix length; a routing prefix length division module configured to divide the routing prefix length range into N equal intervals and count the number of routing prefixes in each interval; A route prefix sorting module is configured to sort the routes based on the number of route prefixes in each interval to obtain a high-frequency route set and a low-frequency route set; a routing prefix storage module configured to use a Bloom filter and a hash table to store the high-frequency routing set, and use a dictionary tree to store the low-frequency routing set; The routing prefix query module is configured to perform routing query on the high-frequency routing set for the data packet arriving at the router, and search the low-frequency routing set if no matching item is found in the high-frequency routing set.
9. The device according to claim 8, characterized in that The routing prefix sorting module is specifically used to: The routing prefix entries in the first K intervals of sorting are regarded as the high-frequency routing set, and the routing prefix entries in the [K+1]-[N] interval of sorting are regarded as the low-frequency routing set.
10. The device according to claim 8, characterized in that The routing prefix storage module is specifically used to: divide the routing entries in the high-frequency routing set into a fixed-length part and a variable-length part, the fixed-length part is stored in a hash table, and the variable-length part points to a dictionary tree for storage.
Citation Information
Patent Citations
Method and system for realizing high-speed routing lookup
CN102333036A
Route prefix storing, matching and updating method and device based on names
CN103428093A