Method and device for compressing routing table

The multi-subtree storage structure addresses the memory and efficiency issues in SDN controllers by encoding routing tables with root identifiers and bitmap values, resulting in reduced memory usage and improved query performance.

CN119109849APending Publication Date: 2024-12-10HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310869079.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-06-08
Filing Date
2023-07-14
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Current SDN controllers face high memory overhead and low query efficiency due to storing many invalid prefixes in prefix trees, which are used to manage large routing tables.

Method used

Implement a multi-subtree storage structure to decompose routing tables into subtrees, using root identifiers and bitmap values to encode network segments and routing attributes, reducing the storage of invalid entries and improving query efficiency.

Benefits of technology

Reduces memory overhead and enhances query efficiency by compressing routing tables, allowing for faster and more accurate network segment and routing attribute lookups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109849A_ABST
    Figure CN119109849A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a compression method and device of a routing table, which are used for reducing the memory overhead of a network device for storing the routing table. The method comprises the steps that an SDN controller obtains a routing table, the routing table comprises routing table entries of one or more network devices, and the routing table entries comprise network segments; and decomposing the routing table into a plurality of sub-trees based on the multi-sub-tree storage structure, wherein the plurality of sub-trees are used for coding the network segment. A network segment index is generated according to a first storage structure of the subtree, the first storage structure is used for storing a network segment, the network segment index comprises a first root identifier and a first bitmap value, the first root identifier is used for indicating a root node of the subtree, and the first bitmap value is used for indicating a non-null child node in the first storage structure; the non-null child nodes are used for representing network segments existing in the routing table, and the network segment index is used for carrying out network segment matching during routing. And storing the network segment index to a memory of the SDN controller.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on June 8, 2023, with application number 202310678010.X and invention name “Method for Compression Encoding of Routing Table Item Index”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The embodiments of the present application relate to the computer field, and in particular to a method and device for compressing a routing table. Background Art

[0003] With the development of cloud services, cloud services are becoming the basic services of operators, and the requirements for backbone network carrying and operation and maintenance are becoming increasingly urgent. In the network management platform of cloud services, the software-defined networking (SDN) controller needs to achieve efficient management of routing tables to support functions such as routing scheduling, balancing, and fault demarcation and location.

[0004] At present, after the SDN controller collects the routing information generated by the network devices running the routing protocol, it needs to generate and maintain the routing table based on the routing information. The routing information in the routing table includes the network segment and routing attribute information. The network segment can also be called a prefix. Since the number of routing information entries that the SDN controller needs to maintain is huge, the SDN controller needs to build an index structure to store this routing information.

[0005] In the current index structure, the SDN controller can store all possible prefixes in the routing table by building a prefix tree. For example, the SDN controller can use a 32-layer prefix tree to store all possible prefixes in the IPv4 routing table. However, since all prefixes stored in the prefix tree do not necessarily exist in the routing table, the current prefix tree storage structure stores many invalid prefixes, resulting in a large memory overhead for the SDN controller and low query efficiency for routing information. Summary of the invention

[0006] The present application provides a routing table compression method for reducing the memory overhead of a network device storing a routing table. The present application also provides a corresponding routing table compression device, a computing device, a computing device cluster, a computer-readable storage medium, and a computer program product.

[0007] In the first aspect, the embodiment of the present application provides a method for compressing a routing table, which can be executed by a computing device deploying an SDN controller, or by a component of the computing device, such as a processor, chip or chip system of the computing device, or by a logic module or software that can realize all or part of the functions of the computing device. The method provided in the first aspect includes: the SDN controller obtains a routing table, the routing table includes routing table items of one or more network devices, and the routing table items include network segments. The routing table is decomposed into multiple subtrees based on a multi-subtree storage structure, and the multiple subtrees are used to encode network segments, and the network segments can also become prefixes or IP address prefixes. The SDN controller generates a network segment index according to the first storage structure of the subtree, the first storage structure is used to store network segments, and the network segment index includes a first root identifier and a first bitmap value, the first root identifier is used to indicate the root node of the subtree, the first bitmap value is used to indicate a non-empty child node in the first storage structure, the non-empty child node is used to characterize the network segment existing in the routing table, and the network segment index is used to match the network segment during routing. The SDN controller stores the network segment index in the memory of the SDN controller.

[0008] In the embodiment of the present application, the SDN controller can encode the network segments of the routing table based on the multi-subtree storage structure and generate the network segment index corresponding to the subtree, thereby realizing the compression of the network segments in the routing table. Since the multi-subtree storage structure does not need to store all possible network segments, the storage of invalid network segments is reduced, thereby reducing the memory overhead of the SDN controller for storing the routing table.

[0009] In one possible implementation, when the computing device generates a network segment index according to the first storage structure of the subtree, the computing device performs base conversion on the network segment corresponding to the root node, that is, converts the binary network segment into a decimal integer to obtain a first root identifier. The computing device performs base conversion on the binary code corresponding to the non-empty child node in the first storage structure, that is, converts the binary non-empty child node code into a decimal integer to obtain the first bitmap value. The computing device generates the network segment index according to the first root identifier and the first bitmap value.

[0010] In the embodiment of the present application, the SDN controller can use the first root identifier and the first bitmap value to index the network segment corresponding to the subtree, wherein the first root identifier and the first bitmap value are both decimal integers, thereby improving the feasibility of the solution.

[0011] In one possible implementation, the routing table entry also includes routing attribute information. The computing device generates a routing index based on the second storage structure of the subtree. The routing index includes a second root identifier and a valid routing pair. The valid routing pair is used to indicate the routing attribute information present in the routing table. The second storage structure is used to store the routing attribute index. The routing attribute index is used to query the routing attribute information.

[0012] In the embodiment of the present application, the SDN controller can encode the routing attribute information of the routing table based on the multi-subtree storage structure and generate the routing index corresponding to the subtree, thereby realizing the compression of the routing attribute information in the routing table. Since the second storage structure of the subtree also stores the routing attribute information of the routing table, the compression rate of the SDN controller storing the routing table is improved, and the storage memory overhead of the routing table is further reduced.

[0013] In a possible implementation, the valid route pair includes a combination of one or more pairs of route attribute indexes and second bitmap values, and the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure.

[0014] In the embodiment of the present application, the valid route pairs in the route index can be represented by a combination of one or more pairs of route attribute indexes and the second bitmap value, thereby improving the feasibility of the valid route pairs.

[0015] In one possible implementation, during the process of the SDN controller generating a routing index according to the second storage structure of the subtree, the computing device performs base conversion on the network segment corresponding to the root node, that is, converts the binary network segment corresponding to the root node into a decimal integer, and obtains a second root identifier. The SDN controller performs base conversion on the binary codes corresponding to different routing attribute indexes in the second storage structure, that is, converts the binary non-empty subnode codes corresponding to different routing attribute indexes into decimal integers, and obtains one or more second bitmap values, and there is a corresponding relationship between the routing attribute index and the second bitmap value. The SDN controller generates a routing index according to the second root identifier, the routing attribute index, and the second bitmap value.

[0016] In the embodiment of the present application, the SDN controller can use the second root identifier, the routing attribute index and the second bitmap value to index the routing attribute information corresponding to the subtree, wherein the second root identifier and the second bitmap value are both decimal integers, thereby improving the feasibility of the solution.

[0017] In a possible implementation, the valid route pair includes a third bitmap value and a route attribute index group, the route attribute index group includes multiple different types of route attribute indexes, and the third bitmap value is used to indicate a non-empty child node corresponding to the route attribute index group in the second storage structure.

