This application is related to U.S. application Ser. No. 11/184,243, filed Jul. 19, 2005, and U.S. application Ser. No. 11/374,622, filed Mar. 13, 2006, the disclosures of which are hereby incorporated herein by reference.
The present invention relates to integrated circuit devices and, more particularly, to integrated circuit search engine devices and methods of operating same.
Linear sorting techniques may be utilized to arrange a plurality of search prefixes (a/k/a search “keys”) within an integrated circuit search engine device. One such linear sorting technique is based on the starting address of a prefix range associated with each search prefix. In the event a plurality of the search prefixes have the same starting address but different prefix lengths, then a search prefix with a shorter prefix length may be treated as “less than” a search prefix with a longer prefix length. One example of a plurality of 8-bit search prefixes is illustrated by TABLE 1.
The search prefixes in TABLE 1 may be sorted linearly as shown in
This search operation is an iterative process, with each search prefix being compared in sequence with the applied search key. As illustrated by
Conventional network routing applications may also utilize tree data structures to support search operations within an integrated circuit device. These tree data structures may include b-tree structures that are kept balanced to prevent one or more branches of the tree from becoming longer than other branches of the tree and thereby increasing search latency.
As illustrated by the highlighted search path, a search of the b-tree using 171 as a search key begins at Node 0-0. The search prefix J at Node 0-0 represents a match with the search key 171 because 171 (i.e., 10101011b) is a match with 128/2 (i.e., 10XXXXXX), where X represents a “don't-care” value. The search then proceeds to Node 1-1 (i.e., along a right-side branch from Node 0-0 to Node 1-1) because 171 is greater than 128. No matches are present at Node 1-1 because the search key 171 (i.e., 10101011b) does not match either the search prefix R:170/8 (10101010b) or the search prefix H:224/3 (i.e., 111XXXXX). Because the search key 171 is greater than 170 and less than 224, the search then proceeds to and terminates at Node 2-5, which is a leaf node of the b-tree 30. None of the search prefixes U:192/2, G:192/3 or K:208/5 at Node 2-5 represent a match with the search key 171. Thus, based on the illustrated search path, which traverses Nodes 0-0, 1-1 and 2-5 of the b-tree 30, only search prefix J:128/2 represents a matching entry with the search key 171. However, as illustrated best by
Another example of a b-tree data structure is described in U.S. Pat. No. 6,490,592, which is assigned to Nortel Networks Limited. As described at Col. 1 of the '592 patent, conventional b-tree data structures may not be well suited for search operations that require identification of longest prefix matches (LPMs) within the b-tree data structure. To address this limitation, the '592 patent describes a modified b-tree data structure that is arranged so that data elements stored therein, which have no overlapping prefixes, are arranged in a standard b-tree structure. However, other data elements that have overlapping prefixes are arranged in a modified structure so that the prefix of such a data element contains the prefixes of all such data elements that succeed it in the b-tree. This modified structure is referred to as an L-structure. FIG. 3 of the '592 patent shows portions 300 and 340 that comprise a b-tree into which an L-structure 320 is inserted. Unfortunately, the use of L-structures within a b-tree may represent a form of prefix nesting that reduces a likelihood of achieving preferred b-tree properties that can reduce search latency and result in efficient utilization of memory space. In particular, for a fixed memory capacity and latency, which is related to tree height, the number of search prefixes that can be supported within the b-tree of the '592 patent is statistically dependent on the degree of nesting within the prefix data set supported by the b-tree. Accordingly, prefix data sets that require a high degree of nesting may result in an inefficient utilization of the memory space that is required to maintain the b-tree.
An additional type of b-tree data structure includes a b*tree data structure, which can require non-root nodes to be at least ⅔ full at all times. To maintain this fill requirement, a sibling node is not immediately split whenever it is full. Instead, keys are first shared between sibling nodes before node splitting is performed. Only when all sibling nodes within a group are full does a node splitting operation occur upon insertion of a new search key.
Some embodiments of the invention include methods of updating a b-tree data structure (e.g., b*tree data structure) using search key insertion and deletion operations that proceed from respective known states (e.g., respective canonical forms). These insertion operations include inserting a first search key into the b-tree by reconfiguring (e.g., pre-processing) a plurality of sibling nodes of the b-tree into a predetermined overloaded form having a shape that is independent of a value of the first search key to be inserted therein. An operation is then performed to split the sibling nodes by redistributing the first and other search keys among an expanded plurality of the sibling nodes. These insertion operations use a process that trades off possibly performing additional memory accesses (e.g., to shift search keys (and/or handles or pointers) to the predetermined overloaded form) for the certainty that the same key movements are ultimately performed during operations to split sibling nodes. The logical state reduction realized by having to deal with only a single split format results in design simplification and consequently reduces design time and verification effort because of the less varied logic required to implement the design and the reduced number of test cases needed to fully verify the design.
In addition, the deletion operations include deleting a second search key from the b-tree by reconfiguring the plurality of sibling nodes into a predetermined underloaded form having a shape that is independent of a value of the second search key to be omitted therefrom. This underloaded form includes a sibling node at a minimum fill level less one. An operation is then performed to merge the plurality of sibling nodes by redistributing remaining search keys among a reduced plurality of the sibling nodes. Like the case with the insertion operations, the deletion operations use a process that trades off possibly performing additional memory accesses (e.g., to shift search keys (and/or handles or pointers) to the predetermined underloaded form) for the certainty that the same key movements are ultimately performed during operations to merge sibling nodes.
Still further embodiments of the invention include an integrated circuit search engine having a hardware implemented b-tree of search keys therein and at least one maintenance engine for controlling, among other things, insert and delete operations within the b-tree. The maintenance engine, which is electrically coupled to the hardware implemented b-tree of search keys, is configured to insert a first search key into the b-tree by reconfiguring a plurality of sibling nodes of the b-tree into an overloaded form having a shape that is independent of a value of the first search key inserted therein and then performing a split operation on the plurality of sibling nodes by redistributing the first and other search keys among an expanded plurality of the sibling nodes. The maintenance engine is also configured to delete a second search key from the b-tree by reconfiguring the plurality of sibling nodes into an underloaded form having a shape that is independent of a value of the second search key omitted therefrom. The maintenance engine then performs a merge operation on the plurality of sibling nodes by redistributing remaining search keys among a reduced plurality of the sibling nodes.
The present invention now will be described more fully with reference to the accompanying drawings, in which preferred embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. For example, although a pipelined b-tree implementation is disclosed herein (see, e.g.,
According to embodiments of the invention, the operations to split the sibling nodes within the b*tree are preceded by operations to pre-process the shape of the b*tree into a canonical form, which is shown as an overloaded form. This overloaded form is shown as overloading the leftmost sibling node to a level of M+1, where M is the maximum number of keys per node in the b*tree. The sibling node immediately adjacent the leftmost sibling node is loaded to a level of M and the remaining N−2 sibling nodes on the right side are also loaded to levels of M. In alternative embodiments of the invention, a sibling node other than the leftmost sibling node may be processed into an overloaded form for insert cases, with the remaining sibling nodes being allocated with M search keys. Thus, the location of the sibling node that is pre-processed into an overloaded form is arbitrary from a logic design standpoint. Nonetheless, the location must remain consistent to achieve the desired reductions in state machine complexity that are associated with processing insert instructions, which are received by a search engine device containing a hardware implemented b-tree of search keys.
One example of the operations illustrated by
Another example of the operations illustrated by
Moreover, as illustrated by
According to these embodiments, the operations to merge the sibling nodes within the b*tree are preceded by operations to pre-process the shape of the b*tree into a canonical form, which is shown as an underloaded form. This underloaded form is shown as including a rightmost sibling node that is filled to a minimum level less one (i.e., ((M(N/(N+1))−1). Thus, as illustrated by the b*tree of
A table maintenance engine 62 is also provided, which contains a plurality of sub-engines that integrate with corresponding ones of the four pipeline stages 70a-70d and the handle lookup stage 80. This table maintenance engine 62 performs operations including the search key insertion and deletion operations described with respect to
The table maintenance engine 62 receives search keys and commands on behalf of the search engine device 60 and forwards search commands to the table configuration circuit 64. The table maintenance engine 62 also queues up any key insert and delete (update) commands it receives for processing because key insertion and deletion typically cannot be completed in a simple single pass through the search engine pipeline. When idle command cycles indicate there are memory access opportunities available to perform table maintenance accesses on the memories (L0, L1, L2, L3) within each pipeline stage 70a-70d and the handle memory 82 within the handle lookup stage 80, the maintenance engine 62 performs maintenance accesses corresponding to portions of a key insert or delete request. The maintenance engine 62 processes one insert or delete request at a time and manages search memory node allocation to thereby allocate free nodes when needed to process key inserts and returning freed nodes to a pool when freed during deletes. To ensure search coherency and permit searching while the maintenance engine 62 processes a key update, the maintenance engine 62 makes a copy of nodes that must be modified while processing updates and only modifies these “temporary” copies. Once all node copies have been modified at all necessary levels for a key update, the maintenance engine 62 updates pointers in all necessary search levels to point to the modified node copies it was working on and reclaims the original nodes, which were copied, for future use. These pointers are updated in a manner that preserves search coherency on every lookup.
Once all temporary node copies at all levels have been properly updated, a special command is executed within the pipeline of stages to thereby cause each level of the b-tree to point to the node copies and reclaim the nodes that are being replaced. This update process propagates through the pipeline across all level at the same speed as a search command. Accordingly, all searches that enter the pipeline before the special command will search against a database before any changes pertaining to the update are applied, but any searches that enter the pipeline after the special command will search against a database that appears to have been instantly and completely modified to reflect the update.
The table configuration circuit 64 receives search commands from the maintenance engine 62, which include a table ID for the table to be searched. The table configuration circuit 64 then maps the table ID, corresponding to a unique b-tree within the search engine device 60, to a root tree node pointer in the Level 0 block 70a. The table configuration circuit 64 then forwards this pointer to the Level 0 block 70a instructing it to perform a search starting at the root node pointed to by the root tree node pointer.
Each of the Level 0, Level 1 and Level 2 blocks 70a-70c corresponds to one of the upper three levels of an SPM b-tree, which is described more fully in U.S. application Ser. No. 11/184,243, filed Jul. 19, 2005. Each level receives a search key, a sub-tree pointer and an indication of the best match found by the previous levels in the search. In the case of the Level 0 block 70a, which can only represent the root level in the b-tree, this best match indication is always null. A Level 0, Level 1 or Level 2 block reads a search node from its node storage based on the sub-tree pointer it receives and buffers it in a set of flip-flops within its respective row buffer sub-block. Each node stores a set of keys, SPM bit-masks and sub-tree pointers. The comparator sub-block compares the search key to all of the keys and the SPM bit-masks read from the node storage sub-block and determines the best match for the search key, if any, and also determines which of the node's sub-tree pointers the search should follow for the next level of the search. The Level 0, Level 1 or Level 2 block forwards the sub-tree pointer it finds to the next lower level block along with the search key. If the next lower level block finds a new best match, then this best match for the search key is forwarded to the next lower level search stage. However, if no new best match is found, then the best match from the previous higher stage is forwarded to the next stage.
The Level 4 block corresponds to the leaf level of the SPM b-tree. It receives a search key, sub-tree pointer and any indication of a best match from the previous levels in the search. The Level 4 block reads a search node from its node storage based on the sub-tree pointer that it receives and buffers it in a set of flip-flops within its row buffer sub-block. The comparator sub-block compares the search key to all of the keys read from the node storage sub-block and determines a best match, if any. If the Level 4 block finds a new best match for the search key, then it forwards its own best match as the handle pointer to the handle lookup block 80. Otherwise, if no new best match is found, then the best match received from the prior stage is passed as the handle pointer.
The handle lookup block 80 receives an indication of the best match found by the Level 0-Level 3 search stages 70a-70d and uses the best match as an index to lookup a search result handle in the handle memory 82. In response to the index, the handle memory 82 outputs a retrieved handle as the result handle (i.e., the search result).
In the drawings and specification, there have been disclosed typical preferred embodiments of the invention and, although specific terms are employed, they are used in a generic and descriptive sense only and not for purposes of limitation, the scope of the invention being set forth in the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4606002 | Waisman et al. | Aug 1986 | A |
5228115 | Natarajan | Jul 1993 | A |
5261088 | Baird et al. | Nov 1993 | A |
5430869 | Ishak et al. | Jul 1995 | A |
5446887 | Berkowitz | Aug 1995 | A |
5475837 | Ishak et al. | Dec 1995 | A |
5560007 | Thai | Sep 1996 | A |
5644763 | Roy | Jul 1997 | A |
5666494 | Mote, Jr. | Sep 1997 | A |
5758356 | Hara et al. | May 1998 | A |
5787430 | Doeringer et al. | Jul 1998 | A |
5812996 | Rubin et al. | Sep 1998 | A |
5813000 | Furlani | Sep 1998 | A |
5822749 | Agarwal | Oct 1998 | A |
5897655 | Mallick | Apr 1999 | A |
5918245 | Yung | Jun 1999 | A |
5924115 | Von Herzen et al. | Jul 1999 | A |
6098150 | Brethour et al. | Aug 2000 | A |
6115792 | Tran | Sep 2000 | A |
6138123 | Rathbun | Oct 2000 | A |
6219662 | Fuh et al. | Apr 2001 | B1 |
6389507 | Sherman | May 2002 | B1 |
6401117 | Narad et al. | Jun 2002 | B1 |
6404752 | Allen, Jr. et al. | Jun 2002 | B1 |
6421730 | Narad et al. | Jul 2002 | B1 |
6430527 | Waters et al. | Aug 2002 | B1 |
6441053 | Klein et al. | Aug 2002 | B1 |
6460112 | Srinivasan et al. | Oct 2002 | B1 |
6460120 | Bass et al. | Oct 2002 | B1 |
6480839 | Whittington et al. | Nov 2002 | B1 |
6490592 | St. Denis et al. | Dec 2002 | B1 |
6522632 | Waters et al. | Feb 2003 | B1 |
6526055 | Perlman et al. | Feb 2003 | B1 |
6532457 | Tal et al. | Mar 2003 | B1 |
6535491 | Gai et al. | Mar 2003 | B2 |
6539369 | Brown | Mar 2003 | B2 |
6553370 | Andreev et al. | Apr 2003 | B1 |
6564211 | Andreev et al. | May 2003 | B1 |
6611832 | van Lunteren | Aug 2003 | B1 |
6633865 | Liao | Oct 2003 | B1 |
6636849 | Tang et al. | Oct 2003 | B1 |
6636956 | Venkatachary et al. | Oct 2003 | B1 |
6662287 | Andreev et al. | Dec 2003 | B1 |
6691124 | Gupta et al. | Feb 2004 | B2 |
6694323 | Bumbulis | Feb 2004 | B2 |
6697276 | Pereira et al. | Feb 2004 | B1 |
6707693 | Ichiriu | Mar 2004 | B1 |
6757779 | Nataraj et al. | Jun 2004 | B1 |
6768739 | Kobayashi et al. | Jul 2004 | B1 |
6778530 | Greene | Aug 2004 | B1 |
6831850 | Pereira et al. | Dec 2004 | B2 |
6839800 | Stark | Jan 2005 | B2 |
6859455 | Yazdani et al. | Feb 2005 | B1 |
6934795 | Nataraj et al. | Aug 2005 | B2 |
6941314 | Andreev et al. | Sep 2005 | B2 |
6944709 | Nataraj et al. | Sep 2005 | B2 |
7007027 | Najork et al. | Feb 2006 | B2 |
7016904 | Grove et al. | Mar 2006 | B1 |
7017021 | Gupta et al. | Mar 2006 | B2 |
7023807 | Michels et al. | Apr 2006 | B2 |
7035844 | Andreev et al. | Apr 2006 | B2 |
7047317 | Huie et al. | May 2006 | B1 |
7076602 | Stark et al. | Jul 2006 | B2 |
7107263 | Yianilos et al. | Sep 2006 | B2 |
7231373 | Kidd et al. | Jun 2007 | B2 |
7231383 | Andreev et al. | Jun 2007 | B2 |
7257530 | Yin | Aug 2007 | B2 |
7289979 | Wilson | Oct 2007 | B2 |
7292162 | Somasundaram | Nov 2007 | B2 |
7383276 | Lomet | Jun 2008 | B2 |
7426518 | Venkatachary et al. | Sep 2008 | B2 |
7437354 | Venkatachary et al. | Oct 2008 | B2 |
7571156 | Gupta et al. | Aug 2009 | B1 |
20020089937 | Venkatachary et al. | Jul 2002 | A1 |
20020146009 | Gupta et al. | Oct 2002 | A1 |
20020152413 | Waters et al. | Oct 2002 | A1 |
20020161969 | Nataraj et al. | Oct 2002 | A1 |
20030009453 | Basso et al. | Jan 2003 | A1 |
20030009466 | Ta et al. | Jan 2003 | A1 |
20030093613 | Sherman | May 2003 | A1 |
20030093646 | Stark | May 2003 | A1 |
20030123397 | Lee et al. | Jul 2003 | A1 |
20030123459 | Liao | Jul 2003 | A1 |
20030163302 | Yin | Aug 2003 | A1 |
20040030686 | Cardno et al. | Feb 2004 | A1 |
20040059731 | Yianilos et al. | Mar 2004 | A1 |
20040083336 | Stark et al. | Apr 2004 | A1 |
20040109451 | Huang et al. | Jun 2004 | A1 |
20040139274 | Hui | Jul 2004 | A1 |
20040170379 | Yao et al. | Sep 2004 | A1 |
20040193619 | Venkatachary et al. | Sep 2004 | A1 |
20040205229 | Stojancic | Oct 2004 | A1 |
20040249803 | Vankatachary et al. | Dec 2004 | A1 |
20050091443 | Hershkovich et al. | Apr 2005 | A1 |
20050131867 | Wilson | Jun 2005 | A1 |
20050163122 | Sahni et al. | Jul 2005 | A1 |
20060259682 | Somasundaram | Nov 2006 | A1 |
20070276648 | Andreev et al. | Nov 2007 | A1 |
Number | Date | Country |
---|---|---|
WO2004088548 | Oct 2004 | WO |