Prefix matching structure and method for fast packet switching

Abstract
A prefix matching apparatus for directing information to a destination port includes a memory configured to store a piece of data including an address and a plurality of levels each including a plurality of memory locations, the levels each representing a unique address space. A controller is coupled to the memory and to the plurality of levels, and is configured to read the data address and to direct the data to the next level associated with a unique address space associated with the data address. In one embodiment, the controller is configured to match the data address prefix to a plurality of addresses associated with the unique address spaces. Advantages of the invention include fast switch decisions and low switch latency.
Description
FIELD

The present invention relates to the field of telecommunications, and more particularly to a prefix matching structure and method for fast packet switching. In one embodiment, the invention is directed to a longest prefix matching structure and method for fast packet switching.


BACKGROUND

Computer networking and communications are important aspects of daily life. These products and services are the infrastructure through which the Internet operates. The universal benefits of the Internet are well known, enabling immediate worldwide sharing of news and events, access to in-depth research on virtually any topic, sophisticated financial analysis available to all, the convenience of e-commerce available on virtually any product to consumers and the emerging capabilities for commercial e-commerce, and the outsourcing enabled by Application Service Providers and Storage Area Networks, to list just a few of the world-changing available uses.


This explosive growth in network traffic is further demonstrated by forecasts made by many leading networking industry experts regarding scaling specific infrastructure areas. Every aspect of these scaling estimates represents requirements for network equipment to scale to provide the necessary bandwidth.


Telecommunications switches and routing help to meet the needs of many devices to connect to a network and then for the network to communicate with other networks. The increasing demands of Internet traffic require equipment suppliers to develop faster and more efficient techniques for routing traffic. Inside the routers are switches that decode addresses associated with data packets and then direct the data packets to the proper ports. The invention is one such technique for improving switching.


SUMMARY OF INVENTION

The invention provides a prefix matching structure and method for fast packet switching. The invention matched the address in the data to those available in a number of layers. A pipelined technique ensures that a new packet is switched to the correct port in a steady and quick manner.


A prefix matching apparatus for directing information to a destination port includes a memory configured to store a piece of data including an address and a plurality of levels each including a plurality of memory locations, the levels each representing a unique address space. A controller is coupled to the memory and to the plurality of levels, and is configured to read the data address and to direct the data to the next level associated with a unique address space associated with the data address. In one embodiment, the controller is configured to match the data address prefix to a plurality of addresses associated with the unique address spaces. In one embodiment, the invention is directed to a longest prefix matching structure and method for fast packet switching.


Advantages of the invention include fast switch decisions and low switch latency.




BRIEF DESCRIPTION OF THE FIGURES

The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:



FIG. 1 depicts an exemplary architecture according to an embodiment of the invention;


FIGS. 2A-C depicts exemplary tree structures used to describe the invention;



FIG. 3 depicts an embodiment using an external memory; and



FIG. 4 depicts an embodiment detailing memory organization.




DETAILED DESCRIPTION

The invention is described with reference to specific architectures and protocols. Those skilled in the art will recognize that the description is for illustration and to provide the best mode of practicing the invention. The description is not meant to be limiting. For example, reference is made to Ethernet Protocol but other protocols can be used in the invention. Likewise, reference is made to packets and cells, while other forms of data and addresses can be used in the invention.


A longest prefix matching method works by expanding address prefixes into specific ranges. Then, the method performs a binary search of the sorted list of numbers, which constitute the address spaces. An exemplary architecture is described and then the method if described using that architecture.


A. Architecture



FIG. 1 depicts an exemplary architecture according to an embodiment of the invention. As shown, the invention includes a number of levels Level0-Level3 (110a-110d) and has access to external levels. There are also several slices shown as Slice0-Slice4 (112a-112e). These slices overlay the levels to the extent that the address spaces described below overlap. A controller 140 manages the operation. In the exemplary embodiment, the controller includes a map or equation representing the index, for example, as graphically depicted in FIGS. 2A-B. By storing the index, the invention can operate deterministically in a highly efficient manner with low latency.