[0018] In the embodiment of the present application, the valid route pairs in the route index can be represented by a third bitmap value and a route attribute index group. Compared with the combined representation of one or more pairs of route attribute indexes and the second bitmap value, the compression rate of the route index is improved and the memory overhead of the route table is reduced.

[0019] In one possible implementation, during the process of the SDN controller generating the routing index corresponding to the routing table entry according to the second storage structure of the subtree, the computing device performs base conversion on the network segment corresponding to the root node, that is, converts the binary network segment corresponding to the root node into a decimal integer, and obtains the second root identifier. The SDN controller performs base conversion on the binary code corresponding to the routing attribute index group in the second storage structure, that is, converts the binary non-empty subnode codes corresponding to all routing attribute indexes in the routing attribute index group into a decimal integer, and obtains the third bitmap value. The SDN controller generates the routing index according to the second root identifier, the routing attribute index group, and the third bitmap value.

[0020] In the embodiment of the present application, the SDN controller can use the second root identifier, the routing attribute index group and the third bitmap value to index the routing attribute information corresponding to the subtree, wherein the second root identifier and the third bitmap value are both decimal integers, thereby improving the feasibility of the solution.

[0021] In one possible implementation, the routing attribute information includes one or more items: next hop IP address, routing source, autonomous system path, group attribute list, starting autonomous system number, and local priority. Among them, the next hop IP address refers to the IP address of the next router that delivers the data packet to the destination address. The routing source refers to the source of the routing information. The autonomous system path refers to the sequence of autonomous systems that the routing information passes through, which is used to help select the routing path. The group attribute list is an attribute used in BGP to describe routing information and is used to distinguish different routing strategies. The starting autonomous system number refers to the source AS number of the routing information. In BGP, each AS has a unique AS number, which is used to identify the network interconnection relationship between ASs. Local priority refers to the priority assigned by the router when selecting a reachable route for the local host.

[0022] The routing attribute information in the routing table in the embodiment of the present application may be multiple types of routing attribute information, which improves the applicability of the SDN controller to the routing table compression solution.

[0023] In a possible implementation, the SDN controller receives a first routing request sent by a network device, the first routing request including a destination IP address, and the computing device matches the destination IP address with a network segment based on a network segment index to determine a network segment in the routing table that matches the destination IP address.

[0024] In the embodiment of the present application, the SDN controller can perform network segment matching on the destination IP address in the routing request based on the network segment index, thereby determining the network segment in the routing table that matches the destination IP address, thereby improving the feasibility of network segment matching.

[0025] In a possible implementation, the SDN controller receives a second routing request sent by the network device, the second routing request including a destination IP address, and the computing device performs a routing query on the destination IP address based on the routing index to determine routing attribute information matching the destination IP address in the routing table.

[0026] In the embodiment of the present application, the SDN controller can perform a route query on the destination IP address in the route request based on the route index, thereby determining the route attribute information corresponding to the destination IP address in the routing table, thereby improving the feasibility of the route query.

[0027] In one possible implementation, the SDN controller determines the layer of the root node of the subtree according to the number of bits of the network segment in the routing table. For each root node, the SDN controller can use the storage structure of the subtree to store all the network segments corresponding to the root node, that is, each subtree can represent the IP address range under the root node.

[0028] In the embodiment of the present application, the SDN controller can represent all network segments under the root node in a subtree structure, thereby completing the encoding of the network segments and improving the feasibility of the solution.

[0029] In a possible implementation, after the SDN controller constructs the network segment index or routing index, it can periodically update the network segment index or routing index based on the routing table. That is, the SDN controller can periodically collect routing information of network devices, generate a routing table, and update the network segment index or routing index based on the new routing table.

[0030] In the embodiment of the present application, the SDN controller can regularly update the routing table and regenerate the routing index based on the updated routing, thereby improving the accuracy of the network segment index and the routing index.

[0031] In a second aspect, an embodiment of the present application provides a routing table compression device, including an interface unit, an encoding unit, an index generation unit and a processing unit. Among them, the interface unit is used to obtain a routing table, the routing table includes routing table items of one or more network devices, and the routing table items include network segments. The encoding unit is used to decompose the routing table into multiple subtrees based on a multi-subtree storage structure, and the multiple subtrees are used to encode the network segments. The index generation unit is used to generate a network segment index according to a first storage structure of the subtree, the first storage structure is used to store network segments, and the network segment index includes a first root identifier and a first bitmap value, the first root identifier is used to indicate the root node of the subtree, the first bitmap value is used to indicate a non-empty child node in the first storage structure, the non-empty child node is used to characterize the network segment existing in the routing table, and the network segment index is used to match the network segment during routing. The processing unit is used to store the network segment index in the memory of the SDN controller.

[0032] In a possible implementation, the index generation unit is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a first root identifier, perform base conversion on the binary code corresponding to the non-empty child node in the first storage structure to obtain a first bitmap value, and generate a network segment index according to the first root identifier and the first bitmap value.

[0033] In one possible implementation, the routing table entry also includes routing attribute information, and the index generation unit is further used to generate a routing index based on the second storage structure of the subtree, the routing index includes a second root identifier and a valid routing pair, the valid routing pair is used to indicate the routing attribute information existing in the routing table, the second storage structure is used to store the routing attribute index, and the routing attribute index is used to query the routing attribute information.

[0034] In a possible implementation, the valid route pair includes a combination of one or more pairs of route attribute indexes and second bitmap values, and the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure.

[0035] In a possible implementation, the index generation unit is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a second root identifier. Base conversion is performed on the binary codes corresponding to different routing attribute indexes in the second storage structure to obtain one or more second bitmap values, and there is a corresponding relationship between the routing attribute index and the second bitmap value. The routing index is generated according to the second root identifier, the routing attribute index, and the second bitmap value.

[0036] In a possible implementation, the valid route pair includes a third bitmap value and a route attribute index group, the route attribute index group includes multiple different types of route attribute indexes, and the third bitmap value is used to indicate a non-empty child node corresponding to the route attribute index group in the second storage structure.

[0037] In a possible implementation, the index generation unit is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a second root identifier, perform base conversion on the binary code corresponding to the routing attribute index group in the second storage structure to obtain a third bitmap value, and generate a routing index according to the second root identifier, the routing attribute index group and the third bitmap value.

[0038] In a possible implementation manner, the routing attribute information includes one or more items: next hop IP address, routing source, autonomous system path, community attribute list, starting autonomous system number, and local priority.

[0039] In a possible implementation, the interface unit is further configured to receive a first routing request sent by the network device, the first routing request including a destination IP address. The processing unit is further configured to perform network segment matching on the destination IP address based on the network segment index, and determine a network segment in the routing table that matches the destination IP address.

[0040] In a possible implementation, the interface unit is further configured to receive a second routing request sent by the network device, the second routing request including a destination IP address. The processing unit is further configured to perform a routing query on the destination IP address based on the routing index, and determine routing attribute information matching the destination IP address in the routing table.

[0041] In a third aspect, an embodiment of the present application provides a computing device, which includes a processor, the processor is coupled to a memory, and the processor is used to store instructions. When the instructions are executed by the processor, the computing device executes the method described in the first aspect or any possible implementation method of the first aspect.

[0042] In a fourth aspect, an embodiment of the present application provides a computing device cluster, which includes one or more computing devices, and the computing device includes a processor, the processor is coupled to a memory, and the processor is used to store instructions. When the instructions are executed by the processor, the computing device cluster executes the method described in the first aspect or any possible implementation method of the first aspect.

[0043] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.

[0044] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the computer implements the method described in the first aspect or any possible implementation method of the first aspect.

