Table Of Contents
Configuring QoS
Understanding QoS
Basic QoS Model
Classification
Classification Based on QoS ACLs
Classification Based on Class Maps and Policy Maps
Policing and Marking
Mapping Tables
Queueing and Scheduling
Queueing and Scheduling on Gigabit-Capable Ports
Queueing and Scheduling on 10/100 Ethernet Ports
Packet Modification
Configuring Auto-QoS
Generated Auto-QoS Configuration
Effects of Auto-QoS on the Configuration
Configuration Guidelines
Enabling Auto-QoS for VoIP
Displaying Auto-QoS Information
Auto-QoS Configuration Example
Configuring Standard QoS
Default Standard QoS Configuration
Standard QoS Configuration Guidelines
Enabling QoS Globally
Configuring Classification By Using Port Trust States
Configuring the Trust State on Ports within the QoS Domain
Configuring the CoS Value for an Interface
Configuring a Trusted Boundary to Ensure Port Security
Enabling Pass-Through Mode
Configuring the DSCP Trust State on a Port Bordering Another QoS Domain
Configuring a QoS Policy
Classifying Traffic by Using ACLs
Classifying Traffic on a Physical-Port Basis by Using Class Maps
Classifying Traffic on a Per-Port Per-VLAN Basis by Using Class Maps
Classifying, Policing, and Marking Traffic by Using Policy Maps
Classifying, Policing, and Marking Traffic by Using Aggregate Policers
Configuring DSCP Maps
Configuring the CoS-to-DSCP Map
Configuring the IP-Precedence-to-DSCP Map
Configuring the Policed-DSCP Map
Configuring the DSCP-to-CoS Map
Configuring the DSCP-to-DSCP-Mutation Map
Configuring Egress Queues on Gigabit-Capable Ethernet Ports
Mapping CoS Values to Select Egress Queues
Configuring the Egress Queue Size Ratios
Configuring Tail-Drop Threshold Percentages
Configuring WRED Drop Thresholds Percentages
Configuring the Egress Expedite Queue
Allocating Bandwidth among Egress Queues
Configuring Egress Queues on 10/100 Ethernet Ports
Mapping CoS Values to Select Egress Queues
Configuring the Minimum-Reserve Levels
Configuring the Egress Expedite Queue
Allocating Bandwidth among Egress Queues
Displaying Standard QoS Information
Standard QoS Configuration Examples
QoS Configuration for the Existing Wiring Closet
QoS Configuration for the Intelligent Wiring Closet
QoS Configuration for the Distribution Layer
Configuring QoS
This chapter describes how to configure quality of service (QoS) by using automatic QoS (auto-QoS) commands or by using standard QoS commands. With QoS, you can give preferential treatment to certain traffic at the expense of others. Without QoS, the Catalyst 3550 switch offers best-effort service to each packet, regardless of the packet contents or size. It sends the packets without any assurance of reliability, delay bounds, or throughput.
Note
For complete syntax and usage information for the commands used in this chapter, refer to the command reference for this release.
This chapter consists of these sections:
•
Understanding QoS
•
Configuring Auto-QoS
•
Displaying Auto-QoS Information
•
Auto-QoS Configuration Example
•
Configuring Standard QoS
•
Displaying Standard QoS Information
•
Standard QoS Configuration Examples
Note
When you are configuring QoS parameters for the switch, in order to allocate system resources to maximize the number of possible QoS access control entries (ACEs) allowed, you can use the sdm prefer access global configuration command to set the Switch Database Management feature to the access template. For more information on the SDM templates, see the "Optimizing System Resources for User-Selected Features" section.
Understanding QoS
Typically, networks operate on a best-effort delivery basis, which means that all traffic has equal priority and an equal chance of being delivered in a timely manner. When congestion occurs, all traffic has an equal chance of being dropped.
When you configure QoS, you can select specific network traffic, prioritize it according to its relative importance, and use congestion-management and congestion-avoidance techniques to give preferential treatment. Implementing QoS in your network makes network performance more predictable and bandwidth utilization more effective.
The QoS implementation is based on the DiffServ architecture, an emerging standard from the Internet Engineering Task Force (IETF). This architecture specifies that each packet is classified upon entry into the network. The classification is carried in the IP packet header, using 6 bits from the deprecated IP type of service (TOS) field to carry the classification (class) information. Classification can also be carried in the Layer 2 frame. These special bits in the Layer 2 frame or in the Layer 3 packet are described here and shown in Figure 28-1:
•
Prioritization bits in Layer 2 frames:
Layer 2 Inter-Switch Link (ISL) frame headers have a 1-byte User field that carries an IEEE 802.1P class of service (CoS) value in the three least-significant bits. On interfaces configured as Layer 2 ISL trunks, all traffic is in ISL frames.
Layer 2 802.1Q frame headers have a 2-byte Tag Control Information field that carries the CoS value in the three most-significant bits, which are called the User Priority bits. On interfaces configured as Layer 2 802.1Q trunks, all traffic is in 802.1Q frames except for traffic in the native VLAN.
Other frame types cannot carry Layer 2 CoS values.
Layer 2 CoS values range from 0 for low priority to 7 for high priority.
•
Prioritization bits in Layer 3 packets:
Layer 3 IP packets can carry either an IP precedence value or a Differentiated Services Code Point (DSCP) value. QoS supports the use of either value because DSCP values are backward-compatible with IP precedence values.
IP precedence values range from 0 to 7.
DSCP values range from 0 to 63.
Figure 28-1 QoS Classification Bits in Frames and Packets
Note
Layer 3 IPv6 packets are treated as non-IP packets and are bridged by the switch.
To give the same forwarding treatment to packets with the same class information and different treatment to packets with different class information, all switches and routers that access the Internet rely on class information. Class information in the packet can be assigned by end hosts or by switches or routers along the way, based on a configured policy, detailed examination of the packet, or both. Detailed examination of the packet is expected to happen closer to the network edge so that core switches and routers are not overloaded.
Switches and routers along the path can use class information to limit the amount of resources allocated per traffic class. The behavior of an individual device when handling traffic in the DiffServ architecture is called per-hop behavior. If all devices along a path have a consistent per-hop behavior, you can construct an end-to-end QoS solution.
Implementing QoS in your network can be a simple or complex task and depends on the QoS features offered by your internetworking devices, the traffic types and patterns in your network, and the granularity of control that you need over incoming and outgoing traffic.
These sections describe the QoS stages and how they work:
•
Basic QoS Model
•
Classification
•
Policing and Marking
•
Mapping Tables
•
Queueing and Scheduling
•
Packet Modification
Basic QoS Model
Figure 28-2 shows the basic QoS model. Actions at the ingress interface include classifying traffic, policing, and marking:
•
Classifying distinguishes one kind of traffic from another. The process generates an internal DSCP for a packet, which identifies all the future QoS actions to be performed on this packet. For more information, see the "Classification" section.
•
Policing determines whether a packet is in or out of profile by comparing the internal DSCP to the configured policer. The policer limits the bandwidth consumed by a flow of traffic. The result of this determination is passed to the marker. For more information, see the "Policing and Marking" section.
•
Marking evaluates the policer and the configuration information for the action to be taken when a packet is out of profile and decides what to do with the packet (pass through a packet without modification, mark down the DSCP value in the packet, or drop the packet). For more information, see the "Policing and Marking" section.
Actions at the egress interface include queueing and scheduling:
•
Queueing evaluates the internal DSCP and determines which of the four egress queues in which to place the packet. The DSCP value is mapped to a CoS value, which selects one of the queues. For more information, see the "Mapping Tables" section.
•
Scheduling services the four egress queues based on their configured weighted round robin (WRR) weights and thresholds. One of the queues can be the expedite queue, which is serviced until empty before the other queues are serviced. Congestion avoidance techniques include tail drop and Weighted Random Early Detection (WRED) on Gigabit-capable Ethernet ports and tail drop (with only one threshold) on 10/100 Ethernet ports. For more information, see the "Queueing and Scheduling" section.
Note
Policing and marking also can occur on egress interfaces.
Figure 28-2 Basic QoS Model
Classification
Classification is the process of distinguishing one kind of traffic from another by examining the fields in the packet. Classification is enabled only if QoS is globally enabled on the switch. By default, QoS is globally disabled, so no classification occurs.
Note
Classification occurs on a physical interface or on a per-port per-VLAN basis. No support exists for classifying packets at the switch virtual interface level.
You specify which fields in the frame or packet that you want to use to classify incoming traffic.
For non-IP traffic, these are the classification options as shown in Figure 28-3:
•
Use the port default. If the frame does not contain a CoS value, the switch assigns the default port CoS value to the incoming frame. Then, the switch uses the configurable CoS-to-DSCP map to generate the internal DSCP value.
•
Trust the CoS value in the incoming frame (configure the port to trust CoS). Then, the switch uses the configurable CoS-to-DSCP map to generate the internal DSCP value. Layer 2 ISL frame headers carry the CoS value in the three least-significant bits of the 1-byte User field. Layer 2 802.1Q frame headers carry the CoS value in the three most-significant bits of the Tag Control Information field. CoS values range from 0 for low priority to 7 for high priority.
The trust DSCP and trust IP precedence configurations are meaningless for non-IP traffic. If you configure a port with either of these options and non-IP traffic is received, the switch assigns the default port CoS value and generates the internal DSCP from the CoS-to-DSCP map.
•
Perform the classification based on the configured Layer 2 MAC access control list (ACL), which can examine the MAC source address, the MAC destination address, and the Ethertype field. If no ACL is configured, the packet is assigned the default DSCP of 0, which means best-effort traffic; otherwise, the policy map specifies the DSCP to assign to the incoming frame.
For IP traffic, these are the classification options as shown in Figure 28-3:
•
Trust the IP DSCP in the incoming packet (configure the port to trust DSCP), and assign the same DSCP to the packet for internal use. The IETF defines the 6 most-significant bits of the 1-byte ToS field as the DSCP. The priority represented by a particular DSCP value is configurable. DSCP values range from 0 to 63.
For ports that are on the boundary between two QoS administrative domains, you can modify the DSCP to another value by using the configurable DSCP-to-DSCP-mutation map.
•
Trust the IP precedence in the incoming packet (configure the port to trust IP precedence), and generate a DSCP by using the configurable IP-precedence-to-DSCP map. The IP version 4 specification defines the three most-significant bits of the 1-byte ToS field as the IP precedence. IP precedence values range from 0 for low priority to 7 for high priority.
•
Trust the CoS value (if present) in the incoming packet, and generate the DSCP by using the CoS-to-DSCP map.
•
Perform the classification based on a configured IP standard or an extended ACL, which examines various fields in the IP header. If no ACL is configured, the packet is assigned the default DSCP of 0, which means best-effort traffic; otherwise, the policy map specifies the DSCP to assign to the incoming frame.
For information on the maps described in this section, see the "Mapping Tables" section. For configuration information on port trust states, see the "Configuring Classification By Using Port Trust States" section.
Figure 28-3 Classification Flowchart
Classification Based on QoS ACLs
You can use IP standard, IP extended, and Layer 2 MAC ACLs to define a group of packets with the same characteristics (class). In the QoS context, the permit and deny actions in the access control entries (ACEs) have different meanings than with security ACLs:
•
If a match with a permit action is encountered (first-match principle), the specified QoS-related action is taken.
•
If a match with a deny action is encountered, the ACL being processed is skipped, and the next ACL is processed.
•
If no match with a permit action is encountered and all the ACEs have been examined, no QoS processing occurs on the packet, and the switch offers best-effort service to the packet.
•
If multiple ACLs are configured on an interface, the lookup stops after the packet matches the first ACL with a permit action, and QoS processing begins.
Note
When creating an access list, remember that, by default, the end of the access list contains an implicit deny statement for everything if it did not find a match before reaching the end.
After a traffic class has been defined with the ACL, you can attach a policy to it. A policy might contain multiple classes with actions specified for each one of them. A policy might include commands to classify the class as a particular aggregate (for example, assign a DSCP) or rate-limit the class. This policy is then attached to a particular port on which it becomes effective.
You implement IP ACLs to classify IP traffic by using the access-list global configuration command; you implement Layer 2 MAC ACLs to classify non-IP traffic by using the mac access-list extended global configuration command. For configuration information, see the "Configuring a QoS Policy" section.
Classification Based on Class Maps and Policy Maps
A class map is a mechanism that you use to name and to isolate a specific traffic flow (or class) from all other traffic. The class map defines the criteria used to match against a specific traffic flow to further classify it; the criteria can include matching the access group defined by the ACL, matching a specific list of DSCP or IP precedence values, or matching a specific list of VLAN IDs associated with another class map that defines the actual criteria (for example, to match a standard or extended ACL). If you have more than one type of traffic that you want to classify, you can create another class map and use a different name. After a packet is matched against the class-map criteria, you further classify it through the use of a policy map.
A policy map specifies which traffic class to act on. Actions can include trusting the CoS, DSCP, or IP precedence values in the traffic class; setting a specific DSCP or IP precedence value in the traffic class; or specifying the traffic bandwidth limitations and the action to take when the traffic is out of profile. Before a policy map can be effective, you must attach it to an interface.
You create a class map by using the class-map global configuration command or the class policy-map configuration command; you should use the class-map command when the map is shared among many ports. When you enter the class-map command, the switch enters the class-map configuration mode. In this mode, you define the match criterion for the traffic by using the match class-map configuration command.
You create and name a policy map by using the policy-map global configuration command. When you enter this command, the switch enters the policy-map configuration mode. In this mode, you specify the actions to take on a specific traffic class by using the class, trust, or set policy-map configuration and policy-map class configuration commands. To make the policy map effective, you attach it to an interface by using the service-policy interface configuration command.
The policy map also can contain commands that define the policer, the bandwidth limitations of the traffic, and the action to take if the limits are exceeded. For more information, see the "Policing and Marking" section.
A policy map has these characteristics:
•
A policy map can contain multiple class statements.
•
A separate policy-map class can exist for each type of traffic received through an interface.
•
The policy-map trust state and an interface trust state are mutually exclusive, and whichever is configured last takes affect.
For configuration information, see the "Configuring a QoS Policy" section.
Policing and Marking
After a packet is classified and has an internal DSCP value assigned to it, the policing and marking process can begin as shown in Figure 28-4.
Policing involves creating a policer that specifies the bandwidth limits for the traffic. Packets that exceed the limits are out of profile or nonconforming. Each policer specifies the action to take for packets that are in or out of profile. These actions, carried out by the marker, include passing through the packet without modification, dropping the packet, or marking down the packet with a new DSCP value that is obtained from the configurable policed-DSCP map. For information on the policed-DSCP map, see the "Mapping Tables" section.
You can create these types of policers:
•
Individual
QoS applies the bandwidth limits specified in the policer separately to each matched traffic class. You configure this type of policer within a policy map by using the police policy-map configuration command.
•
Aggregate
QoS applies the bandwidth limits specified in an aggregate policer cumulatively to all matched traffic flows. You configure this type of policer by specifying the aggregate policer name within a policy map by using the police aggregate policy-map configuration command. You specify the bandwidth limits of the policer by using the mls qos aggregate-policer global configuration command. In this way, the aggregate policer is shared by multiple classes of traffic within a policy map.
Policing uses a token bucket algorithm. As each frame is received by the switch, a token is added to the bucket. The bucket has a hole in it and leaks at a rate that you specify as the average traffic rate in bits per second. Each time a token is added to the bucket, the switch performs a check to determine if there is enough room in the bucket. If there is not enough room, the packet is marked as nonconforming, and the specified policer action is taken (dropped or marked down).
How quickly the bucket fills is a function of the bucket depth (burst-byte), the rate at which the tokens are removed (rate-bps), and the duration of the burst above the average rate. The size of the bucket imposes an upper limit on the burst length and determines the number of frames that can be sent back-to-back. If the burst is short, the bucket does not overflow, and no action is taken against the traffic flow. However, if a burst is long and at a higher rate, the bucket overflows, and the policing actions are taken against the frames in that burst.
You configure the bucket depth (the maximum burst that is tolerated before the bucket overflows) by using the burst-byte option of the police policy-map class configuration command or the mls qos aggregate-policer global configuration command. You configure how fast (the average rate) that the tokens are removed from the bucket by using the rate-bps option of the police policy-map class configuration command or the mls qos aggregate-policer global configuration command.
When configuring policing and policers, keep these items in mind:
•
By default, no policers are configured.
•
Policers can be configured only on a physical port or on a per-port per-VLAN basis (specifies the bandwidth limits for the traffic on a per-VLAN basis, for a given port). Per-port per-VLAN policing is not supported on routed ports or on virtual (logical) interfaces. It is supported only on an ingress port configured as a trunk or as a static-access port.
•
Only one policer can be applied to a packet per direction.
•
Only the average rate and committed burst parameters are configurable.
•
Policing can occur on ingress and egress interfaces:
Note
Per-port per-VLAN policing is supported only on ingress interfaces.
–
128 policers are supported on ingress Gigabit-capable Ethernet ports.
–
8 policers are supported on ingress 10/100 Ethernet ports.
–
8 policers are supported on all egress ports.
–
Ingress policers can be individual or aggregate.
•
On an interface configured for QoS, all traffic received through the interface is classified, policed, and marked according to the policy map attached to the interface. On a trunk interface configured for QoS, traffic in all VLANs received through the interface is classified, policed, and marked according to the policy map attached to the interface.
After you configure the policy map and policing actions, attach the policy to an ingress or egress interface by using the service-policy interface configuration command. For configuration information, see the "Classifying, Policing, and Marking Traffic by Using Policy Maps" section and the "Classifying, Policing, and Marking Traffic by Using Aggregate Policers" section.
Figure 28-4 Policing and Marking Flowchart
Mapping Tables
During QoS processing, the switch represents the priority of all traffic (including non-IP traffic) with an internal DSCP value:
•
During classification, QoS uses configurable mapping tables to derive the internal DSCP (a 6-bit value) from received CoS or IP precedence (3-bit) values. These maps include the CoS-to-DSCP map and the IP-precedence-to-DSCP map.
On an ingress interface configured in the DSCP-trusted state, if the DSCP values are different between the QoS domains, you can apply the configurable DSCP-to-DSCP-mutation map to the interface that is on the boundary between the two QoS domains.
•
During policing, QoS can assign another DSCP value to an IP or non-IP packet (if the packet is out of profile and the policer specifies a marked down DSCP value). This configurable map is called the policed-DSCP map.
•
Before the traffic reaches the scheduling stage, QoS uses the configurable DSCP-to-CoS map to derive a CoS value from the internal DSCP value. Through the CoS-to-egress-queue map, the CoS values select one of the four egress queues for output processing.
The CoS-to-DSCP, DSCP-to-CoS, and the IP-precedence-to-DSCP map have default values that might or might not be appropriate for your network.
The default DSCP-to-DSCP-mutation map and the default policed-DSCP map are null maps; they map an incoming DSCP value to the same DSCP value. The DSCP-to-DSCP-mutation map is the only map you apply to a specific Gigabit-capable Ethernet port or to a group of 10/100 Ethernet ports. All other maps apply to the entire switch.
For configuration information, see the "Configuring DSCP Maps" section.
Queueing and Scheduling
After a packet is policed and marked, the queueing and scheduling process begins as described in these sections:
•
Queueing and Scheduling on Gigabit-Capable Ports
•
Queueing and Scheduling on 10/100 Ethernet Ports
Queueing and Scheduling on Gigabit-Capable Ports
Figure 28-5 shows the queueing and scheduling flowchart for Gigabit-capable Ethernet ports.
Figure 28-5 Queueing and Scheduling Flowchart for Gigabit-Capable Ethernet Ports
Note
If the expedite queue is enabled, WRR services it until it is empty before servicing the other three queues.
During the queueing and scheduling process, the switch uses egress queues and WRR for congestion management, and tail drop or WRED algorithms for congestion avoidance on Gigabit-capable Ethernet ports.
Each Gigabit-capable Ethernet port has four egress queues, one of which can be the egress expedite queue. You can configure the buffer space allocated to each queue as a ratio of weights by using the wrr-queue queue-limit interface configuration command, where the relative size differences in the numbers show the relative differences in the queue sizes. To display the absolute value of the queue size, use the show mls qos interface interface-id statistics privileged EXEC command, and examine the FreeQ information.
You assign two drop thresholds to each queue, map DSCPs to the thresholds through the DSCP-to-threshold map, and enable either tail drop or WRED on the interface. The queue size, drop thresholds, tail-drop or WRED algorithm, and the DSCP-to-threshold map work together to determine when and which packets are dropped when the thresholds are exceeded. You configure the drop percentage thresholds by using either the wrr-queue threshold interface configuration command for tail drop or the wrr-queue random-detect max-threshold interface configuration command for WRED; in either case, you map DSCP values to the thresholds (DSCP-to-threshold map) by using the wrr-queue dscp-map interface configuration command. For more information, see the "Tail Drop" section and "WRED" section.
The available bandwidth of the egress link is divided among the queues. You configure the queues to be serviced according to the ratio of WRR weights by using the wrr-queue bandwidth interface configuration command. The ratio represents the importance (weight) of a queue relative to the other queues. WRR scheduling prevents low-priority queues from being completely neglected during periods of high-priority traffic by sending some packets from each queue in turn. The number of packets sent corresponds to the relative importance of the queue. For example, if one queue has a weight of 3 and another has a weight of 4, three packets are sent from the first queue for every four that are sent from the second queue. By using this scheduling, low-priority queues can send packets even though the high-priority queues are not empty. Queues are selected by the CoS value that is mapped to an egress queue (CoS-to-egress-queue map) through the wrr-queue cos-map interface configuration command.
All four queues participate in the WRR unless the expedite queue is enabled, in which case, the fourth bandwidth weight is ignored and not used in the ratio calculation. The expedite queue is a priority queue, and it is serviced until empty before the other queues are serviced. You enable the expedite queue by using the priority-queue out interface configuration command.
You can combine the commands described in this section to prioritize traffic by placing packets with particular DSCPs into certain queues, allocate a larger queue size or service the particular queue more frequently, and adjust queue thresholds so that packets with lower priorities are dropped. For configuration information, see the "Configuring Egress Queues on Gigabit-Capable Ethernet Ports" section.
Tail Drop
Tail drop is the default congestion-avoidance technique on Gigabit-capable Ethernet ports. With tail drop, packets are queued until the thresholds are exceeded. Specifically, all packets with DSCPs assigned to the first threshold are dropped until the threshold is no longer exceeded. However, packets assigned to the second threshold continue to be queued and sent as long as the second threshold is not exceeded.
You can modify the two tail-drop threshold percentages assigned to the four egress queues by using the wrr-queue threshold interface configuration command. Each threshold value is a percentage of the total number of allocated queue descriptors for the queue. The default threshold is 100 percent for thresholds 1 and 2.
You modify the DSCP-to-threshold map to determine which DSCPs are mapped to which threshold ID by using the wrr-queue dscp-map interface configuration command. By default, all DSCPs are mapped to threshold 1, and when this threshold is exceeded, all the packets are dropped.
If you use tail-drop thresholds, you cannot use WRED, and vice versa. If tail drop is disabled, WRED is automatically enabled with the previous configuration (or the default if it was not previously configured).
WRED
Cisco's implementation of Random Early Detection (RED), called Weighted Random Early Detection (WRED), differs from other congestion-avoidance techniques because it attempts to anticipate and avoid congestion, rather than controlling congestion when it occurs.
WRED takes advantage of the Transmission Control Protocol (TCP) congestion control to try to control the average queue size by indicating to end hosts when they should temporarily stop sending packets. By randomly dropping packets before periods of high congestion, it tells the packet source to decrease its transmission rate. Assuming the packet source is using TCP, WRED tells it to decrease its transmission rate until all the packets reach their destination, meaning that the congestion is cleared.
WRED reduces the chances of tail drop by selectively dropping packets when the output interface begins to show signs of congestion. By dropping some packets early rather than waiting until the queue is full, WRED avoids dropping large numbers of packets at once. Thus, WRED allows the transmission line to be fully used at all times. WRED also drops more packets from large users than small. Therefore, sources that generate the most traffic are more likely to be slowed down versus sources that generate little traffic.
You can enable WRED and configure the two threshold percentages assigned to the four egress queues on a Gigabit-capable Ethernet port by using the wrr-queue random-detect max-threshold interface configuration command. Each threshold percentage represents where WRED starts to randomly drop packets. After a threshold is exceeded, WRED randomly begins to drop packets assigned to this threshold. As the queue limit is approached, WRED continues to drop more and more packets. When the queue limit is reached, WRED drops all packets assigned to the threshold. By default, WRED is disabled.
You modify the DSCP-to-threshold map to determine which DSCPs are mapped to which threshold ID by using the wrr-queue dscp-map interface configuration command. By default, all DSCPs are mapped to threshold 1, and when this threshold is exceeded, all the packets are randomly dropped.
If you use WRED thresholds, you cannot use tail drop, and vice versa. If WRED is disabled, tail drop is automatically enabled with the previous configuration (or the default if it was not previously configured).
Queueing and Scheduling on 10/100 Ethernet Ports
Figure 28-6 shows the queueing and scheduling flowchart for 10/100 Ethernet ports.
Figure 28-6 Queueing and Scheduling Flowchart for 10/100 Ethernet Ports
Note
If the expedite queue is enabled, WRR services it until it is empty before servicing the other three queues.
During the queueing and scheduling process, the switch uses egress queues (to select the minimum-reserve level and buffer size) and WRR for congestion management.
Each 10/100 Ethernet port has four egress queues, one of which can be the egress expedite queue. Each queue can access one of eight minimum-reserve levels; each level has 100 packets of buffer space by default for queueing packets. When the buffer specified for the minimum-reserve level is full, packets are dropped until space is available.
Figure 28-7 is an example of the 10/100 Ethernet port queue assignments, minimum-reserve levels, and buffer sizes. The figure shows four egress queues per port, with each queue assigned to a minimum-reserve level. For example, for Fast Ethernet port 0/1, queue 1 is assigned to minimum-reserve level 1, queue 2 is assigned to minimum-reserve level 3, queue 3 is assigned to minimum-reserve level 5, and queue 4 is assigned to minimum-reserve level 7. You assign the minimum-reserve level to a queue by using the wrr-queue min-reserve interface configuration command.
Each minimum-reserve level is configured with a buffer size. As shown in the figure, queue 4 of Fast Ethernet port 0/1 has a buffer size of 70 packets, queue 4 of Fast Ethernet port 0/2 has a buffer size of 80 packets, queue 4 of Fast Ethernet port 0/3 has a buffer size of 40 packets, and Fast Ethernet port 0/4 has a buffer size of 80 packets. You configure the buffer size by using the mls qos min-reserve global configuration command.
Figure 28-7 10/100 Ethernet Port Queue Assignment, Minimum-Reserve Levels, and Buffer Size

