1. Field of the Invention
The present invention is directed to a method and apparatus for a table lookup index that provides access to a table, such as an addressing table, in a fast and efficient manner. More specifically the table lookup index is for the transmission of data packets in a network switch.
2. Description of the Prior Art
In the world of data transmission it is necessary to transmit data as quickly as possible, in order to have almost instantaneous access to information.
Table lookups are frequently used to index information to give quick access to much needed data. For example in network switching it is imperative that when data is received in a port the appropriate port for output be identified in order to transfer data. Therefore table lookups are utilized to store information regarding incoming data that directs the incoming data to an appropriate port for output.
In the field of table look-ups there are several methods used to access information. One method is a linear index.
Other methods make use of pointers, hash functions or tree functions to remedy the problem. Most of these methods, when implemented, have a “bad” worst case performance—particularly for insert and delete operations. As noted above, as the size of the table increases, performance becomes degraded. Some of the main reasons for the poor results are that the table size directly affects performance and the methods require extra storage and data structures.
The present invention is designed to overcome the deficiencies of the prior art and to increase the speed of data transmission.
In one embodiment, the present invention is a method of performing a table look-up. The method has the steps of receiving data through an input source; parsing the data into an index portion and a corresponding bucket portion; indexing the index portion to the corresponding bucket portion; and accessing table information stored in a look-up table using the bucket portion.
In another embodiment, the present invention is a table look-up indexing device. The table look-up indexing device has a receiver that receives incoming data; a data parser that parses the data into an index portion and a corresponding bucket portion; an indexer that indexes the index portion to the bucket portion; and a lookup device that accesses a look-up table using the corresponding bucket portion.
In a further embodiment, the present invention is a network switch having multiple ports used for receiving and exporting data. Each of the multiple ports are connected to one another through a communications medium. Multiple Address Resolution Logic (ARL) devices are connected to one of the multiple ports so that each of the multiple ports has a corresponding ARL device. Each of said multiple ARL devices is made up of a parser that parses data into an index portion and a corresponding bucket portion; an indexer that indexes said index portion to a corresponding bucket portion; and a look-up device that accesses table entries in a look-up table using the bucket portion.
The objects and features of the invention will be more readily understood with reference to the following description and the attached drawings, wherein:
The present invention is a method and apparatus that performs a table look-up that parses incoming data into an index portion and a bucket portion and uses the index portion and bucket portion to do a look-up.
When data is received by one of the ports 52, 54, 56, 58 or 60 the data is indexed by the corresponding ARL. Simultaneously the data is sent to all the ports to determine which port the data should be sent to for output. When the output port is determined the ARL stores the output port data in the L Table using the index. In this way the output port for a particular type of data is “learned”.
Once the output port for a particular type of data is “learned”, when a port receives data, the ARL indexes the data and “looks up” the proper output port in the look-up table, L Table. The data is then sent to the appropriate port for output and the step of sending data to every port is eliminated thereby speeding up the switching process.
For Example, suppose initial data is received by port 52 and is to be output through port 60. Initially data is sent to all the ports to determine the proper output port. When the proper output port is determined, the initial data is sent to switching table 62 to be indexed by the ARL and the output port data is stored in the look-up table, L Table using the index created by the ARL. In the present case the L Table contains output port data directing any data with a particular index to be sent to port 60.
When port 52 receives subsequent data, switching table 62 indexes the data and “looks up” the index in the look-up table, L Table. If the subsequent data has the same index as the initial data and is found in the look-up table, the look-up table will show that the subsequent data should be sent to port 60 for output and the subsequent data will be automatically sent to port 60 for output.
If the subsequent data is indexed and the index is not found in the look-up table, the subsequent data will be sent to all ports to determine the appropriate output port. The subsequent data will then be indexed and the output port information stored in a look-up table by switching table 62. The subsequent data is now “learned” and the next time incoming data comes in with the same index as the subsequent data, the incoming data will be immediately sent to the proper port for output since the data or index is now “learned”.
For a key size of 48 and a table size of 64K, 16 bits are used for indexing. The 48 bit key is parsed into 3 segments, segment M, index segment I and bucket segment N.
Index segment I is called the index and is linearly indexed to a bucket which is designated as a bucket segment N. The combination of the index and bucket directly selects an entry in the table. Therefore once the index is selected it will take a maximum of five clock cycles to search the bucket and only 5 bits will have to be binary sorted for an insert or delete operation. Thus an insert or delete function is dependent on the bucket size which can be programmed to fit a particular need.
It is noted that in some instances it is important to select bits from a key for index segment I that will have recurring index segments I for all incoming keys. This will allow for bucket sizes of 2 or greater which is more desirable for high speed switching.
In some applications manufacturers of chips use a manufacturers identification number as part of the key. Therefore it may be valuable to use bits in the key used for the manufacturers identification number as part of the index segment I. Another useful method for indexing index segment I is to use an XOR index where the index is XORed with the remaining bits of the key.
In one embodiment of the invention a MAC address is received in a port of a network switch having multiple ports. The MAC address is parsed into an index portion and a bucket portion. The index portion is indexed to a bucket portion and the bucket portion is used to access a table entry in a look-up table to determine which port the MAC address and associated data should be sent to for output. If there is a table entry for the corresponding bucket portion the MAC address and associated data will be sent to the proper port for output. In the case where there is no table entry the port for output has to be “learned”. This is accomplished by sending the MAC address to all ports in the switch. The proper port for output will send a message back that it is the proper port for output and this information is stored in the look-up table with the corresponding bucket. Therefore any subsequent MAC addresses having the same index and bucket will be able to access the table entry in the look-up table to determine the proper port for output without sending the MAC address to all the ports in the switch.
An address 505 is received by switch 500 through an input port 515. The input port 515 transmits address 505 to parser 520. Parser 520 segments address 505 into three parts, segment 525 labeled as M, segment 530 labeled as I and segment 535 labeled as N. Segment I is linearly indexed to a bucket 535 and bucket 535 directly indexes a entry in table 510. In effect bucket 535 does a look up in table 510 in order to determine which of output ports 540 or 545 are to be used to transmit incoming data. The Index I merely selects a bucket.
Port 605 has a corresponding Address Resolution Logic device (ARL) 625 and a corresponding look-up table 630. ARL 625 is made up of a parser 635, an indexer 640 and a look-up device 645.
Port 610 has a corresponding Address Resolution Logic device (ARL) 650 and a corresponding look-up table 655. ARL 650 is made up of a parser 660, an indexer 665 and a look-up device 670.
Port 615 has a corresponding Address Resolution Logic device (ARL) 675 and a corresponding look-up table 680. ARL 675 is made up of a parser 685, an indexer 690 and a look-up device 695.
In the event that port 605 receives a MAC address to be sent to port 610, the operation of the switch is as follows. A MAC address is received in port 605 of network switch 600 having multiple ports 605, 610 and 615. The MAC address is sent to ARL 625 to be processed. Parser 635 parses the MAC address into an index portion and a bucket portion. Indexer 640 indexes the index portion to a bucket in look-up 645. The bucket portion in look-up 645 is used to access a table entry in look-up table 630 to determine which port the MAC address and associated data should be sent to for output. If there is a table entry for the corresponding bucket portion the MAC address and associated data will be sent to the proper port for output. In this case the look-up table entry will direct the MAC address and associated data to output port 610. However, if there is no table entry the port for output has to be “learned”. This is accomplished by sending the MAC address to all ports, ports 605, 610 and 615, in switch 600. The proper port for output will send a message back that it is the proper port for output and this information is stored in look-up table 630 with the corresponding bucket. In this case port 610 will send port 605 a signal indicating that port 610 is the proper port for output and this information is stored in look-up table 630. Therefore any subsequent MAC addresses having the same index and bucket will be able to access the table entry in the look-up table to determine the proper port for output without sending the MAC address to all the ports in the switch.
An advantage of the present invention is that insert and delete operations will no longer be dependent upon table size. As discussed above, address look-ups in the prior art are dependent upon table size. Therefore if the table size is 64K the index will be 16 bits long. Thus an insert or delete operation will involve sorting and moving 16 bit indexes.
However, the present invention for a 64K table with a bucket size of 32 (5 bits) will only have an 11 bit index (16 bits−5 bits=11 bits). Therefore once a bucket is selected by an index, insert or delete operations will depend on the bucket size and involve the sorting and moving of, in this case, 5 bit bucket indexes which is much more efficient than the sorting and moving of 16 bit indexes.
Although the invention has been described based upon the embodiments discussed above, it would be apparent to those skilled in the art that certain modifications, variations and alternative constructions would be apparent, while remaining within the spirit and scope of the invention. For example instead of using a linear index an XOR index is appropriate in certain circumstances. Likewise the bucket and index sizes are programmable to accommodate different circumstances and be tailored to specific needs.
This application claims the benefit of U.S. Provisional Patent Application No. 60/166,225 filed on Nov. 18, 1999. The contents of this Provisional Patent Application is hereby incorporated be reference.
Number | Name | Date | Kind |
---|---|---|---|
4837447 | Pierce et al. | Jun 1989 | A |
5278789 | Inoue et al. | Jan 1994 | A |
5390173 | Spinney et al. | Feb 1995 | A |
5414704 | Spinney | May 1995 | A |
5423015 | Chung | Jun 1995 | A |
5440734 | Wagar | Aug 1995 | A |
5459717 | Mullan et al. | Oct 1995 | A |
5473607 | Hausman et al. | Dec 1995 | A |
5499295 | Cooper | Mar 1996 | A |
5506624 | Moreton | Apr 1996 | A |
5524254 | Morgan et al. | Jun 1996 | A |
5555398 | Raman | Sep 1996 | A |
5568477 | Galand et al. | Oct 1996 | A |
5579301 | Ganson et al. | Nov 1996 | A |
5644784 | Peek | Jul 1997 | A |
5652579 | Yamada et al. | Jul 1997 | A |
5696899 | Kalwitz | Dec 1997 | A |
5724033 | Burrows | Mar 1998 | A |
5742613 | MacDonald | Apr 1998 | A |
5745889 | Burrows | Apr 1998 | A |
5748631 | Bergantino et al. | May 1998 | A |
5781549 | Dai | Jul 1998 | A |
5787084 | Hoang et al. | Jul 1998 | A |
5790539 | Chao et al. | Aug 1998 | A |
5802052 | Venkataraman | Sep 1998 | A |
5802287 | Rostoker et al. | Sep 1998 | A |
5825772 | Dobbins et al. | Oct 1998 | A |
5828653 | Goss | Oct 1998 | A |
5831980 | Varma et al. | Nov 1998 | A |
5842038 | Williams et al. | Nov 1998 | A |
5845081 | Rangarajan et al. | Dec 1998 | A |
5852607 | Chin | Dec 1998 | A |
5860136 | Fenner | Jan 1999 | A |
5864535 | Basilico | Jan 1999 | A |
5887187 | Rostoker et al. | Mar 1999 | A |
5892922 | Lorenz | Apr 1999 | A |
5898687 | Harriman et al. | Apr 1999 | A |
5909686 | Muller et al. | Jun 1999 | A |
5918074 | Wright et al. | Jun 1999 | A |
5940596 | Rajan et al. | Aug 1999 | A |
5966703 | Burrows | Oct 1999 | A |
5987507 | Creedon et al. | Nov 1999 | A |
5999596 | Walker et al. | Dec 1999 | A |
6011795 | Varghese et al. | Jan 2000 | A |
6041053 | Douceur et al. | Mar 2000 | A |
6046979 | Bauman | Apr 2000 | A |
6061351 | Erimli et al. | May 2000 | A |
6067547 | Douceur | May 2000 | A |
6119196 | Muller et al. | Sep 2000 | A |
6175902 | Runaldue et al. | Jan 2001 | B1 |
6185185 | Bass et al. | Feb 2001 | B1 |
6690667 | Warren | Feb 2004 | B1 |
6829217 | Bechtolsheim et al. | Dec 2004 | B1 |
Number | Date | Country |
---|---|---|
0312917 | Apr 1989 | EP |
0465090 | Jan 1992 | EP |
0 594 196 | Apr 1994 | EP |
0752796 | Jan 1997 | EP |
0 845 889 | Jun 1998 | EP |
0849917 | Jun 1998 | EP |
0854606 | Jul 1998 | EP |
0859492 | Aug 1998 | EP |
0862349 | Sep 1998 | EP |
0907300 | Apr 1999 | EP |
0853441 | Jul 1999 | EP |
0 725 573 | Apr 1996 | FR |
4-189023 | Jul 1992 | JP |
WO 9809473 | Mar 1998 | WO |
WO 9900938 | Jan 1999 | WO |
WO 9900939 | Jan 1999 | WO |
WO 9900944 | Jan 1999 | WO |
WO 9900945 | Jan 1999 | WO |
WO 9900948 | Jan 1999 | WO |
WO 9900949 | Jan 1999 | WO |
WO 9900950 | Jan 1999 | WO |
WO 9914906 | Mar 1999 | WO |
WO9900936 | Jun 2001 | WO |
Number | Date | Country | |
---|---|---|---|
60166225 | Nov 1999 | US |