[0045] It is understandable that the beneficial effects that can be achieved by any of the routing table compression devices, computing devices, computing device clusters, computer-readable media, or computer program products provided above can refer to the beneficial effects in the corresponding methods, and will not be repeated here. The embodiments of the present application can be further combined on the basis of the implementation methods provided in the above aspects to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A schematic diagram of the system architecture of a backbone network system provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of a flow chart of a method for compressing a routing table provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a routing table provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a first storage structure of a subtree provided in an embodiment of the present application;

[0050] Figure 5a A schematic diagram of a network segment index provided in an embodiment of the present application;

[0051] Figure 5b A schematic diagram for comparing compression ratios provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of a second storage structure of a subtree provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram for comparing another compression ratio provided in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of the structure of a routing table compression device provided in an embodiment of the present application;

[0055] Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0056] Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0057] Fig.11 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The embodiments of the present application provide a method and device for compressing a routing table, which are used to reduce the memory overhead of a network device storing a routing table.

[0059] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0060] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0061] First, some terms involved in the embodiments of the present application are introduced to facilitate technical personnel in this field to understand the technical solution.

[0062] Software defined networking (SDN) is a network that separates the control layer and the data layer. SDN can achieve unified management of network devices through SDN controllers. SDN controllers can directly control the behavior of switches and routers through programming interfaces or APIs to achieve flexible control and management of network traffic.

[0063] Backbone network refers to a network that forms the core connection of the Internet. Backbone network is usually a wide area network with backbone routers as the core, which can mount physical router nodes and Internet data routers and other devices.

[0064] A backbone router (BR) node refers to the access device of the backbone network and can be interconnected with other BR nodes through dedicated lines.

[0065] The physical router (PR) node is the exit of network traffic, connecting to the gateway of the Internet service provider (ISP) and Internet exchange point (IXP) network to perform public network routing exchange.

[0066] The Internet Data Router (IDR) is a device at the boundary between the backbone network and the regional public network, used to aggregate the public network services in the city area.

[0067] The following describes the routing table compression method and device provided by the embodiments of the present application in conjunction with the accompanying drawings.

[0068] See also Figure 1 , Figure 1 A schematic diagram of a system architecture used in a routing table compression method provided in an embodiment of the present application. Figure 1In the system architecture shown, the backbone network system 100 includes a backbone router BR101, a physical router PR102, an Internet data router IDR103, and a software defined network SDN controller 104. The backbone router 101 is respectively connected to the physical router 102 and the Internet data router 103, the physical router 102 connects the backbone network and the networks of different network service providers IPS, and the Internet data router 103 connects the backbone network and the data center. The functions of each part of the backbone network system 100 are described in detail below.

[0069] The backbone router 101 is located at the center of the backbone network system 100 and is used to connect network devices corresponding to different subnets. The backbone router 101 needs to process data flows from different physical routers 102 and Internet data routers 103, and undertake the task of aggregating and forwarding data traffic. For example, when a data packet is transmitted from one subnet to another, the backbone router 101 can forward the data packet to the next router based on the shortest path or other routing selection algorithms.

[0070] The physical router 102 is used to connect the backbone network and the branch networks of different Internet service providers ISPs, and to forward data between the branch networks and the backbone network. The physical router 102 implements the flow of data traffic in the backbone network by routing and forwarding data packets. For example, the physical router 102 analyzes the destination address and forwarding path of the data packet and forwards the data packet to the correct destination address, thereby realizing the interconnection and communication between the branch network and the backbone network.

[0071] The Internet data router 103 is a border router between the backbone network and the data center. The Internet data router 103 is used to transmit the data traffic of the backbone network to the data center, and transmit the data traffic from the data center to the backbone network. For example, the Internet data router 103 collects and distributes the routing information of the global network by using the border gateway protocol BGP, which is used to realize the routing and data transmission between different data centers.

[0072] The software defined network SDN controller 104 is used to implement the control function of the data traffic of the backbone network, including data traffic billing, public network quality detection, route collection, policy-based centralized computing, route distribution, etc. The SDN controller 104 can collect the routing information in the physical router 102 and the Internet data router 103 through the backbone router 101, and compress and encode the routing information to construct a network segment index and a routing index. Among them, the network segment index is used to query the network segment matching the IP address. The network segment can also be called a prefix or an address prefix. In the embodiment of this application, no distinction is made. The routing index is used to query the routing table item corresponding to the IP address.

[0073] It should be noted that the SDN controller 104 in the embodiment of the present application can be deployed in the backbone router 101 or in other network devices, without specific limitation.

[0074] See also Figure 2 , Figure 2 A schematic diagram of a flow chart of a method for compressing a routing table provided in an embodiment of the present application. Figure 2 In the example shown, the routing table compression method provided in the embodiment of the present application includes the following steps:

[0075] 201. The SDN controller obtains routing information of the network device.

[0076] The SDN controller obtains the routing information of the network device. Specifically, the SDN controller collects the routing information of the physical router and the Internet data router. For example, the SDN controller can communicate with the physical router and the Internet data router through the border gateway protocol (BGP) protocol to obtain the local routing tables of the physical router and the Internet data router.

[0077] The routing information collected by the SDN controller in the embodiment of the present application includes one or more of the following: prefix, next hop address, routing priority, interface, routing type, sequence number and routing update time. Among them, the prefix is ​​used to indicate the address range contained in the destination network. The next hop address represents the address information of the next router that needs to be passed to the destination network. The routing priority refers to the parameter selected according to the routing priority when the router is grouped to handle the competition of multiple routers on the local machine. The interface is mapped to the destination network in the local routing table to ensure that the data packet can reach the target network smoothly. Routing types include direct routing, static routing, dynamic routing, etc. The sequence number is used to prevent routing information loops. The routing update time is used to indicate the last update time of the routing information.

[0078] 202. The SDN controller generates a routing table according to the routing information.

[0079] The SDN controller generates a routing table based on the routing information, which is a global routing table. Specifically, after the SDN controller collects the routing information of the physical router and the Internet data router, it parses and integrates the routing information of the physical router and the Internet data router to generate a routing table containing the global routing information.

[0080] In the embodiment of the present application, the routing table includes a network segment and routing attribute information. The network segment can also be referred to as a prefix, which is not distinguished in the embodiment of the present application. Among them, the prefix usually refers to the network prefix in the IP address, which is a part of the IP address used to determine the network identifier. The IP address includes IPv4 and IPv6 addresses. In IPv4, the prefix is ​​composed of the first few bits in a 32-bit address. In IPv6, it is composed of the first few bits in a 128-bit address. For example, the first 8 bits in the IPv4 address 10.0.0.0 / 8 are the network prefix, indicating that the network range of the address is from 10.0.0.0 to 10.255.255.255. Routing attribute information refers to the routing information transmitted and stored in the routing protocol, such as the next hop address, routing priority, interface, routing type, sequence number and routing update time.

[0081] In a possible implementation, under the border gateway protocol (BGP), the routing attribute information includes one or more pieces of information: the next hop IP address (next_hop), the routing source (origin), the autonomous system path (as_path), the community attribute list (community_list), the starting autonomous system number (origin_as), the routing update time (update time) and the local preference (local_pref).

[0082] Among them, the next-hop IP address refers to the IP address of the next router that delivers the data packet to the destination address. The routing source refers to the source of the routing information. The autonomous system path refers to the sequence of autonomous systems (AS) that the routing information passes through, which is used to help select the routing path. The community attribute list is an attribute used in BGP to describe routing information and is used to distinguish different routing strategies. The starting autonomous system number refers to the source AS number of the routing information. In BGP, each AS has a unique AS number that is used to identify the network interconnection relationship between ASs. The local priority refers to the priority assigned by the router when selecting a reachable route for the local host.

[0083] See also Figure 3 , Figure 3 A schematic diagram of a routing table provided in an embodiment of the present application. Figure 3 In the example shown, the SDN controller collects routing information from physical routers and Internet data routers, and parses and integrates the routing table, which includes prefixes and routing attribute information (route info).

[0084] For example, in Figure 3In the routing table shown, the next hop address corresponding to the prefix "99.96.0.0 / 13" is "63.218.165.141", the routing source is "igp", the self-made system path is "34917018", the community attribute list is "65411:62021,65534:34", the starting autonomous system number is "7018", and the local priority is "1500".

[0085] 203. The SDN controller decomposes the routing table into multiple subtrees based on a multi-subtree storage structure, and the multiple subtrees are used to encode the network segments in the routing table.

[0086] Due to the huge number of routing table entries in the routing table generated by the SDN controller, for example, the unique prefixes in the IPv4 routing table are as many as more than 900,000, and the current prefixes in the IPv6 routing table are as many as more than 100,000. In order to support upper-layer services, SDN control needs to build prefix indexes and routing indexes to support a variety of routing queries and maintenance operations. The following describes in detail the process of SDN controller building prefix indexes and routing indexes.

[0087] In the process of constructing prefix index and routing index, the SDN controller decomposes the routing table into multiple subtrees based on the multi-subtree storage structure. The multi-subtree storage structure is also called a hierarchical forest structure. Multiple subtrees are used to encode prefix and routing attribute information in the routing table. For example, each subtree in the multi-subtree can represent the aggregation of multiple prefixes.

[0088] In one possible implementation, the SDN controller determines the layer of the root node of the subtree according to the number of bits of the prefix in the routing table. For each root node, the SDN controller can use the storage structure of the subtree to store all prefixes corresponding to the root node, that is, each subtree can represent the IP address range under the root node. In the embodiment of the present application, the SDN controller maps the logical hierarchical forest structure into a graph structure, making the storage structure simple and easy to maintain, saving the node overhead of the tree structure.

[0089] See also Figure 4 , Figure 4 A schematic diagram of a multi-subtree structure provided in an embodiment of the present application. Figure 4 In the example shown, the SDN controller decomposes the routing table into multiple subtrees based on the multi-subtree storage structure. For example, a three-layer subtree is used. The root node of the subtree is "101.168.0.0 / 20", and the first 20 bits of the IP address "101.168.0.0" are the prefix corresponding to the root node of the subtree. The node at the next level of the root node is a 21-bit prefix, and the first 20 bits of the 21-bit prefix are the same as the 20-bit prefix corresponding to the root node.

[0090] For example, in Figure 4In the example shown, the next layer of the root node includes nodes 2 and 3. Node 2 is "101.168.0.0 / 21" and node 2 is "101.168.8.0 / 21". Nodes 2 and 3 are used to represent 21-bit prefixes after the root node in the routing table, that is, the first 20 bits of the prefix of node 2 and the prefix of node 3 are the same. The next layer of nodes 2 and 3 includes nodes 4, 5, 6, and 7. The number of bits of the prefix of nodes 4, 5, 6, and 7 is 22.

[0091] 204. The SDN controller generates a network segment index corresponding to the subtree according to the first storage structure of the subtree.

[0092] The SDN controller generates a network segment index corresponding to the subtree according to the first storage structure of the subtree. The network segment index can also be called a prefix index. The embodiment of the present application does not make a distinction. The first storage structure is used to store prefixes. The prefix index includes a first root identifier and a first bitmap value. The first root identifier is used to indicate the root node of the subtree. The first bitmap value is used to indicate a non-empty child node in the first storage structure. The non-empty child node is used to represent the prefix existing in the routing table. The prefix index is used for prefix matching of the destination IP address. The prefix index generated by the SDN controller can be represented by the following storage structure:

[0093] HashMap<key1,value1> , or {key1:value1}

[0094] Among them, key1 is the first root identifier, and value1 is the first bitmap value.<key1,value1> for<key1,value1> Mapping gets the hash value.

[0095] In one possible implementation, in the process of generating a prefix index corresponding to a subtree according to the first storage structure of the subtree, the SDN controller performs base conversion on the prefix corresponding to the root node to obtain a first root identifier. The SDN controller performs base conversion on the binary code corresponding to the non-empty subnode in the first storage structure to obtain a first bitmap value. The SDN controller then generates a prefix index according to the first root identifier and the first bitmap value. Therefore, the index structure of the prefix index in the embodiment of the present application can also be referred to as an index structure based on a Hash Bitmap.

[0096] Specifically, the SDN controller converts the binary prefix corresponding to the root node into a decimal integer to obtain a first root identifier. The SDN controller converts the binary code corresponding to the non-empty child node in the first storage structure into a decimal integer to obtain a first bitmap value. The SDN controller uses the first root identifier and the first bitmap value to uniquely encode the subtree.

[0097] It should be noted that, in the process of the SDN controller converting the binary prefix corresponding to the root node into a decimal integer, in order to prevent the first digit of the binary prefix from being 0 and losing digits, the SDN controller adds 1 before the digit of the binary prefix, and the SDN controller converts the binary prefix after adding 1.

[0098] Please continue reading Figure 4 ,exist Figure 4 In the example shown, the SDN controller uses the first storage structure of the subtree to represent all prefixes under the root node. In the first storage structure, each child node under the root node represents a prefix, wherein the dark child nodes are non-empty child nodes, which are used to represent prefixes existing in the routing table, i.e., valid routing prefixes, and the white child nodes are non-empty child nodes, which are used to represent prefixes that do not exist in the routing table or invalid routing prefixes. Figure 4 In the three-layer subtree shown, node 1, node 2, node 5 and node 6 are non-empty child nodes, and the prefixes corresponding to node 1, node 2, node 5 and node 6 respectively exist in the routing table of the SDN controller.

[0099] exist Figure 4 In the example shown, the SDN controller converts the binary prefix corresponding to the root node into a decimal integer. For example, the root node is node 1, and the binary IP address corresponding to node 1 "101.168.0.0" is "01100101.10101000.00000000.00000000", where the 20-bit prefix is ​​"01100101101010000000", and after adding 1 before the binary prefix, it is "101100101101010000000", and the SDN controller converts "101100101101010000000" into a decimal integer "1464960" to obtain the first root identifier, which is "1464960".

[0100] exist Figure 4 In the example shown, the SDN controller converts the binary code corresponding to the non-empty child node in the first storage structure into a decimal integer. For example, in nodes 1 to 7 of the subtree, nodes 1, 2, 5 and 6 are non-empty child nodes, and nodes 3, 4 and 7 are empty nodes. The non-empty child node is "1" and the empty child node is "0". Then nodes 7 to 1 can be represented as the binary code "0110011". The SDN controller adds "0" to the last bit of the binary code "0110011" to obtain the binary code "01100110". The SDN controller converts the binary code "01100110" into a decimal integer "102" to obtain the first bit map value, which is "102".

[0101] exist Figure 4 In the example shown, the SDN controller determines that the first root identifier is "1464960" based on the first storage structure of the subtree, and determines that the first bitmap value is "102". Therefore, the SDN control obtains the prefix index "HashMap<146490,102>" or "{146490:102}" according to the first root identifier and the first bitmap value.