The available bandwidth of the egress link is divided among the queues. You configure the queues to be serviced according to the ratio of WRR weights by using the wrr-queue bandwidth interface configuration command. The ratio represents the importance (weight) of a queue relative to the other queues. WRR scheduling prevents low-priority queues from being completely neglected during periods of high-priority traffic by sending some packets from each queue in turn. The number of packets sent corresponds to the relative importance of the queue. For example, if one queue has a weight of 3 and another has a weight of 4, three packets are sent from the first queue for every four that are sent from the second queue. By using this scheduling, low-priority queues can send packets even though the high-priority queues are not empty. Queues are selected by the CoS value that is mapped to an egress queue (CoS-to-egress-queue map) through the wrr-queue cos-map interface configuration command.
All four queues participate in the WRR unless the egress expedite queue is enabled, in which case, the fourth bandwidth weight is ignored and not used in the ratio calculation. The expedite queue is a priority queue, and it is serviced until empty before the other queues are serviced. You enable the expedite queue by using the priority-queue out interface configuration command.
You can combine the commands described in this section to prioritize traffic by placing packets with particular DSCPs into certain queues, allocate a larger minimum-reserve buffer size, and service a particular queue more frequently. For configuration information, see the "Configuring Egress Queues on 10/100 Ethernet Ports" section.
Packet Modification
A packet is classified, policed, and queued for QoS. Packet modifications can occur during this process:
•
For IP packets, classification involves assigning a DSCP to the packet. However, the packet is not modified at this stage; only an indication of the assigned DSCP is carried along. The reason for this is that QoS classification and ACL lookup occur in parallel, and it is possible that the ACL specifies that the packet should be denied and logged. In this situation, the packet is forwarded with its original DSCP to the CPU, where it is again processed through ACL software. However, route lookup is performed based on classified DSCPs.
•
For non-IP packets, classification involves assigning an internal DSCP to the packet, but because there is no DSCP in the non-IP packet, no overwrite occurs. Instead, the internal DSCP is translated to the CoS and is used both for queueing and scheduling decisions and for writing the CoS priority value in the tag if the packet is being sent on either an ISL or 802.1Q trunk port. Because the CoS priority is written in the tag, Catalyst 3500 series XL switches that use the 802.1P priority can interoperate with the QoS implementation on the Catalyst 3550 switches.
•
During policing, IP and non-IP packets can have another DSCP assigned to them (if they are out of profile and the policer specifies a markdown DSCP). For IP packets, the packet modification occurs at a later stage; for non-IP packets the DSCP is converted to CoS and used for queueing and scheduling decisions.
Configuring Auto-QoS
You can use the auto-QoS feature to simplify the deployment of existing QoS features. Auto-QoS makes assumptions about the network design, and as a result, the switch can prioritize different traffic flows and appropriately use the egress queues instead of using the default QoS behavior. (The default is that QoS is disabled. The switch then offers best-effort service to each packet, regardless of the packet contents or size, and sends it from a single queue.)
When you enable auto-QoS, it automatically classifies traffic based on the traffic type and ingress packet label. The switch uses the resulting classification to choose the appropriate egress queue.
You use auto-QoS commands to identify ports connected to Cisco IP phones and to identify ports that receive trusted voice over IP (VoIP) traffic through an uplink. Auto-QoS then performs these functions:
•
Detects the presence or absence of IP phones
•
Configures QoS classification
•
Configures egress queues
These sections describe how to configure auto-QoS on your switch:
•
Generated Auto-QoS Configuration
•
Effects of Auto-QoS on the Configuration
•
Configuration Guidelines
•
Enabling Auto-QoS for VoIP
Generated Auto-QoS Configuration
By default, auto-QoS is disabled on all interfaces.
When auto-QoS is enabled, it uses the ingress packet label to categorize traffic and to configure the egress queues as shown in Table 28-1.
Table 28-1 Traffic Types, Ingress Packet Labels, Assigned Packet Labels, and Egress Queues
| |
VoIP Data Traffic Only From Cisco IP Phones
|
VoIP Control Traffic Only From Cisco IP Phones
|
Routing Protocol Traffic
|
|
All Other Traffic
|
Ingress DSCP
|
46
|
26
|
-
|
-
|
-
|
Ingress CoS
|
5
|
3
|
6
|
7
|
-
|
DiffServ
|
EF
|
AF31
|
-
|
-
|
-
|
Assigned DSCP
|
46
|
26
|
48
|
56
|
0
|
Assigned CoS
|
5
|
3
|
6
|
7
|
0
|
CoS-to-Queue Map
|
5
|
3, 6, 7
|
0, 1, 2, 4
|
Egress Queue
|
Expedite queue
|
80% WRR
|
20% WRR
|
Table 28-2 shows the generated auto-QoS configuration for the egress queues.
Table 28-2 Auto-QoS Configuration for the Egress Queues
Egress Queue
|
Queue Number
|
CoS-to-Queue Map
|
Queue Weight
|
Queue Size for Gigabit-Capable Ports
|
Queue Size (in packets) for 10/100 Ethernet Ports
|
Expedite
|
4
|
5
|
-
|
-
|
26
|
80% WRR
|
3
|
3, 6, 7
|
80%
|
20%
|
65
|
20% WRR
|
1
|
0, 1, 2, 4
|
20%
|
80%
|
170
|
When you enable the auto-QoS feature on the first interface, these automatic actions occur:
•
QoS is globally enabled (mls qos global configuration command).
•
When you enter the auto qos voip trust interface configuration command, the ingress classification on the interface is set to trust the QoS label received in the packet, and the egress queues on the interface are reconfigured (see Table 28-2).
•
When you enter the auto qos voip cisco-phone interface configuration command, the trusted boundary feature is enabled. It uses the Cisco Discovery Protocol (CDP) to detect the presence or absence of a Cisco IP phone. When a Cisco IP phone is detected, the ingress classification on the interface is set to trust the QoS label received in the packet. When a Cisco IP phone is absent, the ingress classification is set to not trust the QoS label in the packet. The egress queues on the interface are also reconfigured (see Table 28-2).
For information about the trusted boundary feature, see the "Configuring a Trusted Boundary to Ensure Port Security" section.
When you enable auto-QoS by using the auto qos voip cisco-phone or the auto qos voip trust interface configuration command, the switch automatically generates a QoS configuration based on the traffic type and ingress packet label and applies the commands listed in Table 28-3 to the interface.
Table 28-3 Generated Auto-QoS Configuration
Description
|
Automatically Generated Command
|
The switch automatically enables standard QoS and configures the CoS-to-DSCP map (maps CoS values in incoming packets to a DSCP value) as shown in Table 28-1.
|
Switch(config)# mls qos map cos-dscp 0 8 16 26 32 46
48 56
|
If 10/100 Ethernet ports are present, the switch automatically configures the buffer size of the minimum-reserve levels 5, 6, 7, and 8:
• Level 5 can hold 170 packets.
• Level 6 is not used.
• Level 7 can hold 65 packets.
• Level 8 can hold 26 packets.
|
Switch(config)# mls qos min-reserve 5 170
Switch(config)# mls qos min-reserve 6 10
Switch(config)# mls qos min-reserve 7 65
Switch(config)# mls qos min-reserve 8 26
|
The switch automatically sets the ingress classification on the interface to trust the CoS value received in the packet.
|
Switch(config-if)# mls qos trust cos
|
If you entered the auto qos voip cisco-phone command, the switch automatically enables the trusted boundary feature, which uses the CDP to detect the presence or absence of a Cisco IP phone.
|
Switch(config-if)# mls qos trust device cisco-phone
|
The switch automatically assigns egress queue usage (as shown in Table 28-2) on this interface.
The switch enables the egress expedite queue and assigns WRR weights to queues 1 and 3. (The lowest value for a WRR queue is 1. When the WRR weight of a queue is set to 0, this queue becomes an expedite queue.)
The switch configures the CoS-to-egress-queue map:
• CoS values 0, 1, 2, and 4 select queue 1.
• CoS values 3, 6, and 7 select queue 3.
• CoS value 5 selects queue 4 (expedite queue).
Because the expedite queue (queue 4) contains the VoIP data traffic, the queue is serviced until empty.
|
Switch(config-if)# wrr-queue bandwidth 20 1 80 0
Switch(config-if)# no wrr-queue cos-map
Switch(config-if)# wrr-queue cos-map 1 0 1 2 4
Switch(config-if)# wrr-queue cos-map 3 3 6 7
Switch(config-if)# wrr-queue cos-map 4 5
Switch(config-if)# priority-queue out
|
On Gigabit-capable Ethernet ports only, the switch automatically configures the ratio of the sizes of the WRR egress queues:
• Queue 1 is 80 percent.
• Queue 3 is 20 percent.
• Queue 4 is the expedite queue and is not assigned a size.
|
Switch(config-if)# wrr-queue queue-limit 80 1 20 1
|
On 10/100 Ethernet ports only, the switch automatically configures minimum-reserve levels for the egress queues:
• Queue 1 selects the minimum-reserve level 5.
• Queue 2 selects the minimum-reserve level 6.
• Queue 3 selects the minimum-reserve level 7.
• Queue 4 selects the minimum-reserve level 8.
|
Switch(config-if)# wrr-queue min-reserve 1 5
Switch(config-if)# wrr-queue min-reserve 2 6
Switch(config-if)# wrr-queue min-reserve 3 7
Switch(config-if)# wrr-queue min-reserve 4 8
|
Effects of Auto-QoS on the Configuration
When auto-QoS is enabled, the auto qos voip interface configuration command and the generated configuration are added to the running configuration.
Configuration Guidelines
Before configuring auto-QoS, you should be aware of this information:
•
In this release, auto-QoS configures the switch only for VoIP with Cisco IP phones.
•
To take advantage of the auto-QoS defaults, do not configure any standard-QoS commands before entering the auto-QoS commands. If necessary, you can fine-tune the QoS configuration, but we recommend that you do so only after the auto-QoS configuration is completed.
•
You can enable auto-QoS on static, dynamic-access, voice VLAN access, and trunk ports.
•
By default, the CDP is enabled on all interfaces. For auto-QoS to function properly, do not disable the CDP.
•
Policing is not enabled with auto-QoS. You can manually enable policing, as described in the "Configuring a QoS Policy" section
Enabling Auto-QoS for VoIP
Beginning in privileged EXEC mode, follow these steps to enable auto-QoS for VoIP within a QoS domain:
| |
Command
|
Purpose
|
Step 1
|
configure terminal
|
Enter global configuration mode.
|
Step 2
|
interface interface-id
|
Enter interface configuration mode, and specify the interface that is connected to a Cisco IP phone or the uplink interface that is connected to another switch or router in the interior of the network.
|
Step 3
|
auto qos voip {cisco-phone | trust}
|
Enable auto-QoS.
The keywords have these meanings:
• cisco-phone—If the interface is connected to a Cisco IP phone, the QoS labels of incoming packets are trusted only when the telephone is detected.
• trust—The uplink interface is connected to a trusted switch or router, and the VoIP traffic classification in the ingress packet is trusted.
|
Step 4
|
end
|
Return to privileged EXEC mode.
|
Step 5
|
show auto qos interface interface-id
|
Verify your entries.
This command displays the auto-QoS configuration that was initially applied; it does not display any user changes to the configuration that might be in effect.
|
To display the QoS commands that are automatically generated when auto-QoS is enabled or disabled, enter the debug autoqos privileged EXEC command before enabling auto-QoS. For more information, see the "Using the debug autoqos Command" section.
To disable auto-QoS on an interface, use the no auto qos voip interface configuration command. When you enter this command, the switch changes the auto-QoS settings to the standard-QoS default settings for that interface.
To disable auto-QoS on the switch, use the no mls qos global configuration command. When you enter this command, the switch disables QoS on all interfaces and enables pass-through mode.
This example shows how to enable auto-QoS and to trust the QoS labels in incoming packets when the device connected to Fast Ethernet interface 0/1 is detected as a Cisco IP phone:
Switch(config)# interface fastethernet0/1
Switch(config-if)# auto qos voip cisco-phone
This example shows how to enable auto-QoS and to trust the QoS labels in incoming packets when the switch or router connected to Gigabit Ethernet interface 0/1 is a trusted device:
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# auto qos voip trust
Displaying Auto-QoS Information
To display the inital auto-QoS configuration, use the show auto qos [interface [interface-id]] privileged EXEC command. To display any user changes to that configuration, use the show running-config privileged EXEC command. You can compare the show auto qos and the show running-config command output to identify the user-defined QoS settings.
To display information about the QoS configuration that might be affected by auto-QoS, use one of these commands:
•
show mls qos
•
show mls qos map cos-dscp
•
show mls qos interface [interface-id] [buffers | queueing]
For more information about these commands, refer to the command reference for this release.
Auto-QoS Configuration Example
This section describes how you could implement auto-QoS in a network, as shown in Figure 28-8.
Figure 28-8 Auto-QoS Configuration Example Network
The intelligent wiring closets in Figure 28-8 are composed of Catalyst 2950 switches running the enhanced software image (EI) and Catalyst 3550 switches. The object of this example is to prioritize the VoIP traffic over all other traffic. To do so, enable auto-QoS on the switches at the edge of the QoS domains in the wiring closets.
Note
You should not configure any standard QoS commands before entering the auto-QoS commands. You can fine-tune the QoS configuration, but we recommend that you do so only after the auto-QoS configuration is completed.
Beginning in privileged EXEC mode, follow these steps to configure the switch at the edge of the QoS domain to prioritize the VoIP traffic over all other traffic:
| |
Command
|
Purpose
|
Step 1
|
debug autoqos
|
Enable debugging for auto-QoS. When debugging is enabled, the switch displays the QoS configuration that is automatically generated when auto-QoS is enabled.
|
Step 2
|
configure terminal
|
Enter global configuration mode.
|
Step 3
|
cdp enable
|
Enable CDP globally. By default, it is enabled.
|
Step 4
|
interface fastethernet0/3
|
Enter interface configuration mode.
|
Step 5
|
auto qos voip cisco-phone
|
Enable auto-QoS on the interface, and specify that the interface is connected to a Cisco IP phone.
The QoS labels of incoming packets are trusted only when the IP phone is detected.
|
Step 6
|
interface fastethernet0/5
|
Enter interface configuration mode.
|
Step 7
|
auto qos voip cisco-phone
|
Enable auto-QoS on the interface, and specify that the interface is connected to a Cisco IP phone.
|
Step 8
|
interface fastethernet0/7
|
Enter interface configuration mode.
|
Step 9
|
auto qos voip cisco-phone
|
Enable auto-QoS on the interface, and specify that the interface is connected to a Cisco IP phone.
|
Step 10
|
interface gigabitethernet0/1
|
Enter interface configuration mode.
|
Step 11
|
auto qos voip trust
|
Enable auto-QoS on the interface, and specify that the interface is connected to a trusted router or switch.
|
Step 12
|
end
|
Return to privileged EXEC mode.
|
Step 13
|
show auto qos
|
Verify your entries.
This command displays the auto-QoS configuration that is initially applied; it does not display any user changes to the configuration that might be in effect.
For information about the QoS configuration that might be affected by auto-QoS, see the "Displaying Auto-QoS Information" section on page 26-12.
|
Step 14
|
copy running-config startup-config
|
Save the auto qos voip interface configuration commands and the generated auto-QoS configuration in the configuration file.
|
Configuring Standard QoS
Before configuring standard QoS, you must have a thorough understanding of these items:
•
The types of applications used and the traffic patterns on your network.
•
Traffic characteristics and needs of your network. Is the traffic bursty? Do you need to reserve bandwidth for voice and video streams?
•
Bandwidth requirements and speed of the network.
•
Location of congestion points in the network.
These sections describe how to configure standard QoS on your switch:
•
Default Standard QoS Configuration
•
Standard QoS Configuration Guidelines
•
Enabling QoS Globally
•
Configuring Classification By Using Port Trust States
•
Configuring a QoS Policy
•
Configuring DSCP Maps
•
Configuring Egress Queues on Gigabit-Capable Ethernet Ports
•
Configuring Egress Queues on 10/100 Ethernet Ports
Default Standard QoS Configuration
Table 28-4 shows the default standard QoS configuration when QoS is disabled.
Table 28-4 Default Standard QoS Configuration when QoS is Disabled
Port Type
|
QoS State
|
Egress traffic (DSCP and CoS Value)
|
Queue
|
Queue Weights
|
Tail-drop Thresholds
|
CoS Mapping to Queue
|
Gigabit-capable Ethernet ports
|
Disabled
|
Pass through.
|
All of the queue RAM is allocated to queue 1 (no expedite queue).
|
-
|
100%, 100%
WRED is disabled.
|
All CoS values map to queue 1.
|
10/100 Ethernet ports
|
Disabled
|
Pass through.
|
Each of the eight minimum-reserve levels have a buffer size of 100 packets. The queue selects the level.
|
-
|
-
|
All CoS values map to queue 1.
|
When QoS is disabled, there is no concept of trusted or untrusted ports because the packets are not modified (the CoS, DSCP, and IP precedence values in the packet are not changed).
Table 28-5 shows the default standard QoS configuration without any further configuration when QoS is enabled.
Table 28-5 Default Standard QoS Configuration when QoS is Enabled
Port Type
|
QoS State
|
Egress traffic (DSCP and CoS Value)
|
Queue
|
Queue Weights
|
Tail-drop Thresholds
|
CoS Mapping to Queue
|
Gigabit-capable Ethernet ports
|
Enabled
(no policing)
|
DSCP=0
CoS=0
(0 means best-effort delivery.)
|
Four queues are available (no expedite queue).
|
Each queue has the same weight.
|
100%, 100%
WRED is disabled.
|
0, 1: queue 1
2, 3: queue 2
4, 5: queue 3
6, 7: queue 4
|
10/100 Ethernet ports
|
Enabled
(no policing)
|
DSCP=0
CoS=0
(0 means best-effort delivery.)
|
Each of the eight minimum-reserve levels have a buffer size of 100 packets. The queue selects the level.
|
Each queue has the same weight.
|
-
|
0, 1: queue 1
2, 3: queue 2
4, 5: queue 3
6, 7: queue 4
|
The default port CoS value is 0.
The default port trust state on all ports is untrusted.
No policy maps are configured.
No policers are configured.
The default CoS-to-DSCP map is shown in Table 28-6.
The default IP-precedence-to-DSCP map is shown in Table 28-7.
The default DSCP-to-CoS map is shown in