US20150215204A1 - Method and apparatus for pre-classifying packets - Google Patents
Method and apparatus for pre-classifying packets Download PDFInfo
- Publication number
- US20150215204A1 US20150215204A1 US14/679,346 US201514679346A US2015215204A1 US 20150215204 A1 US20150215204 A1 US 20150215204A1 US 201514679346 A US201514679346 A US 201514679346A US 2015215204 A1 US2015215204 A1 US 2015215204A1
- Authority
- US
- United States
- Prior art keywords
- packet
- data
- port
- attributes
- classification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/70—Routing based on monitoring results
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2441—Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Definitions
- the disclosed embodiments generally relate to packet-processing systems associated with communications networks. More specifically, the disclosed embodiments relate to a method and an apparatus for pre-classifying packets and determining per-packet attributes for subsequent packet-processing operations.
- Traditional ports in communication networks receive packets and forward them to a main processing unit where they are classified, modified, metered, counted, and forwarded to the next destination.
- Traditional ports work well in most scenarios. However, there are a few scenarios where more intelligence is needed at the port level. For example, in oversubscribed scenarios, the main processing unit is not able to process all incoming packets, which can lead to packets being dropped. In these scenarios, it is important to be able to drop “best effort” traffic, and not to drop control packets or other important packets.
- packets may be directed to different destinations in the packet-processing device. For example, some packets may be destined for the main processing unit and others may be destined for a configuration unit. Hence, it is useful for ports to be able to rapidly and efficiently determine the destination for a packet. These differing destinations are also significant because packets may require different packet attributes depending upon what type of processing device they are targeted for.
- the disclosed embodiments relate to a system that provides an intelligent port infrastructure for communication network devices. This is accomplished by incorporating a highly configurable pre-classifier module into the port infrastructure. This pre-classifier makes it possible to realign packet data to add a configurable number of bytes to the front of the packet, and also to select interesting data from incoming packets for further analysis. The selected data is sent into a configurable classification engine, which generates instructions that specify how to determine associated packet attributes. The packet attributes are then generated based on the instructions, and are forwarded along with the packet to downstream processing units.
- the configurable number of bytes for the packet realignment is determined based at least partly on the input port.
- selecting the data from the one or more locations in the packet involves selecting the data from a set of locations associated with the input port.
- performing the classification operation additionally involves using a channel number associated with the packet and a programmable identifier associated with the input port to perform the classification.
- the channel number is received as in-band control information with the packet (i.e., as a header parsed by the port).
- the system additionally adjusts a packet base pointer based on the classification, wherein the packet base pointer accompanies the packet and points to a specific header in the packet.
- performing the classification operation involves performing a lookup in a lookup structure based on the selected data for the packet.
- the lookup structure is a ternary content-addressable memory (TCAM).
- TCAM ternary content-addressable memory
- generating the attributes involves combining one or more of the following: data from the classification result; data from the packet; and information forwarded from the input port.
- the attributes for the packet include one or more of the following: a mapping type; a packet type; a color; a class of service; a destination queue identifier; a number of copies; a mirror enable; a mirror queue identifier; and a packet base pointer.
- FIG. 1 illustrates a network router or switch in accordance with the disclosed embodiments.
- FIG. 2 illustrates a line card in accordance with the disclosed embodiments.
- FIG. 3 illustrates a network processor in accordance with the disclosed embodiments.
- FIG. 4 illustrates the structure of a port which includes a pre-classifier in accordance with the disclosed embodiments.
- FIG. 5 presents a flow chart illustrating the operations involved in processing a packet in accordance with the disclosed embodiments.
- FIG. 6 illustrates the packet alignment process in accordance with the disclosed embodiments.
- FIG. 7 illustrates the data selection process in accordance with the disclosed embodiments.
- FIG. 8A illustrates default values for attributes in an exemplary packet attribute structure in accordance with the disclosed embodiments.
- FIG. 8B illustrates how packet attributes are generated in accordance with the disclosed embodiments.
- non-transitory computer-readable storage medium which may be any device or medium that can store code and/or data for use by a computer system.
- the non-transitory computer-readable storage medium includes, but is not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing code and/or data now known or later developed.
- the methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a non-transitory computer-readable storage medium as described above.
- a computer system reads and executes the code and/or data stored on the non-transitory computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the non-transitory computer-readable storage medium.
- the methods and processes described below can be included in hardware modules.
- the hardware modules can include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), and other programmable-logic devices now known or later developed. When the hardware modules are activated, the hardware modules perform the methods and processes included within the hardware modules.
- ASIC application-specific integrated circuit
- FPGAs field-programmable gate arrays
- the disclosed embodiments make it possible to send packets from multiple ports through a shared pre-classification stage. As mentioned above, this is accomplished by incorporating a configurable pre-classifier module into the port infrastructure. This pre-classifier makes it possible to realign data to add a configurable number of bytes to the front of the packet. The pre-classifier also selects interesting data from incoming packets. This selected data is sent into a configurable classification engine, which generates instructions that specify how to determine associated packet attributes. Note that different ports can be grouped together or separated based on a per port configurable identifier which accompanies each packet through the classification stage. Moreover, each port has its own set of configuration registers that can be used to determine which packet data or control information is to be classified by the classification engine.
- the packet attributes are generated based on the instructions from the classification engine. Then, the attributes are forwarded along with the packet from the output of the port infrastructure to downstream processing units. While generating the packet attributes, some attributes can be taken directly from the packet itself. For example, the destination queue can be taken directly from a packet header in the packet data. Other attributes can be calculated based on the classification results and based on values taken from per-port configuration registers. For example, the destination queue can be calculated as the sum of the classification result, the port's configuration value, and a channel number. This makes the classification extremely flexible yet easy to configure.
- FIG. 1 illustrates the structure of network router (or network switch) 100 in accordance with the disclosed embodiments.
- Network router/switch 100 includes a switch fabric 110 , which is coupled to a number of line cards 101 - 104 , through associated line card “system interfaces” 121 - 124 .
- These line cards 101 - 104 are coupled to various communication lines (e.g., fiber optic links) through associated line card “line interfaces” 111 - 114 .
- line card 101 includes a physical interface 202 that contains circuitry to facilitate communications through line interface 111 .
- Line card 101 also includes a switch fabric interface 206 that contains circuitry to facilitate communications through system interface 121 .
- Physical interface 202 and switch fabric interface 206 are coupled to a network processor 204 , which performs various packet-processing operations.
- line card 101 provides an “ingress data path” 208 for packets, which flows from line interface 111 through physical interface 202 and network processor 204 , and then through switch fabric interface 206 and system interface 121 into switch fabric 110 (see FIG. 1 ).
- a corresponding “egress data path” 210 flows in the opposite direction from switch fabric 110 through system interface 121 , then through switch fabric interface 206 and network processor 204 , and then through physical interface 202 and line interface 111 to an associated communication channel.
- FIG. 3 illustrates the internal structure of a network processor 204 in accordance with the disclosed embodiments.
- Network processor 204 includes a port module 302 which includes one or more ports (traffic interfaces) 307 .
- Port module 302 also includes a pre-classifier 308 , which performs various pre-classification operations that are described in more detail below.
- Port module 302 is also coupled to a buffer module, which includes a number of queues 310 for buffering packets. These queues 310 feed into a scheduler 312 , which schedules packets to be sent to various destinations through the switch fabric.
- buffer 304 drops packets if necessary, for example by implementing a “tail drop” policy.
- FIG. 4 illustrates the structure of a port module 302 which includes one or more ports 307 and a pre-classifier 308 in accordance with the disclosed embodiments.
- port 302 receives data 412 (in the form of a packet) through port(s) 307 and outputs aligned data 414 and attributes 420 .
- the received data 412 feeds into a pre-classifier 308 within port module 302 , and pre-classifier 308 performs a number of operations on the data.
- pre-classifier 308 typically operates are follows. First, a packet is received at pre-classifier 308 through port(s) 307 (step 502 ). Next, data 412 from the packet passes through a packet alignment stage 402 , which aligns data 412 to add a configurable number of bytes to the front of the packet to produce aligned data 414 (step 504 ). The packet alignment process is described in more detail below with reference to FIG. 6 .
- aligned data 414 passes into a data selection stage 404 , which selects data from one or more locations in the packet to produce selected data 416 (step 506 ), wherein selected data 406 also include the channel number and configurable identifier. This data selection process is described in more detail below with reference to FIG. 7 . Note that aligned data 414 also passes from data selection stage 404 to the output of port module 302 .
- Selected data 416 then feeds into classification stage 406 which performs a classification operation on selected data 416 to generate a classification result 418 , which includes instructions specifying how to generate attributes for the packet (step 508 ).
- the classification operation involves performing a lookup in a lookup structure based on selected data 416 .
- the lookup structure can be a ternary content-addressable memory (TCAM) with 512 entries, which performs the classification lookup, and an associated static random-access memory (SRAM), which provides a ten-byte classification result 418 .
- TCAM ternary content-addressable memory
- SRAM static random-access memory
- TCAM uses a TCAM to perform a longest prefix match, which is useful in many packet-processing operations.
- another lookup structure such as a search tree, can be used to perform the classification.
- a custom hardware engine or a software programmable micro-controller can be used to perform the classification operation and to provide the classification results.
- attribute-generation stage 408 uses the instructions from classification result 418 to generate attributes 420 for the packet (step 510 ).
- This attribute-generation process can involve combining data from classification result 418 with configuration values from a corresponding input port and possibly data from the packet itself. This attribute-generation process is described in more detail below with reference to FIG. 8B .
- the attributes 420 are forwarded along with the aligned data 414 in the packet to facilitate downstream packet-processing operations (step 512 ).
- FIG. 6 illustrates the packet alignment process 600 in accordance with the disclosed embodiments.
- the packet before the alignment process, the packet includes a QMAP header 606 and a payload 604 .
- QMAP header 606 is a proprietary header which can hold buffer enqueue commands and addresses.
- additional header space 608 is added to the front of the packet.
- the alignment process makes it possible to add up to 127 bytes to the front of the packet. Note that the number of bytes which are added to the front of the packet can depend upon the input port (or input sub-port) from which the packet was received.
- the terms “port” and “sub-port” are used interchangeably throughout this disclosure.
- This additional header space 608 can initially be blank and can be populated in downstream stages to include information which accompanies the packet through a backplane or switch fabric. For example, this information can include instructions associated with egress from the backplane or switch fabric. Moreover, this information can be stripped off when the packet leaves the router or switch. Additional header space 608 can also be used to store Multiprotocol Label Switching (MPLS) tags or to make room for inserting Virtual Local Area Network (VLAN) tags. (Note that a VLAN tag can be inserted by shifting an existing header into the additional header space and writing the VLAN tag into the position where the header was.)
- MPLS Multiprotocol Label Switching
- VLAN Virtual Local Area Network
- FIG. 7 illustrates operation of the data selection stage 404 in accordance with the disclosed embodiments.
- the data selection stage 404 is configurable on a per port basis and lets the user configure selection of up to nine two-byte chunks of data from packets entering the device through a specific port. These nine data-selection points can select data from anywhere within the first 256 bytes of the packet, thereby facilitating L2-L4 classification.
- the selected data can include a destination MAC address from the packet.
- the data selection stage 404 can be implemented using a number of multiplexers and the data selection points can be associated with the input port from which the packet was received.
- the selected data can also include a configurable ID 706 and channel number 708 , which are received from the input port and are configurable on a “per port” basis.
- configurable ID 706 can be used to group ports together. For example, all gigabit Ethernet ports can be assigned a configurable ID 706 with a one on the most significant bit. These groupings can be used during subsequent classification operations.
- a higher-priority TCAM entry in classification stage 406 can be configured to direct a packet to a specific destination if the packet originates from a Gigibit Ethernet port and includes a specification destination MAC address.
- a lower-priority entry can direct the packet to another destination if the packet originates from a Gigabit Ethernet port and does not match the higher-priority entry.
- the circuitry illustrated in FIG. 7 also pulls QMAP data 702 out of the packet using selectors S 0 , S 1 and S 2 , wherein this QMAP data 702 is forwarded to the attribute-generation stage 408 .
- FIG. 8A illustrates default values for specific attributes in an exemplary packet attribute structure in accordance with the disclosed embodiments.
- the packet attribute structure “PktAttr” includes a number of fields.
- the first field is MappingType, which indicates whether an associated parameter is direct mapped or indirectly mapped.
- the default value for this parameter is zero, which indicates that the parameter is direct mapped.
- the second field is PacketType, which indicates, for example, whether the packet is unicast or multicast.
- the default value for this parameter is zero, which indicates that the packet is unicast.
- the third parameter is Color, which is a drop precedence parameter that facilitates subsequently determining whether the packet should be dropped from a queue.
- the default value for this parameter is BaseColr, which is a value defined per port.
- the fourth field is CoS, which specifies a class of service for the packet which can similarly be used to determine precedence for the packet in subsequent downstream processing operations.
- the default value for this parameter is RESERVED.
- the fifth field is Source, which indicates whether the source for an associated parameter should be the classification result or the QMAP header.
- the default value for this parameter is RESERVED.
- the sixth field is Destination, which specifies the destination queue for the packet. The operations involved in calculating this field are described below with reference to FIG. 8B .
- the default value for this parameter is BaseDest, which is a per port defined value.
- the seventh parameter is Copies, which specifies a number of copies for the packet, which for example can be used to process multicast packets.
- the default value for this parameter is one.
- the eighth and ninth parameters are MirrorEn, which enables port mirroring, and MirrorQ, which specifies an associated mirror queue. These parameters can be used to facilitate port mirroring.
- the default value for MirrorEn is zero, which means that port mirroring is disabled, and the default value for MirrorQ is RESERVED.
- the tenth field is PBase, a pointer which points to a specific header in the packet.
- PBase a pointer which points to a specific header in the packet.
- the operations involved in calculating this pointer are described below with reference to FIG. 8B .
- the default value for this pointer is BasePBase, which is a per port defined pointer value.
- FIG. 8B illustrates how the above-described packet attributes are generated in accordance with the disclosed embodiments.
- classification result 418 comprises the data structure “Val.”
- the attribute mapping type PktAttr.MappingType is set to a corresponding value from classification result 418 , namely Val.MappingType.
- PktAttr.PacketType is set to Val.PktType
- PktAttr.Color is set to Val.Colr
- PktAttr.CoS is set to Val.CoS.
- PktAttr.Source is set to either Val.Src or Qmap.Src (wherein Qmap.Src is a value from QMAP data 702 illustrated in FIG. 7 ) depending upon whether a corresponding field Val.SrcSel is set or not.
- Val.DestOp is used as an opcode to select a specific technique for calculating the destination for the packet, namely, PktAttr.Destination.
- the destination is the sum of Val.Dest and BaseDest and Chnl (wherein Chnl is the per port channel value 708 illustrated in FIG. 7 ).
- Chnl is the per port channel value 708 illustrated in FIG. 7 .
- the Chnl value is selectively shifted by different number of bits for different opcodes.
- a large number of different destinations can be specified based on a relatively small number of entries from the TCAM and SRAM in the classifier. This saves a considerable amount of space in the TCAM and SRAM.
- PktAttr.Copies is set to either Val.Cps or Qmap.Cps depending upon whether a corresponding field Val.CpsSel is set or not. Then, PktAttr.MirrorEn is set to Val.MirrorEn and PktAttr.MirrorQ is set to Val.MirrorQ.
- Val.PBaseOp is used as an opcode to select a specific technique for calculating a packet base pointer (PktAttr.PBase), which points to a specific header in the packet.
- PktAttr.PBase packet base pointer
- the pointer is simply taken from a per port value BasePBase.
- the pointer is taken from the Val.PBase parameter from classification result 418 .
- the pointer is computed by either adding or subtracting BasePBase and Val.PBase. In this way, the present invention makes it possible to define a packet base pointer by using both a per port “base value” and the classification results.
- embodiments of the present invention can modify the packet itself by writing classification data into the packet. This can, for example, be used to insert special headers needed for enqueuing in certain packet buffer structures, or to transfer timestamp information or classification information to downstream processing units.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosed embodiments relate to a system that provides an intelligent port infrastructure for communication network devices. This is accomplished by incorporating a highly configurable pre-classifier module into the port infrastructure. This pre-classifier makes it possible to realign packet data to add a configurable number of bytes to the front of the packet, and also to select interesting data from incoming packets for further analysis. The selected data is sent into a configurable classification engine, which generates instructions that specify how to determine associated packet attributes. The packet attributes are then generated based on the instructions, and are forwarded along with the packet to downstream processing units.
Description
- This application is a continuation of U.S. application Ser. No. 13/052,336, “Method and Apparatus for Pre-Classifying Packets” filed on Mar. 21, 2011, the entire contents of which are incorporated herein by reference.
- 1. Field
- The disclosed embodiments generally relate to packet-processing systems associated with communications networks. More specifically, the disclosed embodiments relate to a method and an apparatus for pre-classifying packets and determining per-packet attributes for subsequent packet-processing operations.
- 2. Related Art
- Traditional ports in communication networks receive packets and forward them to a main processing unit where they are classified, modified, metered, counted, and forwarded to the next destination. Traditional ports work well in most scenarios. However, there are a few scenarios where more intelligence is needed at the port level. For example, in oversubscribed scenarios, the main processing unit is not able to process all incoming packets, which can lead to packets being dropped. In these scenarios, it is important to be able to drop “best effort” traffic, and not to drop control packets or other important packets.
- Moreover, different packets may be directed to different destinations in the packet-processing device. For example, some packets may be destined for the main processing unit and others may be destined for a configuration unit. Hence, it is useful for ports to be able to rapidly and efficiently determine the destination for a packet. These differing destinations are also significant because packets may require different packet attributes depending upon what type of processing device they are targeted for.
- Traditional ports in communication network devices typically do not incorporate the above-described functionality or intelligence. Hence, what is needed is a method and an apparatus which provides such functionality at the port level.
- The disclosed embodiments relate to a system that provides an intelligent port infrastructure for communication network devices. This is accomplished by incorporating a highly configurable pre-classifier module into the port infrastructure. This pre-classifier makes it possible to realign packet data to add a configurable number of bytes to the front of the packet, and also to select interesting data from incoming packets for further analysis. The selected data is sent into a configurable classification engine, which generates instructions that specify how to determine associated packet attributes. The packet attributes are then generated based on the instructions, and are forwarded along with the packet to downstream processing units.
- In some embodiments, the configurable number of bytes for the packet realignment is determined based at least partly on the input port.
- In some embodiments, selecting the data from the one or more locations in the packet involves selecting the data from a set of locations associated with the input port.
- In some embodiments, performing the classification operation additionally involves using a channel number associated with the packet and a programmable identifier associated with the input port to perform the classification. (Note that the channel number is received as in-band control information with the packet (i.e., as a header parsed by the port).)
- In some embodiments, the system additionally adjusts a packet base pointer based on the classification, wherein the packet base pointer accompanies the packet and points to a specific header in the packet.
- In some embodiments, performing the classification operation involves performing a lookup in a lookup structure based on the selected data for the packet.
- In some embodiments, the lookup structure is a ternary content-addressable memory (TCAM).
- In some embodiments, generating the attributes involves combining one or more of the following: data from the classification result; data from the packet; and information forwarded from the input port.
- In some embodiments, the attributes for the packet include one or more of the following: a mapping type; a packet type; a color; a class of service; a destination queue identifier; a number of copies; a mirror enable; a mirror queue identifier; and a packet base pointer.
-
FIG. 1 illustrates a network router or switch in accordance with the disclosed embodiments. -
FIG. 2 illustrates a line card in accordance with the disclosed embodiments. -
FIG. 3 illustrates a network processor in accordance with the disclosed embodiments. -
FIG. 4 illustrates the structure of a port which includes a pre-classifier in accordance with the disclosed embodiments. -
FIG. 5 presents a flow chart illustrating the operations involved in processing a packet in accordance with the disclosed embodiments. -
FIG. 6 illustrates the packet alignment process in accordance with the disclosed embodiments. -
FIG. 7 illustrates the data selection process in accordance with the disclosed embodiments. -
FIG. 8A illustrates default values for attributes in an exemplary packet attribute structure in accordance with the disclosed embodiments. -
FIG. 8B illustrates how packet attributes are generated in accordance with the disclosed embodiments. - The following description is presented to enable any person skilled in the art to make and use the disclosed embodiments, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the disclosed embodiments. Thus, the disclosed embodiments are not limited to the embodiments shown, but are to be accorded the widest scope consistent with the principles and features disclosed herein.
- The data structures and code described in this detailed description are typically stored on a non-transitory computer-readable storage medium, which may be any device or medium that can store code and/or data for use by a computer system. The non-transitory computer-readable storage medium includes, but is not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing code and/or data now known or later developed.
- The methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a non-transitory computer-readable storage medium as described above. When a computer system reads and executes the code and/or data stored on the non-transitory computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the non-transitory computer-readable storage medium. Furthermore, the methods and processes described below can be included in hardware modules. For example, the hardware modules can include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), and other programmable-logic devices now known or later developed. When the hardware modules are activated, the hardware modules perform the methods and processes included within the hardware modules.
- The disclosed embodiments make it possible to send packets from multiple ports through a shared pre-classification stage. As mentioned above, this is accomplished by incorporating a configurable pre-classifier module into the port infrastructure. This pre-classifier makes it possible to realign data to add a configurable number of bytes to the front of the packet. The pre-classifier also selects interesting data from incoming packets. This selected data is sent into a configurable classification engine, which generates instructions that specify how to determine associated packet attributes. Note that different ports can be grouped together or separated based on a per port configurable identifier which accompanies each packet through the classification stage. Moreover, each port has its own set of configuration registers that can be used to determine which packet data or control information is to be classified by the classification engine.
- As mentioned above, the packet attributes are generated based on the instructions from the classification engine. Then, the attributes are forwarded along with the packet from the output of the port infrastructure to downstream processing units. While generating the packet attributes, some attributes can be taken directly from the packet itself. For example, the destination queue can be taken directly from a packet header in the packet data. Other attributes can be calculated based on the classification results and based on values taken from per-port configuration registers. For example, the destination queue can be calculated as the sum of the classification result, the port's configuration value, and a channel number. This makes the classification extremely flexible yet easy to configure.
- The specification that follows describes how these attributes are generated, but first the specification describes how the present invention fits into the context of a networking system.
-
FIG. 1 illustrates the structure of network router (or network switch) 100 in accordance with the disclosed embodiments. Network router/switch 100 includes aswitch fabric 110, which is coupled to a number of line cards 101-104, through associated line card “system interfaces” 121-124. These line cards 101-104 are coupled to various communication lines (e.g., fiber optic links) through associated line card “line interfaces” 111-114. - Referring to
FIG. 2 ,line card 101 includes aphysical interface 202 that contains circuitry to facilitate communications throughline interface 111.Line card 101 also includes aswitch fabric interface 206 that contains circuitry to facilitate communications throughsystem interface 121.Physical interface 202 and switchfabric interface 206 are coupled to anetwork processor 204, which performs various packet-processing operations. - Note that
line card 101 provides an “ingress data path” 208 for packets, which flows fromline interface 111 throughphysical interface 202 andnetwork processor 204, and then throughswitch fabric interface 206 andsystem interface 121 into switch fabric 110 (seeFIG. 1 ). A corresponding “egress data path” 210 flows in the opposite direction fromswitch fabric 110 throughsystem interface 121, then throughswitch fabric interface 206 andnetwork processor 204, and then throughphysical interface 202 andline interface 111 to an associated communication channel. -
FIG. 3 illustrates the internal structure of anetwork processor 204 in accordance with the disclosed embodiments.Network processor 204 includes aport module 302 which includes one or more ports (traffic interfaces) 307.Port module 302 also includes a pre-classifier 308, which performs various pre-classification operations that are described in more detail below.Port module 302 is also coupled to a buffer module, which includes a number ofqueues 310 for buffering packets. Thesequeues 310 feed into ascheduler 312, which schedules packets to be sent to various destinations through the switch fabric. During this process, buffer 304 drops packets if necessary, for example by implementing a “tail drop” policy. -
FIG. 4 illustrates the structure of aport module 302 which includes one ormore ports 307 and a pre-classifier 308 in accordance with the disclosed embodiments. As illustrated inFIG. 4 ,port 302 receives data 412 (in the form of a packet) through port(s) 307 and outputs aligneddata 414 and attributes 420. The receiveddata 412 feeds into a pre-classifier 308 withinport module 302, andpre-classifier 308 performs a number of operations on the data. - Referring to
FIG. 4 and the associated flow chart inFIG. 5 , pre-classifier 308 typically operates are follows. First, a packet is received atpre-classifier 308 through port(s) 307 (step 502). Next,data 412 from the packet passes through apacket alignment stage 402, which alignsdata 412 to add a configurable number of bytes to the front of the packet to produce aligned data 414 (step 504). The packet alignment process is described in more detail below with reference toFIG. 6 . - Next, aligned
data 414 passes into adata selection stage 404, which selects data from one or more locations in the packet to produce selected data 416 (step 506), wherein selecteddata 406 also include the channel number and configurable identifier. This data selection process is described in more detail below with reference toFIG. 7 . Note that aligneddata 414 also passes fromdata selection stage 404 to the output ofport module 302. -
Selected data 416 then feeds intoclassification stage 406 which performs a classification operation on selecteddata 416 to generate aclassification result 418, which includes instructions specifying how to generate attributes for the packet (step 508). In one embodiment, the classification operation involves performing a lookup in a lookup structure based on selecteddata 416. For example, the lookup structure can be a ternary content-addressable memory (TCAM) with 512 entries, which performs the classification lookup, and an associated static random-access memory (SRAM), which provides a ten-byte classification result 418. (Note that using a TCAM makes it possible to perform a longest prefix match, which is useful in many packet-processing operations.) Also note that, instead of using a TCAM, another lookup structure, such as a search tree, can be used to perform the classification. In yet other embodiments, a custom hardware engine or a software programmable micro-controller can be used to perform the classification operation and to provide the classification results. - Next, attribute-
generation stage 408 uses the instructions fromclassification result 418 to generateattributes 420 for the packet (step 510). This attribute-generation process can involve combining data fromclassification result 418 with configuration values from a corresponding input port and possibly data from the packet itself. This attribute-generation process is described in more detail below with reference toFIG. 8B . - Finally, the
attributes 420 are forwarded along with the aligneddata 414 in the packet to facilitate downstream packet-processing operations (step 512). -
FIG. 6 illustrates thepacket alignment process 600 in accordance with the disclosed embodiments. As illustrated inFIG. 6 , before the alignment process, the packet includes aQMAP header 606 and apayload 604. (Note thatQMAP header 606 is a proprietary header which can hold buffer enqueue commands and addresses.) After thealignment process 600,additional header space 608 is added to the front of the packet. In one embodiment, the alignment process makes it possible to add up to 127 bytes to the front of the packet. Note that the number of bytes which are added to the front of the packet can depend upon the input port (or input sub-port) from which the packet was received. (The terms “port” and “sub-port” are used interchangeably throughout this disclosure.) - This
additional header space 608 can initially be blank and can be populated in downstream stages to include information which accompanies the packet through a backplane or switch fabric. For example, this information can include instructions associated with egress from the backplane or switch fabric. Moreover, this information can be stripped off when the packet leaves the router or switch.Additional header space 608 can also be used to store Multiprotocol Label Switching (MPLS) tags or to make room for inserting Virtual Local Area Network (VLAN) tags. (Note that a VLAN tag can be inserted by shifting an existing header into the additional header space and writing the VLAN tag into the position where the header was.) -
FIG. 7 illustrates operation of thedata selection stage 404 in accordance with the disclosed embodiments. In the illustrated embodiment, thedata selection stage 404 is configurable on a per port basis and lets the user configure selection of up to nine two-byte chunks of data from packets entering the device through a specific port. These nine data-selection points can select data from anywhere within the first 256 bytes of the packet, thereby facilitating L2-L4 classification. For example, the selected data can include a destination MAC address from the packet. Note that thedata selection stage 404 can be implemented using a number of multiplexers and the data selection points can be associated with the input port from which the packet was received. - The selected data can also include a
configurable ID 706 andchannel number 708, which are received from the input port and are configurable on a “per port” basis. Note thatconfigurable ID 706 can be used to group ports together. For example, all gigabit Ethernet ports can be assigned aconfigurable ID 706 with a one on the most significant bit. These groupings can be used during subsequent classification operations. For example, a higher-priority TCAM entry inclassification stage 406 can be configured to direct a packet to a specific destination if the packet originates from a Gigibit Ethernet port and includes a specification destination MAC address. At the same time, a lower-priority entry can direct the packet to another destination if the packet originates from a Gigabit Ethernet port and does not match the higher-priority entry. - In additional to generating 20 bytes of selected
data 416, the circuitry illustrated inFIG. 7 also pullsQMAP data 702 out of the packet using selectors S0, S1 and S2, wherein thisQMAP data 702 is forwarded to the attribute-generation stage 408. -
FIG. 8A illustrates default values for specific attributes in an exemplary packet attribute structure in accordance with the disclosed embodiments. Referring toFIG. 8A , the packet attribute structure “PktAttr” includes a number of fields. The first field is MappingType, which indicates whether an associated parameter is direct mapped or indirectly mapped. The default value for this parameter is zero, which indicates that the parameter is direct mapped. - The second field is PacketType, which indicates, for example, whether the packet is unicast or multicast. The default value for this parameter is zero, which indicates that the packet is unicast.
- The third parameter is Color, which is a drop precedence parameter that facilitates subsequently determining whether the packet should be dropped from a queue. The default value for this parameter is BaseColr, which is a value defined per port.
- The fourth field is CoS, which specifies a class of service for the packet which can similarly be used to determine precedence for the packet in subsequent downstream processing operations. The default value for this parameter is RESERVED.
- The fifth field is Source, which indicates whether the source for an associated parameter should be the classification result or the QMAP header. The default value for this parameter is RESERVED.
- The sixth field is Destination, which specifies the destination queue for the packet. The operations involved in calculating this field are described below with reference to
FIG. 8B . The default value for this parameter is BaseDest, which is a per port defined value. - The seventh parameter is Copies, which specifies a number of copies for the packet, which for example can be used to process multicast packets. The default value for this parameter is one.
- The eighth and ninth parameters are MirrorEn, which enables port mirroring, and MirrorQ, which specifies an associated mirror queue. These parameters can be used to facilitate port mirroring. The default value for MirrorEn is zero, which means that port mirroring is disabled, and the default value for MirrorQ is RESERVED.
- Finally, the tenth field is PBase, a pointer which points to a specific header in the packet. The operations involved in calculating this pointer are described below with reference to
FIG. 8B . The default value for this pointer is BasePBase, which is a per port defined pointer value. -
FIG. 8B illustrates how the above-described packet attributes are generated in accordance with the disclosed embodiments. Note thatclassification result 418 comprises the data structure “Val.” First, the attribute mapping type PktAttr.MappingType is set to a corresponding value fromclassification result 418, namely Val.MappingType. Similarly, PktAttr.PacketType is set to Val.PktType, PktAttr.Color is set to Val.Colr and PktAttr.CoS is set to Val.CoS. Next, PktAttr.Source is set to either Val.Src or Qmap.Src (wherein Qmap.Src is a value fromQMAP data 702 illustrated inFIG. 7 ) depending upon whether a corresponding field Val.SrcSel is set or not. - Next, Val.DestOp is used as an opcode to select a specific technique for calculating the destination for the packet, namely, PktAttr.Destination. In the first case, where Val.DestOp=0, the destination is simply taken from the
classification result 418 Val.Dest. In the next case, where Val.DestOp=1, the destination is the sum of Val.Dest and Qmap.Dest (which is taken from QMAP data 702). In the next case, where Val.DestOp=2, the destination is the sum of Val.Dest and BaseDest, which as mentioned above is a per port defined value. In the next three cases, the destination is the sum of Val.Dest and BaseDest and Chnl (wherein Chnl is the perport channel value 708 illustrated inFIG. 7 ). Note that the Chnl value is selectively shifted by different number of bits for different opcodes. Also note that, by combining a value from the classification result with the per port values BaseDest and Chnl, a large number of different destinations can be specified based on a relatively small number of entries from the TCAM and SRAM in the classifier. This saves a considerable amount of space in the TCAM and SRAM. - Next, PktAttr.Copies is set to either Val.Cps or Qmap.Cps depending upon whether a corresponding field Val.CpsSel is set or not. Then, PktAttr.MirrorEn is set to Val.MirrorEn and PktAttr.MirrorQ is set to Val.MirrorQ.
- Finally, Val.PBaseOp is used as an opcode to select a specific technique for calculating a packet base pointer (PktAttr.PBase), which points to a specific header in the packet. In the first case, where Val.PBaseOp=0, the pointer is simply taken from a per port value BasePBase. In the second case, where Val.PBaseOp=1, the pointer is taken from the Val.PBase parameter from
classification result 418. In the third and fourth cases, the pointer is computed by either adding or subtracting BasePBase and Val.PBase. In this way, the present invention makes it possible to define a packet base pointer by using both a per port “base value” and the classification results. - Furthermore, other embodiments of the present invention can modify the packet itself by writing classification data into the packet. This can, for example, be used to insert special headers needed for enqueuing in certain packet buffer structures, or to transfer timestamp information or classification information to downstream processing units.
- The foregoing descriptions of embodiments have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present description to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present description. The scope of the present description is defined by the appended claims.
Claims (1)
1. A method for processing a packet, comprising:
receiving a packet from an input port;
selecting data from one or more locations in the packet;
performing a classification operation based on the selected data to generate a classification result including instructions specifying how to generate attributes for the packet;
using the instructions from the classification result to generate attributes for the packet; and
forwarding the attributes along with the packet to facilitate subsequent packet-processing operations.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US14/679,346 US20150215204A1 (en) | 2011-03-21 | 2015-04-06 | Method and apparatus for pre-classifying packets |
US15/169,011 US10462267B2 (en) | 2011-03-21 | 2016-05-31 | Method and apparatus for pre-classifying packets |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US13/052,336 US9001828B2 (en) | 2011-03-21 | 2011-03-21 | Method and apparatus for pre-classifying packets |
US14/679,346 US20150215204A1 (en) | 2011-03-21 | 2015-04-06 | Method and apparatus for pre-classifying packets |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/052,336 Continuation US9001828B2 (en) | 2011-03-21 | 2011-03-21 | Method and apparatus for pre-classifying packets |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/169,011 Continuation US10462267B2 (en) | 2011-03-21 | 2016-05-31 | Method and apparatus for pre-classifying packets |
Publications (1)
Publication Number | Publication Date |
---|---|
US20150215204A1 true US20150215204A1 (en) | 2015-07-30 |
Family
ID=45974455
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/052,336 Expired - Fee Related US9001828B2 (en) | 2011-03-21 | 2011-03-21 | Method and apparatus for pre-classifying packets |
US14/679,346 Abandoned US20150215204A1 (en) | 2011-03-21 | 2015-04-06 | Method and apparatus for pre-classifying packets |
US15/169,011 Expired - Fee Related US10462267B2 (en) | 2011-03-21 | 2016-05-31 | Method and apparatus for pre-classifying packets |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/052,336 Expired - Fee Related US9001828B2 (en) | 2011-03-21 | 2011-03-21 | Method and apparatus for pre-classifying packets |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/169,011 Expired - Fee Related US10462267B2 (en) | 2011-03-21 | 2016-05-31 | Method and apparatus for pre-classifying packets |
Country Status (5)
Country | Link |
---|---|
US (3) | US9001828B2 (en) |
EP (1) | EP2689564A1 (en) |
CN (1) | CN103444140B (en) |
TW (1) | TWI569609B (en) |
WO (1) | WO2012127321A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
ES2775798T3 (en) * | 2012-02-03 | 2020-07-28 | Ericsson Telefon Ab L M | Advanced Baseband Digital Processor |
US9219694B2 (en) * | 2013-03-15 | 2015-12-22 | Wisconsin Alumni Research Foundation | Content addressable memory with reduced power consumption |
US9203711B2 (en) | 2013-09-24 | 2015-12-01 | International Business Machines Corporation | Port mirroring for sampling measurement of network flows |
US9401853B2 (en) | 2013-09-24 | 2016-07-26 | International Business Machines Corporation | Determining sampling rate from randomly sampled events |
US20150195387A1 (en) * | 2014-01-08 | 2015-07-09 | Cavium, Inc. | Methods and systems for flexible packet classification |
US9859006B1 (en) * | 2016-06-17 | 2018-01-02 | Globalfoundries Inc. | Algorithmic N search/M write ternary content addressable memory (TCAM) |
CN107547332B (en) * | 2016-06-28 | 2021-06-04 | 中兴通讯股份有限公司 | Data transmission method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7185081B1 (en) * | 1999-04-30 | 2007-02-27 | Pmc-Sierra, Inc. | Method and apparatus for programmable lexical packet classifier |
US20080279205A1 (en) * | 2007-05-11 | 2008-11-13 | Applied Micro Circuits Corporation | Packet preclassification using search tree algorithms |
Family Cites Families (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6977930B1 (en) * | 2000-02-14 | 2005-12-20 | Cisco Technology, Inc. | Pipelined packet switching and queuing architecture |
US6665495B1 (en) * | 2000-10-27 | 2003-12-16 | Yotta Networks, Inc. | Non-blocking, scalable optical router architecture and method for routing optical traffic |
US7072300B1 (en) | 2001-03-23 | 2006-07-04 | Advanced Micro Devices, Inc. | Action tag generation within a network based on priority or differential services information |
US7423975B2 (en) | 2002-03-05 | 2008-09-09 | Broadcom Corporation | Method, apparatus and computer program product for performing data packet classification |
GB2395395B (en) * | 2002-11-15 | 2004-11-10 | 3Com Corp | Classification search scheme and rules engine for network unit |
GB2401279B (en) * | 2003-04-29 | 2005-06-01 | 3Com Corp | Switch module architecture |
CN1323534C (en) * | 2004-02-09 | 2007-06-27 | 中兴通讯股份有限公司 | Flow control pocessing method of 3G packet field boundary gateway |
US7760719B2 (en) * | 2004-06-30 | 2010-07-20 | Conexant Systems, Inc. | Combined pipelined classification and address search method and apparatus for switching environments |
US7508764B2 (en) * | 2005-09-12 | 2009-03-24 | Zeugma Systems Inc. | Packet flow bifurcation and analysis |
US7869411B2 (en) * | 2005-11-21 | 2011-01-11 | Broadcom Corporation | Compact packet operation device and method |
US20070183415A1 (en) * | 2006-02-03 | 2007-08-09 | Utstarcom Incorporated | Method and system for internal data loop back in a high data rate switch |
US7924890B2 (en) | 2006-02-13 | 2011-04-12 | Cisco Technology, Inc. | Apparatus and method for increasing reliability of data sensitive to packet loss |
US7809009B2 (en) * | 2006-02-21 | 2010-10-05 | Cisco Technology, Inc. | Pipelined packet switching and queuing architecture |
US7813337B2 (en) * | 2007-01-19 | 2010-10-12 | Broadcom Corporation | Network packet processing using multi-stage classification |
KR100864888B1 (en) * | 2007-02-12 | 2008-10-22 | 삼성전자주식회사 | Routing System and Method for Managing Rule Entry of Ternary Content Addressable Memory |
WO2008114408A1 (en) | 2007-03-20 | 2008-09-25 | Fujitsu Limited | Packet relay device, discard packet transferring method for packet relay device, and its program |
US8462786B2 (en) * | 2009-08-17 | 2013-06-11 | Board Of Trustees Of Michigan State University | Efficient TCAM-based packet classification using multiple lookups and classifier semantics |
US9042405B1 (en) * | 2010-06-02 | 2015-05-26 | Marvell Israel (M.I.S.L) Ltd. | Interface mapping in a centralized packet processor for a network |
US8824293B2 (en) * | 2011-02-28 | 2014-09-02 | Avaya, Inc. | Implementation of a QoS processing filter to manage upstream over-subscription |
-
2011
- 2011-03-21 US US13/052,336 patent/US9001828B2/en not_active Expired - Fee Related
-
2012
- 2012-03-16 WO PCT/IB2012/000680 patent/WO2012127321A1/en unknown
- 2012-03-16 CN CN201280014287.2A patent/CN103444140B/en not_active Expired - Fee Related
- 2012-03-16 EP EP12714840.1A patent/EP2689564A1/en not_active Withdrawn
- 2012-03-19 TW TW101109352A patent/TWI569609B/en not_active IP Right Cessation
-
2015
- 2015-04-06 US US14/679,346 patent/US20150215204A1/en not_active Abandoned
-
2016
- 2016-05-31 US US15/169,011 patent/US10462267B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7185081B1 (en) * | 1999-04-30 | 2007-02-27 | Pmc-Sierra, Inc. | Method and apparatus for programmable lexical packet classifier |
US20080279205A1 (en) * | 2007-05-11 | 2008-11-13 | Applied Micro Circuits Corporation | Packet preclassification using search tree algorithms |
Also Published As
Publication number | Publication date |
---|---|
WO2012127321A1 (en) | 2012-09-27 |
TWI569609B (en) | 2017-02-01 |
EP2689564A1 (en) | 2014-01-29 |
US20160277549A1 (en) | 2016-09-22 |
TW201304464A (en) | 2013-01-16 |
CN103444140B (en) | 2016-06-29 |
CN103444140A (en) | 2013-12-11 |
US20120243538A1 (en) | 2012-09-27 |
US10462267B2 (en) | 2019-10-29 |
US9001828B2 (en) | 2015-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10462267B2 (en) | Method and apparatus for pre-classifying packets | |
US10735221B2 (en) | Flexible processor of a port extender device | |
US7447204B2 (en) | Method and device for the classification and redirection of data packets in a heterogeneous network | |
US9509639B1 (en) | Switch device having a plurality of processing cores | |
US6937606B2 (en) | Data structures for efficient processing of IP fragmentation and reassembly | |
US7266120B2 (en) | System and method for hardware accelerated packet multicast in a virtual routing system | |
EP2580894B1 (en) | Switch, system and method for forwarding packets | |
US8671219B2 (en) | Method and apparatus for efficiently processing data packets in a computer network | |
US7149216B1 (en) | M-trie based packet processing | |
EP1662725B1 (en) | Cut-through switching in a network device | |
US7649885B1 (en) | Network routing system for enhanced efficiency and monitoring capability | |
US20090279558A1 (en) | Network routing apparatus for enhanced efficiency and monitoring capability | |
US20090279546A1 (en) | Flexible method for processing data packets in a network routing system for enhanced efficiency and monitoring capability | |
US11494189B2 (en) | Methods and systems for processing data in a programmable data processing pipeline that includes out-of-pipeline processing | |
US11863467B2 (en) | Methods and systems for line rate packet classifiers for presorting network packets onto ingress queues | |
US9137030B1 (en) | Multicast queueing in a network switch | |
US9178717B1 (en) | Systems and methods for enabling leaf isolation in a multi-node tree network | |
US7397762B1 (en) | System, device and method for scheduling information processing with load-balancing | |
US20120106555A1 (en) | Low latency carrier class switch-router | |
US7043544B2 (en) | Processor with multiple-pass non-sequential packet classification feature | |
CN102763383B (en) | Mechanism is selected in the queue based on source in routed environment | |
US10205805B2 (en) | Dropping or admitting packets to an output queue using policy-based scheduling and virtual destination queue occupancy values | |
Finochietto et al. | Hardware primitives for packet flow processing architectures |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |