Next Patent: System and method for TCP/IP offload independent of bandwidth delay product
Next Patent: System and method for TCP/IP offload independent of bandwidth delay product
Plaque It!
Sponsored by: Flash of Genius |
[0001] This application is related to U.S. patent application Ser. No. ______ filed on ______, entitled METHOD AND APPARATUS FOR HIGH-SPEED LONGEST PREFIX MATCH OF KEYS IN A MEMORY.
[0002] 1. Technical Field
[0003] This apparatus and invention relates to the field of data transmission in local area and global networks, e.g., an Internet, and, more specifically, to an apparatus and method to enable address lookup in forwarding and transferring devices of local area networks and the Internet.
[0004] 2. Background
[0005] Current applications utilizing the Internet and local area networks (LANs), such as Internet video-on-demand or Internet telephony, require large amounts of data to be transferred from a LAN endsystem through the Internet to an endsystem or group of endsystems on other LANs.
[0006] Local area network switches (LAN switches) are evolving to handle the high-bandwidth issues within the LAN. LAN switches receive a packet of data and may perform error checks to verify that the packet has the necessary format. If the packet does not contain any errors, the LAN switch looks up the packet destination address in its switching table and determines the outgoing port to which the packet is to be transferred. The switching table includes a destination address list along with associated outgoing port interfaces. The LAN switch performs an “exact matching” search, meaning the destination address must exactly match a destination address entry in the switching table. The packet is then forwarded to the location associated with the switching table entry.
[0007] Internet data is transferred by groups of routers, which are interconnected by communication links. An individual router receives data packets on any of its input links and decides to which of its outgoing links the packet may be forwarded based on the packet's encoded destination protocol address. The router makes this determination by comparing the destination protocol address to its router table entries that, similarly to the LAN switch, contain destination protocol addresses and corresponding “next hop” instructions.
[0008] Unlike the LAN switch, however, the router performs a “longest prefix matching” search. Routing table entries may not contain the full length of all addresses. The destination protocol address is compared to routing table entries. The router utilizes the forwarding instructions of the entry with which the address has the longest prefix in common. The router changes the packet's destination physical address to the address of the next hop information and transmits it.
[0009] The link speed, data throughput rates, and packet forwarding rates in forwarding devices are all major factors in increasing bandwidth/throughput. Link speed is increased by improvements in cabling in both the LAN and the Internet. Faster switching technology is utilized to move packets from the device's input port to the corresponding output port at gigabit speeds. Packet forwarding, specifically the address lookup portion, is where a bottleneck exists.
[0010] Criteria in packet forwarding performance include the routing/switching table, i.e., address lookup table, size, the number of memory accesses required to retrieve the next hop information, and logic required to perform the search. Routing/switching tables require larger databases and memory because the number of destination addresses has grown exponentially.
[0011] Hardware implementations of “exact matching” schemes use parallelism to gain lookup speed. Parallelism is implemented using content addressable memories (CAMs) in which every memory location, in parallel, compares the input key value to the content of that memory location. CAMs are small, both in the number of bits per entry and the number of entries. Plus, CAMs for both large address/mask pairs, e.g., 256 bits needed for Internet Protocol Version 6—Ipv6, and CAMs for a large number of prefixes require extensive hardware logic.
[0012] The “exact matching” searching algorithm utilized by LAN switches is cumbersome with large routing tables because of the number of searches required to complete the search. This problem led router manufacturers to develop “longest prefix matching” searching schemes.
[0013] One of these schemes is a modified binary search technique, which requires log2 (2×N) steps, with N being the number of routing table entries. In the worst case, this scheme may require 17 data lookups for a 32-bit address, each requiring at least one memory access. Typical binary search schemes require an average number of accesses equal to log2 (2×N)−1.
[0014] Another scheme involves applying an “exact match” scheme for each possible prefix length, but this scheme is expensive because it requires W (number of bits) iterations for the “exact match” scheme used. This scheme also requires W memory accesses.
[0015] A radix tree implementation is the most commonly used “longest prefix matching” scheme. If W is the length of an address, the worst-case time to access in the basic implementation can be shown to be memory access time (O)×W×2. The worst case was improved to O×W by requiring that the prefix be contiguous, but this implementation requires up to 32 or 128 costly memory accesses, depending on the Internet protocol version.
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023] In one embodiment, a router or a local area network switch (LAN switch) receives a packet and may determine the next step in the packet's travel, e.g., the next hop information. The router or LAN switch extracts a lookup value based on a network address from the received packet and transfers the lookup value to an address lookup device. The lookup value may also be referred to as an input key. The address lookup device receives the lookup value and may perform a pipelined binary search to identify a memory section at which the lookup value should be located. In one embodiment, the address lookup device performs a discriminant bits search to determine if the lookup value is included in the memory section of a address lookup table, outputs the next hop information for the lookup value if the lookup value is included in the memory section of the address lookup table, and outputs a default next hop information if the lookup value is not included in the memory section of the address lookup table. In another embodiment, a pipelined binary search may not be performed, the address lookup device may perform a discriminant bits search on the address lookup table to determine if the lookup value is included in the address lookup table. If the lookup value is included in the address lookup table, next hop information may be output and if the lookup value is not included in the address lookup table, default next hop information is output. The forwarding device of the router or LAN switch may receive the next hop information or the default next hop information and transfer the packet to the location specified by the next hop information.
[0024] The address lookup device may only utilize one memory access to the address lookup table. In addition, the searching device's memory requirements may be low even for input address widths of 32 and 48 bits, and may be implemented utilizing standard synchronous dynamic random access memories (SDRAMs). Illustratively, if twelve 48-bit Ethernet addresses are stored in a section of memory, the address lookup device may only need to store 60 bits of information to be able to predict deterministically the only possible location of the lookup value in the address lookup table.
[0025] The lookup value may be the destination address, when utilizing the address lookup device in a local area network switch (LAN switch), or may be a destination protocol address, when utilizing the address lookup device in an Internet router.
[0026]
[0027] The pipelined binary search device
[0028] In one embodiment, the address lookup table
[0029] In one embodiment, a last address of each memory section in the address lookup table
[0030] In another embodiment, a first address of each memory section in the routing switching table
[0031] For example, in a three-stage binary search utilizing last address memory banks, a first stage of the binary search may start at a middle last address. Thus, the middle last address may be placed in a first last address memory bank (1
[0032] In one embodiment, the number of last address memory banks (LAMBs)
[0033] The number of binary search stages may be equivalent to the number of last address memory banks. Illustratively, if 7 memory sections are to be searched, three binary search stages and three last address memory banks are utilized to perform the binary search. If 25 sections of memory are searched, five binary search stages and five last address memory banks may be utilized to perform the binary search.
[0034]
[0035]
MS0 = 1, 4, 8,12 MS1 = 14, 18, 30, 34 MS2 = 40, 46, 50, 51 MS3 = 54, 57, 59, 60 MS4 = 70, 74, 78, 82 MS5 = 90, 100, 101, 105 MS6 = 110, 120, 130, 140
[0036] According to an embodiment of the address lookup device, the middle last address (LA3) is the last address of MS3
[0037] In one embodiment of the address lookup device, two lookup values having, for example, values of
[0038] As illustrated in
[0039] In the first binary search stage for lookup value 100, which may occur at the same time the second binary search stage for lookup value 46 takes place, lookup value 100 is compared to the value of 60, which is located in LAMB0
[0040] The pipelined binary search device
[0041] In one embodiment of the address lookup device during the pipelined binary search, it may be determined that the lookup value equals a last addresses of one of the plurality of last address memory banks. In another embodiment, it may be determined that the lookup value equals one of the first addresses in the plurality of first address memory banks. In such an embodiment, a discriminant bit search module may not be utilized. Because the pipelined binary search module has identified that the lookup value is equal to a location in the address lookup table
[0042] In one embodiment, the discriminant bits search module
[0043]
[0044] Alternatively, the discriminant bits pattern may be extracted from the complete address lookup table
[0045] Utilizing the memory section's discriminant bits pattern, the discriminant bits search module
[0046]
[0047] The discriminant bits search device
[0048] In one embodiment of the present invention, the discriminant bits pattern is DB[0]=8; DB[1]=5; DB[2]=6; DB[3]=7; DB[4]=9; DB[5]=7; and DB[6]=6. Illustratively, a lookup value may be 0011000110. The reduced lookup value is extracted as follows. Going from most significant bit, e.g., DB[6] to least significant bit, e.g., DB[0], because DB[6]=6, the value of the sixth bit, i.e., 1, is the most significant bit of the reduced lookup value. DB[5]=7, and the value of the lookup value's seventh bit is 1, and is the next bit of the reduced lookup value. In a similar fashion, the remaining values of the reduced lookup value are extracted, yielding a reduced lookup value of 1101100.
[0049] A reduced address matching mask may also be extracted from the address matching mask for the plurality of addresses in the memory section utilizing the discriminant bits pattern. Alternatively, a reduced address matching mask may also be extracted from the address matching mask for the plurality of addresses in the address lookup table
[0050] Offset 3=0101yyyyyy
[0051] Offset 4=011yyyyyyy
[0052] Offset 5=1y0yyyyyyy (y means the value does not matter, e.g., can be either one or zero).
[0053] In one embodiment of the address lookup device, the reduced address matching mask may be extracted by encoding each of the address matching masks shown above as follows. The most significant bit of address 3, e.g., bit
[0054] In the discriminant bits search module
[0055] Alternatively, the discriminant bits search module
[0056] If the comparison is made between the reduced lookup value and the reduced address masking mask rather then the lookup value and the address matching mask, the hardware area needed to implement the comparison may be lessened. If the comparison is performed in software, the comparison between the reduced lookup value and the reduced address matching mask may be achieved at a faster speed than if the comparison is performed between the lookup value and the address matching mask in hardware, due to the reduced number of bits being compared.
[0057] Because only the selected mask address has been matched, the discriminant bits search module
[0058] For example in one embodiment of the present invention, a memory section is selected by the pipelined binary search module
[0059] In this embodiment of the present invention, two lookup values may have been transferred to the address lookup device to determine next hop information. For example, the first lookup value is 263 (1001100011) and the second lookup value is 280 (1010000001).
Offset = 00000000 Record Address = 065 0001100101 Offset = 00000001 Record Address = 124 0100100100 Offset = 00000002 Record Address = 18d 0110001101 Offset = 00000003 Record Address = 209 1000001001 Offset = 00000004 Record Address = 212 1000010010 Offset = 00000005 Record Address = 263 1001100011 Offset = 00000006 Record Address = 281 1010000001 Offset = 00000007 Record Address = 30d 1100001101
[0060] Illustratively, the discriminant bits search module
[0061] The discriminant bits pattern for the memory section may be stored in the discriminant bits memory
[0062] Reduced lookup value for 263=>0010100
[0063] Reduced lookup value for 280=>0100110
[0064] The discriminant bits search module
[0065] The discriminant bit between the address with an offset of 0 and the address with an offset of 1 is the eighth bit, as illustrated below.
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 Offset 1 1
[0066] The discriminant bit between the address with an offset of 1 and the address with an offset of 2 is the seventh bit
Bit Number 9 8 7 6 5 4 3 2 1 Offset 1 0 Offset 1 1 0 Offset 2 1 1
[0067] The discriminant bit between offset address 2 and offset address 3 is the ninth bit, as illustrated below. Because the ninth bits of offset addresses 1 and 2 are the same, and the ninth bits of offset addresses 0 and 1 are the same, the ninth bits of offset addresses 0 and 1 may be filled in with zeros.
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 0 Offset 1 0 1 0 Offset 2 0 1 1 Offset 3 1
[0068] The discriminant bit between offset address 3 and offset address 4 is the fourth bit, as illustrated below. Because the first difference in bits is the fourth bit, all higher bits are equivalent. Thus, the ninth bit of offset address 4 is one.
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 0 Offset 1 0 1 0 Offset 2 0 1 1 Offset 3 1 0 Offset 4 1 1
[0069] The discriminant bit between offset address 4 and offset address 5 is the sixth bit. Again, the ninth bit of offset address 5 has an equivalent value to the ninth bit of offset address 4, as illustrated below, for the reasons discussed previously.
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 0 Offset 1 0 1 0 Offset 2 0 1 1 Offset 3 1 0 0 Offset 4 1 0 1 Offset 5 1 1
[0070] The discriminant bit between offset address 5 and offset address 6 is the seventh bit, as illustrated below. The address matching masks for some of the plurality of addresses in the memory section are further filled in because the 7th bit of offset addresses 4 and 5 are equivalent, along with the seventh bit of offset addresses 3 and 4.
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 0 Offset 1 0 1 0 Offset 2 0 1 1 Offset 3 1 0 0 0 Offset 4 1 0 0 1 Offset 5 1 0 1 Offset 6 1 1
[0071] The discriminant bit between offset address 6 and offset address 7 is the eight bit, as illustrated below. The address matching masks for some of the plurality of addresses in the memory section are further filled in because the 8
Bit Number 9 8 7 6 5 4 3 2 1 Offset 0 0 0 y y Y y y y y Offset 1 0 1 0 y Y y y y y Offset 2 0 1 1 y Y y y y y Offset 3 1 0 0 0 Y 0 y y y Offset 4 1 0 0 0 Y 1 y y y Offset 5 1 0 0 1 Y y y y y Offset 6 1 0 1 y Y y y y y Offset 7 1 1 y y Y y y y y
[0072]
[0073] The discriminant bits mask, e.g., the address matching mask, has now been created for each of the plurality of addresses in the memory section. In one embodiment of the present invention, the lookup value may be compared to the address matching mask for each of the plurality of addresses in the memory section. For example, in the case of address 1001100011 (263), the lookup value matches the mask value for offset 5 and this value is the selected matching address mask. In the case of address 1010000001 (280), the lookup value matches the mask value for offset
[0074] In an alternative embodiment, the reduced lookup value may be compared to the reduced address matching mask for each of the plurality of addresses in the memory section. Illustratively, the reduced mask address for each of the plurality of addresses in the memory section illustrated above is:
Offset 0 0 Y Y Y 0 y 0 Offset 1 1 0 Y Y 0 0 1 Offset 2 1 1 Y Y 0 1 1 Offset 3 0 0 0 0 1 0 0 Offset 4 0 0 0 1 1 0 0 Offset 5 0 0 1 Y 1 0 0 Offset 6 0 1 Y Y 1 1 0 Offset 7 1 Y Y Y 1 y y
[0075] The reduced lookup value for 263 is 0010100. The reduced lookup value for 280 is 0100110. For lookup value 280, the reduced lookup value matches the reduced address matching mask for offset 5 and is the selected address matching mask. For lookup value 263, the reduced lookup value matches the reduced address matching mask for offset 6 and is the selected address matching mask. Note that the same result is obtained when comparing the lookup value to the address matching mask or comparing the reduced lookup value to the reduced address matching mask.
[0076] The discriminant bits search module
[0077]
[0078] While the description above refers to particular embodiments of the present invention, it will be understood that many modifications may be made without departing from the spirit thereof. The accompanying claims are intended to cover such modifications as would fall within the true scope and spirit of the embodiments of the present invention. The presently disclosed embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the embodiments of the invention being indicated by the appended claims, rather than the foregoing description, and all changes that come within the meaning and range of equivalency of the claims are intended to be embraced therein.