WO2011127642A1 - 路由表建立方法和装置及路由表查找方法和装置 - Google Patents

路由表建立方法和装置及路由表查找方法和装置 Download PDF

Info

Publication number
WO2011127642A1
WO2011127642A1 PCT/CN2010/071698 CN2010071698W WO2011127642A1 WO 2011127642 A1 WO2011127642 A1 WO 2011127642A1 CN 2010071698 W CN2010071698 W CN 2010071698W WO 2011127642 A1 WO2011127642 A1 WO 2011127642A1
Authority
WO
WIPO (PCT)
Prior art keywords
trie
subtree
routing table
trie subtree
trunk
Prior art date
Application number
PCT/CN2010/071698
Other languages
English (en)
French (fr)
Inventor
胡睿
陈洪飞
龚钧
翟素平
王小忠
赵鹤轩
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201080003601.8A priority Critical patent/CN102484610B/zh
Priority to EP10849652.2A priority patent/EP2560327B1/en
Priority to PCT/CN2010/071698 priority patent/WO2011127642A1/zh
Publication of WO2011127642A1 publication Critical patent/WO2011127642A1/zh
Priority to US13/649,633 priority patent/US20130034096A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/748Address table lookup; Address filtering using longest matching prefix

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a routing table establishing method and apparatus, and a routing table searching method and apparatus. Background technique
  • CIDR Classless Inter-Domain Routing
  • the given address block can be divided by any bit boundary.
  • the computer on the network will allocate the address in a continuous range, but this range does not need the corresponding predefined class, so it is called untyped addressing.
  • CIDR can avoid the excessive exhaustion of the network address and the rapid expansion of the routing entries of the backbone routers.
  • the length of the network address prefix can be any value. The longest prefix match search must be performed when performing route lookup. .
  • the main factors that measure the merits of the lookup table algorithm of the routing table include: routing table query speed (determined by the number of accesses to the memory), the memory capacity required by the routing table, and the difficulty of inserting and deleting routing entries.
  • the data structure of the untyped routing table can be stored in a layered data structure.
  • the routing table search is performed down the hierarchy, so it can be represented by a Binary Tree or a Radix Tree and its variant data structure.
  • Table 1 is an example routing table. Table 1
  • the prefix in Table 1 can be stored in a basic binary tree.
  • Figure 1 is a schematic diagram of the routing table stored in the existing basic binary tree. As shown in Figure 1, "0" represents the left branch and "1" represents the right branch. .
  • the prefix bit value determines the path from the root down, and the prefixes P1, P2, P3, and P4 are respectively shaded.
  • the value of the prefix P1-P4 is not stored in the node of the basic binary tree, and the value of P1-P4 is the path to the corresponding node, so the path of the basic binary tree is determined by the stored data (for example, the prefix bit value), that is, the basic
  • the path of the binary tree represents the data it is going to store.
  • the node at the Lth layer represents an address space in which the L bits are the same before the address, and the first L bit strings are composed of L bits on the path from the root node to the node.
  • Basic binary tree structure search and storage efficiency are both low. For example, for a subnet address divided by a group of traditional B-type addresses, the first 16 bits are the same, but when traversing the binary tree, only "1" bits are extracted at a time, speed ⁇ Slowly, if the corresponding address prefix is the longest M, the depth of the tree is M. If you check K bits at a time, the depth of the tree can be reduced to M/K, so that the internal nodes of the tree contain a match that increases to a power of 2 to the power of K. Such a tree is called a K power branch tree of 2, and the maximum number of layers of the tree is M/K.
  • the look-up algorithm checks the number of bits at each node as K, which is also called the step size of the tree.
  • the Patr ic ia tree allows each node to specify a value, testing the number of consecutively skipped bits to speed up the search.
  • the prefix is stored on the leaf node of the Patr ic ia tree. If there are N prefixes, there are N leaf nodes and N-1 internal nodes.
  • the redundant branch chain is compressed to one node, so the lookup algorithm does not need to do continuous bit matching but can match multiple bits at a time to reach the leaf node quickly.
  • Figure 2 shows the existing Pa tr ic ia tree storage Schematic diagram of the routing table, for the Pa tricia tree to search for leaf nodes faster, Pa tricia tree search efficiency for longer prefixes is higher than the basic binary tree, as shown in Figure 2, as for the prefix P4, Pat r
  • the ic ia tree can be searched by 3 matches, and the basic binary tree needs 5 times.
  • the IP address prefix can be regarded as a range, for example, 10. 110. 0. 0/16 actually represents all IP addresses from 10.110. 0. 0 to 10. 110. 255. 255, therefore, the IP address
  • the prefix can be expressed in the range [10. 110. 0. 0 , 10. 110. 255. 255].
  • the longest prefix matching problem can be translated into the question of which range of IP addresses to look for. This problem is similar to the sorting problem, and the routing table can be established by the binary tree method. Assume that the IP address is 8 bits and there are 7 IP addresses.
  • the mask and range of the IP address are as follows:
  • the left side is the interval representation of the IP address
  • the right side is the end point of the interval into the binary tree.
  • Each node stores the entire routing entry, and an IP address prefix is divided into two endpoints, so the space utilization is low.
  • the TRIE algorithm can be used to establish and find a routing table.
  • the TRIE algorithm has the advantages of high compression ratio and update speed block. However, because the number of times the TRIE algorithm accesses the node is proportional to the number of accesses to the memory and the length of the entry, as the key value of the TRIE algorithm increases, the routing table is highly enhanced, and the IPv6 forwarding information base (Forwarding Information Base; Abbreviation: FIB) Finding more access to memory, resulting in lower throughput, lower performance, longer delay, and lower capacity.
  • FIB Forwarding Information Base
  • the embodiment of the invention provides a method and a device for establishing a routing table, and a method and a device for searching a routing table, which are used to solve the problem that the height of the tree in the existing TRIE algorithm is too high, and the rate of searching the routing table is slow and the delay is increased. Improve the search rate of the routing table and reduce the search delay.
  • the embodiment of the invention provides a routing table establishing method, including:
  • the height of the TRIE subtree is less than or equal to a set height threshold
  • the boost subnode of the vertex of the TRIE subtree is the TR IE
  • the sub-vertices of the subtree include the sub-vertices in the prefix sub-node.
  • the embodiment of the present invention further provides a routing table searching method, where the data structure of the routing table includes a trunk and a TRIE subtree, and the lifting subnode of the vertices of the subtree is saved in a trunk of the routing table, Methods include:
  • An embodiment of the present invention further provides a routing table establishing apparatus, including:
  • a dividing module configured to divide a data structure of the routing table into a trunk and a TRIE subtree
  • an entry adding module configured to add a routing entry to the TRIE subtree
  • a save module configured to save a boost subnode of a vertex of the TRIE subtree to the trunk
  • the height of the TRIE subtree is less than or equal to a set height threshold
  • the boost subnode of the vertices of the TRIE subtree is a sub vertice in a prefix subnode included in a vertex of the TRIE subtree.
  • the embodiment of the invention further provides a routing table searching device, including:
  • a backbone search module configured to search for a boosting child node that matches the longest keyword in the trunk of the routing table, where the data structure of the routing table includes a trunk and a TRIE subtree, and the lifting subnode of the vertices of the subtree is saved In the trunk of the routing table;
  • a subtree location obtaining module configured to acquire a location of a vertex of the TRIE subtree corresponding to the boosting subnode that matches the longest keyword
  • a subtree search module configured to search for a search result corresponding to the keyword by using a TRIE algorithm in the TRIE subtree according to the location of the vertices of the TRIE subtree corresponding to the promotion subnode that matches the longest keyword.
  • the embodiment of the invention provides a routing table establishing method and device, and a routing table searching method and device. Since the data structure of the routing table is divided into a trunk and a TRIE subtree, the subtree is a TRIE subtree established by using the TRIE algorithm, which can guarantee The high compression ratio of the routing table; when adding routing entries, controlling the height of the TRIE subtree can reduce the number of accesses to the memory, improve the rate of searching the routing table, and reduce the search latency.
  • FIG. 1 is a schematic diagram of a routing table of an existing basic binary tree storage
  • FIG. 2 is a schematic diagram of a routing table stored in an existing Patricia tree
  • 3 is a schematic diagram of a conventional binary tree storage IP address mask range
  • 4 is a flowchart of an embodiment of a method for establishing a routing table according to the present invention
  • FIG. 5a is a schematic structural diagram of a trunk and a TRIE subtree in an embodiment of a method for establishing a routing table according to the present invention
  • FIG. 5b is a schematic diagram of a multi-bit TRIE algorithm in an embodiment of a method for establishing a routing table according to the present invention
  • FIG. 5 is a schematic diagram of an outer bitmap of a tree bitmap algorithm in an embodiment of a method for establishing a routing table according to the present invention
  • FIG. 6a is a schematic diagram of adding a routing table to an embodiment of a method for establishing a routing table according to the present invention
  • Figure 6b is a schematic diagram of a routing table entry in the embodiment of the routing table in the embodiment of the present invention
  • Figure 6c is a schematic flowchart of adding a routing entry in the method for establishing a routing table according to the present invention
  • FIG. 6 is a schematic diagram of an embodiment of a method for establishing a routing table according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of an embodiment of a method for establishing a routing table according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of an embodiment of a method for establishing a routing table according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of a first embodiment of a routing table establishing apparatus according to the present invention.
  • FIG. 9 is a schematic structural diagram of a second embodiment of a routing table establishing apparatus according to the present invention.
  • FIG. 10 is a schematic structural diagram of a first embodiment of a routing table searching apparatus according to the present invention.
  • FIG. 11 is a schematic structural diagram of a second embodiment of a routing table searching apparatus according to the present invention. detailed description
  • the routing table establishing method includes:
  • the vertices of the TR IE subtree include sub-vertices in the prefix sub-node.
  • the routing table may be stored in the layered data structure, and the data structure of the routing table may be divided into a trunk and a TRIE subtree in advance, and the promotion subnode of the vertices of the TRIE subtree is saved in the trunk, where The TRIE subtree can be established by the TRIE algorithm.
  • FIG. 5 is a schematic structural diagram of a trunk and a TRIE subtree in an embodiment of a method for establishing a routing table according to the present invention. As shown in FIG. 5a, each node 42 of a TRIE subtree 41 established by using a TRIE algorithm may include multiple prefix subnodes.
  • the node 42 of the uppermost layer of the TRIE subtree 41 is a vertex, and the uppermost prefix subnode of the TRIE subtree 41 vertex is the promotion subnode 44, and the promotion subnode 44 of the TRIE subtree 41 is stored in the trunk 45, that is, the lifter
  • the node 44 belongs to both the TRIE subtree 41 and the backbone 45, and the trunk is equivalent to a database that stores the promotion subnodes.
  • FIG. 5b is a schematic diagram of a multi-bit TRIE algorithm in a method for establishing a routing table according to the present invention.
  • the multi-bit TRIE algorithm forms an array by using an index of multiple bits (bi t ) of an IP address, which will be different by the IP address.
  • the arrays formed by the bits are associated in the order of their IP addresses.
  • searching multiple addresses are searched at a time, and the search is hierarchical. As shown in FIG. 5b, the first 24 bits are the first level, and the last 8 bits are the second level.
  • the matching result can be directly sent to the forwarding information base 13;
  • the first 24 bits and the last 8 bits are combined and matched in the second storage area 12.
  • the matching result can be sent to the forwarding information base 13.
  • FIG. 5c is a schematic diagram of an internal bitmap of a Tree Bitmap algorithm in a method for establishing a routing table according to the present invention
  • FIG. 5d is a schematic diagram of an outer bitmap of a tree bitmap algorithm in an embodiment of a routing table establishing method according to the present invention
  • the tree bitmap algorithm also belongs to the mul t i-bi t TRIE algorithm.
  • the tree bitmap algorithm uses a bitmap (bi tmap ) to indicate which prefixes are in the node and which children are in the node.
  • the internal bitmap (Interna l bitmap) indicates which prefixes are in the node, as shown in the node of a TRIE subtree in Figure 5c.
  • prefix sub-nodes PI, P2, P3, and the bit (bi t ) of the inner bitmap stored in the prefix is set to "1", and the prefix is not stored.
  • the position is "0" and you can get "1011000”.
  • Externa l bitmap can indicate which children are in a node of the TRIE subtree. As shown in Figure 5d, the node can have up to 8 child nodes, but there are actually only three child nodes, so there are children. The position of the node is set to "1", and the position of the child node is not set to "0".
  • the TRIE subtree can be established by using the TRIE algorithm, and then in the specific process of adding a routing entry or deleting a routing entry, the pair is stored in the trunk of the routing table according to the set height threshold.
  • the upgrade sub-nodes are updated accordingly, and are classified into the following scenarios: Scenario 1: Adding a routing entry
  • the branch in the TRIE subtree whose height is greater than the height threshold is split from the TRIE subtree to obtain a new TRIE subtree.
  • the lifting subnode of the vertex of the new TRIE subtree is saved into the trunk, the vertex of the new TRIE subtree is a branch in the TRIE subtree whose height is greater than the height threshold, and the TR The node to which the vertices of the IE subtree are connected.
  • 6a is a schematic diagram of a method for establishing a routing table in the embodiment of the present invention
  • FIG. 6b is a schematic diagram of the method for establishing a routing table in the embodiment of the present invention.
  • the preset height threshold is "3".
  • IP address prefix if the height of all TRIE subtrees of the routing table does not exceed "3", add the routing entry directly. Go to the corresponding location in the routing table.
  • the height of a TRIE subtree is greater than "3" after the routing entry is added, as shown in Figure 6a, after adding the routing entry, the height is "4", and in the two branches of the vertice N1 of the TRIE subtree T, The height of the branches of N1->N2->N4->N8 is greater than the height threshold.
  • the TRIE subtree T can be split from N2, and the branch whose branch height is greater than the height threshold is used as the new TRIE subtree T2, and N2 is the new TRIE subtree.
  • the apex of T2 The prefix subnode of the uppermost layer of N2 can be saved to the trunk as the promotion subnode of the new TRIE subtree T2. After the split, the remaining part is the TRIE subtree T1.
  • the correspondence between the vertices of the new TR IE subtree and the vertices of the TR IE subtree is unchanged, and between the new TR IE subtree and the promotion subnode of the TRIE subtree The relationship is reflected in the trunk.
  • the TRIE subtree may be The vertex is merged into the upper level TRIE subtree, and the boost subnode of the vertex of the TRIE subtree is deleted from the trunk.
  • FIG. 6 is a schematic diagram of a process of adding a routing entry in the method for establishing a routing table according to the present invention. As shown in FIG. 6c, the process of adding a routing entry may include:
  • a node in the TRIE subtree T1 finds that the height of the TRIE subtree is greater than the height threshold h.
  • T1 Determine whether the height of T1 is less than a preset height threshold h. If T1 has a previous TRIE subtree (which may also be called a parent-child tree, a father, etc.) and the height of T1 is less than h, execute 205, otherwise it ends.
  • a previous TRIE subtree which may also be called a parent-child tree, a father, etc.
  • TRIE subtree T1 Combines the TRIE subtree T1 into its upper level TRIE subtree, and use the merged TRIE subtree as the TRIE subtree T, and return 201.
  • IP address prefix added to the routing table is used as an example. Assume that the height threshold of the TRIE subtree is "2", and the prefix in the node of each TRIE subtree.
  • the child nodes are level 3, each node has a total of 7 prefix child nodes, and the 14-bit identifier IP address prefix is used.
  • the trunk is stored in a Ternary Content Addressable Memory (TCAM). As shown in FIG.
  • TCAM Ternary Content Addressable Memory
  • P4 saves the prefix "1011100000****”
  • P5 saves the IP address prefix as "1011100001****”
  • P6 saves the IP address prefix as "10111000001*** "
  • P7 saved IP address prefix is "10111000010***
  • P8 saved IP address prefix is
  • the IP address prefix reserved by P9 is "10111011101***”
  • the IP address prefix saved by P10 is "10111011110***”.
  • the promotion child node in the vertex N1 of the TRIE subtree A is to store the IP address prefix, according to the path of the routing table, the IP address prefix corresponding to the promotion child node T1 of N1 should be "101110********” Therefore, the IP address prefix "101110********" of the TRIE subtree A promotion subnode T1 is saved in the trunk TCAM.
  • other TRIE subtree promotion subnode IP address prefixes may be saved in the trunk TCAM, such as:
  • IP address prefix to be added is "1011100001010*,, , and a prefix sub-node P11 needs to be added to the TRIE subtree A, but after adding P11 Since the height of the TRIE subtree A after adding node N4 is "3", which is greater than the set height threshold "2", splitting is required.
  • the branch is from the TRIE subtree.
  • A is split into a new TRIE subtree A2, and the remaining part is A1 (including nodes N1 and N3).
  • the IP address prefix corresponding to the promotion subnode T2 of the vertex N2 of A2 should be The value is "101110000*** **"; the IP address prefix of the A1 promotion child node T1 is the same as A, which is "101110**** ****,.
  • the IP address prefix of the A2 promotion child node T2" 101110000**** *, Saved to the trunk TCAM, the correspondence between T2 and T1 is reflected in the trunk, completing the splitting process.
  • Scenario 2 Delete routing entries.
  • the vertices of the TRIE subtree may be merged into the upper TRIE.
  • the promotion child node of the vertices of the TRIE subtree is deleted from the trunk.
  • the process of merging the vertices of the TRIE subtree into the upper TIRE subtree is similar to the process of adding a routing entry to the upper TRIE subtree, and can also determine whether the height of the upper TRIE subtree is greater than the height. Threshold value, if it is greater than the height threshold, it can split the upper-level TRIE subtree, and possibly merge or split the upper-level TRIE subtree, and merge and split through layers to ensure that each one has no previous one.
  • the height of the TRIE subtree of the level TRIE subtree is the set height threshold.
  • the data structure of the routing table is divided into a trunk and a TRIE subtree, and the subtree is a TRIE subtree established by the TRIE algorithm, so that the high compression ratio of the routing table can be guaranteed; according to the set height threshold, the TRIE subtree can be controlled.
  • the height thus reducing the number of accesses to the memory, increases the seek rate and reduces the lookup latency.
  • FIG. 7 is a flowchart of a method for finding a routing table according to the present invention. As shown in FIG. 7, the routing table searching method includes:
  • the routing table finds a boosting child node that matches the longest keyword; wherein, the routing table may be stored in a layered data structure, and the data structure of the routing table includes a trunk and a TRIE subtree, and the TRIE subtree The vertices of the vertices are saved to the trunk, where
  • the boosting child nodes of the vertices of the TRIE subtree are the child vertices in the prefix child nodes included in the vertices of the TRIE subtree.
  • the TRIE subtree can be established using the TRIE algorithm.
  • the backbone creation method can be implemented by, but not limited to, other algorithms such as range matching, B-tree or tri-state content addressing memory. Routing table specific structure Reference can be made to the related description in the above embodiment and Fig. 5a.
  • the specific process of searching for the promotion child node that matches the longest keyword in the trunk of the routing table may include: searching from the promotion child node of each TRIE subtree stored in the trunk of the routing table And each of the first prefixes, the first prefix having the longest mask length is selected as the boosting child node that matches the longest keyword.
  • searching for each first prefix corresponding to the keyword part of the data in the keyword may be matched with each of the promotion sub-nodes in the trunk, and the matching method may be selected according to the establishment method of the trunk.
  • the address information of the boosting child node that matches the longest keyword may be directed to the vertices of the TRIE subtree in which the boosting child node is located, and the location of the vertices of the TRIE subtree corresponding to the boosting child node may be obtained according to the address information.
  • 303 may specifically include:
  • a second prefix having the longest mask length is selected as the search result.
  • the partial data in the keyword may be matched with the prefix child node of each node of the TRIE subtree, and the matching method may adopt the TRIE used when establishing the TRIE subtree. algorithm.
  • the search process in FIG. 6e in the above embodiment is taken as an example to specifically describe the process of searching.
  • the searched keyword is "10111000011000”
  • the promotion child node matching the keyword should be the IP address prefix corresponding to one or more promotion child nodes saved in the TCAM.
  • the hit child nodes that are hit are two IP address prefixes:
  • the data structure of the routing table in this embodiment is divided into a backbone and a TRIE subtree established by using the TRIE algorithm, which can ensure a high compression ratio of the routing table.
  • the height of the TRIE subtree can be controlled, so when searching the routing table , can reduce the number of access to memory, improve the search rate, and reduce the search delay.
  • FIG. 8 is a schematic structural diagram of a first embodiment of a routing table establishing apparatus according to the present invention.
  • the routing table establishing apparatus includes: a dividing module 51, an entry adding module 52, and a saving module 53.
  • the dividing module 51 is configured to divide the data structure of the routing table into a trunk and a TRIE subtree, and the entry adding module 52 is configured to add a routing entry to the TR I E subtree;
  • a saving module 53 configured to save a lifting subnode of a vertex of the TRIE subtree into the trunk, where a height of the TRIE subtree is less than or equal to a set height threshold, and a verifier of the vertex of the TRIE subtree
  • the node is a child vertex in the prefix sub-node included in the vertex of the TRIE subtree.
  • the dividing module 51 divides the data structure of the routing table into a trunk and a TRIE subtree, and uses a TRIE subtree established by the TRIE algorithm, and adopts other algorithms such as: range matching, B-tree or three.
  • the state content addressing memory or the like establishes a trunk.
  • the saving module 53 saves the promotion subnode of the vertices of the TRIE subtree in the trunk, and presets a height threshold, and the height of the TRIE subtree is less than or equal to the set. Height threshold.
  • the TRI E subtree after the routing entry is added may be split, and the data structure of the routing table is The height of the TRIE subtree is controlled to a height threshold. After the data structure of the routing table is created, you need to delete the routing entries. After deleting a certain routing entry, if the height of the TRIE subtree after the routing entry is deleted is less than or equal to the height threshold, the routing entry will be deleted. The TRIE subtree is merged with the previous TRI E subtree.
  • the TRIE subtree is established by using the TRIE algorithm, so that the high compression ratio of the routing table can be guaranteed; according to the set height threshold, the update module can control the TRIE subtree.
  • the height thus reducing the number of accesses to the memory, increases the seek rate and reduces the lookup latency.
  • FIG. 9 is a schematic structural diagram of a second embodiment of a routing table establishing apparatus according to the present invention.
  • the routing table establishing apparatus may further include: a splitting module 54. And, if the height after the routing entry is added to the TRIE subtree is greater than the height threshold, splitting a branch in the TRIE subtree whose height is greater than the height threshold from the TRIE subtree to obtain a new TIRE sub Tree
  • the saving module 53 is further configured to save, in the trunk, a promotion subnode of a vertex of the new TRI E subtree, where a height of the new TRIE subtree is greater than the height in the TRIE subtree A branch of a threshold, a node connected to a vertex of the TRIE subtree.
  • the routing table establishing apparatus may further include: a merge deleting module 56, configured to: if the height of the TRI E subtree split is less than the height threshold, and the TRIE subtree has a higher level TRIE subtree And merging the vertices of the TRIE subtree into the upper level TRIE subtree, and removing the promotion subnode of the vertices of the TR IE subtree from the trunk.
  • a merge deleting module 56 configured to: if the height of the TRI E subtree split is less than the height threshold, and the TRIE subtree has a higher level TRIE subtree And merging the vertices of the TRIE subtree into the upper level TRIE subtree, and removing the promotion subnode of the vertices of the TR IE subtree from the trunk.
  • the merge deletion module 56 may be further configured to: if the height of the TRIE subtree after deleting the routing entry is less than the height threshold, and the TRIE subtree has a higher level TRIE subtree, the TR The vertices of the IE subtree are merged into the upper TR IE subtree, and the promotion subnodes of the vertices of the TR IE subtree are deleted from the trunk.
  • the dividing module 51 may divide the data structure of the routing table into a backbone and a TRIE subtree in advance, and the lifting subnode of the vertices of the TRIE subtree is stored in the trunk; establishing a TRIE using the TRIE algorithm
  • the subtree the specific method for establishing the TRIE subtree, may refer to the description of the related example of the embodiment of the routing table establishment method of the present invention, and the backbone of the TRIE subtree is established by using range matching, B-tree or TCAM.
  • the saving module 53 saves the promotion subnode of the vertices of the TRIE subtree in the trunk, and presets a height threshold, and the height of the TRIE subtree is less than Or equal to the set height threshold.
  • the splitting module 54 divides the branch in the TRIE subtree that is greater than the height threshold from the TRI E sub The tree splits and gets the new TRIE subtree.
  • merge delete module 56 merges the vertices of the TRIE subtree into the upper level TRIE subtree, The promotion child node in the trunk that deletes the vertices of the TRIE subtree.
  • the merge deletion module 56 can also be used to: merge the vertices of the TRIE subtree into a higher level TRIE subtree, and delete the TR IE subtree from the trunk. The elevation of the vertices of the child nodes.
  • the data structure of the routing table is divided into a trunk and a TRIE subtree, and the TRIE subtree is established by using the TRIE algorithm, so that the high compression ratio of the routing table can be ensured; when the routing entry is added, the splitting unit and the saving unit can be greater than the height.
  • the TRI E subtree of the threshold is split; when the routing entry is deleted, the deletion order is deleted.
  • the meta and add unit can merge the TRIE subtrees whose height is less than the height threshold, thereby controlling the height of the TRIE subtree, reducing the number of accesses to the memory, increasing the search rate, and reducing the search delay.
  • FIG. 10 is a schematic structural diagram of a first embodiment of a routing table searching apparatus according to the present invention. As shown in FIG. 10, the routing table searching apparatus includes:
  • the backbone search module 71 is configured to search for a boosting child node that matches the longest keyword in the trunk of the routing table, where the data structure of the routing table includes a trunk and a TRIE subtree, and the vertices of the TRIE subtree are upgraded.
  • the child node is saved in the trunk of the routing table;
  • a subtree location obtaining module 72 configured to acquire a location of a vertex of the TRIE subtree corresponding to the boosting subnode that matches the longest keyword
  • a sub-tree search module 73 configured to search for a search result corresponding to the keyword by using a TRIE algorithm in the TRIE subtree according to the location of a vertex of the TRIE subtree corresponding to the boost subnode that matches the longest keyword .
  • the routing table may be stored in a layered data structure, the data structure of the routing table includes a trunk and a TRIE subtree, and the promotion subnode of the vertices of the TRIE subtree is saved in the trunk, where the TRIE subtree
  • the boosting child node of the vertex is a child vertex in the prefix child node included in the vertex of the TRIE subtree.
  • the TRIE subtree can be built using the TRIE algorithm.
  • the backbone creation method can be used with other algorithms such as range matching, B-tree or tri-state content addressed memory.
  • the backbone search module 71 can search for the promotion child node that matches the longest keyword in the backbone of the data structure of the routing table; the subtree location acquisition module 72 can be based on the promotion child node that matches the longest keyword. Address information, obtaining a vertex position of the corresponding TRIE subtree; the subtree searching module 73 may adopt a TRIE algorithm in the corresponding TRIE subtree according to the position of the vertex of the TRIE subtree corresponding to the lifting subnode matching the longest keyword Find the search result corresponding to the keyword.
  • the data structure of the routing table in this embodiment is divided into a backbone and a TRIE subtree established by using the TRIE algorithm, which can ensure a high compression ratio of the routing table.
  • the height of the TRIE subtree can be controlled, so when searching the routing table , the longest match between the keywords found by the backbone lookup module
  • the sub-tree location acquisition module can obtain the location of the TRIE subtree corresponding to the keyword, and then the subtree search module searches for the search result corresponding to the keyword in the corresponding TRIE subtree, which can reduce the number of accesses to the memory and improve the search rate. , reduce the search delay.
  • FIG. 11 is a schematic structural diagram of a second embodiment of a routing table searching apparatus according to the present invention.
  • the trunk searching module 71 of the routing table searching apparatus includes:
  • the first prefix sub-module 711 is configured to search, from the promotion sub-nodes of the TRIE sub-trees stored in the trunk of the routing table, respective first prefixes that match the keywords;
  • the longest matching sub-module 712 is configured to select, from the first prefixes, a first prefix with the longest mask length as the boosting child node that matches the longest keyword.
  • subtree lookup module 73 includes:
  • a second prefix sub-module 731 configured to: according to the location of a vertex of the TRIE subtree corresponding to the promotion subnode that matches the longest keyword, the TRIE corresponding to the promotion subnode that matches the longest keyword Find a second prefix that matches the keyword in a prefix child node of each node of the subtree;
  • the search result sub-module 732 is configured to select, from the each second prefix, a second prefix with the longest mask length as the search result.
  • the first prefix sub-module 711 searches for the longest matching sub-module 712 after searching for each first prefix corresponding to the keyword from the promotion sub-nodes of the respective TRIE sub-trees stored in the trunk of the routing table. And selecting, from each of the first prefixes, the first prefix having the longest mask length as the boosting child node that matches the longest keyword.
  • the subtree location obtaining module 72 acquires the location of the vertices of the corresponding TRIE subtree according to the promotion subnode matching the keyword; then, the second prefix submodule 731 is based on the TRIE corresponding to the promotion subnode that matches the keyword the longest match.
  • the data structure of the routing table in this embodiment is divided into a backbone and a TRIE subtree established by using the TRIE algorithm, which can ensure a high compression ratio of the routing table.
  • the height of the TRIE subtree can be controlled, so when searching the routing table
  • the sub-tree location acquisition module can obtain the TRIE sub-tree location corresponding to the keyword, and then the sub-modules of the sub-tree search module are Finding the search result corresponding to the keyword in the corresponding TRIE subtree can reduce the number of accesses to the memory, improve the search rate, and reduce the search delay.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Description