The invention employs a pipelined data path approach to processing the data. In each level, the data address is compared to the available address spaces and is forwarded to the slice with the matching address space. Each of the levels contains four decisions, but more or less decisions could be implemented. Consequently, the pipelined approach that enables a new output every four cycles. The pipelined architecture supports multiple searches simultaneously. The deterministic aspect of the index provides the invention to infer the next level from the index of the current level and the result of the compare operation. This avoids having to store the index in the memory, thereby reducing implementation size.


Each of the slices has a predetermined address space associated with the slice. The address space definitions can be stored locally or stored in external memory, and they are arbitrary (i.e. they don't need to be contiguous or in order). As the data proceeds through the levels, the address is compared to the address space for the next level slice and the controller directs the data based on the index. Since the exemplary embodiment employs a random access memory (RAM), the invention is more efficient than conventional prefix matching techniques that use ternary content addressable memory (TCAM). The invention can achieve a high degree of utilization with the benefits of low power and many stored addresses. In one aspect, the invention can achieve an optimal ratio of addresses to storage approaching 1:1, which is significantly better than conventional techniques.


The search is divided into multiple levels to utilize the pipeline. The number of entries in each level is calculated according to Table 1. A multiplier is chosen at each stage. This is used to tradeoff the number of routes to be supported to the number of accesses needed. For example, a multiplier of 15 means 4 internal accesses at the next level while a multiplier of 7 means 3 accesses.

TABLE 1Level0Level1Level2Level3Level4Level5ParameterInternalExternalMultiplier (number of accesses)15(4)15(4)7(3)7(3)7(3)Number of Entries15240384028672229376786432Cummulative Number of Worst Case1282 K16 K128 K512 KRoutes


When using internal memory only, the search is performed on the four slices as shown 112a-112d. The database, which is a binary tree, is programmed into the four slices. Each level needs a maximum of four lookups. This allows the system to pipeline the lookups and perform the search linearly.


The fifth slice 112e is used as a shadow copy for software to program the device. Insertions and deletions are performed by re-calculating the new database and programming it into the shadow slice. Then the original slice is replaced with the new slice. The original slice now becomes the shadow copy and may be reprogrammed or otherwise utilized as permitted by the controller 140. The shadow slice can be reprogrammed or otherwise utilized simultaneously with operation of the active slices.


B. Operation



FIGS. 2A depicts an exemplary decision tree according to the invention. The boxes 222 and 224a-224d represent levels in the tree. Each of the circles represents an address space that a new piece of data could be associated with. As the data moves down through the tree, the data is directed to matching address spaces. Likewise, FIG. 2B depicts how a level can be divided into an address space 0A and an address space 0B. The initial decision block 232 would cause data within the address space of 0A (00000000-00111110) to be routed to the slice associated with reference 234a and data within the address space of 0B (0011111-11111111) to be routed to the slice associated with reference 234b, which address space would cause data with the first four symbols of 1111 to be directed to the slice associated with the reference 234b. This is how the controller directs the data to the slices in FIG. 1. Since, the exemplary controller includes a map or equation representing the index, the controller can operate deterministically in a highly efficient manner with low latency. Note that the address spaces for references 236a-236d are subsets of the address space for their respective parents. This binary tree is repeated for as many levels as desired when implementing the invention.


Referring to FIG. 2C, a flowchart with reference to FIG. 1 is useful for describing the functions. In step 252, a piece of data having an associated address is retrieved. Step 254 performs four address matches in Level0 (110a). Once Level0 is finished with the data, step 256 utilizes the controller 140 to decide where to forward the data based on the data address and the address spaces associated with the next level for the appropriate slice (112a-112e). Step 258, in Level1, then performs four additional address matches, similar to those performed in Level0 and step 260 forwards the data to the next level for continued processing. These steps continue as shown until the data is delivered to an external device/memory in step 270.


C. Memory Organization


As described above, the first four levels are performed using internal memories resident in the levels (110a-110d). However, there are additional techniques that can be implemented with the invention. For example, FIG. 3 depicts the processor 100 coupled to external memories 310a-310b. The result of the internal search is to generate an address into the external memory. Two RLDRAMS (310a-310b) running at 400 MHz are used for external memory. The fifth slice in the internal memory is used as a shadow slice that can be reprogrammed on the fly for new updates or configurations. FIG. 4 depicts an embodiment detailing external memory organization. One aspect of the invention is advantageous since it provides the ability to extend the search to external memory thereby increasing the number of stored addresses.


D. Conclusion


Advantages of the invention include fast switch decisions and low switch latency.


Having disclosed exemplary embodiments and the best mode, modifications and variations may be made to the disclosed embodiments while remaining within the subject and spirit of the invention as defined by the following claims.

Claims
  • 1. A prefix matching apparatus for directing information to a destination, comprising: a memory configured to store a piece of data including an address; a plurality of levels each including a plurality of memory locations, the levels each representing a unique address space; and a controller coupled to the memory and to the plurality of levels, and configured to read the data address and to direct the data to the next level associated with a unique address space associated with the data address.
  • 2. The prefix matching apparatus of claim 1, wherein: the controller is configured to match the data address prefix to a plurality of addresses associated with the unique address spaces.
  • 3. The prefix matching apparatus of claim 1, wherein: the controller is configured to store an index representing the address relationships.
  • 4. The prefix matching apparatus of claim 3, wherein: the index is stored as a map.
  • 5. The prefix matching apparatus of claim 3, wherein: the index is stored as an equation.
  • 6. The prefix matching apparatus of claim 3, further comprising: a plurality of active slices each including predetermined address spaces representing the address relationships of the index.
  • 7. The prefix matching apparatus of claim 6, further comprising: a shadow slice that can be utilized by the controller.
  • 8. The prefix matching apparatus of claim 7, wherein: the shadow slice can be exchanged with one of the active slices, whereupon the exchanged active slice becomes a shadow slice.
  • 9. The prefix matching apparatus of claim 7, wherein: the shadow slice can be reprogrammed.
  • 10. The prefix matching apparatus of claim 8, wherein: the shadow slice can be reprogrammed.
  • 11. The prefix matching apparatus of claim 8, wherein: the shadow slice is exchanged in response to a fault with an active slice.
  • 12. The prefix matching apparatus of claim 1, wherein: the levels support simultaneous lookup of multiple addresses.
  • 13. The prefix matching apparatus of claim 6, wherein: the levels support simultaneous lookup of multiple addresses.
  • 14. The prefix matching apparatus of claim 1, further comprising: an external memory.
  • 15. The prefix matching apparatus of claim 6, further comprising: an external memory.
  • 16. A method of directing information to a destination level based on a memory storing address ranges, comprising the steps of: storing a piece of data including an address; reading the data address and comparing the address to the address ranges; and directing the data to the next level associated with a unique address space associated with the data address.
  • 17. The method of claim 16, further comprising the step of: matching the data address prefix to a plurality of addresses associated with the unique address spaces.
  • 18. The method of claim 16, further comprising the step of: storing an index representing the address relationships.
  • 19. The method of claim 18, wherein the storing step includes the step of: storing the index as a map.
  • 20. The method of claim 18, wherein the storing step includes the step of: storing the index as an equation.
  • 21. The method of claim 18, wherein the storing step includes the step of: storing address spaces in a plurality of active slices each including predetermined address spaces representing the address relationships of the index.
  • 22. The method of claim 21, further comprising the step of: utilizing a shadow slice by exchanging the shadow slice with one of the active slices, whereupon the exchanged active slice becomes a shadow slice.
  • 23. The method of claim 22, wherein the utilizing step includes the step of: reprogramming the the shadow slice.
  • 24. The method of claim 23, wherein the utilizing step includes the step of: exchanging the shadow slice in response to a fault with an active slice.
RELATED APPLICATIONS

This application claims priority to Prov. No. 60/512,121 filed Oct. 17, 2003, incorporated herein by reference.

Provisional Applications (1)
Number Date Country
60512121 Oct 2003 US