Apparatus and method for two-stage packet classification using most specific filter matching and transport level sharing
A method and apparatus for two-stage packet classification. In the first stage, which may be implemented in software, a packet is classified on the basis of the packet's network path and, perhaps, its protocol. In the second stage, which may be implemented in hardware, the packet is classified on the basis of one or more transport level fields of the packet. An apparatus of two-stage packet classification may include a processing system for first stage code execution, a classification circuit for performing the second stage of classification, and a memory to store a number of bins, each bin including one or more rules.
Latest Intel Patents:
- Systems and methods for module configurability
- Hybrid boards with embedded planes
- Edge computing local breakout
- Separate network slicing for security events propagation across layers on special packet data protocol context
- Quick user datagram protocol (UDP) internet connections (QUIC) packet offloading
This application is related to U.S. patent application Ser. No. 10/690,301, entitled “Method and Apparatus for Two-Stage Packet Classification Using Most Specific Filter Matching and Transport Level Sharing,” and filed on Oct. 20, 2003.
FIELD OF THE INVENTIONThe invention relates generally to computer networking and, more particularly, to a method and apparatus for classifying packets.
BACKGROUND OF THE INVENTIONTraditionally, packet routing in computer networks is based solely on the destination address of a packet. This routing technique is generally associated with “best effort” delivery, and all traffic going to the same address is treated identically. However, packet routing based on destination address alone is insufficient to meet growing demands for greater bandwidth, enhanced security, and increased flexibility and service differentiation. To meet these objectives, equipment vendors and service providers are providing more discriminating forms of routing, including routing through firewalls, quality of service (QoS) based forwarding, and bandwidth and/or resource reservation.
Generally, a firewall comprises any component, or combination of components, capable of blocking certain classes of traffic (e.g., “unwanted” or “suspicious” traffic). Firewalls are often utilized in corporate networks and other enterprise networks, and the firewall is usually implemented at the entry and/or exit points—i.e., the “trust boundary”—of the network. A typical firewall includes a series of rules or filters that are designed to carry out a desired security policy.
Network service providers may have a wide array of customers, each requiring different services, service priorities, and pricing. To provide differentiated services to a number of different customers—or, more generally, to provide preferential treatment to certain classes of network traffic—equipment vendors have implemented a variety of mechanisms, including QoS based forwarding and bandwidth/resource reservation. The goal of QoS based forwarding is to provide service differentiation for a number of different customers and/or traffic types. QoS based forwarding may include, for example, forwarding based upon class of service, special queuing procedures (e.g., per-flow queuing), and fair scheduling methods. Integrally tied with QoS forwarding is bandwidth or resource reservation. Bandwidth reservation generally includes reserving a specified bandwidth for certain types of traffic. For example, bandwidth reservation may be applied to traffic between two points, or bandwidth reservation may be applied to traffic relating to a certain application (e.g., multimedia, video, etc.).
To implement the above-described routing methodologies (e.g., firewalls, QoS forwarding, bandwidth reservation) that provide more discriminating routing of network traffic, as well as to perform other policy-based packet forwarding techniques, it is necessary to classify packets. Generally, packet classification comprises distinguishing between packets belonging to different flows or between packets associated with different traffic types. As used herein, a “flow” is a series of packets that share at least some common header characteristics (e.g., packets flowing between two specific addresses). A packet is usually classified based upon one or more fields in the packet's header. One or more rules are applied to this header information to determine which flow the packet corresponds with or what type of traffic the packet is associated with.
A packet classification rule generally includes several fields that are compared against a number of corresponding fields in the header of a received packet, as well as an associated priority and action. The set of rules making up a classification database may be arranged into a prioritized list, and rules with higher priority are preferred over those with lower priority. When a packet is received, the contents of the packet (e.g., certain header fields) are compared with each rule in the classification database to determine the highest priority action that is to be applied to the packet.
A number of methods—both hardware and software implementations—for performing packet classification based upon header data are known in the art, including hashing schemes, bit parallelism techniques, and implementations utilizing content addressable memory (CAM). Hashing methods create groups of rules according to bit masks used in each field of the rules, each group of rules represented by a hash table (or tables). Identifying a rule matching a received packet requires a series of look-ups on the hash tables.
Bit parallelism splits an n-dimensional classification problem into multiple stages of a single dimension each. Each match in a single dimension returns a bit vector. The bit vector has a length equal to the number of rules stored in the system, and a bit in the bit vector is set if the rule corresponding to that bit specifies a range of values matching the appropriate field of the received packet. The rules that have their bits set in all returned bit vectors match the received packet. An improvement over the standard bit parallelism scheme is the aggregated bit vector (ABV) method. For the ABV method, each “full” bit vector is compressed and represented as a smaller size set of bits (called an “aggregated bit vector”). Each bit in the aggregated bit vector represents a group of bits from the full bit vector, and a bit in the aggregated bit vector is set if a least one bit among the associated group of bits (in the full bit vector) is set.
For CAM implementations, each entry of a CAM is associated with a value and a bit mask. The value includes one or more fields of a rule, and the bit mask specifies which bits of a search key are taken into account when the key is compared against the value. The CAM unit—which may be capable of simultaneously comparing the search key against multiple entries—returns an index associated with a highest priority matching entry, and this index is used for identifying the action for the packet.
A number of factors may impact the performance of the above-described classification schemes, including a high number of required memory accesses, large storage requirements, and (at least for CAM implementations) significant power dissipation. Because of the bandwidth and memory overhead, as well as other factors, these packet classification techniques may struggle to keep pace with advances in link speeds as well as growth in classification database sizes, and packet classification can be the bottleneck in routers supporting high speed links (e.g., gigabit capacity).
Embodiments of a packet classifier are disclosed herein. The disclosed embodiments of the packet classifier are described below in the context of a router implementing a packet forwarder (e.g., a firewall, a QoS based forwarder, etc.). However, it should be understood that the disclosed embodiments are not so limited in application and, further, that the embodiments of a packet classifier described in the following text and figures are generally applicable to any device, system, and/or circumstance where classification of packets or other communications is needed.
Illustrated in
The router 200 is coupled via a plurality of links 130—including links 130a, 130b, . . . , 130n—with a number of nodes 110 and/or a number of subnets 120. A node 110 comprises any addressable device. For example, a node 110 may comprise a computer system or other computing device, such as a server, a desktop computer, a laptop computer, or a hand-held computing device (e.g., a personal digital assistant or PDA). A subnet 120 may comprise a collection of other nodes, and a subnet 120 may also include other routers or switches. Each of the links 130a-n may be established over any suitable medium—e.g., wireless, copper wire, fiber optic, or a combination thereof—supporting the exchange of information via any suitable protocol—e.g., TCP/IP (Transmission Control Protocol/Internet Protocol), HTTP (Hyper-Text Transmission Protocol), as well as others.
The network 100 may comprise any type of network, such as a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Wireless LAN (WLAN), or other network. The router 200 also couples the network 100 with another network (or networks) 5, such as, by way of example, the Internet and/or another LAN, MAN, LAN, or WLAN. Router 200 may be coupled with the other network 5 via any suitable medium, including a wireless, copper wire, and/or fiber optic connection using any suitable protocol (e.g., TCP/IP, HTTP, etc.).
It should be understood that the network 100 shown in
In one embodiment, the router 200 comprises any suitable computing device upon which the packet classifier 600 can be implemented (in hardware, software, or a combination of hardware and software). An embodiment of such a computing system is illustrated in
Referring to
Coupled with bus 205 is a processing device (or devices) 300. The processing device 300 may comprise any suitable processing device or system, including a microprocessor, a network processor, an application specific integrated circuit (ASIC), or a field programmable gate array (FPGA), or similar device. An embodiment of the processing device 300 is illustrated below in
Router 200 also includes system memory 210 coupled with bus 205, the system memory 210 comprising, for example, any suitable type and number of random access memories, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), or double data rate DRAM (DDRDRAM). During operation of router 200, an operating system (or set of operating systems) 214, the packet classifier 600, as well as other programs 218 may be resident in the system memory 210. In the embodiment of
Router 200 may further include a read-only memory (ROM) 220 coupled with the bus 205. During operation, the ROM 220 may store temporary instructions and variables for processing device 300. The router 200 may also include a storage device (or devices) 230 coupled with the bus 205. The storage device 230 comprises any suitable non-volatile memory, such as, for example, a hard disk drive. The packet classifier 600 (e.g., the first stage 600a of packet classifier 600), as well as operating system 214 and other programs 218 (e.g., a software implementation of packet forwarder 201), may be stored in the storage device 230. Further, a device 240 for accessing removable storage media (e.g., a floppy disk drive or a CD ROM drive) may be coupled with bus 205.
The router 200 may include one or more input devices 250 coupled with the bus 205. Common input devices 250 include keyboards, pointing devices such as a mouse, and as well as other data entry devices. One or more output devices 260 may also be coupled with the bus 205. Common output devices 260 include video displays, printing devices, audio output devices, and status indicators (e.g., LEDs).
The router 200 further comprises a network/link interface 270 coupled with bus 205. The network/link interface 270 comprises any suitable hardware, software, or combination of hardware and software that is capable of coupling the router 200 with the other network (or networks) 5 and, further, that is capable of coupling the router 200 with each of the links 130a-n.
It should be understood that the router 200 illustrated in
In one embodiment, the packet classifier 600, or a portion of the packet classifier, comprises a set of instructions (i.e., a software application) run on a computing device—e.g., the router 200 of
In another embodiment, the packet classifier 600 (or a portion of the packet classifier) comprises a set of instructions stored on a machine accessible medium, such as, for example, a magnetic media (e.g., a floppy disk or magnetic tape), an optically accessible disk (e.g., a CD-ROM disk), a flash memory device, etc. To run packet classifier 600 on, for example, the router 200 of
In a further embodiment, the packet classifier 600, or a portion of the packet classifier, is implemented in hardware. For example, the packet classifier 600 (or a portion thereof) may be implemented using a content addressable memory (CAM). In yet a further embodiment, the packet classifier 600 may be implemented using a combination of software and hardware.
In one particular embodiment, which will be described below in more detail, the packet classifier 600 comprises a two-stage packet classification system, and this two-stage classification scheme may be implemented in both hardware and software. The two-stage packet classifier comprises a first stage 600a and a second stage 600b (see
As previously noted, an embodiment of processing device 300 is illustrated in
Turning now to
A core 310 and a number of processing engines 320 (e.g., processing engines 320a, 320b, . . . , 320k) are coupled with the local bus 305. In one embodiment, the core 310 comprises a general purpose processing system, which may execute operating system 214. Core 310 may also control operation of processing device 300 and perform a variety of management functions, such as dispensing instructions to the processing engines 320 for execution. Each of the processing engines 320a-k comprises any suitable processing system, and each may include an arithmetic and logic unit (ALU), a controller, and a number of registers (for storing data during read/write operations). Also, in one embodiment, each processing engine 320a-k provides for multiple threads of execution (e.g., four).
Also coupled with the local bus 305 is an on-chip memory subsystem 330. Although depicted as a single unit, it should be understood that the on-chip memory subsystem 330 may—and, in practice, likely does—comprise a number of distinct memory units and/or memory types. For example, such on-chip memory may include SDRAM, SRAM, and/or flash memory (e.g., FlashROM). It should be understood that, in addition to on-chip memory, the processing device 300 may be coupled with off-chip memory (e.g., ROM 220, off-chip cache memory, etc.).
Processing device 300 further includes a bus interface 340 coupled with local bus 305. Bus interface 340 provides an interface with other components of router 200, including bus 205. For simplicity, bus interface 340 is depicted as a single functional unit; however, it should be understood that, in practice, the processing device 300 may include multiple bus interfaces. For example, the processing device 300 may include a PCI bus interface, an IX (Internet Exchange) bus interface, as well as others, and the bus interface 340 is intended to represent a collection of one or more such interfaces.
It should be understood that the embodiment of processing device 300 illustrated and described with respect to
Referring now to
A communication will generally be referred to herein as a “packet.” However, it should be understood that the disclosed embodiments are applicable to any type of communication (e.g., packets, cells, frames, etc.), irrespective of format or content.
Turning to
Referring to
Illustrated in
Each field of a rule may be expressed as an exact match (e.g., a source port equal to “80”), a prefix (e.g., a source address of “128.128.*”), or a range specification (e.g., a source port “≦1023”). However, some ranges (e.g., a source port that is “>1023”) cannot be represented by a prefix, and such expressions may be broken down into a set of prefixes. For example, the range of “>1023” can be delineated by the following series of prefixes (in binary format): “000001**********”; “00001***********”; “0001************”; “001*************”; “01**************”; and “1***************”. Thus, a rule having the field “>1023” can be expanded into six different rules, one for each of the six distinct prefixes comprising the range specification “>1023”. It should be noted here that, in general, a range of K-bits can be broken down into a maximum of (2K−2) prefixes.
Illustrated in
The first stage logic 610 comprises any suitable software, hardware, or combination of software and hardware capable of classifying a received packet on the basis of the packet's network path. In one embodiment, the first stage logic 610 will determine a result based on the received packet's source and destination addresses, and this result is provided to the classifier's second stage 600b. Various embodiments of a method of classifying a packet based on the network path of the packet are described below. Network paths are commonly expressed by source and destination addresses (e.g., a source IP address and a destination IP address). However, it should be understood that expression of a network path is not limited to a source-destination address pair and, further, that other alternative criteria may be used to identify a network path, such as multiprotocol label switching (MPLS) labels (See, e.g., IETF RFC 3031, Multiprotocol Label Switching Architecture (2001)), a combination of a source IP address and a destination multicast group, etc. The first stage data structure 1600, which is also described below in more detail, may be stored in any suitable memory, including SRAM, DRAM, SDRAM, DDRDRAM, as well as other memory types.
The second stage logic 620 comprises any suitable software, hardware, or combination of software and hardware capable of classifying a received packet on the basis of transport level fields (or other fields) contained in the header of a received packet. In one embodiment, the second stage logic 620 receives the result from the first stage of classification and, based on this result and other fields (e.g., transport level fields) of the received packet, determines an action that is to be applied to the packet or otherwise executed. Various embodiments of a method of classifying a packet based on one or more transport level fields (or other fields) contained in the packet's header are described below. The second stage data structure 1700 may be stored in any suitable type of memory, such as a CAM, SRAM, DRAM, SDRAM, or other type of memory. Second stage data structure 1700 is also described below in greater detail.
In one particular embodiment, as alluded to above, the packet classifier 600 is implemented in a combination of software and hardware. More specifically, the first classification stage 600a is implemented in software, and the second classification stage 600b is implemented in hardware. In this embodiment, the first classification stage 600a may comprise a set of instructions stored in a memory (e.g., system memory 210 shown in
The aforementioned two-stage classification scheme, as can be implemented on the two-stage packet classifier 600 of
In the Internet, as well as many other large networks, there is usually many possible routes across the network, but relatively few applications. Thus, it follows that the number of distinct network paths will generally be much larger than the number of applications. These observations are borne out by studies of real classification databases, which suggest that the number of source-destination address pairs found in a set of classification rules is generally much larger than the number of other fields (e.g., transport level fields such as port numbers and protocol). These studies also suggest that many different source-destination address pairs use the same set of transport level fields (or other fields) and, further, that the relative priority and action associated with each member of the set is generally the same in each occurrence of the set. In addition, the number of entries in each set is generally small.
The fact that source-destination address pairs in a classification database routinely use the same set of transport level fields is illustrated in
Returning to
The first stage 600a of the two-stage classification scheme is simplified by reducing the multi-dimensional classification problem to a two-dimensional one, as noted above. However, it is possible—and, in practice, likely—that a packet will match a number of rules in a classification database and, therefore, the first stage 600a will return multiple matches. Multiple matches can occur due, at least in part, to the overlapping nature of the source-destination pairs of all rules in a classification database and, secondly, to the fact that source-destination pairs may be associated with arbitrary priorities. Finding all possible matching rules can significantly increase the number of memory accesses needed in the first classification stage. Furthermore, merging of the results between the first and second stages 600a, 600b of classification becomes difficult when multiple matches are returned from the first classification stage. Thus, in another embodiment, in order to simplify and increase the efficiency of the first stage 600a of packet classification, a single, most specific match is returned from the first stage. In one embodiment, a “most specific match” is a match that provides the greatest amount of information about the network path of a packet (e.g., for IP networks, the most specific match is the intersection of all filters covering the packet). The process of determining and returning a single matching filter from the first classification stage 600a is referred to herein as “most specific filter matching” (or “MSFM”).
Turning to
Both most specific filter matching (MSFM) and transport level sharing (TLS) will now be described in greater detail. This discussion will begin with a description of TLS, followed by a description of MSFM.
A typical classification database comprises a list of rules. This is illustrated in
One example of the partitioning of a classification database into a number of rule sets is illustrated in
Each of the rule sets 1150 in
The small bins 1170 associated with the database 1100 of
The second stage data structure 1700 that is used to classify packets on the basis of transport level fields will be described below. We now turn our attention to a discussion of most specific filter matching.
As previously suggested, when classifying a packet based upon the packet's network path, it is likely that a packet will match multiple rules in a classification database. In order to increase the efficiency of the first classification stage 600a—e.g., to reduce the number of required memory accesses—and, further, in order to simplify merging of the result of the first stage with the second classification stage 600b, it is desirable to return a single, most specific match from the first stage.
It should be noted that, at this point in our discussion, the term “filter” will be used rather than “rule”, as the term “filter” is used herein to refer to the source-destination address pair associated with a rule set (see
That a packet being classified on the basis of its source and destination addresses can match multiple filters is due, at least in part, to the overlapping nature of filters in a classification database. This is illustrated schematically in
Both filters F1 and F2 are shown in
Filters may also be “completely overlapping,” and this scenario is illustrated in
As can be observed from
To classify a packet on the basis of its source and destination addresses, the problem becomes one of finding the smallest intersection of filters where the packet is located (or simply the filter, if the packet does not lie in an intersection). To find this smallest intersection of filters, the first stage of classification (a two-dimensional classification problem) is split into two one-dimensional look-ups. This is illustrated schematically in
The parallel LPM look-up scheme illustrated in
The concept of non-existent filters may be best understood with reference to an example. Referring to
To insure the parallel look-up scheme of
With reference to
Region R2 cannot, however, be merged with any other filter. This region, which is formed from the source address of filter D and the destination address of filter E, is completely covered by a fully specified filter—i.e., filter C. Non-existent filter R2 is distinguished from the other non-existent filter in that it is the only one that is completely contained in a fully specified filter. The non-existent filter R2 cannot be aggregated with filter C, or any other entry, and an entry for this filter should be placed in the filter database. Non-existent filters, such as R2, are also referred to herein as “indicator filters.” An indicator filter is associated with the set of transport level fields corresponding to the smallest possible intersection of filters that completely covers the indicator filter. By way of example, for the set of filters shown in
Some additional observations aid in the development of the first stage data structure 1600. Generally, there are three sources of partial overlap between filters in a classification database, including: (1) partial overlaps created between partially specified filters (i.e., filters of the form “X*, *” or “*, Y*”); (2) partial overlaps created between fully specified filters (i.e., filters of the form “X*, Y*”); and (3) partial overlaps created between partially specified filters and fully specified filters. Note that each partially specified filter having the wildcard in the source dimension creates a partial overlap with all partially specified filters having the wildcard in the destination dimension, and the number of partial overlaps created by the intersections of such partially specified filters is equal to the product of the number of partially specified filters in each of the source and destination dimensions, respectively. The number of partial overlaps due to intersections of partially specified filters can, in theory, be quite large. On the other hand, fully specified filters create an insignificant number of partial overlaps with one another, a result that arises because, in practice, most fully specified filters are segments of straight lines or points in the two-dimensional address space.
As suggested in the preceding paragraph, partially specified filters will typically be the main source of partial overlaps amongst filters in a typical classification database. However, partially specified filters often represent a small fraction of the total number of filters in a classification database, because network administrators usually specify rules that apply to traffic exchanged between particular address domains. Thus, the number of partial filter overlaps caused by partially specified filters is, in practice, significantly less than the theoretical worst case. Also, as noted above, fully specified filters create an insignificant number of partial overlaps between filters. Accordingly, the number of partial overlaps present in real classification databases is generally much smaller than would, in theory, be expected to occur.
At this point, it should be noted that we have not concerned ourselves with completely overlapping filters, as that illustrated in
The above observations and discussion (e.g., see
Referring now to
An embodiment of the parallel LPM data structure 1601 is further illustrated schematically in
The first two indexes 1691 and 1692 (I1 and I2) associated with fully specified filters are combined to create a key 1690. The key 1690, which is associated with a fully specified filter, as well as the third and fourth indexes 1693, 1694, which are associated with partially specified filters, are used to search the forwarding table 1602, as will be described below. The reason for distinguishing between fully and partially specified filters at this juncture is that, should the matching filter be a partially specified filter and should longest prefix matching be used in the first stage of classification, the partially specified filter that you are looking for may not be identified (i.e., the matching source or destination prefix you identify may be “longer” than the corresponding prefix of the actual matching filter).
In one embodiment, as shown in
An embodiment of the primary table 1630 is shown in
Each of the secondary tables 1640a, 1640b is similar to the primary table 1630. However, the key for accessing one of the secondary tables comprises the third index 1693 (I3), and the key for accessing the other secondary tables comprises the fourth index 1694 (I4). If a query on the primary table 1630 returns a match, the secondary tables 1640a-b are ignored, and the matching entry of the primary table corresponds to the most specific matching filter. However, if no match is found in the primary table, then a query on one of the secondary tables 1640a-b may return a match, and this matching entry will correspond to the most specific matching filter. In the event that queries on the primary and secondary tables 1630, 1640a-b do not return a match, a default filter corresponding to the entire two-dimensional filter space (i.e., “*, *”) is used as the most specific filter.
In one embodiment, the primary table 1630 and the secondary tables 1640a, 1640b are implemented as hash tables. In this embodiment, a hashing function may be applied to the key (i.e., the key 1690 or the third and fourth indexes 1693, 1694) to create a search key used for searching the primary and secondary hash tables. Of course, it should be understood that hash tables represent but one example of the manner in which the primary and secondary tables 1630, 1640a-b can be implemented and, further, that other alternative data structures may be utilized.
We now turn our attention to the second stage data structure 1700, an embodiment of which is illustrated in
Referring to
In one embodiment, the second stage data structure 1700 is implemented in a content addressable memory (CAM), such as a ternary CAM. In this embodiment, the CAM may include a number of entries, each entry associated with one of the triplets 1710 of second stage data structure 1700. In a further embodiment, where the second stage data structure 1700 is implemented in a CAM, a number of the CAM's entries (e.g., the triplets 1710 associated with one or more small bins 1720) may be searched in parallel.
Referring now to
The two indexes I1 and I2 associated with the matching fully specified filters are then combined (e.g., concatenated) to form a key (see
Referring to block 1825, the key (formed from I1 and I2) is compared with the key 1637a in each entry 1632 of the primary table 1630 (see
When a match is found in the primary table 1630, the secondary tables 1640a-b are ignored. If a match is not found in the primary table, and a match is found in one of the secondary tables—see block 1835—the bin pointer(s) in the matching entry of that secondary table are accessed, which is shown at block 1840. Note that only one of the secondary tables will have a matching entry (if, indeed, a match is found in the secondary tables). If, however, no match is found in the primary table or either one of the secondary tables, a default entry corresponding to the entire two-dimensional address space is used, and this entry's associated bin pointers are accessed, as set forth at block 1845. At this juncture, the received packet has been classified on the basis of its network path, and the process moves to the second stage of classification.
Referring now to block 1850, a small bin (or, in some embodiments, a large bin) identified by one of the bin pointers is accessed. The transport level fields of the received packet are compared against each entry of the accessed bin (see
As described above, an entry in the primary table or one of the secondary tables may include multiple pointers, each pointer identifying a small bin (i.e., in other words, the entry is associated with a large bin). Thus, after considering all entries in the accessed bin (see block 1855), if a matching entry has not been identified (see block 1860), the process will then look to any other bin pointers (and bins) that have not yet been considered (see block 1850). If there are additional bins to query, the above-described process for accessing a small bin is repeated (i.e., blocks 1850, 1855, and 1860). Thus, so long as there are bin pointers remaining that have not been accessed, the process for accessing and searching a small bin is repeated until a match is found.
Returning at this time to
The above-described embodiment is further illustrated in
Referring first to
Referring next to
Illustrated in
Turning to
As previously described, the two indexes I1 and I2 associated with the matching fully specified filters are then combined to form a key that is used to search the primary table, and the indexes I3 and I4 are used to search the secondary tables, as set forth at blocks 1820a, 1820b, and 1820c. In addition, the indexes I5 and I6 are combined to form a key (see
Referring to block 1825, the key (formed from I1 and I2) is compared with the key 1637a in each entry 1632 of the primary table 1630 (see
We now turn our attention to embodiments of a method for creating and/or updating the first and second stage data structures. Referring to
With reference now to block 2110 in
Referring to block 2130, the source address look-up data structure and destination address look-up data structure, which are to be used for the parallel LPM queries on the source and destination addresses of a received packet, are created (see
To complete the first stage data structure, the forwarding table is constructed (see
Referring to block 2180, the second stage data structure is created. As previously described, in one embodiment, the second stage data structure contains the set of triplets associated with each small bin (see
As suggested above, in one embodiment, the first stage of packet classification may be realized using software and the second classification stage in hardware. Illustrated in
Turning now to
The first classification stage is implemented as a series of software instructions (e.g., first stage code 2250, as shown in
As shown in
Each of the entries 2300—including a SRCPRTLB, SRCPRTUP, DSTPRTLB, DSTPRTUB, action, and priority—will be referred to herein as a “rule.”. Thus, as used herein with respect to the embodiment of
In one embodiment, classification in the second stage does not account for the protocol, which is considered in the first stage. Thus, for example, in the embodiment of
To classify a packet based upon the protocol in the first stage, the protocol (which, again, is typically a fully-specified value) may be concatenated with the search keys used to search the primary and secondary tables. This is illustrated in
Referring now to
Turning next to
A core 2610 and a number of processing engines 2620 (e.g., processing engines 2620a, 2620b, . . . , 2620k) are coupled with the local bus 2605. In one embodiment, the core 2610 comprises a general purpose processing system, which may execute operating system 214. Core 2610 may also control operation of processing device 2600 and perform a variety of management functions, such as dispensing instructions to the processing engines 2620 for execution. Each of the processing engines 2620a-k comprises any suitable processing system, and each may include an arithmetic and logic unit (ALU), a controller, and a number of registers (for storing data during read/write operations). Also, in one embodiment, each processing engine 2620a-k provides for multiple threads of execution (e.g., four).
Also coupled with the local bus 2605 is a memory 2630 for storing a number of bins. Memory 2630 may comprise any type of memory, or combination of memories, capable of storing a number of bins (e.g., small bins and/or large bins). In one embodiment, the memory 2630 comprises a SRAM (e.g., a “scratch” memory). In other embodiments, the memory 2630 comprises a SDRAM, DDRDRAM, and/or a flash memory (e.g., FlashROM).
Processing device 2600 further includes a bus interface 2640 coupled with local bus 2605. Bus interface 2640 provides an interface with other components of system 2500, including bus 205. For simplicity, bus interface 2640 is depicted as a single functional unit; however, it should be understood that, in practice, the processing device 2600 may include multiple bus interfaces. For example, the processing device 2600 may include a PCI bus interface, an IX (Internet Exchange) bus interface, as well as others, and the bus interface 2640 is intended to represent a collection of one or more such interfaces.
In one embodiment, the processing system upon which the first stage code is executed comprises one of the processing engines 2620a-k (e.g., processing engine 2620b). As noted above, in one embodiment, the first stage code (or a portion of these instructions) may be stored in a memory of the processing device 2600. In one embodiment, the first stage code may be stored in an on-chip memory (e.g., the memory 2630 or another memory coupled with the bus 2605). In another embodiment, the first stage code or a portion of this code may be stored in a memory of one of the processing engines (e.g., a memory 2625 of processing engine 2620b).
To perform the second stage of packet classification, the processing device 2600 includes a classification circuit 2700 coupled with bus 2605. Classification circuit 2700 comprises any suitable circuitry or logic capable of classifying a packet on the basis of one or more transport level fields (or other fields). An embodiment of the classification circuit is shown and described below with respect to
It should be understood that the embodiment of processing device 2600 illustrated and described with respect to
Turning now to
The first comparator circuit 2710 will determine whether the received packet's source port is greater than or equal to the source port lower bound of a rule and less than or equal to the source port upper bound of the rule. If this condition is true, the first comparator circuit will provide a signal 2713 (e.g., a logical “high” signal) to output circuitry 2730. Similarly, the second comparator circuit 2720 will determine whether the received packet's destination port is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound, and if this condition is true, the second comparator circuit will provide a signal 2723 (e.g., a logical high signal) to output circuitry 2730. Note that should the comparison performed in either of the comparator circuits 2710, 2720 be false, the comparator circuit may also provide a signal (e.g., a logical “low” signal) indicative of this false condition.
If, for any rule, the output circuitry 2730 receives a signal from each of the comparator circuits 2710, 2720 indicating that their respective comparisons are true, the output circuitry 2730 will provide a match signal 2737 (e.g., a logical high signal). Conversely, if either of the first and second comparator circuits 2710, 2720 fails to provide a signal indicating that their comparison is true, the output circuitry 2730 will provide a match failed signal 2739 (e.g., a logical low signal). The match and match failed signals 2737, 2739 may be provided to the processing engine that is executing the first stage code. Thus, the output circuitry 2730 essentially performs an “AND” operation with the outputs of the first and second comparator circuits 2710, 2720.
Referring to
Based on the source address query, the longest prefix match (LPM) associated with a fully specified filter and the LPM associated with a partially specified filter are identified, as shown at block 2615a. An index I1 associated with the matching fully specified filter and an index I3 associated with the matching partially specified filter are returned (see
In one embodiment, as set forth in block 2620a, the first index I1, the second index I2, and the protocol are then combined (e.g., concatenated) to form a key (see
Although for the embodiment shown in
Referring to block 2625, the key formed from I1, I2, and the protocol is compared with the entries of the primary table. The key formed from I1, I2, and the protocol may be used to search the primary table in a variety of ways. For example, in one embodiment, a hash function is applied to the key, and the hash is used to search the primary table, which is implemented as a hash table. If a match is found in the primary table, a command is issued to the classification circuit for the matching entry of the primary table, as set forth in block 2630. The matching entry of the primary table will identify one or more bins that need to be searched.
In a similar fashion, with reference to block 2635, the key formed from I3 and the protocol and the key formed from I4 and the protocol are each compared with the entries of the appropriate one of the secondary tables. Again, these keys may be used to search the secondary tables according to any suitable technique (e.g., by applying a hash function to the keys and using the results to search the secondary tables, which are implemented as hash tables). If a match is found in one of the secondary tables (again, only one of the secondary tables, if any, should provide a match), a command is issued to the classification circuit for the matching entry of the secondary table including the matching entry, as set forth in block 2640. The matching entry of this secondary table will identify one or more bins that need to be searched. Note that, should a match be found in the primary table, the secondary tables will be ignored.
Referring to block 2645, if no match is found in the primary table and, further, if no match is found in either of the secondary tables (see blocks 2625 and 2635), a command is issued to the classification engine for a default entry (e.g., an entry corresponding to the entire two-dimensional address space “*, *”). The default entry will have one or more associated bins that need to be searched.
In one embodiment, the command issued to the classification circuit will include the base address of the start of the bin (or one of the bins), as well as the number of entries or rules that are included in the bin. For example, referring back to
Classification of the received packet now advances to the second classification stage. Referring to block 2650, the rules identified in the command issued to the classification circuit—e.g., the rules of the bin or bins associated with the matching entry of the forwarding table—are copied from bin memory to the classification circuit. The classification circuit the performs a comparison between these rules and the search values (e.g., the received packet's source and destination ports), as set forth in block 2655. In one embodiment, as shown in
Referring to block 2660, if a match is found in one of the rules, the action associated with the matching rule is returned by the classification circuit, as set forth in block 2665. In one embodiment, the matching rules comprises the first matching rule that is identified. At this point, the second stage of classification is complete, and the action may be applied to the received packet, which is set forth in block 2670.
As noted above, the matching entry from the forwarding table (e.g., the primary table, one of the secondary tables, the default entry, and, perhaps, a wide filter table) may identify a bin (or multiple bins) that includes more rules than the maximum that can be handled by any given command issued to the classification circuit. Therefore, referring back to block 2660, should there be additional rules that have not been searched, and should no match be found in the rules that were copied to the classification circuit (see block 2650), then an additional command may be issued to the classification circuit for other bins and/or rules, as set forth in block 2675. These additional rules are then copied over to the classification circuit (see block 2655), and the above-described process is repeated for this additional set of rules. As many commands as is necessary may be issued to the classification circuit in order to search all bins and/or rules that are identified by the matching entry of the forwarding table.
The foregoing detailed description and accompanying drawings are only illustrative and not restrictive. They have been provided primarily for a clear and comprehensive understanding of the disclosed embodiments and no unnecessary limitations are to be understood therefrom. Numerous additions, deletions, and modifications to the embodiments described herein, as well as alternative arrangements, may be devised by those skilled in the art without departing from the spirit of the disclosed embodiments and the scope of the appended claims.
Claims
1. A method comprising,
- providing a plurality of bins stored in a memory, each of the bins including a number of rules, each rule specifying a source port range and a destination port range;
- identifying, from the plurality of bins, a bin corresponding to a network path and a protocol of a received packet;
- comparing a source port and a destination port of the received packet with the rules of the corresponding bin; and
- if the source port of the received packet is within the source port range of a rule and the destination port of the received packet is within the destination port range of the rule, applying an action associated with the rule to the received packet;
- wherein identifying a bin corresponding to a network path and a protocol of a received packet comprises: searching a source address data structure to find a first index and a third index, the first index associated with a fully specified filter having a source prefix matching the source address of the packet, the third index associated with a partially specified filter having a source prefix matching the source address of the packet; searching a destination address data structure to find a second index and a fourth index, the second index associated with a fully specified filter having a destination prefix matching the destination address of the packet, the fourth index associated with a partially specified filter having a destination prefix matching the destination address of the packet; forming a key from the first index, the second index, and the protocol; and searching a primary table for an entry matching the key, the primary table including a number of entries, each entry corresponding to one of a fully specified filter, a fully specified filter intersection, and an indicator filter; wherein an entry of the primary table matching the key will identify the corresponding bin.
2. The method of claim 1, wherein the rule matching the source and destination ports of the received packet comprises a highest priority matching rule.
3. The method of claim 1, wherein:
- the source port range of each rule is specified by a source port lower bound and a source port upper bound;
- and the destination port range of each rule is specified by a destination port lower bound and a destination port upper bound.
4. The method of claim 3, wherein:
- the source port of the received packet is within the source port range of a rule if the packet's source port is greater than or equal to the source port lower bound of the rule and less than or equal to the source port upper bound of the rule; and
- the destination port of the received packet is within the destination port range of the rule if the packet's destination port is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound of the rule.
5. The method of claim 1, wherein identifying a bin corresponding to a network path and a protocol of a received packet comprises:
- identifying, from a number of entries in a data structure, an entry having a source address prefix matching a source address of the received packet, the matching entry including a first identifier;
- identifying, from a number of entries in another data structure, an entry having a destination address prefix matching a destination address of the received packet, the matching entry including a second identifier; and
- identifying, from the number of bins, a bin corresponding to the first and second identifiers and the protocol.
6. The method of claim 1, further comprising:
- searching a first of two secondary tables for an entry matching a key formed from the third index and the protocol, the first secondary table including a number of entries, each entry corresponding to a partially specified filter; and
- searching a second of the two secondary tables for an entry matching a key formed from the fourth index and the protocol, the second secondary table including a number of entries, each entry corresponding to a partially specified filter;
- wherein, if no match is found in the primary table, a matching entry in one of the two secondary tables will identify the corresponding bin.
7. The method of claim 6, wherein, if no match is found in the primary table or either of the secondary tables, the corresponding bin comprises a default bin associated with an entire two-dimensional address space.
8. The method of claim 1, further comprising:
- searching the source address data structure to find a fifth index associated with a wide filter having a source prefix matching the source address of the packet;
- searching the destination address data structure to find a sixth index associated with a wide filter having a destination prefix matching the destination address of the packet;
- forming a second key from the fifth index, the sixth index, and the protocol; and
- searching a wide filter table for an entry matching the second key, the wide filter table including a number of entries, each entry corresponding to a wide filter;
- wherein, if no match is found in the primary table, a matching entry the wide filter table will identify the corresponding bin.
9. The method of claim 8, wherein each wide filter contained in the wide filter table comprises a fully specified filter having a number of indicator filters exceeding a specified threshold.
10. A method comprising:
- identifying, from a plurality of bins stored in a memory, a bin corresponding to a network path of a received packet, each of the bins including a number of rules, the corresponding bin further corresponding to a protocol associated with the received packet;
- issuing a command to a classification circuit, the command identifying the corresponding bin;
- copying the rules of the corresponding bin from the memory to the classification circuit, wherein the classification circuit compares at least one transport level field of the received packet with each of the rules and provides a match signal if a rule matches the at least one transport level field of the packet; and
- in response to the match signal, applying an action associated with the matching rule to the received packet, wherein identifying a bin corresponding to a network path of a received packet comprises: searching a source address data structure to find a first index and a third index, the first index associated with a fully specified filter having a source prefix matching the source address of the packet, the third index associated with a partially specified filter having a source prefix matching the source address of the packet; searching a destination address data structure to find a second index and a fourth index, the second index associated with a fully specified filter having a destination prefix matching the destination address of the packet, the fourth index associated with a partially specified filter having a destination prefix matching the destination address of the packet; forming a key from the first index, the second index, and the protocol; and searching a primary table for an entry matching the key, the primary table including a number of entries, each entry corresponding to one of a fully specified filter, a fully specified filter intersection, and an indicator filter; and wherein an entry of the primary table matching the key will identify the corresponding bin.
11. The method of claim 10, wherein the matching rule comprises a highest priority matching rule.
12. The method of claim 10, wherein the at least one transport level field of the received packet comprises a source port and a destination port.
13. The method of claim 12, wherein each rule of a bin includes a source port lower bound, a source port upper bound, a destination port lower bound, and a destination port upper bound.
14. The method of claim 13, wherein a rule matches the at least one transport level field of the packet if:
- the source port of the received packet is greater than or equal to the source port lower bound of the rule and less than or equal to the source port upper bound of the rule; and the destination port of the received packet is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound of the rule.
15. The method of claim 10, wherein identifying a bin corresponding to a network path of a received packet comprises:
- identifying, from a number of entries in a data structure, an entry having a source address prefix matching the source address of the received packet, the matching entry including a first identifier;
- identifying, from a number of entries in another data structure, an entry having a destination address prefix matching the destination address of the received packet, the matching entry including a second identifier; and
- identifying, from the number of bins, a bin corresponding to the first and second identifiers and the protocol.
16. The method of claim 10, further comprising:
- searching a first of two secondary tables for an entry matching a key formed from the third index and the protocol, the first secondary table including a number of entries, each entry corresponding to a partially specified filter; and
- searching a second of the two secondary tables for an entry matching a key formed from the fourth index and the protocol, the second secondary table including a number of entries, each entry corresponding to a partially specified filter;
- wherein, if no match is found in the primary table, a matching entry in one of the two secondary tables will identify the corresponding bin.
17. The method of claim 16, wherein, if no match is found in the primary table or either of the secondary tables, the corresponding bin comprises a default bin associated with an entire two-dimensional address space.
18. The method of claim 10, further comprising:
- searching the source address data structure to find a fifth index associated with a wide filter having a source prefix matching the source address of the packet;
- searching the destination address data structure to find a sixth index associated with a wide filter having a destination prefix matching the destination address of the packet;
- forming a second key from the fifth index, the sixth index, and the protocol; and
- searching a wide filter table for an entry matching the second key, the wide filter table including a number of entries, each entry corresponding to a wide filter;
- wherein, if no match is found in the primary table, a matching entry the wide filter table will identify the corresponding bin.
19. The method of claim 18, wherein each wide filter contained in the wide filter table comprises a fully specified filter having a number of indicator filters exceeding a specified threshold.
20. An apparatus comprising:
- a memory, the memory having a plurality of bins stored therein, each bin including a number of rules;
- a processing system, the processing system programmed to identify, from the plurality of bins, a bin corresponding to a network path of a received packet; and
- a classification circuit coupled with the memory and the processing system, the classification circuit to identify, from the rules of the corresponding bin, a rule matching at least one transport level field of the packet, wherein to identify a bin corresponding to a network path of a received packet, the processing system is programmed to perform operations including: searching a source address data structure to find a first index and a third index, the first index associated with a fully specified filter having a source prefix matching the source address of the packet, the third index associated with a partially specified filter having a source prefix matching the source address of the packet; searching a destination address data structure to find a second index and a fourth index, the second index associated with a fully specified filter having a destination prefix matching the destination address of the packet, the fourth index associated with a partially specified filter having a destination prefix matching the destination address of the packet; forming a key from the first index, the second index, and the protocol; and searching a primary table for an entry matching the key, the primary table including a number of entries, each entry corresponding to one of a fully specified filter, a fully specified filter intersection, and an indicator filter; wherein an entry of the primary table matching the key will identify the corresponding bin.
21. The apparatus of claim 20, wherein the rule matching the at least one transport level field comprises a highest priority matching rule.
22. The apparatus of claim 20, wherein the at least one transport level field of the packet includes a source port and a destination port, and wherein each rule of a bin includes a source port lower bound, a source port upper bound, a destination port lower bound, and a destination port upper bound.
23. The apparatus of claim 22, wherein the classification circuit comprises:
- a first comparison circuit to compare the source port of the received packet with the source port lower and upper bounds of one of the rules;
- a second comparison circuit to compare the destination port of the received packet with the destination port lower and upper bounds of the rule; and
- an output circuit to output a match signal if a rule of the corresponding bin matches the source and destination ports of the received packet.
24. The apparatus of claim 23, wherein the rule matches the source and destination ports of the received packet if:
- the source port of the received packet is greater than or equal to the source port lower bound of the rule and less than or equal to the source port upper bound of the rule; and
- the destination port of the received packet is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound of the rule.
25. The apparatus of claim 20, wherein to identify a bin corresponding to a network path of a received packet, the processing system is programmed to perform operations including:
- identifying, from a number of entries in a data structure, an entry having a source address prefix matching the source address of the received packet, the matching entry including a first identifier;
- identifying, from a number of entries in another data structure, an entry having a destination address prefix matching the destination address of the received packet, the matching entry including a second identifier; and
- identifying, from the number of bins, a bin corresponding to the first and second identifiers and the protocol.
26. The apparatus of claim 20, wherein to identify a bin corresponding to a network path of a received packet, the processing system is programmed to perform operations further including:
- searching a first of two secondary tables for an entry matching a key formed from the third index and the protocol, the first secondary table including a number of entries, each entry corresponding to a partially specified filter; and
- searching a second of the two secondary tables for an entry matching a key formed from the fourth index and the protocol, the second secondary table including a number of entries, each entry corresponding to a partially specified filter;
- wherein, if no match is found in the primary table, a matching entry in one of the two secondary tables will identify the corresponding bin.
27. The apparatus of claim 26, wherein, if no match is found in the primary table or either of the secondary tables, the corresponding bin comprises a default bin associated with an entire two-dimensional address space.
28. The apparatus of claim 20, wherein to identify a bin corresponding to a network path of a received packet, the processing system is programmed to perform operations further including:
- searching the source address data structure to find a fifth index associated with a wide filter having a source prefix matching the source address of the packet;
- searching the destination address data structure to find a sixth index associated with a wide filter having a destination prefix matching the destination address of the packet;
- forming a second key from the fifth index, the sixth index, and the protocol; and
- searching a wide filter table for an entry matching the second key, the wide filter table including a number of entries, each entry corresponding to a wide filter;
- wherein, if no match is found in the primary table, a matching entry the wide filter table will identify the corresponding bin.
29. The apparatus of claim 28, wherein each wide filter contained in the wide filter table comprises a fully specified filter having a number of indicator filters exceeding a specified threshold.
30. The apparatus of claim 20, wherein the memory, the processing system, and the classification circuit comprise a single processing device.
31. A system, comprising:
- a bus;
- a processing device coupled with the bus, the processing device including a memory, the memory having a plurality of bins stored therein, each bin including a number of rules, a processing engine, the processing engine programmed to identify, from the plurality of bins, a bin corresponding to a network path of a received packet, the corresponding bin further corresponding to a protocol associated with the received packet, and a classification circuit coupled with the memory and the processing engine, the classification circuit to identify, from the rules of the corresponding bin, a rule matching at least one transport level field of the packet; and
- a network interface coupled with the bus, the network interface to couple the system with an optical link, wherein to identify a bin corresponding to a network path of a received packet, the processing engine is programmed to perform operations including: searching a source address data structure to find a first index and a third index, the first index associated with a fully specified filter having a source prefix matching the source address of the packet, the third index associated with a partially specified filter having a source prefix matching the source address of the packet; searching a destination address data structure to find a second index and a fourth index, the second index associated with a fully specified filter having a destination prefix matching the destination address of the packet, the fourth index associated with a partially specified filter having a destination prefix matching the destination address of the packet; forming a key from the first index, the second index, and the protocol; and searching a primary table for an entry matching the key, the primary table including a number of entries, each entry corresponding to one of a fully specified filter, a fully specified filter intersection, and an indicator filter; wherein an entry of the primary table matching the key will identify the corresponding bin.
32. The system of claim 31, wherein the rule matching the at least one transport level field comprises a highest priority matching rule.
33. The system of claim 31, wherein the at least one transport level field of the packet includes a source port and a destination port, and wherein each rule of a bin includes a source port lower bound, a source port upper bound, a destination port lower bound, and a destination port upper bound.
34. The system of claim 33, wherein the classification circuit comprises:
- a first comparison circuit to compare the source port of the received packet with the source port lower and upper bounds of one of the rules;
- a second comparison circuit to compare the destination port of the received packet with the destination port lower and upper bounds of the rule; and
- an output circuit to output a match signal if a rule of the corresponding bin matches the source and destination ports of the received packet.
35. The system of claim 34, wherein the rule matches the source and destination ports of the received packet if:
- the source port of the received packet is greater than or equal to the source port lower bound of the rule and less than or equal to the source port upper bound of the rule; and
- the destination port of the received packet is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound of the rule.
36. The system of claim 31, wherein to identify a bin corresponding to a network path of a received packet, the processing engine is programmed to perform operations including:
- identifying, from a number of entries in a data structure, an entry having a source address prefix matching the source address of the received packet, the matching entry including a first identifier;
- identifying, from a number of entries in another data structure, an entry having a destination address prefix matching the destination address of the received packet, the matching entry including a second identifier; and
- identifying, from the number of bins, a bin corresponding to the first and second identifiers and the protocol.
37. The system of claim 31, wherein to identify a bin corresponding to a network path of a received packet, the processing engine is programmed to perform operations further including:
- searching a first of two secondary tables for an entry matching a key formed from the third index and the protocol, the first secondary table including a number of entries, each entry corresponding to a partially specified filter; and
- searching a second of the two secondary tables for an entry matching a key formed from the fourth index and the protocol, the second secondary table including a number of entries, each entry corresponding to a partially specified filter;
- wherein, if no match is found in the primary table, a matching entry in one of the two secondary tables will identify the corresponding bin.
38. The system of claim 37, wherein, if no match is found in the primary table or either of the secondary tables, the corresponding bin comprises a default bin associated with an entire two-dimensional address space.
39. The system of claim 31, wherein to identify a bin corresponding to a network path of a received packet, the processing engine is programmed to perform operations farther including:
- searching the source address data structure to find a fifth index associated with a wide filter having a source prefix matching the source address of the packet;
- searching the destination address data structure to find a sixth index associated with a wide filter having a destination prefix matching the destination address of the packet;
- forming a second key from the fifth index, the sixth index, and the protocol; and
- searching a wide filter table for an entry matching the second key, the wide filter table including a number of entries, each entry corresponding to a wide filter;
- wherein, if no match is found in the primary table, a matching entry the wide filter table will identify the corresponding bin.
40. The system of claim 39, wherein each wide filter contained in the wide filter table comprises a fully specified filter having a number of indicator filters exceeding a specified threshold.
41. The system of claim 31, wherein the memory comprises a static random access memory (SRAM).
42. An article of manufacture comprising:
- a computer-readable medium encoded with computer-executable instructions that, when accessed by a machine, causes the machine, to:
- identify, from a plurality of bins stored in a memory, a bin corresponding to a network path of a received packet, and farther corresponding to a protocol associated with the received packet, each of the bins including a number of rules;
- issue a command to a classification circuit, the command identifying the corresponding bin;
- copy the rules of the corresponding bin from the memory to the classification circuit, wherein the classification circuit compares at least one transport level field of the received packet with each of the rules and provides a match signal if a rule matches the at least one transport level field of the packet;
- in response to the match signal, apply an action associated with the matching rule to the received packet; and when identifying a bin corresponding to a network path of a received packet, to: search a source address data structure to find a first index and a third index, the first index associated with a filly specified filter having a source prefix matching the source address of the packet, the third index associated with a partially specified filter having a source prefix matching the source address of the packet; search a destination address data structure to find a second index and a fourth index, the second index associated with a filly specified filter having a destination prefix matching the destination address of the packet, the fourth index associated with a partially specified filter having a destination prefix matching the destination address of the packet; form a key from the first index, the second index, and the protocol; and search a primary table for an entry matching the key, the primary table including a number of entries, each entry corresponding to one of a fully specified filter, a fully specified filter intersection, and an indicator filter; wherein an entry of the primary table matching the key will identify the corresponding bin.
43. The article of manufacture of claim 42, wherein the matching rule comprises a highest priority matching rule.
44. The article of manufacture of claim 42, wherein the at least one transport level field of the received packet comprises a source port and a destination port, and wherein each rule of a bin includes a source port lower bound, a source port upper bound, a destination port lower bound, and a destination port upper bound.
45. The article of manufacture of claim 44, wherein a rule matches the at least one transport level field of the packet if:
- the source port of the received packet is greater than or equal to the source port lower bound of the rule and less than or equal to the source port upper bound of the rule; and
- the destination port of the received packet is greater than or equal to the destination port lower bound of the rule and less than or equal to the destination port upper bound of the rule.
46. The article of manufacture of claim 42, wherein the computer-executable instructions, when accessed, further causes the machine, when identifying a bin corresponding to a network path of a received packet, to:
- identify, from a number of entries in a data structure, an entry having a source address prefix matching the source address of the received packet, the matching entry including a first identifier;
- identify, from a number of entries in another data structure, an entry having a destination address prefix matching the destination address of the received packet, the matching entry including a second identifier; and
- identify, from the number of bins, a bin corresponding to the first and second identifiers and the protocol.
47. The article of manufacture of claim 42, wherein the computer-executable instructions, when accessed, further causes the machine to:
- search a first of two secondary tables for an entry matching a key formed from the third index and the protocol, the first secondary table including a number of entries, each entry corresponding to a partially specified filter; and
- search a second of the two secondary tables for an entry matching a key formed from the fourth index and the protocol, the second secondary table including a number of entries, each entry corresponding to a partially specified filter;
- wherein, if no match is found in the primary table, a matching entry in one of the two secondary tables will identify the corresponding bin.
48. The article of manufacture of claim 47, wherein, if no match is found in the primary table or either of the secondary tables, the corresponding bin comprises a default bin associated with an entire two-dimensional address space.
49. The article of manufacture of claim 42, wherein the computer-executable instructions, when accessed, further causes the machine to:
- search the source address data structure to find a fifth index associated with a wide filter having a source prefix matching the source address of the packet;
- search the destination address data structure to find a sixth index associated with a wide filter having a destination prefix matching the destination address of the packet;
- form a second key from the fifth index, the sixth index, and the protocol; and
- search a wide filter table for an entry matching the second key, the wide filter table including a number of entries, each entry corresponding to a wide filter;
- wherein, if no match is found in the primary table, a matching entry the wide filter table will identify the corresponding bin.
50. The article of manufacture of claim 49, wherein each wide filter contained in the wide filter table comprises a fully specified filter having a number of indicator filters exceeding a specified threshold.
6147976 | November 14, 2000 | Shand et al. |
6252872 | June 26, 2001 | Tzeng |
6289013 | September 11, 2001 | Lakshman |
6301669 | October 9, 2001 | Boden |
6341130 | January 22, 2002 | Lakshman |
6529508 | March 4, 2003 | Li et al. |
6567408 | May 20, 2003 | Li et al. |
6587466 | July 1, 2003 | Bhattacharya et al. |
6665495 | December 16, 2003 | Miles et al. |
6920146 | July 19, 2005 | Johnson et al. |
7184444 | February 27, 2007 | Posey, Jr. |
7193997 | March 20, 2007 | Van Lunteren et al. |
7362702 | April 22, 2008 | Terrell et al. |
7367052 | April 29, 2008 | Desanti |
20020165949 | November 7, 2002 | Na et al. |
20020191605 | December 19, 2002 | Lunteren et al. |
20030051165 | March 13, 2003 | Krishnan et al. |
20030063348 | April 3, 2003 | Posey, Jr. |
20030074458 | April 17, 2003 | Gokhale |
20030123386 | July 3, 2003 | Yang |
20030167348 | September 4, 2003 | Greenblat |
20030200339 | October 23, 2003 | Greenblat et al. |
20050041675 | February 24, 2005 | Trostle et al. |
20050044264 | February 24, 2005 | Grimminger et al. |
20050083935 | April 21, 2005 | Kounavis et al. |
WO 2005/041503 | May 2005 | WO |
PCT/US2005/010924 | July 2005 | WO |
- M.E. Kounavis, et al., “Directions in Packet Classification for Network Processors”, Second on Network Processors (NP2), Anaheim, CA, Feb. 2003, pp. 1-10.
- P.F. Tsuchiya, “A Search Algorithim for Table Entries With Non-Contiguous Wildcarding”, Bellcore, 1991, 9 pgs.
- Degermark, et al., “Small Forwarding Tables for Fast Routing Lookups”, Computer Communication Review, acm sigcomm, vol. 27, No. 4, Oct. 1997, 16 pgs.
- Shafai, et al., “Fully Parallel 30-MHz, 2.5Mb CAM”, IEEE Journal of Solid-State Circuits, vol. 33, No. 11, Nov. 1998, 9. pgs.
- Srinivasan, et al., “Fast and Scalable Layer Four Switching”, Computer Communication Review, acm sigcomm, vol. 28, No. 4, Oct. 1998, 14 pgs.
- Lakshman, et al., “High-Speed Policy-Based Packet Forwarding Using Efficient Multi-Dimensional Range Matching”, Computer Communication Review, acm sigcomm, vol. 28, No. 4, Oct. 1998, 14pgs.
- Buddhikot, et al., “Space Decomposition Techniques for FST Layer-4 Switching”, IEEE Com-Soc TC on Gigabit Networking Sixth Intnl. Workshop on Protocals for High-Speed Networks (PfHSN 99), 1999, 12 pgs.
- Gutpa, et al., “Packet Classification on Multiple Fields”, Computer Communication Review, acm sigcomm, vol. 29, No. 4, Oct. 1999, 16 pgs.
- Srinivasan, et al., “Packet Classification Using Tuple Space Search” Computer Communication Review, acm sigcomm, vol. 29, No. 4, Oct. 1999, 14 pgs.
- Gupta, et al., “Classifying Packets With Heirarchical Intelligent Cuttings”, IEEE Micro Chips, Systems Software, and Applications, Jan./Feb. 2000, 10 pgs.
- Hari, et al. “Detecting and Resolving Packet Filter Conflicts”, IEEE Infocom 2000, The Conference on Computer Communications, vol. 3, 12 pgs.
- Feldman, et al., “Tradeoffs for Packet Classification”, IEEE Infocom 2000, The Conference on Computer Communications, vol. 3, 12 pgs.
- Baboescu, et al., “Scalable Packet Classification”, Computer Communication Review, acm sigcomm, vol. 31, No. 4, Oct. 2001, 14 pgs.
- Prakash, et al., “OC-3072 Packet Classification Using BDDs and Pipelined SRAMs” HOT Interconnects 9, Symposium on High Performance Interconnects, IEEE Computer Society, 2001, 8 pgs.
- Gutpa, et al., “Algorithims for Packet Classification”, IEEE Network, The Magazine of Global Internetworking, Mar./Apr. 2001, vol. 15, No. 2, 11 pgs.
- Baboescu, et al., “Packet Classification for Core Routers: Is There an Alternative to CAMs?”, IEEE Infocom 2003, 11 pgs.
- Kounavis M E et al., “Directions in Packet Classification for Network Processors”, 2nd Workshop on Network Processors, Feb. 8, 2003, pp. 1-10, Online: URL:http://web.archive.org/web/20031202171.
- Chen W T et al., “A Two-Stage Packet Classification Algorithm”, Proceedings 17th International Conference on Advanced Information Networking and Applications, 2003 IEEE, Mar. 27, 2003, pp. 762-767.
- European Patent Office, “Office Action”, Application No. 05732332.1-1525 (P17967EP), (Aug. 2, 2007), 4 pages.
Type: Grant
Filed: Apr 8, 2004
Date of Patent: Apr 28, 2009
Patent Publication Number: 20050226235
Assignee: Intel Corporation (Santa Clara, CA)
Inventors: Alok Kumar (Santa Clara, CA), Michael E. Kounavis (Hillsboro, OR), Raj Yavatkar (Portland, OR), Prashant R Chandra (Sunnyvale, CA), Sridhar Lakshmanamurthy (Sunnyvale, CA), Chen-Chi Kuo (Pleasanton, CA), Harrick M. Vin (Austin, TX)
Primary Examiner: Edan Orgad
Assistant Examiner: Venkatesh Haliyur
Attorney: Blakely, Sokoloff, Taylor & Zafman LLP
Application Number: 10/822,034
International Classification: H04L 12/56 (20060101); H04L 12/28 (20060101);