[0102] It is understandable that the SDN controller can use the multi-subtree storage structure to represent all prefixes in the routing table as multiple prefix indexes, thereby compressing the routing table prefixes. When matching the routing prefix, the SDN controller can uniquely index and restore the nodes corresponding to all valid routes through the root identifier and bitmap value, and support multiple prefix query matching.

[0103] See also Figure 5a , Figure 5a A schematic diagram of a prefix index corresponding to a storage structure of multiple subtrees provided in an embodiment of the present application. Figure 5a In the example shown, the left figure is a prefix index composed of a root node and a bitmap value, for example, "{218.32.128.0 / 16:102}" is a prefix index. The right figure is a prefix index composed of a root node identifier (root id) and a bitmap value, for example, {121376:102} is a prefix index. Multiple prefix indexes constitute a hierarchical forest corresponding to the routing table, where each routing index represents a subtree.

[0104] exist Figure 5a In the example shown, the key value of the HashMap is represented by the subtree root identifier, and the value value is represented by the bitmap value corresponding to the non-empty child node position of the subtree. The SDN controller can uniquely index and restore all valid routes in the routing table through the key value and value value, and can also support multiple prefix query matching.

[0105] Please refer to Table 1, which is a comparison table of entries before and after compression of a routing table data set provided in an embodiment of the present application. It can be seen from the table that in the routing table data set corresponding to the Border Gateway Protocol BGP, the number of original routing table entries is 918768, and after the SDN controller compresses the routing table based on the multi-subtree storage structure, the number of subtrees is 163794, which greatly reduces the number of entries in the routing table data set.

[0106] Table 1

[0107] Routing table entry data set Number of original routing entries Number of subtrees BGP 918768 163794 BMP Peer-1 3940 1063 BMP Peer-2 5414 1553 BMP Peer-3 45565 11655

[0108] Please refer to Table 2, which is a memory overhead comparison table of a prefix index provided in an embodiment of the present application. As can be seen from Table 2, the memory occupied by the prefix index after the routing table entry is compressed based on the multi-subtree storage structure in the embodiment of the present application is 11.55MB, which achieves a compression ratio of 17.69 times compared to the existing solution, greatly reducing the memory of the prefix index.

[0109] Table 2

[0110] Prefix Tree Existing solution (prefix tree) This application Compression ratio illustrate Memory overhead 204.37MB 11.55MB 17.69x Index memory overhead

[0111] See also Figure 5b , Figure 5b A schematic diagram of a change in the ratio of the original routing table memory size to the prefix index memory size provided by an embodiment of the present application. Figure 5b It can be seen from the example shown that the memory ratio corresponding to the prefix index after compression of the routing table item based on the multi-subtree storage structure in the embodiment of the present application is 32 to 36, and the memory ratio corresponding to the prefix index after compression in the prior art solution is 2. Compared with the prior solution, the prefix index in the embodiment of the present application has a larger compression ratio, thereby reducing the memory overhead of the SDN controller.

[0112] The above embodiment introduces an embodiment in which the SDN controller constructs a prefix index based on a multi-subtree structure. The following further introduces an embodiment in which the SDN controller constructs a routing index based on a multi-subtree structure.

[0113] In one possible implementation, the SDN controller generates a routing index corresponding to the routing table entry according to the second storage structure of the subtree, the second storage structure is used to store prefixes and routing attribute indexes, the routing attribute indexes are used to query routing attribute information, the routing indexes are used to query routing table entries corresponding to the destination IP address, the routing indexes include a second root identifier and a valid routing pair, the valid routing pair is used to indicate routing attribute information present in the routing table. The prefix index generated by the SDN controller can be represented by the following storage structure:

[0114] HashMap<key2,couple> , or key2: {couple}

[0115] Among them, key2 is the second root identifier, and couple is a valid routing pair.

[0116] See also Figure 6 , Figure 6 A schematic diagram of another subtree storage structure provided in an embodiment of the present application. Figure 6In the example shown, the SDN controller decomposes the routing table into multiple subtrees based on the multi-subtree storage structure. For example, a three-layer subtree is used. The root node of the subtree is "101.168.0.0 / 20", and the routing attribute index corresponding to the root node is "label1". The second-layer nodes of the subtree include two nodes, node 2 and node 3. Node 2 is "101.168.0.0 / 21", and the routing attribute index corresponding to node 2 is "label1". Node 3 is "101.168.8.0 / 21", and the routing attribute index corresponding to node 3 is "label2". The third-layer nodes of the subtree include node 4, node 5, node 6 and node 7, a total of 4 nodes. Node 4 is "101.168.0.0 / 22", and node 4 is an empty child node, that is, an invalid route. Node 5 is "101.168.4.0 / 22", and the routing attribute index corresponding to node 5 is "label3". Node 6 is "101.168.8.0 / 22", and the routing attribute index corresponding to node 5 is "label1". Node 7 is "101.168.12.0 / 22", and the routing attribute index corresponding to node 7 is "label3".

[0117] The valid route pairs in the embodiment of the present application include non-hybrid representation and hybrid representation. The two representation methods are specifically introduced below with examples.

[0118] In one possible implementation, in a non-hybrid representation method, a valid route pair includes a combination of one or more pairs of route attribute indexes and a second bitmap value, and the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure. In this implementation, the prefix index generated by the SDN controller can be represented by the following storage structure:

[0119] HashMap <key2,HashMap<key3,value2> >, or key2:{key3:value2}

[0120] Among them, key2 is the second root identifier, key3 is the routing attribute index, value2 is the second bitmap value, and the routing attribute index key3 can be represented by the following storage structure:

[0121] HashMap<info id,route info>

[0122] Among them, info id is the route attribute index, and route info is the route attribute information. It should be noted that HashMap<info id,route info> It can also be called a routing attribute dictionary, which is used to establish a mapping relationship between routing attribute indexes and routing attribute information.

[0123] In one possible implementation, during the process of the SDN controller generating a routing index corresponding to a routing table entry according to the second storage structure of the subtree, the SDN controller performs base-to-base conversion on the prefix corresponding to the root node to obtain a second root identifier. The SDN controller performs base-to-base conversion on the binary codes corresponding to different routing attribute indexes in the second storage structure to obtain multiple second bitmap values, and there is a corresponding relationship between the routing attribute index and the second bitmap value. The SDN controller generates a routing index according to the second root identifier, the routing attribute index, and the second bitmap value.

[0124] exist Figure 6 In the example shown, the SDN controller converts the binary prefix corresponding to the root node into a decimal integer. For example, the binary IP address corresponding to the root node "101.168.0.0" is "01100101.10101000.00000000.00000000", where the 20-bit prefix is ​​"01100101101010000000", and after adding 1 before the binary prefix, it is "101100101101010000000", and the SDN controller converts "101100101101010000000" into a decimal integer "1464960", and the second root identifier is "1464960".

[0125] exist Figure 6 In the example shown, the SDN controller performs base conversion on the binary codes corresponding to different routing attribute indexes in the second storage structure. For example, the nodes corresponding to the routing attribute index "label1" are node 1, node 2, and node 6, that is, node 1, node 2, and node 6 are non-empty child nodes corresponding to "label1", and node 3, node 4, node 5, and node 7 are empty child nodes corresponding to "label1". The non-empty child nodes are "1" and the empty child nodes are "0". Then, node 7 to node 1 can be represented as the binary code "0100011". The SDN controller adds "0" after the last bit of the binary code "0100011" to obtain "01000110". The SDN controller converts the binary code "01000110" into a decimal integer "70" to obtain a second bitmap value, which is "70".