路由表建立方法和装置及路由表查找方法和装置 技术领域
本发明实施例涉及通信技术领域, 特别涉及一种路由表建立方法和装置 及路由表查找方法和装置。 背景技术
为了阻止地址空间耗尽, 互联网工程任务组 ( The Internet Engineering Task Force; 简称: IETF) 于 1993 年提出了无类型域间路由 (Classless Inter-Domain Routing; 简称: CIDR) 的地址结构的临时解决办法。 CIDR是 现在实际路由查表的基石出, 脱离了传统的 A-E分类地址结构。 在 CIDR中, 一 个 IP网络由一个前缀 ( refix )表示, 该前缀由 IP地址和标识该 IP地址有 效位的掩码复合表示。 CIDR允许路由器进行路由聚合, 即大小相同、 在地址 空间中相互邻近且路由相同的 2的整数次幂个子网的路由表条目可以合并成 一条路径, 并在路由表中只占用一个路由表项。 最后的结果是: 给定的地址 块可按任意比特(bit)界限划分, 网络上的计算机将按连续范围分配地址, 但这个范围不需要相应的预先定义的类, 所以称为无类型编址。 CIDR可以避 免网络地址的过快枯竭和骨干路由器的路由表项的快速膨胀, 同时使网络地 址前缀的长度可以为任意值, 进行路由查表时必须进行最长前缀匹配(the longest prefix match)搜索。 衡量路由表的查表算法优劣的主要因素包括: 路由表查询速度(由访问存储器的次数决定)、 路由表所需要的存储器容量、 插入删除路由表项的难易程度等。
无类型路由表的数据结构可以存储在一个层状数据结构。 路由表的搜索 是沿层次向下进行的,因此可以采用二叉树( Binary Tree )或者是根树( Radix Tree)及其变形的数据结构表示, 表 1为一种示例路由表。 表 1
Figure imgf000004_0001
可以将表 1中的前缀存储到一个基本二叉树中,图 1 为现有的基本二叉树 存储的路由表的示意图, 如图 1所示, "0" 代表向左分支, "1" 代表向右分 支。 其中前缀比特值决定了从根向下的路径, 前缀 Pl、 P2、 P3、 P4分别采用 阴影表示。 该基本二叉树的节点中没有存储前缀 P1-P4的值, P1-P4 的值为抵 达对应节点的路径, 因此该基本二叉树的路径由所存储的数据(例如: 前缀 比特值)确定, 即该基本二叉树的路径表示了它所要存储的数据。 在该基本 二叉树中, 处于第 L层的节点代表了一类地址前 L比特均相同的地址空间, 且 该前 L个比特串是由从根节点到该节点的路径上的 L比特组成。 基本二叉树结 构查找和存储效率都 4艮低,比如:对于一组传统的 B类地址上划分的子网地址, 其前 16比特相同, 但遍历二叉树时, 一次只提取 "1 " 比特, 速度 ^艮慢, 若相 应的地址前缀最长为 M, 则树的深度为 M。 如果一次检查 K个比特, 则树的深度 可减少到 M/K, 这样树的内部节点包含的匹配项增加为 2的 K次幂。 这样的树被 称为 2的 K次幂分支树, 树的最大层数为 M/K。 查表算法在每个节点处检查的比 特数为 K, 也就被称为树的步长。
Pa t r i c i a# ( Binary Tree ) 的变型, Patr i c ia树允许每个 节点指定一个值, 测试连续跳过的比特数以加快搜索速度。 前缀存放在 Patr ic ia树的叶节点上,假设有 N个前缀则有 N个叶节点,另有 N-1个内部节点。 冗余的支路链被压缩到了一个节点, 因此查找算法不需要做连续的比特匹配 而是可以一次匹配多个比特来快速到达叶节点。 图 2为现有 Pa t r ic ia 树存储 的路由表的示意图, 对 Pa t r i c i a树能够较快地的搜索到叶节点, Pa t r i c i a树 对较长的前缀的搜索效率比基本二叉树要高, 如图 2所示, 如对于前缀 P4 , Pat r ic i a树经 3次匹配可以完成查找, 而基本二叉树需要 5次。
IP地址前缀可以看成一个范围, 例如 10. 110. 0. 0/16实际上表示从 10. 110. 0. 0到 10. 110. 255. 255之间所有的 IP地址, 所以, 该 IP地址前缀可以 用范围 [10. 110. 0. 0 , 10. 110. 255. 255]表示。 将所有的 IP地址前缀都转换成 范围, 则最长前缀匹配问题可以转化为找待查 IP地址在哪个范围的问题, 此 问题类似于排序问题,可以用二叉树的方法建立路由表。假设 IP地址为 8比特, 共有 7个 I P地址, I P地址的掩码和范围如下表 2:
Figure imgf000005_0001
Figure imgf000005_0002
如图 3所示, 为现有采用二叉树存储 IP地址掩码范围的示意图, 左边是 IP 地址的区间表示, 右边是将区间的端点放入二叉树中。 每个节点存储整个路 由表项, 且一个 IP地址前缀要分为 2个端点, 因此空间利用率低。
为了提高路由表的空间利用率低,可以采用 TRIE算法建立并查找路由表,
TRIE算法具有压缩率高、 更新速度块的优点。 但是由于 TRIE算法访问节点的 次数与、 访问存储器的次数和表项长度成正比, 随着 TRIE算法的关键(key ) 值增长,路由表高度增力口, IPv6转发信息库( Forwarding Informat ion Base ; 简称: FIB )查找访问存储器的次数较多, 造成吞吐率降低, 性能下降, 时延 增长, 容量降低。 发明内容
本发明实施例提供一种路由表建立方法和装置及路由表查找方法和装 置, 用以解决现有 TRIE算法中树的高度过高, 引起的查找路由表的速率慢, 时延增长的问题, 提高对路由表的查找速率, 降低查找时延。
本发明实施例提供了一种路由表建立方法, 包括:
将路由表的数据结构划分为主干和 TRIE子树;
将路由表项添加到所述 TRIE子树;
将所述 TRIE子树的顶点的提升子节点保存到所述主干中, 所述 TRIE子 树的高度小于或等于设置的高度阈值,所述 TRIE子树的顶点的提升子节点为 所述 TR I E子树的顶点包括的前缀子节点中的子顶点。
本发明实施例还提供了一种路由表查找方法, 其中, 路由表的数据结构 包括主干和 TRIE子树,所述子树的顶点的提升子节点保存在所述路由表的主 干中, 所述方法包括:
在所述路由表的主干中, 查找与关键字最长匹配的提升子节点; 获取所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置;
根据所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置, 在所述 TRIE子树中采用 TRIE算法查找所述关键字对应的查找结果。
本发明实施例还提供了一种路由表建立装置, 包括:
划分模块, 用于将路由表的数据结构划分为主干和 TRIE子树; 表项添加模块, 用于将路由表项添加到所述 TRIE子树;
保存模块, 用于将所述 TRIE 子树的顶点的提升子节点保存到所述主干 中, 所述 TRIE子树的高度小于或等于设置的高度阈值, 所述 TRIE子树的顶 点的提升子节点为所述 TRIE子树的顶点包括的前缀子节点中的子顶点。
本发明实施例还提供了一种路由表查找装置, 包括:
主干查找模块, 用于在路由表的主干中, 查找与关键字最长匹配的提升 子节点, 所述路由表的数据结构包括主干和 TRIE子树, 所述子树的顶点的提 升子节点保存在所述路由表的主干中;
子树位置获取模块, 用于获取所述与关键字最长匹配的提升子节点对应 的 TRIE子树的顶点的位置;
子树查找模块, 用于根据所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置, 在所述 TRIE子树中采用 TRIE算法查找所述关键字 对应的查找结果。
本发明实施例提供了一种路由表建立方法和装置及路由表查找方法和装 置, 由于路由表的数据结构分为主干和 TRIE子树, 子树为采用 TRIE算法建 立的 TRIE子树, 可以保证路由表的高压缩率; 在添加路由表项时,控制 TRIE 子树的高度, 可以减少的访问存储器的次数, 提高了对查找路由表的速率, 降低了查找时延。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作一简单介绍, 下面描述中的附图 仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造 性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1 为现有的基本二叉树存储的路由表的示意图;
图 2为现有 Pat r ic ia 树存储的路由表的示意图;
图 3为现有采用二叉树存储 IP地址掩码范围的示意图; 图 4为本发明路由表建立方法实施例的流程图;
图 5a为本发明路由表建立方法实施例中主干和 TRIE子树的结构示意图; 图 5b为本发明路由表建立方法实施例中多位 TRIE算法的示意图; 图 5c为本发明路由表建立方法实施例中树位图算法的内位图的示意图; 图 5d为本发明路由表建立方法实施例中树位图算法的外位图的示意图; 图 6a为本发明路由表建立方法实施例添加路由表项分裂前的示意图; 图 6b为本发明路由表建立方法实施例添加路由表项分裂后的示意图; 图 6c为本发明路由表建立方法实施例添加路由表项的流程示意图; 图 6d为本发明路由表建立方法实施例中添加 IP地址前缀之前的示意图; 图 6e为本发明路由表建立方法实施例中添加 IP地址前缀之后的示意图; 图 7为本发明路由表找方法实施例的流程图;
图 8为本发明路由表建立装置第一实施例的结构示意图;
图 9为本发明路由表建立装置第二实施例的结构示意图;
图 10为本发明路由表查找装置第一实施例的结构示意图;
图 11为本发明路由表查找装置第二实施例的结构示意图。 具体实施方式
下面通过附图和实施例, 对本发明的技术方案做进一步的详细描述。 图 4为本发明路由表建立方法实施例的流程图, 如图 4所示, 该路由表 建立方法包括:
101、 将路由表的数据结构划分为主干和 TRIE子树;
102、 将路由表项添加到所述 TRIE子树;
103、将所述 TRIE子树的顶点的提升子节点保存到所述主干中,所述 TRIE 子树的高度小于或等于设置的高度阈值,所述 TRIE子树的顶点的提升子节点 为所述 TR I E子树的顶点包括的前缀子节点中的子顶点。 路由表可以存储在层状的数据结构中, 可以预先将路由表的数据结构划 分为主干和 TRIE子树, 将所述 TRIE子树的顶点的提升子节点保存到在所述 主干中, 其中, TRIE子树可以采用 TRIE算法建立, 其中 TRIE算法建立的树, 又称单词查找树, 是一种树形结构, 是一种哈希树的变种。 主干的建立方法 可以采用但不限于范围匹配、 B树或三态内容寻址存储器等其他算法。 图 5a 为本发明路由表建立方法实施例中主干和 TRIE子树的结构示意图, 如图 5a 所示, 采用 TRIE算法建立的 TRIE子树 41的每个节点 42中可以包括多个前 缀子节点, 其中 TRIE子树 41最上层的节点 42为顶点, 在 TRIE子树 41顶点 中最上层的前缀子节点为提升子节点 44 , TRIE子树 41的提升子节点 44保存 在主干 45中, 即提升子节点 44同时属于 TRIE子树 41和主干 45 , 主干相当 于是一个保存提升子节点的数据库。
下面介绍两种 TRIE算法:
图 5b为本发明路由表建立方法实施例中多位(腿 l t i-b i t ) TRIE算法的 示意图, 多位 TRIE算法用 IP地址的多个位(bi t ) 的索引形成数组, 将由 IP地址的不同位形成的数组按其在 IP地址中的先后顺序关联, 查找时一次 查找多个位, 分级查找。 如图 5b中, 前 24位为第一级, 后 8位为第二级, 如果前 24位在第一存储区域 11 中匹配成功, 则可以直接将得到匹配结果发 送到转发信息库 13; 如果前 24位在第一存储区域 11中部分匹配, 则将前 24 位和后 8位结合在第二存储区域 12中匹配, 匹配成功时, 可以将得到匹配结 果发送到转发信息库 13。
图 5c为本发明路由表建立方法实施例中树位图 (Tree bi tmap ) 算法的 内位图的示意图,图 5d为本发明路由表建立方法实施例中树位图算法的外位 图的示意图。 树位图算法也属于 mul t i-bi t TRIE 算法, 树位图算法用位图 ( bi tmap )表示节点中有哪些前缀, 以及节点有哪些孩子。 内位图(Interna l bi tmap )表示节点中有哪些前缀, 如图 5c中的一个 TRIE子树的节点中可存 放 7个前缀, 但实际上仅在前缀子节点 PI、 P2、 P3的位置存放了三个前缀, 将存放前缀的内位图的位(bi t )置为 "1 " , 将未存放前缀的位置为 "0" , 可以得到 "1011000" 。 外位图 (Externa l bi tmap )可以表示 TRIE子树的一 个节点有哪些孩子, 如图 5d所示, 该节点最多可以有 8个孩子节点, 但实际 上只有三个孩子节点, 则在有孩子节点的位置上置 "1 " , 没有孩子节点的位 置上置 "0" 。
建立该路由表的数据结构时, 可以先采用 TRIE算法建立 TRIE子树, 然 后在添加路由表项或删除路由表项的具体过程中, 根据设置的高度阈值对保 存在所述路由表的主干中的提升子节点进行相应的更新,具体分为以下场景: 场景一、 添加路由表项
其中, 若所述 TRIE子树添加路由表项后的高度大于所述高度阈值, 则将 所述 TRIE子树中高度大于所述高度阈值的分支从所述 TRIE子树分裂, 得到 新 TRIE子树;
然后, 将所述新 TRIE子树的顶点的提升子节点保存到所述主干中, 所述 新 TRIE子树的顶点为所述 TRIE子树中高度大于所述高度阈值的分支、 与所 述 TR I E子树的顶点连接的节点。
图 6a为本发明路由表建立方法实施例添加路由表项分裂前的示意图,图
6b为本发明路由表建立方法实施例添加路由表项分裂后的示意图。 假设预设 的高度阈值为 " 3" , 在向路由表中添加路由表项例如: IP 地址前缀时, 如 果路由表的所有 TRIE子树的高度没有超出 "3" , 则直接将路由表项添加到 路由表中对应的位置。如果添加路由表项后,某个 TRIE子树的高度大于 "3" , 如图 6a中, 添加路由表项后, 高度为 "4" , 而 TRIE子树 T的顶点 N1的两 个分支中, N1->N2->N4->N8 的分支的高度大于高度阈值。 此时, 如图 6b所 示, 为了保证 TRIE子树 T的高度可以将该 TRIE子树 T从 N2处分裂, 将分支 高度大于高度阈值的分支作为新 TRIE子树 T2 , N2为新 TRIE子树 T2的顶点, N2最上层的前缀子节点可以作为新 TRIE子树 T2的提升子节点保存到主干中, 分裂后 Τ剩余的部分为 TRIE子树 Tl。 其中, 将 TRIE子树分裂得到新 TRIE 子树后, 新 TR I E子树的顶点与 TR I E子树顶点之间的对应关系不变, 新 TR I E 子树与 TRIE子树的提升子节点之间的关系在主干中有体现。
进一步地, 在添加路由表项的过程中, 若所述 TRIE子树分裂后的高度小 于所述高度阈值, 且所述 TRIE子树具有上一级 TRIE子树, 可以将所述 TRIE 子树的顶点合并到所述上一级 TRIE子树, 从所述主干中删除所述 TRIE子树 的顶点的提升子节点。
根据上图 6b , 假设添加路由表项后, 需要再从 N3对 TRIE子树 T1进行 分裂, 分裂后的 T1只剩下节点 N1 , 此时分裂后的 T1的高度为 "1" , 小于 高度阈值, 如果此时分裂后的 T1具有上一级的 TRIE子树, 则可以将分裂后 的 T1合并到上一级 TRIE子树中。图 6c为本发明路由表建立方法实施例添加 路由表项的流程示意图, 如图 6c所示, 结合上述的图 6a和图 6b, 该添加路 由表项的流程具体可以包括:
201、 TRIE子树 T中的某个节点 N1 (顶点)发现该 TRIE子树的高度大于 高度阈值 h。
202、 从节点 N1向 TRIE子树 T的祖先方向查找, 找到高度为 h的节点
N2。
203、 以节点 N2为顶点, 从 TRIE子树 T分裂出新 TRIE子树 T2 , T剩余 的部分为 Tl。
204、 判断 T1的高度是否小于预设的高度阈值 h, 如果 T1有上一级 TRIE 子树(也可以称为父子树、 父亲等)且 T1的高度小于 h, 执行 205 , 否则结 束。
205、 将 TRIE子树 T1合并入其上一级 TRIE子树, 将合并后的 TRIE子树 作为 TRIE子树 T, 并返回 201。 为了详细说明路由表项添加的具体过程, 以向路由表中添加的路由表项 为 IP地址前缀为例, 假设 TRIE子树的高度阈值为 "2" , 每个 TRIE子树的 节点中的前缀子节点为 3级, 每个节点共 7个前缀子节点, 用 14位标识 IP 地址前缀, 主干存储在三态内容寻址存储器 ( Ternary Content Addressable Memory; 简称: TCAM ) 中。 如图 6d所示, 为本发明路由表建立方法实施例中 添加 IP地址前缀之前的示意图, 其中, 在 TRIE子树 A的一些前缀子节点中 保存的 IP地址前缀, 其中 P1保存的 IP地址前缀为 "1011101*******" , P2 保存的 IP 地址前缀为 "10111001******,, , P3 保存的 IP 地址前缀为
"10111010******" , P4保存的前缀为 "1011100000****" , P5保存的 IP 地址前缀为 "1011100001****" , P6保存的 IP地址前缀为 "10111000001***" , P7 保存的 IP 地址前缀为 "10111000010***,, , P8 保存的 IP 地址前缀为
"10111011100***" , P9保存的 IP地址前缀为 "10111011101***" , P10保 存的 IP地址前缀为 "10111011110***" 。 TRIE子树 A的顶点 N1中的提升子 节点虽然为保存 IP地址前缀, 但根据路由表的路径, N1的提升子节点 T1对 应的 IP地址前缀应该为 "101110********" , 因此, 主干 TCAM中保存 TRIE 子树 A提升子节点 T1的 IP地址前缀 " 101110********" 。 同理, 主干 TCAM 中还可能保存其他的 TRIE 子树提升子节点的 IP 地址前缀, 如:
'1001***********" 。 ^叚设需要添加的 IP地址前缀为 "1011100001010*,, , 需要在 TRIE子树 A中添加一个前缀子节点 P11, 但添加 P11后, 由于 TRIE 子树 A增加了节点 N4后的高度为 "3" , 大于设置的高度阈值 "2" , 因此需 要进行分裂。
如图 6e所示, 为本发明路由表建立方法实施例中添加 IP地址前缀之后 的示意图, 由于 TRIE子树 A中将 N2和 N4所在的分支高度大于高度阈值, 因 此将该分支从 TRIE子树 A中分裂为新 TRIE子树 A2, 剩余的部分为 A1 (包括 节点 N1和 N3 ) , 此时 A2的顶点 N2的提升子节点 T2对应的 IP地址前缀应 该为 "101110000*** **" ; A1提升子节点 T1 的 IP地址前缀与 A相同, 为 "101110**** ****,,。将 A2的提升子节点 T2的 IP地址前缀" 101110000**** *,, 保存到主干 TCAM中, T2与 T1的对应关系在主干中有体现, 完成分裂过程。
场景二、 删除路由表项;
其中, 若所述 TRIE子树删除路由表项后的高度小于所述高度阈值, 且所 述 TRIE子树具有上一级 TRIE子树,可以将所述 TRIE子树的顶点合并到上一 级 TRIE子树中, 从所述主干中删除所述 TRIE子树的顶点的提升子节点。
其中, 将所述 TRIE子树的顶点合并到上一级 TRIE子树中的过程与向上 一级 TRIE子树添加路由表项的过程相似, 也可以判断上一级 TRIE子树的高 度是否大于高度阈值, 如果大于高度阈值, 则可以对上一级 TRIE子树进行分 裂处理, 还有可能对再上一级 TRIE子树进行合并或分裂处理, 经过层层合并 和分裂, 保证每一个没有上一级 TRIE子树的 TRIE子树的高度为设定的高度 阈值。
本实施例路由表的数据结构分为主干和 TRIE子树, 子树为采用 TRIE算 法建立的 TRIE子树,因此可以保证路由表的高压缩率;根据设置的高度阈值, 可以控制 TRIE子树的高度, 因此减少了的访问存储器的次数, 提高了查找速 率, 降低了查找时延。
图 7为本发明路由表找方法实施例的流程图, 如图 7所示, 该路由表找 方法包括:
301、 在路由表的主干中, 查找与关键字最长匹配的提升子节点; 其中, 路由表可以存储在层状的数据结构中, 路由表的数据结构包括主 干和 TRIE子树, TRIE子树的顶点的提升子节点保存到在所述主干中, 其中,
TRIE子树的顶点的提升子节点为所述 TRIE子树的顶点包括的前缀子节点中 的子顶点。 TRIE子树可以采用 TRIE算法建立, 主干的建立方法可以采用但 不限于范围匹配、 B树或三态内容寻址存储器等其他算法。 路由表具体结构 可以参照上述实施例中的相关描述和图 5 a。
其中, 在路由表的主干中查找与关键字最长匹配的提升子节点的具体过 程可以包括: 从保存在所述路由表的主干中的各个 TRIE 子树的提升子节点 中, 查找与所述关键字匹配的各个第一前缀; 从所述各个第一前缀中, 选取 掩码长度最长的第一前缀作为所述与关键字最长匹配的提升子节点。 其中, 查找与所述关键字对应的各个第一前缀时, 可以采用关键字中的部分数据与 主干中的各个提升子节点进行匹配, 匹配方法可以根据主干的建立方法选择。
302、 获取所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点 的位置;
与关键字最长匹配的提升子节点的地址信息可以指向该提升子节点所在 的 TRIE子树的顶点, 根据该地址信息可以获取该提升子节点对应的 TRIE子 树的顶点的位置。
303、 根据所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点 的位置,在所述 TRIE子树中采用 TRIE算法查找所述关键字对应的查找结果。
303具体可以包括:
根据所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置,在所述与关键字最长匹配的提升子节点对应的所述 TRIE子树各个节点的 前缀子节点中, 查找与所述关键字匹配的各个第二前缀;
从所述各个第二前缀中, 选取掩码长度最长的第二前缀作为所述查找结 果。
其中, 查找与所述关键字对应的各个第二前缀时, 可以采用关键字中的 部分数据与 TRIE子树各个节点的前缀子节点进行匹配, 匹配方法可以采用建 立 TRIE子树时所使用的 TRIE算法。
以在上述实施例中图 6e的路由表中查找为例, 具体说明查找的过程。假 设查找的关键字为 "10111000011000" , 现在主干 TCAM中查找与关键字匹配 的提升子节点, 该与关键字匹配的提升子节点应该为一个或多个保存在 TCAM 中的提升子节点对应的 IP地址前缀。 以关键字 "10111000011000" 在图 6e 所示的路由表中查找后, 命中的提升子节点为两个 IP 地址前缀:
"1 01 1 1 0**** ****" 和 "101110000*** *" , 分别对应指向 TRIE子 4对 A1 和 A2。 由于 TRIE子树 A2对应的 IP地址前缀 "101110000****" 的掩码长度比 TRIE子树 A1对应的 IP地址前缀" 101110***** ***"长,因此,可以选则 TRIE 子树 A2采用 TRIE算法进行进一步的查找。 在 TRIE子树 A2中, 以关键字中 未匹配的数据 "11000" 继续进行匹配, 最后查找到 TRIE子树 A2的节点 N2 中的 P5的 IP地址前缀 "1011100001 * ***" 。 因此可以得出该关键字命中 P5 的 IP地址前缀。 如果命中的 IP地址前缀不只是一个, 可以选取掩码长度最 长的 IP地址前缀作为最终的查找结果。
本实施例路由表的数据结构分为主干和采用 TRIE算法建立的 TRIE子树, 可以保证路由表的高压缩率; 根据设置的高度阈值, 可以控制 TRIE子树的高 度, 因此在查找路由表时, 可以减少访问存储器的次数, 提高查找速率, 降 低查找时延。
图 8为本发明路由表建立装置第一实施例的结构示意图, 如图 8所示, 该路由表建立装置包括: 划分模块 51、 表项添加模块 52和保存模块 53。
其中, 划分模块 51 , 用于将路由表的数据结构划分为主干和 TRIE子树; 表项添加模块 52 , 用于将路由表项添加到所述 TR I E子树;
保存模块 53 , 用于将所述 TRIE子树的顶点的提升子节点保存到所述主 干中, 所述 TRIE子树的高度小于或等于设置的高度阈值, 所述 TRIE子树的 顶点的提升子节点为所述 TRIE子树的顶点包括的前缀子节点中的子顶点。
具体地, 在路由表存储的数据结构中, 划分模块 51将路由表的数据结构 划分为主干和 TRIE子树, 采用 TRIE算法建立的 TRIE子树, 采用其他算法例 如: 范围匹配、 B树或三态内容寻址存储器等建立主干。 其中表项添加模块 52将路由表项添加到所述 TRI E子树后, 保存模块 53将 TRIE子树的顶点的 提升子节点保存在主干中, 且预先设置了高度阈值, TRIE子树的高度小于或 等于设置的高度阈值。 如果采用 TRIE算法建立的 TRIE子树, 在添加路由表 项例如: IP 地址前缀后的高度大于高度阈值, 则可以将添加路由表项后的 TRI E子树分裂, 将路由表的数据结构中的 TRIE子树的高度控制为高度阈值。 路由表的数据结构建立之后, 可能需要删除其中的路由表项, 删除一定的路 由表项之后, 如果删除路由表项后的 TRIE子树的高度小于或等于高度阈值, 将删除路由表项后的 TRIE子树与上一级 TRI E子树合并。 本实施例中建立路 由表的具体过程, 可以参见本发明路由表建立方法实施例中的相关描述。
本实施例由于路由表的数据结构分为主干和 TRIE子树, TRIE子树采用 TRIE算法建立, 因此可以保证路由表的高压缩率; 根据设定的高度阈值, 更 新模块可以控制 TRIE子树的高度, 因此减少了的访问存储器的次数, 提高了 查找速率, 降低了查找时延。
图 9为本发明路由表建立装置第二实施例的结构示意图, 如图 9所示, 在本发明路由表建立装置第二实施例的基石出上,路由表建立装置还可以包括: 分裂模块 54 , 用于若所述 TRIE子树添加路由表项后的高度大于所述高度阈 值, 则将所述 TRIE子树中高度大于所述高度阈值的分支从所述 TRIE子树分 裂, 得到新 TRIE子树;
此外, 保存模块 53 , 还用于将所述新 TRI E子树的顶点的提升子节点保 存到所述主干中, 所述新 TRIE子树的顶点为所述 TRIE子树中高度大于所述 高度阈值的分支、 与所述 TRIE子树的顶点连接的节点。
或者, 进一步地, 路由表建立装置还可以包括: 合并删除模块 56 , 用于 若所述 TRI E子树分裂后的高度小于所述高度阈值, 且所述 TRIE子树具有上 一级 TRIE子树, 将所述 TRIE子树的顶点合并到所述上一级 TRIE子树, 从所 述主干中删除所述 TR I E子树的顶点的提升子节点。 再进一步地, 合并删除模块 56还可以用于, 若所述 TRIE子树删除路由 表项后的高度小于所述高度阈值, 且所述 TRIE子树具有上一级 TRIE子树, 将所述 TR I E子树的顶点合并到上一级 TR I E子树,从所述主干中删除所述 TR I E 子树的顶点的提升子节点。
具体地, 在路由表存储的数据结构中, 划分模块 51可以预先将路由表的 数据结构划分为主干和 TRIE子树, TRIE子树的顶点的提升子节点保存在主 干中; 采用 TRIE算法建立 TRIE子树, 具体的建立 TRIE子树的方法可以参照 本发明路由表建立方法实施例的相关示例的描述,采用范围匹配、 B树或 TCAM 等方法建立 TRIE子树所在的主干。 表项添加模块 52将路由表项添加到所述 TRI E子树后, 保存模块 53将 TRIE子树的顶点的提升子节点保存在主干中, 且预先设置了高度阈值, TRIE子树的高度小于或等于设置的高度阈值。 在添 加路由表项时, 如果添加路由表项后的 TRI E 子树的高度大于设置的高度阈 值,分裂模块 54将所述 TRIE子树中高度大于所述高度阈值的分支从所述 TRI E 子树分裂, 得到新 TRIE子树。 如果分裂后的 TRIE子树的高度小于高度阈值, 且 TRIE子树具有上一级 TRIE子树, 合并删除模块 56将所述 TRIE子树的顶 点合并到所述上一级 TRIE子树, 从所述主干中删除所述 TRIE子树的顶点的 提升子节点。
路由表的数据结构建立之后, 可能需要删除其中的路由表项例如: IP地 址前缀, 删除一定的路由表项之后, 如果删除路由表项后的 TRIE子树的高度 小于或等于高度阈值, 且所述 TRIE子树具有上一级 TRIE子树, 合并删除模 块 56还可以用于: 将所述 TRIE子树的顶点合并到上一级 TRIE子树, 从所述 主干中删除所述 TR I E子树的顶点的提升子节点。
本实施例路由表的数据结构分为主干和 TRIE子树, TRIE子树采用 TRIE 算法建立, 因此可以保证路由表的高压缩率; 在添加路由表项时,分裂单元和 保存单元可以将大于高度阈值的 TRI E子树分裂;在删除路由表项时, 删除单 元和添加单元可以将高度小于高度阈值的 TRIE子树合并, 从而控制 TRIE子 树的高度, 减少了的访问存储器的次数, 提高了查找速率, 降低了查找时延。
图 10为本发明路由表查找装置第一实施例的结构示意图,如图 10所示, 该路由表查找装置包括:
主干查找模块 71 , 用于在路由表的的主干中, 查找与关键字最长匹配的 提升子节点, 所述路由表的数据结构包括主干和 TRIE子树, 所述 TRIE子树 的顶点的提升子节点保存在所述路由表的主干中;
子树位置获取模块 72 , 用于获取所述与关键字最长匹配的提升子节点对 应的 TRIE子树的顶点的位置;
子树查找模块 73 , 用于根据所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置, 在所述 TRIE子树中采用 TRIE算法查找所述关键字 对应的查找结果。
具体地, 路由表可以存储在层状的数据结构中, 路由表的数据结构包括 主干和 TRIE子树, TRIE子树的顶点的提升子节点保存到在所述主干中, 其 中, TRIE子树的顶点的提升子节点为所述 TRIE子树的顶点包括的前缀子节 点中的子顶点。 TRIE子树可以采用 TRIE算法建立, 主干的建立方法可以采 用但不限于范围匹配、 B树或三态内容寻址存储器等其他算法。 主干查找模 块 71在所述路由表的数据结构的主干中,可以查找与关键字最长匹配的提升 子节点;子树位置获取模块 72则可以根据与关键字最长匹配的提升子节点中 的地址信息, 获取对应的 TRIE子树的顶点位置; 子树查找模块 73根据与关 键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位置, 可以在对应的 TRIE子树中采用 TRIE算法查找到该关键字对应的查找结果。
本实施例路由表的数据结构分为主干和采用 TRIE算法建立的 TRIE子树, 可以保证路由表的高压缩率; 根据设置的高度阈值, 可以控制 TRIE子树的高 度, 因此在查找路由表时, 通过主干查找模块查找到的与关键字最长匹配的 提升子节点, 子树位置获取模块可以获取关键字对应的 TRIE子树位置, 然后 子树查找模块在对应的 TRIE子树中查找关键字对应的查找结果,可以减少访 问存储器的次数, 提高查找速率, 降低查找时延。
图 11为本发明路由表查找装置第二实施例的结构示意图,在本发明路由 表查找装置第一实施例的基础上, 如图 11所示, 该路由表查找装置的主干查 找模块 71包括:
第一前缀子模块 711 , 用于从保存在所述路由表的主干中的各个 TRIE子 树的提升子节点中, 查找与所述关键字匹配的各个第一前缀;
最长匹配子模块 712 , 用于从所述各个第一前缀中, 选取掩码长度最长 的第一前缀作为所述与关键字最长匹配的提升子节点。
进一步地, 子树查找模块 73包括:
第二前缀子模块 731 , 用于根据所述与关键字最长匹配的提升子节点对 应的 TRIE子树的顶点的位置,在所述与关键字最长匹配的提升子节点对应的 所述 TRIE子树各个节点的前缀子节点中,查找与所述关键字匹配的各个第二 前缀;
查找结果子模块 732 , 用于从所述各个第二前缀中, 选取掩码长度最长 的第二前缀作为所述查找结果。
具体地, 第一前缀子模块 711从保存在所述路由表的主干中的各个 TRIE 子树的提升子节点中, 查找与所述关键字对应的各个第一前缀后, 最长匹配 子模块 712 , 从各个第一前缀中选取掩码长度最长的第一前缀作为与关键字 最长匹配的提升子节点。子树位置获取模块 72根据与关键字最长匹配的提升 子节点获取对应的 TRIE子树的顶点的位置; 然后, 第二前缀子模块 731根据 与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置,在与关键字 最长匹配的提升子节点对应的所述 TRIE子树各个节点的前缀子节点中,查找 与所述关键字对应的各个第二前缀; 查找结果子模块 732从所述各个第二前 缀中选取掩码长度最长的第二前缀作为所述查找结果。
本实施例路由表的数据结构分为主干和采用 TRIE算法建立的 TRIE子树, 可以保证路由表的高压缩率; 根据设置的高度阈值, 可以控制 TRIE子树的高 度, 因此在查找路由表时, 在主干查找模块的各个子模块查找到的与关键字 最长匹配的提升子节点后,子树位置获取模块可以获取关键字对应的 TRIE子 树位置,然后子树查找模块的各个子模块在对应的 TRIE子树中查找关键字对 应的查找结果, 可以减少访问存储器的次数, 提高查找速率, 降低查找时延。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于计算机可读取 存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的 存储介质包括: R0M、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求
1、 一种路由表建立方法, 其特征在于, 包括:
将路由表的数据结构划分为主干和 TRIE子树;
将路由表项添加到所述 TRIE子树;
将所述 TRIE子树的顶点的提升子节点保存到所述主干中, 所述 TRIE子 树的高度小于或等于设置的高度阈值,所述 TRIE子树的顶点的提升子节点为 所述 TR I E子树的顶点包括的前缀子节点中的子顶点。
2、 根据权利要求 1所述的路由表建立方法, 其特征在于, 还包括: 若所述 TRIE 子树添加路由表项后的高度大于所述高度阈值, 则将所述
TRIE子树中高度大于所述高度阈值的分支从所述 TRIE子树分裂,得到新 TRIE 子树;
将所述新 TRIE子树的顶点的提升子节点保存到所述主干中,所述新 TRIE 子树的顶点为所述 TRIE子树中高度大于所述高度阈值的分支、 与所述 TRIE 子树的顶点连接的节点。
3、 根据权利要求 2所述的路由表建立方法, 其特征在于, 还包括: 若所述 TRIE子树分裂后的高度小于所述高度阈值, 且所述 TRIE子树具 有上一级 TRIE子树, 将所述 TRIE子树的顶点合并到所述上一级 TRIE子树, 从所述主干中删除所述 TRIE子树的顶点的提升子节点。
4、 根据权利要求 1所述的路由表建立方法, 其特征在于, 还包括: 若所述 TRIE子树删除路由表项后的高度小于所述高度阈值,且所述 TRIE 子树具有上一级 TRIE子树,将所述 TRIE子树的顶点合并到上一级 TRIE子树, 从所述主干中删除所述 TRIE子树的顶点的提升子节点。
5、根据权利要求 1-4任一所述的路由表建立方法,其特征在于,还包括: 采用 TRIE算法建立所述 TRIE子树, 采用范围匹配、 B树或三态内容寻 址存储器建立所述主干。
6、 一种路由表查找方法, 其特征在于, 路由表的数据结构包括主干和 TRIE子树, 所述 TRIE子树的顶点的提升子节点保存在所述路由表的主干中, 所述方法包括:
在所述路由表的主干中, 查找与关键字最长匹配的提升子节点; 获取所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置;
根据所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置, 在所述 TRIE子树中采用 TRIE算法查找所述关键字对应的查找结果。
7、 根据权利要求 6所述的路由表查找方法, 其特征在于, 所述在所述路 由表的主干中, 查找与关键字最长匹配的提升子节点, 包括:
从保存在所述路由表的主干中的各个 TRIE子树的提升子节点中,查找与 所述关键字匹配的各个第一前缀;
从所述各个第一前缀中, 选取掩码长度最长的第一前缀作为所述与关键 字最长匹配的提升子节点。
8、 根据权利要求 6或 7所述的路由表查找方法, 其特征在于, 所述根据 所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置,在所述 TRIE子树中采用 TRIE算法查找所述关键字对应的查找结果, 包括:
根据所述与关键字最长匹配的提升子节点对应的 TRIE 子树的顶点的位 置,在所述与关键字最长匹配的提升子节点对应的所述 TRIE子树各个节点的 前缀子节点中, 查找与所述关键字匹配的各个第二前缀;
从所述各个第二前缀中, 选取掩码长度最长的第二前缀作为所述查找结 果。
9、 一种路由表建立装置, 其特征在于, 包括:
划分模块, 用于将路由表的数据结构划分为主干和 TRIE子树;
表项添加模块, 用于将路由表项添加到所述 TRIE子树; 保存模块, 用于将所述 TRIE 子树的顶点的提升子节点保存到所述主干 中, 所述 TRIE子树的高度小于或等于设置的高度阈值, 所述 TRIE子树的顶 点的提升子节点为所述 TRIE子树的顶点包括的前缀子节点中的子顶点。
10、 根据权利要求 9所述的路由表建立装置, 其特征在于, 还包括: 分裂模块,用于若所述 TRIE子树添加路由表项后的高度大于所述高度阈 值, 则将所述 TRIE子树中高度大于所述高度阈值的分支从所述 TRIE子树分 裂, 得到新 TRIE子树;
所述保存模块,还用于将所述新 TRIE子树的顶点的提升子节点保存到所 述主干中, 所述新 TRIE子树的顶点为所述 TRIE子树中高度大于所述高度阈 值的分支、 与所述 TRIE子树的顶点连接的节点;
或者还包括:
合并删除模块, 用于若所述 TRIE子树分裂后的高度小于所述高度阈值, 且所述 TRIE子树具有上一级 TRIE子树,将所述 TRIE子树的顶点合并到所述 上一级 TRIE子树, 从所述主干中删除所述 TRIE子树的顶点的提升子节点。
11、 根据权利要求 10所述的路由表建立装置, 其特征在于, 所述合并删 除模块还用于, 若所述 TRIE子树删除路由表项后的高度小于所述高度阈值, 且所述 TRIE子树具有上一级 TRIE子树,将所述 TRIE子树的顶点合并到上一 级 TRIE子树, 从所述主干中删除所述 TRIE子树的顶点的提升子节点。
12、 一种路由表查找装置, 其特征在于, 包括:
主干查找模块, 用于在路由表的主干中, 查找与关键字最长匹配的提升 子节点, 所述路由表的数据结构包括主干和 TRIE子树, 所述 TRIE子树的顶 点的提升子节点保存在所述路由表的主干中;
子树位置获取模块, 用于获取所述与关键字最长匹配的提升子节点对应 的 TRIE子树的顶点的位置;
子树查找模块, 用于根据所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置, 在所述 TRIE子树中采用 TRIE算法查找所述关键字 对应的查找结果。
13、 根据权利要求 12所述的路由表查找装置, 其特征在于, 所述主干查 找模块包括:
第一前缀子模块,用于从保存在所述路由表的主干中的各个 TRIE子树的 提升子节点中, 查找与所述关键字匹配的各个第一前缀;
最长匹配子模块, 用于从所述各个第一前缀中, 选取掩码长度最长的第 一前缀作为所述与关键字最长匹配的提升子节点。
14、 根据权利要求 12或 13所述的路由表查找装置, 其特征在于, 所述 子树查找模块包括:
第二前缀子模块, 用于根据所述与关键字最长匹配的提升子节点对应的 TRIE子树的顶点的位置, 在所述与关键字最长匹配的提升子节点对应的所述 TRIE子树各个节点的前缀子节点中,查找与所述关键字匹配的各个第二前缀; 查找结果子模块, 用于从所述各个第二前缀中, 选取掩码长度最长的第 二前缀作为所述查找结果。
PCT/CN2010/071698 2010-04-12 2010-04-12 路由表建立方法和装置及路由表查找方法和装置 WO2011127642A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201080003601.8A CN102484610B (zh) 2010-04-12 2010-04-12 路由表建立方法和装置及路由表查找方法和装置
EP10849652.2A EP2560327B1 (en) 2010-04-12 2010-04-12 Routing table establishment method and device
PCT/CN2010/071698 WO2011127642A1 (zh) 2010-04-12 2010-04-12 路由表建立方法和装置及路由表查找方法和装置
US13/649,633 US20130034096A1 (en) 2010-04-12 2012-10-11 Routing table establishment method and device and routing table lookup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2010/071698 WO2011127642A1 (zh) 2010-04-12 2010-04-12 路由表建立方法和装置及路由表查找方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/649,633 Continuation US20130034096A1 (en) 2010-04-12 2012-10-11 Routing table establishment method and device and routing table lookup method and device

