The Internet is a set of networks connected by routers. A router maintains a routing table that indicates for each possible destination network, the next hop to which a received data packet should be forwarded. The next hop may be another router or the final destination.
An Internet Protocol (“IP”) data packet received at a port in a router includes an IP destination address. The IP destination address is the final destination of the IP data packet. Currently there are two versions of IP, IP version 4 (“IPv4”) and IP version 6 (“IPv6”). IPv4 provides a 32-bit field in an IP header included in the data packet for storing the IP destination address. IPv6 provides a 128-bit field for storing the IP destination address. The router forwards a received data packet connected to a next-loop router or the final destination if the destination is the local network, dependent on the IP destination address stored in the IP header.
A 32-bit IPv4 destination address provides 4 billion possible routes or destinations. An Internet router typically stores a next hop for 50,000 of the 4 billion possible routes or destinations. However, the number of stored routes will increase with the growth of the Internet and the widespread use of IPv6.
Originally, the IP address space was divided into three classes of IP addresses; A, B and C. Each IP address space was divided into a network address and a host address. Class A allowed for 126 networks and 16 million hosts per network. Class B allowed for 16382 networks with 64,000 hosts per network and class C allowed for 2 million networks with 256 hosts per network. However, dividing the IP address space into different classes reduced the number of available IP addresses. Class C only allowed a maximum of 256 hosts per network which is too small for most organizations. Therefore, most organizations were assigned a Class B address, taking up 64,000 host addresses which could not be used by other organizations even if they were not used by the organization to which they were assigned. Hosts in an organization with a Class B IP address all store the same network address in the 16 Most Significant Bits (“MSBs”), for example, 128.32.xx.xx.
Classless InterDomain Routing (“CIDR”) was introduced to free up unused IP host addresses. The remaining unused networks are allocated to organization in variable sized blocks. An organization requiring 500 addresses gets 500 continuous addresses. For example, an organization can be assigned 500 available addresses starting at 128.32.xx. The number of routes stored by a router has increased since the introduction of Classless InterDomain Routing. Classless InterDomain Routing requires longest prefix matching to find the corresponding route instead of searching for a matching network address in order to find the corresponding next hop for the IP destination address. For example, a search can no longer stop after the 16 MSBs of a Class B IP address, for example, 128.xx.xx because 128.32.4.xx may be assigned to another organization requiring a different next hop.
One method for searching for a longest prefix match for a search key is through the use of a binary tree search. A binary tree search matches a 32-bit input, bit by bit, down to 32 levels, requiring 32 searches to finding an entry matching a 32-bit search key. Another method for searching for a match is through the use of a Patricia tree. A Patricia tree reduces the number of searches required if there are no entries down a leaf of the binary tree.
Yet another method for efficiently searching for a next hop associated with an IP destination address is described in PCT application Serial Number PCT/SE98/00854 entitled “Method and System for Fast Routing Lookups” by Brodnick et al. filed on May 11, 1998. The method described by Brodnick reduces the number of next hops stored by not storing duplicate routes. By reducing the number of next hops, the memory requirement is reduced so that a route lookup table can be stored in fast cache memory.
Brodnick et al. divides the 32-bit binary tree into 3-levels. Dividing the binary tree into 3-levels reduces the number of searches for an entry matching a 32-bit search key to three. The indexed entry in the first level indicates whether the search can end at the first level with the route taken from the entry, or the search must continue to a subsequent level using a further portion of the IP destination address.
The array of code words 36, array of base indexes 34 and map table 40 are used to select a pointer in an array of pointers (not shown). The pointer stores a route index or an index to perform a further search.
A group of pointers in the array of pointers is selected by selecting a code word 46 in the array of code words 36 and a base index 42 in the array of base indexes 34. The code word 46 is selected using the first 12 bits 50 of the IP address 38. The base index 42 is selected using the first 10 bits 48 of the IP address 38. The correct pointer in the group of pointers is selected using the map table 32.
The 10-bit value 46b in the selected code word 36 is an index into the map table 32. The map table 32 maps bit numbers within a bit-mask to 4-bit offsets. The offset specifies the pointer within the selected group of pointers in the array of pointers. The 10-bit value 46b selects the row in the map table 32 and bits 19:16 of the IP address 52 selects the 4-bit offset 54.
Thus, a search for a pointer requires the following cache memory accesses: (1) read a 16 bit code word 46; (2) read a 16-bit base address 42; (3) read a 4 bit offset 54 from the map table 32; (4) read a pointer at a pointer index where the pointer index is the sum of the base address 42, the code word offset 46a and the 4-bit offset 54.
The same memory accesses are required for each level of the binary tree. Thus, a search of three levels for a 32-bit IPv4 address requires 12 memory accesses. As many as forty-eight memory accesses can be required to perform a longest prefix search for a 128-bit IPv6 address.
U.S. patent application Ser. No. 09/733,627 entitled “Method and Apparatus for Longest Match Address Lookup,” filed Dec. 8, 2000 by David A. Brown describes a lookup table for performing multiple level searches with portions of a search key in successive mappers, entries in the mappers outputting route indexes or providing partial indexes to subsequent mappers. The length of the search key is limited by the number of search levels in the lookup table.
In accordance with the invention, a longest prefix match lookup table allows searching with longer search keys including search keys of different lengths such as the 32-bit IPv4 and 128 IPv6 addresses. The lookup table includes a plurality of mappers. The mappers are indexed by portions of a search key and partial indexes, to output a route index for the search key or to output partial indexes to subsequent mappers. The lookup table also includes a partial index feedback loop by which a mapper is indexed in multiple passes with multiple portions of the search key.
The route index corresponding to the search key is stored in a single location in one of the plurality of mappers. The length of the search key is variable. The search key may include a 32-bit IPv4 address or a 128 IPv6 address. If the search key includes a 32-bit IPv4 address, the route index corresponding to the search key is found within a first search of the plurality of mappers. With a 128-bit IPv6 address, the route index may be found within a first search of the mappers or in a subsequent search through the mappers. The partial index may be a subtree index.
The foregoing and other objects, features and advantages of the invention will be apparent from the following more particular description of preferred embodiments of the invention, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.
A description of preferred embodiments of the invention follows.
The single lookup table 100 stores route indexes for both IPv4 and IPv6 addresses. A single search of the lookup table for the 32-bit IPv4 address results in a route index 102 corresponding the longest prefix match for the 32-bit IPv4 address stored in the lookup table 100. The resulting route index is forwarded as mapper data 102 to the forwarding engine 108.
A 128-bit IPv6 address is longer than the 40-bit mapper key 110. Thus, multiple searches of the lookup table 100 are required. Typically, there are more route indexes for IPv4 addresses stored in a router than for IPv6 addresses. The length of the mapper key 110 is therefore selected such that a search for a route index corresponding to a 32-bit IPv4 address can be performed in a single search cycle. Thus, only infrequent searches for route indexes corresponding to 128-bit IPv6 addresses require multiple multi-level searches of the lookup table 100.
The multi-level search of the lookup table 100 is described in patent application U.S. patent application Ser. No. 09/733,627 filed on Dec. 8, 2000 entitled “Method and Apparatus for Longest Match Address Lookup,” by David A. Brown incorporated herein by reference in its entirety.
The mapper data 102 forwarded to the forwarding engine 108, at the end of each search of the lookup table 100, indicates whether a further search cycle is required. The mapper data 102 includes a route index (a next hop or destination) corresponding to the search key 104 or a partial index for a further search for the route index.
To request a further search in the multi-level lookup table 100, the forwarding engine 108, forwards the next 24-bits of the search key 104 in the Least Significant Bits (“LSBs”) of the mapper key 110. The forwarding engine 108 also forwards a “search again internal” command on the command bus 112. The lookup table 100 performs a multi-level search dependent on the result of the previous search and the 24 Least Significant Bits (“LSBs”) of the mapper key 110. The forwarding engine 108 continues to forward subsequent 24-bits of the search key 104 until the corresponding route index is returned by the lookup table 100. By providing multiple search capability for a search key 104, the lookup table 100 can store route indexes for search keys 104 longer than the mapper key 110.
In the first search of the lookup table 100, the most significant 40-bits of the search key 104 are forwarded by the forwarding engine 108 to the lookup table 100 with a “search” command forwarded on the command bus 112. Subsequent searches are requested with a “search again internal” command forwarded on the command bus 112. If the command is a “search”, the mapper key 110 stores the 40 MSBs of the search key 104. If the command is “search again internal”, the mapper key 110 stores the next 24-bits of the search key 104. Typically, most IP addresses received by a router are 32-bit IPv4 addresses for which the lookup table 100 provides the corresponding next hop or destination after a single search of the lookup table 100.
The 64-bit search key 104 (
L1 mapper 206a is a direct mapped mapper and stores a route index or a subtree index for the L2 mapper 206b. The subtree index is a partial index for a location in the next mapper 206d. The L1 mapper 206a has 216 locations, one for each of the 216 nodes in the first mapper level 114a (
The result of the second level search is provided on L2 mapper entry data 220b and forwarded to the pipeline 208 and to the L3 indirect mapper 206c. A third level search is performed in the L3 indirect mapper 206c dependent on the next eight bits of the key 210c and the partial index stored in the L2 mapper entry data 220b.
The result of the search is provided on L3 mapper entry data 220c to the pipeline 208 and to the LA indirect mapper 206d. The L3 mapper entry data 220c determines if a fourth search is performed in the L4 indirect mapper 206d dependent on the last eight bits of the key 210d and the L3 mapper entry data 220c.
The result of the fourth search is provided on L4 mapper entry data 220d. The route index 102 associated with the longest prefix match for search key 104 is stored in only one location in one of the mappers 206a-d. If the route index is stored in one of the mappers 206a-d, for example, mapper 206b a search of the remaining mappers 206c-d is not necessary and mappers 206c-d are not accessed. The pipeline 208 selects the route index 102 included in one of the mapper entry data 220a-d. For example, the Most Significant Bit (“MSB”) of the mapper entry data 220a-d can provide an indication of whether a route index is included.
By using a pipeline 208 in conjunction with the mappers 206a-d, multiple searches of the longest match prefix table 100 with different mapper keys 110 can be performed in parallel. The pipeline 208 allows multiple searches of the lookup table 100 to take place in parallel by storing the mapper entry data 220a-d for each mapper 206a-d associated with the 40-bit mapper key 110 until a search of each of the other mappers 206a-d has been completed, if required, to find route index corresponding to the 40-bit mapper key 110.
Instead of performing 16 separate bit by bit searches for the first 16 bits of the mapper key 110, the route indexes or subtree indexes associated with the first 16-bits of the mapper key 110 are stored in L1 mapper 206a. The L1 mapper 206a is directly indexed with the first 16 MSBs of the mapper key 110. The next mapper 206b is searched dependent on whether the previous mapper 206a stores the route index used to access the next hop information associated with the mapper key 110.
Returning to
The value of any node in the tree can be determined by tracing a path from the root 118. Each node in the binary tree is shown with two children, a right child and a left child. The right child is chosen if the parent node is ‘1.’ The left child is chosen if the parent node is ‘0’. Tracing the path from the root 118 to node 116, r1 is stored as the route index in the L1 mapper 206a (
The L1 mapper 206a (
Each location in the L1 mapper 206a (
If the search of mapper 206b is to continue in mapper level_5, the forwarding engine 108 (
Subtree indexes and route indexes for nodes in level_5114e (
Thus, the route index for node labeled h2 in level_7114g (
Returning to
Continuing with
The pointers field 408 is 256 bits wide to allow for the storage of sixteen 16-bit pointers, with each pointer storing the base address for 16 contiguous mapper entries in the subtree mapper 502, to provide access to the 256 route indexes. Thus, the pointers field 408 can indirectly provide a pointer to a mapper entry in the subtree mapper 502 for each node in the bottom level of the subtree. The data field 406 and pointers field 418 are described in U.S. patent application Ser. No. 09/733,627 entitled “Method and Apparatus for Longest Match Address Lookup,” filed Dec. 8, 2000 by David A. Brown incorporated herein by reference in its entirety. The subtree mapper 502 is described in co-pending U.S. patent application Ser. No. 09/886,649, filed on even date herewith, entitled “Method and Apparatus for Logically Expanding the Width of Memory” by David A. Brown incorporated herein by reference in its entirety.
The subtree data stored in the dense subtree descriptor in the data field 406 and the subtree pointer stored in the pointers field 408 are forwarded to the index generator 504. The index generator 504 also receives the next eight bits of the mapper key 210b.
The index generator 504 determines the mapper address 512 of the mapper entry associated with the node in the bottom level of the subtree dependent on the next eight bits of the mapper key 210b, and the subtree entry 510 associated with the subtree. The subtree entry 510 includes the subtree data field 406 and subtree pointers field 408 storing subtree data and subtree pointers for the subtree selected by the L1 mapper entry data 220a. The mapper address 512 selects the mapper entry in the subtree mapper 502. The subtree mapper 502 includes the same types of mapper entries as described in conjunction with
The next eight bits of the mapper key 210b selects the node in the bottom level of the selected subtree. The subtree pointers select the base address associated with the node in the subtree and the subtree data selects the offset within the block of mapper entries associated with the base address.
The pointer generator 506 generates the L2 mapper entry data 220b to be forwarded to the L3 indirect mapper 206c (
The lookup table 100 (
At step 600, the lookup table 100 (
At step 602, the lookup table 100 (
At step 604, the lookup table 100 (
At step 606, the lookup table 100 (
At step 608, the search of the previous mapper 206a-d (
At step 610, the lookup table 100 searches the next mapper 206b-d (
At step 612, the result of the multi-level search in the lookup table 100 (
At step 614, in a subsequent search, the lookup table 100 (
The invention has been described for a 64-bit search key. The lookup table can store route indexes for variable length search keys. For example, a 208-level search for a route index corresponding to a 208-bit search key 104 can be performed in eight searches of the lookup table 100. The first search is performed for a match for the first 40-bits of the search key 104. The next searches are performed based on the result of the previous search of the lookup table 100 and the next sequential 24-bits of the search key 104.
The lookup table can provide route indexes corresponding to a search key that is longer than the lookup table's mapper key by performing multiple searches of the multi-level lookup table. Multiple searches of the lookup table 100 requires more search cycles. However, the same lookup table 100 can provide a route index for a search key that is the same length as the mapper key in a single search cycle, and can also provide a route index for a search key that is longer than the mapper key. Thus, route indexes for search keys of varying lengths can be stored in the same look up table, for example, 32-bit IPv4 addresses and 128-bit IPv6 addresses. The lookup table can provide a route index for an IPv4 address in a single search cycle and a route index for an IPv6 address after one or more search cycles. In a router in which the majority of IP addresses received are 32-bit IPv4 addresses, searches for a route indexes corresponding to a 128-bit IPv6 address are infrequent. Thus, the benefit of having a single lookup table which stores route indexes for both IPv4 and IPv6 addresses compensates for the longer search time for infrequent searches for route indexes corresponding to IPv6 addresses.
While this invention has been particularly shown and described with references to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the invention encompassed by the appended claims.
This application claims the benefit of U.S. Provisional Application Nos. 60/212,966 filed on Jun. 21, 2000, 60/258,436 filed on Dec. 27, 2000, and 60/294,387 filed on May 30, 2001. The entire teachings of the above applications are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
3716840 | Masten et al. | Feb 1973 | A |
4450525 | Demuth et al. | May 1984 | A |
4661658 | Matyas | Apr 1987 | A |
5202986 | Nickel | Apr 1993 | A |
5329618 | Moati | Jul 1994 | A |
5359724 | Earle | Oct 1994 | A |
5384568 | Grinberg et al. | Jan 1995 | A |
5386413 | McAuley | Jan 1995 | A |
5438535 | Lattibeaudiere | Aug 1995 | A |
5459717 | Mullan et al. | Oct 1995 | A |
5479401 | Bitz et al. | Dec 1995 | A |
5561786 | Morse | Oct 1996 | A |
5680161 | Lehman | Oct 1997 | A |
5727051 | Holender | Mar 1998 | A |
5787151 | Nakatsu et al. | Jul 1998 | A |
5857196 | Angle et al. | Jan 1999 | A |
5930805 | Marquis | Jul 1999 | A |
5946679 | Ahuja et al. | Aug 1999 | A |
6011795 | Varghese et al. | Jan 2000 | A |
6014659 | Wilkinson et al. | Jan 2000 | A |
6034958 | Wicklund | Mar 2000 | A |
6067574 | Tzeng | May 2000 | A |
6085188 | Bachmann | Jul 2000 | A |
6141655 | Johnson et al. | Oct 2000 | A |
6161144 | Michels et al. | Dec 2000 | A |
6189143 | Simonyi | Feb 2001 | B1 |
6192051 | Lipman et al. | Feb 2001 | B1 |
6199100 | Filepp et al. | Mar 2001 | B1 |
6223172 | Hunter et al. | Apr 2001 | B1 |
6226710 | Melchior | May 2001 | B1 |
6247014 | Ladwig et al. | Jun 2001 | B1 |
6266706 | Brodnik et al. | Jul 2001 | B1 |
6285994 | Bui et al. | Sep 2001 | B1 |
6338079 | Kanamori et al. | Jan 2002 | B1 |
6385649 | Draves et al. | May 2002 | B1 |
6430527 | Waters et al. | Aug 2002 | B1 |
6434144 | Romanov | Aug 2002 | B1 |
6452908 | Yamada et al. | Sep 2002 | B1 |
6460112 | Srinivasan et al. | Oct 2002 | B1 |
6490592 | St. Denis et al. | Dec 2002 | B1 |
6512766 | Wilford | Jan 2003 | B2 |
6513028 | Lee et al. | Jan 2003 | B1 |
6522632 | Waters et al. | Feb 2003 | B1 |
6526055 | Perlman et al. | Feb 2003 | B1 |
6539369 | Brown | Mar 2003 | B2 |
6539455 | Khanna et al. | Mar 2003 | B1 |
6553002 | Bremer et al. | Apr 2003 | B1 |
6563823 | Przygienda et al. | May 2003 | B1 |
6570866 | Murase et al. | May 2003 | B1 |
6571313 | Filippi et al. | May 2003 | B1 |
6658482 | Chen et al. | Dec 2003 | B1 |
6675163 | Bass et al. | Jan 2004 | B1 |
6687247 | Wilford et al. | Feb 2004 | B1 |
6691218 | Brown | Feb 2004 | B2 |
6711153 | Hebb et al. | Mar 2004 | B1 |
6744775 | Beshai et al. | Jun 2004 | B1 |
6754799 | Frank | Jun 2004 | B2 |
6778530 | Greene | Aug 2004 | B1 |
6782282 | Bielefeldt | Aug 2004 | B2 |
6782382 | Lunteren | Aug 2004 | B2 |
6826561 | Cao et al. | Nov 2004 | B2 |
6836771 | Brown | Dec 2004 | B2 |
6839825 | Brown | Jan 2005 | B1 |
6873982 | Bates et al. | Mar 2005 | B1 |
6877005 | Hunter et al. | Apr 2005 | B2 |
6880064 | Brown | Apr 2005 | B1 |
6917954 | Ahmad et al. | Jul 2005 | B2 |
6956858 | Hariguchi et al. | Oct 2005 | B2 |
7023807 | Michels et al. | Apr 2006 | B2 |
7106732 | Brown | Sep 2006 | B2 |
7423981 | Brown | Sep 2008 | B2 |
7715385 | Brown | May 2010 | B2 |
20010042130 | Brown | Nov 2001 | A1 |
20010056417 | Cao | Dec 2001 | A1 |
20020059197 | Hunter | May 2002 | A1 |
20020080798 | Hariguchi et al. | Jun 2002 | A1 |
20050175005 | Brown | Aug 2005 | A1 |
Number | Date | Country |
---|---|---|
0453707 | Oct 1991 | EP |
10-257066 | Sep 1998 | JP |
11-191781 | Jul 1999 | JP |
2000-151691 | May 2000 | JP |
2001-517024 | Oct 2001 | JP |
2005-022297 | Jan 2005 | JP |
WO 9913619 | Mar 1999 | WO |
WO 9914906 | Mar 1999 | WO |
WO 0110097 | Feb 2001 | WO |
Number | Date | Country | |
---|---|---|---|
20110082866 A1 | Apr 2011 | US |
Number | Date | Country | |
---|---|---|---|
60212966 | Jun 2000 | US | |
60258436 | Dec 2000 | US | |
60294387 | May 2001 | US |