[0126] Similarly, in Figure 6In the example shown, the node corresponding to the routing attribute index "label2" is node 3, that is, node 3 is a non-empty child node corresponding to "label2", then node 7 to node 1 can be represented as the binary code "0000100", and the SDN controller adds "0" after the last bit of the binary code "0000100" to obtain "00001000", and the SDN controller converts the binary code "00001000" into a decimal integer "8" to obtain another second bitmap value, which is "8".

[0127] Similarly, in Figure 6 In the example shown, the nodes corresponding to the routing attribute index "label3" are node 5 and node 7, that is, node 5 and node 7 are non-empty child nodes corresponding to "label2", then node 7 to node 1 can be represented as a binary code "1010000", and the SDN controller adds "0" after the last bit of the binary code "1010000" to obtain "10100000", and the SDN controller converts the binary code "10100000" into a decimal integer "160" to obtain another second bitmap value, which is "160".

[0128] exist Figure 6 In the example shown, the prefix index generated by the SDN controller can be represented by the following non-hybrid storage structure:

[0129] 1464960:{1:70},

[0130] 1464960:{2:8},

[0131] 1464960:{3:160};

[0132] Or, 1464960:{1:70},{2:8},{3:160}.

[0133] In one possible implementation, in a hybrid representation method, a valid route pair includes a route attribute index group and a third bitmap value, the route attribute index group includes multiple different types of route attribute indexes, and the third bitmap value is used to indicate a non-empty child node corresponding to the route attribute index group in the second storage structure. In this implementation, the prefix index generated by the SDN controller can be represented by the following storage structure:

[0134] HashMap<key2,[value3,info id group]> , or key2: [value3, info id group].

[0135] Among them, key2 is the second root identifier, value3 is the third bitmap value, and info id group is the routing attribute index group. The routing attribute index group can also be represented by the following storage structure:

[0136] [info id1,info id2,info id3,…]

[0137] In one possible implementation, when the SDN controller generates a routing index corresponding to a routing table entry according to the second storage structure of the subtree, the SDN controller performs base conversion on the prefix corresponding to the root node to obtain a second root identifier. The SDN controller performs base conversion on the binary code corresponding to the routing attribute index group in the second storage structure to obtain a third bitmap value. The SDN controller generates a routing index according to the second root identifier, the routing attribute index group, and the third bitmap value.

[0138] Please continue reading Figure 6 ,exist Figure 6 In the example shown, the SDN controller converts the binary prefix corresponding to the root node into a decimal integer to obtain a second root identifier, which is "1464960". The SDN controller converts the binary code corresponding to the routing attribute index group in the second storage structure into a decimal integer. Figure 6 In the example shown, the routing attribute index group includes "label1", "label1", "label2", "label3", "label1", and "label3". Therefore, the routing attribute index group can be expressed as follows: [1, 1, 2, 3, 1, 3]

[0140] exist Figure 6 In the example shown, the nodes corresponding to the routing attribute index group "[1, 1, 2, 3, 1, 3]" are node 1, node 2, node 3, node 5, node 6 and node 7, that is, node 1, node 2, node 3, node 5, node 6 and node 7 are non-empty child nodes corresponding to the routing attribute index group "[1, 1, 2, 3, 1, 3]", and node 7 to node 1 can be represented as binary code "1110111", and the SDN controller adds "0" after the last bit of the binary code "1110111" to obtain "11101110", and the SDN controller converts the binary code "11101110" into a decimal integer "238" to obtain the third bitmap value, which is "238". Therefore, the prefix index generated by the SDN controller can be represented by the following hybrid storage structure:

[0141] 1464960: [238, 1, 1, 2, 3, 1, 3]

[0142] Please refer to Table 3, which is a comparison table of memory overhead and addition, deletion, modification and query performance of a routing table item provided in an embodiment of the present application. As can be seen from Table 3, the routing index after the routing table item is compressed based on the storage structure of multiple subtrees in the embodiment of the present application reduces the memory overhead of the routing table item and the time overhead of the routing query. For example, the memory size of the non-hybrid routing index in the embodiment of the present application is 113.3MB, and the memory size of the non-hybrid routing index is 95.31MB, which greatly reduces the memory space required for the routing index compared to the memory size of 556.48MB of the routing index in the existing solution.

[0143] Table 3

[0144]

[0145] Please refer to Table 4, which is a comparison table of memory and time overhead of a routing index in an embodiment of the present application. As can be seen from Table 4, the routing index after the routing table items are compressed based on the storage structure of multiple subtrees in the embodiment of the present application has achieved compression in both memory size and query time compared to the existing solution, greatly reducing the memory overhead and time overhead of the routing index. For example, the non-hybrid routing index in the embodiment of the present application has compressed the memory overhead of the existing solution by 4.91 times, and the non-hybrid routing index has compressed the memory overhead of the existing solution by 5.83 times.

[0146] Table 4

[0147]

[0148]

[0149] See also Figure 7 , Figure 7 A schematic diagram of a memory overhead ratio provided in an embodiment of the present application. Figure 7 In the example shown, (a) is a schematic diagram of the memory overhead ratio in the existing solution, (b) is a schematic diagram of the memory overhead ratio corresponding to the non-hybrid routing index provided in an embodiment of the present application, and (c) is a schematic diagram of the memory overhead ratio corresponding to the hybrid routing index provided in an embodiment of the present application.

[0150] exist Figure 7In the example shown, by comparing (a), (b) and (c), it can be seen that the compression ratio of the routing index in (a) is 0.7, the compression ratio of the routing index in (a) is 3, and the compression ratio of the routing index in (a) is 4, that is, the compression ratio of the hybrid routing index provided in the embodiment of the present application is higher than the compression ratio of the non-hybrid routing index, and the compression ratio of the non-hybrid routing index provided in the embodiment of the present application is higher than the compression ratio of the routing index in the existing solution. Therefore, the non-hybrid routing index and the hybrid routing index provided in the embodiment of the present application can achieve a larger compression ratio, thereby reducing the memory overhead of the routing table.

[0151] It should be noted that after the SDN controller in the embodiment of the present application constructs the prefix index or routing index, it can periodically update the prefix index or routing index. That is, the SDN controller can periodically collect routing information of network devices, generate a routing table, and update the prefix index or routing index based on the new routing table.

[0152] 205. The SDN controller stores the network segment index in the memory.

[0153] After the SDN controller generates the network segment index or the routing index, it stores the network segment index or the routing index in the memory corresponding to the SDN controller. When the SDN controller performs data routing, the network segment index or the routing index is read from the memory for data routing.

[0154] In a possible implementation, the SDN controller receives a first routing request sent by a network device, the first routing request includes a destination IP address, and the SDN controller performs network segment matching on the destination IP address based on a network segment index to determine a network segment in a routing table that matches the destination IP address.

[0155] In one possible implementation, the SDN controller receives a second routing request sent by a network device, the second routing request includes a destination IP address, the SDN controller performs a routing query on the destination IP address based on a routing index, determines routing attribute information in a routing table that matches the destination IP address, and performs data routing based on the routing attribute information corresponding to the destination IP address.

[0156] The embodiments of the present application provide a network segment index and a route index that can support operations of various routing tables, thereby improving the performance of adding, deleting, modifying, and querying routing tables.

[0157] The routing table compression method provided in the embodiment of the present application can also be applied to a variety of business scenarios, including one or more of the following businesses: routing storage and calculation, routing table query, measurement data compression, and data center IP address classification. Among them, routing storage and calculation services such as routing selection, traffic scheduling, and fault delimitation and positioning, routing table query services such as longest match, full match, subnet match, field filtering, dynamic addition, deletion, and modification of routes, etc., and measurement data compression services such as flow classification storage, indexing, and calculation.