Publications (1)

Publication Number Publication Date
WO2011127642A1 true WO2011127642A1 (zh) 2011-10-20

Family

ID=44798251

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/071698 WO2011127642A1 (zh) 2010-04-12 2010-04-12 路由表建立方法和装置及路由表查找方法和装置

Country Status (4)

Country Link
US (1) US20130034096A1 (zh)
EP (1) EP2560327B1 (zh)
CN (1) CN102484610B (zh)
WO (1) WO2011127642A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017000892A1 (zh) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip路由查找
WO2017000893A1 (zh) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip路由查找

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9077669B2 (en) * 2010-06-14 2015-07-07 Dynamic Invention Llc Efficient lookup methods for ternary content addressable memory and associated devices and systems
JP5594171B2 (ja) * 2011-02-02 2014-09-24 富士通株式会社 通信処理装置、アドレス学習プログラムおよびアドレス学習方法
US8923298B2 (en) * 2012-05-04 2014-12-30 Futurewei Technoligies, Inc. Optimized trie-based address lookup
US9680747B2 (en) 2012-06-27 2017-06-13 Futurewei Technologies, Inc. Internet protocol and Ethernet lookup via a unified hashed trie
CN102739550B (zh) * 2012-07-17 2015-11-25 中山大学 基于随机副本分配的多存储器流水路由体系结构
US9491087B1 (en) * 2012-11-28 2016-11-08 The Arizona Board Of Regents On Behalf Of The University Of Arizona Devices and methods for forwarding information base aggregation
US9602407B2 (en) * 2013-12-17 2017-03-21 Huawei Technologies Co., Ltd. Trie stage balancing for network address lookup
US9355133B2 (en) 2014-05-07 2016-05-31 Red Hat Israel, Ltd. Offline compression for limited sequence length radix tree
WO2015188319A1 (zh) * 2014-06-10 2015-12-17 华为技术有限公司 一种查找装置、查找配置方法和查找方法
US20160301658A1 (en) * 2015-04-10 2016-10-13 X15 Software, Inc. Method, apparatus, and computer-readable medium for efficient subnet identification
US10558736B2 (en) * 2016-02-04 2020-02-11 Sap Se Metadata driven user interface layout control for web applications
CN109861908B (zh) * 2017-11-30 2022-06-28 迈普通信技术股份有限公司 一种路由转发方法及设备
JP7152636B2 (ja) * 2017-12-26 2022-10-13 国立大学法人京都大学 通信装置及び通信方法
CN111049746B (zh) * 2018-10-12 2022-04-22 华为技术有限公司 一种路由表项生成方法、字典树生成方法和装置
US20210036956A1 (en) * 2019-07-30 2021-02-04 Vmware, Inc. Identification of route-map clauses using prefix trees
CN112565072B (zh) * 2020-11-02 2022-08-09 鹏城实验室 一种路由表压缩方法、路由器及存储介质
CN112383145B (zh) * 2020-11-12 2022-09-02 山东鲁软数字科技有限公司 一种改善配电环网图成图效果的线路拆分方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787477A (zh) * 2004-12-09 2006-06-14 北京三星通信技术研究有限公司 IPv6路由表的查找方法
CN101141389A (zh) * 2007-09-29 2008-03-12 华为技术有限公司 增强多位Trie树查找方法和装置
CN101491015A (zh) * 2006-07-27 2009-07-22 佛罗里达大学研究基金公司 用于ip查找和更新的动态树位图

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6560610B1 (en) * 1999-08-10 2003-05-06 Washington University Data structure using a tree bitmap and method for rapid classification of data in a database
US7426518B2 (en) * 2003-03-28 2008-09-16 Netlogic Microsystems, Inc. System and method for efficiently searching a forwarding database that is split into a bounded number of sub-databases having a bounded size
US7706302B2 (en) * 2004-09-14 2010-04-27 Alcatel Lucent Optimization of routing forwarding database in a network processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787477A (zh) * 2004-12-09 2006-06-14 北京三星通信技术研究有限公司 IPv6路由表的查找方法
CN101491015A (zh) * 2006-07-27 2009-07-22 佛罗里达大学研究基金公司 用于ip查找和更新的动态树位图
CN101141389A (zh) * 2007-09-29 2008-03-12 华为技术有限公司 增强多位Trie树查找方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017000892A1 (zh) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip路由查找
WO2017000893A1 (zh) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip路由查找

