Table Of Contents
Understanding Classification and Marking at the Ingress Port
Configuring the Default CoS Value for the Switch
Reverting to the Default Switch CoS Value
Mapping CoS Values to Transmit Queues and Drop Thresholds
Reverting to the Default CoS-to-Transmit Queue and Drop Threshold Mapping
Configuring QoS
This chapter describes how to configure quality of service (QoS) on Catalyst enterprise LAN switches.
Note For complete syntax and usage information for the commands that are used in this chapter, refer to the Catalyst 4500 Series, Catalyst 2948G, Catalyst 2948G-GE-TX, and Catalyst 2980G Switches Command Reference.
This chapter consists of these sections:
•Configuring QoS on the Switch
Understanding How QoS Works
These sections describe how QoS works:
•Understanding QoS Terminology
•Understanding Classification and Marking at the Ingress Port
QoS Overview
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.
QoS selects network traffic, prioritizes it according to its relative importance, and provides priority-indexed treatment through congestion-avoidance techniques. Implementing QoS in your network makes network performance more predictable and bandwidth utilization more effective.
QoS classifies traffic by assigning priority-indexed 802.1p class of service (CoS) values to frames at ingress ports. If traffic is tagged with a CoS value at the ingress port, the switch forwards the value. If traffic is native, then the switch can rewrite the CoS tag.
QoS implements scheduling on supported egress ports with transmit queue drop thresholds and multiple transmit queues that use the 802.1p CoS values to give preference to higher-priority traffic.
Figure 14-1 shows how QoS affects the traffic flow.
Figure 14-1 Traffic Flow Through the Switch with QoS Enabled—Catalyst 4500 Series, Catalyst 2948G, and Catalyst 2980G Switches
Understanding QoS Terminology
The following QoS terminology is used in this chapter:
•QoS labels are used to prioritize traffic:
–Layer 2 CoS values—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 (the User Priority bits). Other frame types cannot carry CoS values. CoS values range between 0 (low priority) and 7 (high priority).
•Classification is the selection of traffic to be marked.
•Marking is the application of QoS labels to traffic.
•Scheduling is the assignment of traffic to a queue. QoS assigns traffic based on CoS values.
•Congestion avoidance is the process by which QoS reserves ingress and egress port capacity for traffic with high-priority CoS values. QoS implements congestion avoidance with CoS value-based drop thresholds and transmit queues. A drop threshold is the percentage of buffer utilization at which traffic with a specified CoS value is dropped, leaving the buffer available for traffic with higher-priority CoS values. A transmit queue is a queue on the egress port where outgoing frames are stored before transmission. With multiple transmit queues, traffic with higher-priority CoS values can be placed in a reserved transmit queue.
•Policing is the process by which the switch limits the bandwidth that is consumed by a flow of traffic. Policing can mark or drop traffic.
Understanding Classification and Marking at the Ingress Port
ISL or 802.1Q frames are not classified or marked at the ingress port; the existing CoS value is honored.
When an 802.1Q frame enters the switch through a supported ingress port, QoS accepts the User Priority bits as the CoS value.
QoS classifies and marks all other frame types that enter the switch with the default CoS value that is configured for the entire switch. You cannot mark traffic on a per-port basis.
Note The Catalyst 4500 series, 2948G, and 2980G switches support frame classification and marking only on unclassified frames entering the switch.
Understanding Scheduling
There are two user-configurable transmit queues and one non-user-configurable transmit queue drop threshold for each port. You can specify such ports using the 2q1t keyword in QoS-related commands.
QoS uses the transmit queues to schedule transmission of network traffic from the switch through egress ports. By default, all traffic is assigned to queue 1 and threshold 1 when QoS is enabled. All traffic that is destined for a transmit queue, regardless of classification, is subject to tail drop when the queue is full (that is, frames at the end of the queue are dropped).
Caution When you disable QoS, the switch assigns unicast traffic to queue 1 and broadcast, multicast, and unknown traffic to queue 2. If you enable QoS but do not modify the CoS-to-transmit queue mappings, switch performance could be affected because all traffic is assigned to queue 1. If you enable QoS, we recommend that you modify the CoS-to-transmit queue mappings.
Note To configure the CoS values that are mapped to each transmit queue, see the "Mapping CoS Values to Transmit Queues and Drop Thresholds" section.
Software Requirements
QoS requires supervisor engine software release 5.2 or later releases. Use the show port capabilities command to determine the specific QoS support for a module.
QoS Default Configuration
Table 14-1 shows the QoS default configuration.
Table 14-1 QoS Default Configuration
Feature Default ValueQoS global enable state
Disabled
Switch CoS value
0
Transmit queue drop threshold percentages
•Threshold 1:100%1
CoS value-to-drop threshold mapping
•Transmit queue drop threshold 1: CoS 0-71.
CoS value-to-transmit queue mapping
•Transmit queue 1: CoS 0-7
•Transmit queue 2: None configured
1 Not user-configurable
Configuring QoS on the Switch
These sections describe how to configure QoS:
•Configuring the Default CoS Value for the Switch
•Reverting to the Default Switch CoS Value
•Mapping CoS Values to Transmit Queues and Drop Thresholds
•Reverting to the Default CoS-to-Transmit Queue and Drop Threshold Mapping
Note Because entering some QoS commands disables and then reenables ports (which can cause spanning tree topology changes), enter QoS commands only when necessary.
Enabling QoS Globally
To enable QoS globally on the switch, perform this task in privileged mode:
This example shows how to enable QoS globally:
Console> (enable) set qos enableQoS is enabled.Console> (enable)Configuring the Default CoS Value for the Switch
QoS assigns a CoS value to unclassified frames that are received on a port. The default CoS value is zero.
To set the default CoS value on the switch, perform this task in privileged mode:
Task CommandStep 1
Set the CoS value.
set qos defaultcos cos-value
Step 2
Verify the CoS value.
show qos info [runtime | config]
This example shows how to set CoS equal to 7 in all unclassified frames that are received on the switch and verify the configuration:
Console> (enable) set qos defaultcos 7qos defaultcos set to 7Console> (enable)Reverting to the Default Switch CoS Value
To revert to the default switch CoS value on the switch, perform this task in privileged mode:
Task CommandStep 1
Revert to the default CoS value.
clear qos defaultcos
Step 2
Verify that the default CoS value was restored.
show qos info [runtime | config]
This example shows how to revert to the default CoS value for port 8/1 and verify the configuration:
Console> (enable) clear qos defaultcosqos defaultcos setting cleared.Console> (enable)Mapping CoS Values to Transmit Queues and Drop Thresholds
Enter the set qos map command to associate CoS values to transmit queue drop thresholds.
The port_type is hardware dependent. Enter the show port capabilities command to determine the port_type for your hardware. The port type is defined by the number of transmit queues and the number of drop thresholds that are supported on the port. For example, the 2q1t port type supports two transmit queues and one drop threshold.
The q# is the transmit queue number. The threshold# is the drop threshold number for the specified queue. The cos_list is the list of CoS values to map to the specified transmit queue and drop threshold. CoS values must be specified in pairs (0-1, 2-3, 4-5, and 6-7).
To associate CoS values to a transmit queue and drop threshold, perform this task in privileged mode:
Task CommandAssociate a CoS value to a transmit queue and drop threshold.
set qos map port_type q# threshold# cos cos_list
This example shows how to map CoS values 4 through 7 to the second transmit queue and the first drop threshold for that queue on a 2q1t port:
Console> (enable) set qos map 2q1t 2 1 cos 4-7Qos tx priority queue and threshold mapped to cos successfully.Console> (enable)Reverting to the Default CoS-to-Transmit Queue and Drop Threshold Mapping
Enter the clear qos map command to revert to the default CoS-to-transmit queue and drop threshold mappings. The port_type is hardware dependent. Enter the show port capabilities command to determine the port_type for your hardware.
To revert to default CoS-to-transmit queue and drop threshold mappings, perform this task in privileged mode:
Task CommandRevert to default CoS-to-transmit queue and drop threshold mappings.
clear qos map port_type
This example shows how to revert the CoS-to-transmit queue and drop threshold mappings to the default values on 2q1t ports:
Console> (enable) clear qos map 2q1tQos map setting cleared.Console> (enable)Displaying QoS Information
To display QoS information, perform this task:
This example shows how to display the current QoS configuration information for the switch:
Console> show qos info configQoS setting in NVRAM:QoS is enabledAll ports have 2 transmit queues with 1 drop thresholds (2q1t).Default CoS = 4Queue and Threshold Mapping:Queue Threshold CoS----- --------- ---------------1 1 0 1 2 32 1 4 5 6 7Console>Reverting to QoS Defaults
To revert to QoS defaults, perform this task in privileged mode:
This example shows how to revert to QoS defaults:
Console> (enable) clear qos configThis command will disable QoS and take values back to factory default.Do you want to continue (y/n) [n]? yQoS config cleared.Console> (enable)
Note Reverting to defaults disables QoS, because QoS is disabled by default.
Disabling QoS
To disable QoS, perform this task in privileged mode:
This example shows how to disable QoS:
Console> (enable) set qos disableQoS is disabled.Console> (enable)