[0158] It can be seen from the above embodiments that the SDN controller in the embodiment of the present application can encode the network segments of the routing table based on the multi-subtree storage structure and generate the network segment index corresponding to the subtree, thereby realizing the compression of the network segments in the routing table, thereby reducing the memory overhead of the SDN controller for storing the routing table.

[0159] Based on the above method embodiment, the embodiment of the present application further provides a routing table compression device. The routing table compression device provided by the embodiment of the present application is specifically introduced below.

[0160] See also Figure 8 , Figure 8 A schematic diagram of the structure of a routing table compression device provided in an embodiment of the present application. Figure 8 In the example shown, the routing table compression device 800 is used to implement the steps performed by the SDN controller in the above embodiments. The routing table compression device 800 includes an interface unit 801, an encoding unit 802, an index generating unit 803 and a processing unit 804.

[0161] Among them, the interface unit 801 is used to obtain a routing table, the routing table includes routing table items of one or more network devices, and the routing table items include network segments. The encoding unit 802 is used to decompose the routing table into multiple subtrees based on a multi-subtree storage structure, and the multiple subtrees are used to encode the network segments. The index generation unit 803 is used to generate a network segment index according to the first storage structure of the subtree, the first storage structure is used to store the network segment, and the network segment index includes a first root identifier and a first bitmap value. The first root identifier is used to indicate the root node of the subtree, and the first bitmap value is used to indicate a non-empty child node in the first storage structure. The non-empty child node is used to characterize the network segment existing in the routing table, and the network segment index is used to match the network segment during routing. The processing unit 804 is used to store the network segment index in the memory of the SDN controller.

[0162] In a possible implementation, the index generation unit 803 is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a first root identifier, perform base conversion on the binary code corresponding to the non-empty child node in the first storage structure to obtain a first bitmap value, and generate a network segment index according to the first root identifier and the first bitmap value.

[0163] In one possible implementation, the routing table entry also includes routing attribute information, and the index generation unit 803 is further used to generate a routing index based on the second storage structure of the subtree, the routing index includes a second root identifier and a valid routing pair, the valid routing pair is used to indicate the routing attribute information existing in the routing table, the second storage structure is used to store the routing attribute index, and the routing attribute index is used to query the routing attribute information.

[0164] In a possible implementation, the valid route pair includes a combination of one or more pairs of route attribute indexes and second bitmap values, and the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure.

[0165] In a possible implementation, the index generation unit 803 is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a second root identifier. Base conversion is performed on the binary codes corresponding to different routing attribute indexes in the second storage structure to obtain one or more second bitmap values, and there is a corresponding relationship between the routing attribute index and the second bitmap value. The routing index is generated according to the second root identifier, the routing attribute index, and the second bitmap value.

[0166] In a possible implementation, the valid route pair includes a third bitmap value and a route attribute index group, the route attribute index group includes multiple different types of route attribute indexes, and the third bitmap value is used to indicate a non-empty child node corresponding to the route attribute index group in the second storage structure.

[0167] In a possible implementation, the index generation unit 803 is specifically used to perform base conversion on the network segment corresponding to the root node to obtain a second root identifier, perform base conversion on the binary code corresponding to the routing attribute index group in the second storage structure to obtain a third bitmap value, and generate a routing index according to the second root identifier, the routing attribute index group and the third bitmap value.

[0168] In a possible implementation manner, the routing attribute information includes one or more items: next hop IP address, routing source, autonomous system path, community attribute list, starting autonomous system number, and local priority.

[0169] In a possible implementation, the interface unit 801 is further configured to receive a first routing request sent by a network device, the first routing request including a destination IP address. The processing unit 804 is further configured to perform network segment matching on the destination IP address based on the network segment index, and determine a network segment in the routing table that matches the destination IP address.

[0170] In a possible implementation, the interface unit 801 is further configured to receive a second routing request sent by the network device, the second routing request including a destination IP address. The processing unit 804 is further configured to perform a routing query on the destination IP address based on the routing index, and determine routing attribute information matching the destination IP address in the routing table.

[0171] It should be understood that the division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some units can also be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware. For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in the memory in the form of a program, and called and executed by a certain processing element of the device. The function of the unit. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software calling through a processing element.

[0172] It is worth noting that, for the above method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required for the present application.

[0173] Other reasonable step combinations that can be thought of by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be familiar with the fact that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.

[0174] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. Fig. 9 As shown, the computing device 900 includes: a processor 901, a memory 902, a communication interface 903 and a bus 904. The processor 901, the memory 902 and the communication interface 903 are coupled via a bus (not marked in the figure). The memory 902 stores instructions. When the execution instructions in the memory 902 are executed, the computing device 900 executes the method executed by the SDN controller in the above method embodiment.

[0175] The computing device 900 may be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), or a combination of at least two of these integrated circuit forms. For another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0176] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.

[0177] The memory 902 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0178] The memory 902 stores executable program codes, and the processor 901 executes the executable program codes to respectively implement the functions of the aforementioned interface unit, encoding unit, index generation unit, and processing unit, thereby implementing the aforementioned routing table compression method. That is, the memory 902 stores instructions for executing the aforementioned routing table compression method.

[0179] The communication interface 903 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.

[0180] In addition to the data bus, the bus 904 may also include a power bus, a control bus, a status signal bus, etc. The bus may be a peripheral component interconnect express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus may be divided into an address bus, a data bus, a control bus, etc.

[0181] See also Fig.10 , Fig.10 A schematic diagram of a computing device cluster provided in an embodiment of the present application. Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900 .

[0182] like Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900. The memory 902 in one or more computing devices 900 in the computing device cluster 1000 may store the same instructions for executing the above-mentioned routing table compression method.

[0183] In some possible implementations, the memory 902 of one or more computing devices 900 in the computing device cluster 1000 may also respectively store partial instructions for executing the above-mentioned routing table compression method. In other words, the combination of one or more computing devices 900 may jointly execute instructions for executing the above-mentioned routing table compression method.

[0184] It should be noted that the memory 902 in different computing devices 900 in the computing device cluster 1000 can store different instructions, which are respectively used to execute part of the functions of the above-mentioned routing table compression device. That is, the instructions stored in the memory 902 in different computing devices 900 can implement the functions of one or more modules in the interface unit, the encoding unit, the index generation unit, and the processing unit.

[0185] In some possible implementations, one or more computing devices 900 in the computing device cluster 1000 may be connected via a network, which may be a wide area network or a local area network.

[0186] See also Fig.11 , Fig.11A schematic diagram of computer devices in a computer cluster connected via a network provided in an embodiment of the present application. Fig.11 As shown, two computing devices 900A and 900B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.

[0187] In a possible implementation, the memory in the computing device 900A stores instructions for the functions of the interface unit, the encoding unit, and the index generation unit. Meanwhile, the memory in the computing device 900B stores instructions for the functions of the execution processing unit.

[0188] It should be understood that Fig.11 The functions of the computing device 900A shown in FIG. 1 may also be completed by multiple computing devices. Similarly, the functions of the computing device 900B may also be completed by multiple computing devices.

[0189] In another embodiment of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor of a device executes the computer-executable instructions, the device executes the method executed by the SDN controller in the above method embodiment.

[0190] In another embodiment of the present application, a computer program product is provided, the computer program product includes computer executable instructions, the computer executable instructions are stored in a computer readable storage medium. When the processor of the device executes the computer executable instructions, the device executes the method executed by the SDN controller in the above method embodiment.

[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0192] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0195] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or 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 a number of instructions to enable 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 application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for compressing a routing table, characterized in that: Applied to software defined network (SDN) controllers, including: Obtaining a routing table, wherein the routing table includes routing table entries of one or more network devices, and the routing table entries include network segments; Decomposing the routing table into multiple subtrees based on a multi-subtree storage structure, wherein the multiple subtrees are used to encode the network segment; Generate a network segment index according to a first storage structure of the subtree, the first storage structure is used to store the network segment, the network segment index includes a first root identifier and a first bitmap value, the first root identifier is used to indicate a root node of the subtree, the first bitmap value is used to indicate a non-empty child node in the first storage structure, the non-empty child node is used to represent a network segment existing in the routing table, and the network segment index is used to perform network segment matching during routing; The network segment index is stored in the memory of the SDN controller.

2. The method according to claim 1, characterized in that Generating a network segment index according to the first storage structure of the subtree includes: Performing base-based conversion on the network segment corresponding to the root node to obtain the first root identifier; Performing base-to-base conversion on the binary code corresponding to the non-empty child node in the first storage structure to obtain the first bitmap value; The network segment index is generated according to the first root identifier and the first bitmap value.

3. The method according to claim 1 or 2, characterized in that: The routing table entry also includes routing attribute information, and the method further includes: A routing index is generated according to the second storage structure of the subtree, the routing index includes the second root identifier and a valid routing pair, the valid routing pair is used to indicate routing attribute information existing in the routing table, the second storage structure is used to store the routing attribute index, and the routing attribute index is used to query the routing attribute information.

4. The method according to claim 3, characterized in that The valid route pair includes one or more pairs of the route attribute index and a combination of a second bitmap value, where the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure.

5. The method according to claim 4, characterized in that Generating a routing index according to the second storage structure of the subtree comprises: Convert the network segment corresponding to the root node into a base-1 to obtain a second root identifier; Performing base-to-base conversion on binary codes corresponding to different routing attribute indexes in the second storage structure to obtain one or more second bitmap values, wherein the routing attribute indexes correspond to the second bitmap values; The routing index is generated according to the second root identifier, the routing attribute index, and the second bitmap value.

6. The method according to claim 3, characterized in that The valid route pair includes a third bitmap value and a routing attribute index group, the routing attribute index group includes a plurality of routing attribute indexes of different types, and the third bitmap value is used to indicate a non-empty child node corresponding to the routing attribute index group in the second storage structure.

7. The method according to claim 6, characterized in that Generating the routing index corresponding to the routing table entry according to the second storage structure of the subtree includes: Convert the network segment corresponding to the root node into a base-1 to obtain a second root identifier; Performing base-to-base conversion on the binary code corresponding to the routing attribute index group in the second storage structure to obtain the third bitmap value; The routing index is generated according to the second root identifier, the routing attribute index group, and the third bitmap value.

8. The method according to any one of claims 1 to 7, characterized in that The routing attribute information includes one or more items: next hop IP address, routing source, autonomous system path, community attribute list, starting autonomous system number, and local priority.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Receiving a first routing request sent by the network device, wherein the first routing request includes a destination IP address; The destination IP address is matched with a network segment based on the network segment index to determine a network segment in the routing table that matches the destination IP address.

10. The method according to any one of claims 3 to 9, characterized in that The method further comprises: receiving a second routing request sent by the network device, wherein the second routing request includes the destination IP address; A route query is performed on the destination IP address based on the route index to determine route attribute information in the routing table that matches the destination IP address.

11. A routing table compression device, characterized in that: include: An interface unit, configured to obtain a routing table, wherein the routing table includes routing table entries of one or more network devices, and the routing table entries include network segments; An encoding unit, configured to decompose the routing table into a plurality of subtrees based on a multi-subtree storage structure, wherein the plurality of subtrees are used to encode the network segment; An index generating unit, configured to generate a network segment index according to a first storage structure of the subtree, wherein the first storage structure is used to store the network segment, the network segment index includes a first root identifier and a first bitmap value, the first root identifier is used to indicate a root node of the subtree, the first bitmap value is used to indicate a non-empty child node in the first storage structure, the non-empty child node is used to characterize a network segment existing in the routing table, and the network segment index is used to perform network segment matching during routing; A processing unit is used to store the network segment index in the memory of the SDN controller.

12. The device according to claim 11, characterized in that The index generating unit is specifically used for: Performing base-based conversion on the network segment corresponding to the root node to obtain the first root identifier; Performing base-to-base conversion on the binary code corresponding to the non-empty child node in the first storage structure to obtain the first bitmap value; The network segment index is generated according to the first root identifier and the first bitmap value.

13. The device according to claim 11 or 12, characterized in that The routing table entry also includes routing attribute information, and the index generating unit is further used for: A routing index is generated according to the second storage structure of the subtree, the routing index includes the second root identifier and a valid routing pair, the valid routing pair is used to indicate routing attribute information existing in the routing table, the second storage structure is used to store the routing attribute index, and the routing attribute index is used to query the routing attribute information.

14. The device according to claim 13, characterized in that The valid route pair includes one or more pairs of the route attribute index and a combination of a second bitmap value, where the second bitmap value is used to indicate a non-empty child node corresponding to the route attribute index in the second storage structure.

15. The device according to claim 14, characterized in that The index generating unit is specifically used for: Convert the network segment corresponding to the root node into a base-1 to obtain a second root identifier; Performing base-to-base conversion on binary codes corresponding to different routing attribute indexes in the second storage structure to obtain one or more second bitmap values, wherein the routing attribute indexes correspond to the second bitmap values; The routing index is generated according to the second root identifier, the routing attribute index, and the second bitmap value.

16. The device according to claim 13, characterized in that The valid route pair includes a third bitmap value and a routing attribute index group, the routing attribute index group includes a plurality of routing attribute indexes of different types, and the third bitmap value is used to indicate a non-empty child node corresponding to the routing attribute index group in the second storage structure.

17. The device according to claim 16, characterized in that The index generating unit is specifically used for: Convert the network segment corresponding to the root node into a base-1 to obtain a second root identifier; Performing base-to-base conversion on the binary code corresponding to the routing attribute index group in the second storage structure to obtain the third bitmap value; The routing index is generated according to the second root identifier, the routing attribute index group, and the third bitmap value.

18. The device according to any one of claims 11 to 17, characterized in that The routing attribute information includes one or more items: next hop IP address, routing source, autonomous system path, community attribute list, starting autonomous system number, and local priority.

19. The device according to any one of claims 11 to 18, characterized in that The interface unit is also used for: Receiving a first routing request sent by the network device, wherein the first routing request includes a destination IP address; The processing unit is further configured to perform network segment matching on the destination IP address based on the network segment index, and determine a network segment in the routing table that matches the destination IP address.

20. The device according to any one of claims 13 to 19, characterized in that The interface unit is also used for: receiving a second routing request sent by the network device, wherein the second routing request includes the destination IP address; The processing unit is further configured to perform a route query on the destination IP address based on the route index, and determine route attribute information in the routing table that matches the destination IP address.

21. A computing device, characterized in that The invention comprises a processor coupled to a memory, wherein the processor is used to store instructions. When the instructions are executed by the processor, the computing device performs the method according to any one of claims 1 to 10.

22. A computing device cluster, characterized in that: The system comprises one or more computing devices, wherein the computing devices include a processor, the processor is coupled to a memory, and the processor is used to store instructions. When the instructions are executed by the processor, the computing device cluster performs the method according to any one of claims 1 to 10.

23. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed, the computer is caused to perform the method according to any one of claims 1 to 10.

24. A computer program product, comprising instructions, characterized in that: When the instructions are executed, the computer implements the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Route aggregation as a service (RaaS)

    US12689586B2