Also Published As

Publication number Publication date
CN102484610A (zh) 2012-05-30
EP2560327B1 (en) 2014-06-04
EP2560327A4 (en) 2013-04-24
US20130034096A1 (en) 2013-02-07
CN102484610B (zh) 2015-01-21
EP2560327A1 (en) 2013-02-20

Similar Documents

Publication Publication Date Title
WO2011127642A1 (zh) 路由表建立方法和装置及路由表查找方法和装置
WO2017133344A1 (zh) 应用于dns查询的ip地址列表存储和查询方法
Waldvogel et al. Scalable high speed IP routing lookups
US7702630B2 (en) Longest prefix match lookup using hash function
US8625604B2 (en) Hash-based prefix-compressed trie for IP route lookup
US6553370B1 (en) Flexible search engine having sorted binary search tree for perfect match
KR100612256B1 (ko) 터너리 내용 주소화 메모리 관리 장치 및 그 방법
US20060083247A1 (en) Prefix lookup using address-directed hash tables
CN1784678A (zh) 用于高效地搜索被分成具有界大小的、有界数量的子数据库的转发数据库的系统和方法
JP3570323B2 (ja) アドレスに関するプレフィクスの格納方法
WO2015127721A1 (zh) 数据匹配的方法、装置及计算机存储介质
WO2013078644A1 (zh) 路由前缀存储方法、装置及路由地址查找方法、装置
CN106330716B (zh) Ip路由查找方法及装置
WO2007104204A1 (fr) Procédé de gestion de tableau routeur par la mémoire adressable à contenu ternaire
CN102045412A (zh) IPv6地址前缀压缩存储方法及设备
Wuu et al. A longest prefix first search tree for IP lookup
CN114884877B (zh) 一种哈希表和HOT相结合的IPv6路由查找方法
CN110995876B (zh) 一种ip存储与查找的方法及装置
WO2015192742A1 (zh) 一种查找装置、查找方法和配置方法
TWI239476B (en) Address search
CN106656816B (zh) 分布式ipv6路由查找方法和系统
KR100999408B1 (ko) 해시트리를 이용한 url 검색방법
CN109754021B (zh) 基于范围元组搜索的在线包分类方法
CN106302178B (zh) 一种路由查询方法及装置
KR100420957B1 (ko) 클래스 분할 기법을 이용한 라우팅 테이블 자료구조,라우팅 테이블을 이용한 라우팅 경로 검색방법 및 장치

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080003601.8

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10849652

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010849652

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE