Configuring QoS

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Prerequisites for 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. For example, is the traffic on your network 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.

General QoS Guidelines

These are the general QoS guidelines:

  • Control traffic (such as spanning-tree bridge protocol data units [BPDUs] and routing update packets) received by the switch are subject to all ingress QoS processing.

  • You are likely to lose data when you change queue settings; therefore, try to make changes when traffic is at a minimum.

Restrictions for QoS

The following are the restrictions for QoS:

  • The switch does not support classifying of traffic using class maps (class-map global configuration command).

  • Ingress queueing is not supported.

  • Interface restrictions:

    • Enable only cos trust at interface level.

    • Enable SRR shaping and sharing at interface level.

    • Enable Priority queueing at interface level.

Information About QoS

QoS Implementation

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 the QoS feature, you can select specific network traffic, prioritize it according to its relative importance, and use congestion-management and congestion-avoidance techniques to provide preferential treatment. Implementing QoS in your network makes network performance more predictable and bandwidth utilization more effective.

The QoS implementation is based on the Differentiated Services (Diff-Serv) architecture, a standard from the Internet Engineering Task Force (IETF). This architecture specifies that each packet is classified upon entry into the network.

Figure 1. QoS Classification Layers in Frames and Packets. The special bits in the Layer 2 frame or a Layer 3 packet are shown in the following figure:

Layer 2 Frame Prioritization Bits

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 ports 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.

Layer 3 Packet Prioritization Bits

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.

QoS Basic Model

To implement QoS, the switch must distinguish packets or flows from one another (classify), assign a label to indicate the given quality of service as the packets move through the switch, and provide different treatment in all situations where resource contention exists. The switch also needs to ensure that traffic sent from it meets a specific traffic profile (shape).

Actions at Ingress Port

Actions at the ingress port include classifying a distinct path for a packet by associating it with a QoS label. The switch maps the CoS in the packet to a QoS label to distinguish one kind of traffic from another. The QoS label that is generated identifies all future QoS actions to be performed on this packet..


Note

Queueing and scheduling are only supported at egress and not at ingress on the switch.


Actions at Egress Port

Actions at the egress port include queueing and scheduling:

  • Queueing evaluates the QoS packet label and the corresponding DSCP or CoS value before selecting which of the four egress queues to use. Because congestion can occur when multiple ingress ports simultaneously send data to an egress port, WTD differentiates traffic classes and subjects the packets to different thresholds based on the QoS label. If the threshold is exceeded, the packet is dropped.

  • Scheduling services the four egress queues based on their configured SRR shared or shaped weights. One of the queues (queue 1) can be the priority queue, which is serviced until empty before the other queues are serviced.

Mapping Tables Overview

During QoS processing, the switch represents the priority of all traffic (including non-IP traffic) with a QoS label based on the CoS value from the classification stage.

The following table describes QoS processing and mapping tables.

Table 1. QoS Processing and Mapping Tables

QoS Processing Stage

Mapping Table Usage

Classification

During the classification stage, QoS uses configurable mapping tables to derive a corresponding CoS value. This value for the traffic packet can be either trusted, untrusted or overrided. The cos-output-theshold map is supported here.

Pre-scheduling

Before the traffic reaches the scheduling stage, QoS stores the packet in an egress queue according to the QoS label. The QoS label is based on the CoS value in the packet and selects the queue through the CoS output queue threshold maps. In addition to an egress queue, the QOS label also identifies the WTD threshold value.

You configure these maps by using the mls qos srr-queue {output} cos-map global configuration commands.

Queueing and Scheduling Overview

The switch has queues at specific points to help prevent congestion.


Note

The switch supports 4 egress queues by default.

The Catalyst 2960-L switches support Scheduled Round Robin (SRR). They do not support Weighted Round Robin (WRR). If you are running a release earlier than Cisco IOS Release 15.2(5)E2, use the wrr commands instead of srr to configure SRR. From Cisco IOS Release 15.2(5)E2 and later, use the srr commands on the switch.


Weighted Tail Drop

As a frame is enqueued to a particular queue, WTD uses the frame’s assigned QoS label to subject it to different thresholds. If the threshold is exceeded for that QoS label (the space available in the destination queue is less than the size of the frame), the switch drops the frame.

Each queue has three threshold values. The QoS label determines which of the three threshold values is subjected to the frame. Of the three thresholds, two are configurable (explicit) and one is not (implicit).

Figure 2. WTD and Queue Operation. The following figure shows an example of WTD operating on a queue whose size is 1000 frames. Three drop percentages are configured: 40 percent (400 frames), 60 percent (600 frames), and 100 percent (1000 frames). These percentages indicate that up to 400 frames can be queued at the 40-percent threshold, up to 600 frames at the 60-percent threshold, and up to 1000 frames at the 100-percent threshold.

In the example, CoS values 6 and 7 have a greater importance than the other CoS values, and they are assigned to the 100-percent drop threshold (queue-full state). CoS values 4 and 5 are assigned to the 60-percent threshold, and CoS values 0 to 3 are assigned to the 40-percent threshold.

Suppose the queue is already filled with 600 frames, and a new frame arrives. It contains CoS values 4 and 5 and is subjected to the 60-percent threshold. If this frame is added to the queue, the threshold will be exceeded, so the switch drops it.

Queueing and Scheduling on Egress Queues

The following figure shows queueing and scheduling flowcharts for egress ports on the switch.

Figure 3. Queueing and Scheduling Flowchart for Egress Ports on the Switch

Note

If the priority queue is enabled, SRR services it until it is empty before servicing the other three queues.


Egress Priority Queue

Each port supports four egress queues, one of which (queue 1) can be the egress priority queue. All traffic exiting the switch flows through one of these four queues and is subjected to a threshold based on the QoS label assigned to the packet.


Note

If the priority queue is enabled, SRR services it until it is empty before servicing the other three queues.


Egress Queue Buffer Allocation

The following figure shows the egress queue buffer.

Figure 4. Egress Queue Buffer Allocation. The buffer space is divided between the common pool and the reserved pool. The switch uses a buffer allocation scheme to reserve a minimum amount of buffers for each egress queue, to prevent any queue or port from consuming all the buffers and depriving other queues, and to control whether to grant buffer space to a requesting queue. The switch detects whether the target queue has not consumed more buffers than its reserved amount (under-limit), whether it has consumed all of its maximum buffers (over limit), and whether the common pool is empty (no free buffers) or not empty (free buffers). If the queue is not over-limit, the switch can allocate buffer space from the common pool (if it is not empty). If there are no free buffers in the common pool or if the queue is over-limit, the switch drops the frame.
Queues and WTD Thresholds

You can assign each packet that flows through the switch to a queue and to a threshold.

Specifically, you map CoS values to an egress queue and map CoS values to a threshold ID. You use the mls qos srr-queue output cos-map queue queue-id {cos1...cos8 | threshold threshold-id cos1...cos8} global configuration command. You can display the CoS output queue threshold map by using the show mls qos maps privileged EXEC command.

The queues use WTD to support distinct drop percentages for different traffic classes. Each queue has three drop thresholds: two configurable (explicit) WTD thresholds and one nonconfigurable (implicit) threshold preset to the queue-full state. You assign the two WTD threshold percentages for threshold ID 1 and ID 2. The drop threshold for threshold ID 3 is preset to the queue-full state, and you cannot modify it.

Shaped or Shared Mode

SRR services each queue-set in shared or shaped mode. You map a port to a queue-set by using the queue-set qset-id interface configuration command. You assign shared or shaped weights to the port by using the srr-queue bandwidth share weight1 weight2 weight3 weight4 or the srr-queue bandwidth shape weight1 weight2 weight3 weight4 interface configuration command.

The buffer allocation together with the SRR weight ratios control how much data can be buffered and sent before packets are dropped. The weight ratio is the ratio of the frequency in which the SRR scheduler sends packets from each queue.

All four queues participate in the SRR unless the expedite queue is enabled, in which case the first bandwidth weight is ignored and is 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 CoSs into certain queues, by allocating a large queue size or by servicing the queue more frequently, and by adjusting queue thresholds so that packets with lower priorities are dropped.


Note

The egress queue default settings are suitable for most situations. You should change them only when you have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.


Packet Modification

A packet is classified and queued to provide QoS. The following packet modifications can occur during the process to provide QoS:

  • For IP and non-IP packets, classification involves assigning a QoS label to a packet based on the CoS of the received packet. However, the packet is not modified at this stage; only an indication of the assigned CoS value is carried along.

  • If you configure the port to trust the CoS of the incoming frame and it is an IP packet, the CoS value in the frame is not changed.

Standard QoS Default Configuration

QoS is disabled by default.

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.

Traffic is switched in pass-through mode. The packets are switched without any rewrites and classified as best effort without any policing.

When QoS is enabled using the mls qos global configuration command and all other QoS settings are at their defaults, traffic is classified as best effort (the DSCP and CoS value is set to 0) without any policing. No policy maps are configured. The default port trust state on all ports is untrusted.

Default Egress Queue Configuration

The following table shows the default egress queue configuration for each queue-set when QoS is enabled. These values are not user-configurable. All ports are mapped to queue-set 1. The port bandwidth limit is set to 100 percent and rate unlimited.

Note 

For the SRR shaped weights (absolute) feature, a shaped weight of zero indicates that the queue is operating in shared mode.

For the SRR shared weights feature, one quarter of the bandwidth is allocated to each queue

Table 2. Default Egress Queue Configuration

Feature

Queue 1

Queue 2

Queue 3

Queue 4

Buffer allocation

25 percent

25 percent

25 percent

25 percent

WTD drop threshold 1

80 percent

80 percent

80 percent

80 percent

WTD drop threshold 2

80 percent

80 percent

80 percent

80 percent

Maximum threshold

1000 percent

1000 percent

1000 percent

1000 percent

SRR shaped weights (absolute)

25

0

0

0

SRR shared weights

25

25

25

25

The following table shows the default CoS output queue threshold map when QoS is enabled.

Table 3. Default CoS Output Queue Threshold Map

CoS Value

Queue ID–Threshold ID

0

2–2

1

2-2

2

3-2

3

3-2

4

4–2

5

1-2

6

4-2

7

4-2

DSCP Maps

Default CoS-to-DSCP Map

When DSCP transparency mode is disabled, the DSCP values are derived from CoS as per the following table.

Note 

The DSCP transparency mode is disabled by default. If it is enabled (no mls qos rewrite ip dscp interface configuration command), DSCP rewrite will not happen.

Table 4. Default CoS-to-DSCP Map

CoS Value

DSCP Value

0

0

1

8

2

16

3

24

4

32

5

40

6

48

7

56

How to Configure QoS

Enabling QoS Globally

By default, QoS is disabled on the switch.

The following procedure to enable QoS globally is required.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

mls qos

Example:


Switch(config)# mls qos

Enables QoS globally.

QoS operates with the default settings described in the related topic sections below.

Note 

To disable QoS, use the no mls qos global configuration command.

Step 3

end

Example:


Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show mls qos

Example:


Switch# show mls qos

Verifies the QoS configuration.

Step 5

copy running-config startup-config

Example:


Switch# copy running-config 
startup-config

(Optional) Saves your entries in the configuration file.

Configuring Egress Queue Characteristics

Depending on the complexity of your network and your QoS solution, you might need to perform all of the tasks in the following modules. You need to make decisions about these characteristics:

  • Which packets are mapped by DSCP or CoS value to each queue and threshold ID?

  • What drop percentage thresholds apply to the queue-set (four egress queues per port), and how much reserved and maximum memory is needed for the traffic type?

  • How much of the fixed buffer space is allocated to the queue-set?

  • Does the bandwidth of the port need to be rate limited?

  • How often should the egress queues be serviced and which technique (shaped, shared, or both) should be used?

Configuration Guidelines

Follow these guidelines when the expedite queue is enabled or the egress queues are serviced based on their SRR weights:

  • If the egress expedite queue is enabled, it overrides the SRR shaped and shared weights for queue 1.

  • If the egress expedite queue is disabled and the SRR shaped and shared weights are configured, the shaped mode overrides the shared mode for queue 1, and SRR services this queue in shaped mode.

  • If the egress expedite queue is disabled and the SRR shaped weights are not configured, SRR services this queue in shared mode.

Mapping DSCP or CoS Values to an Egress Queue and to a Threshold ID

You can prioritize traffic by placing packets with particular CoS into certain queues and adjusting the queue thresholds so that packets with lower priorities are dropped.


Note

The egress queue default settings are suitable for most situations. You should change them only when you have a thorough understanding of egress queues and if these settings do not meet your QoS solution.


Beginning in privileged EXEC mode, follow these steps to map CoS values to an egress queue and to a threshold ID. This procedure is optional.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

mls qos srr-queue output cos-map queue queue-id-1...queue-id-4 { cos0...cos7 | threshold threshold-id-1...threshold-id-4 cos0...cos7}

Example:


Switch(config)# mls qos srr-queue output 
cos-map queue 1 threshold 2 4 5

Maps CoS values to an egress queue and to a threshold ID.

See the Default Egress Queue Configuration section for the default mapping between the CoS values to the Queue ID and the Threshold ID

  • For queue-id , the range is 1 to 4.

  • For threshold-id , the range is 1 to 4. The drop-threshold percentage for threshold 3 is predefined. It is set to the queue-full state.

  • For cos0...cos7 , enter up to eight values, and separate each value with a space. The range is 0 to 7.

Note 

To return to the default CoS output queue threshold map, use the no mls qos srr-queue output cos-map global configuration command.

Step 3

end

Example:


Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show mls qos maps

Example:


Switch# show mls qos maps

Verifies your entries.

The CoS output queue threshold map shows the CoS value in the top row and the corresponding queue ID and threshold ID in the second row; for example, queue 2 and threshold 2 is shown as "2-2".

Step 5

copy running-config startup-config

Example:


Switch# copy-running-config 
startup-config

(Optional) Saves your entries in the configuration file.

To return to the default CoS output queue threshold map, use the no mls qos srr-queue output cos-map global configuration command.

Configuring SRR Shaped Weights on Egress Queues

You can specify how much of the available bandwidth is allocated to each queue. The ratio of the weights is the ratio of frequency in which the SRR scheduler sends packets from each queue.

You can configure the egress queues for shaped or shared weights, or both. Use shaping to smooth bursty traffic or to provide a smoother output over time.

Beginning in privileged EXEC mode, follow these steps to assign the shaped weights and to enable bandwidth shaping on the four egress queues mapped to a port. This procedure is optional.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

interface interface-id

Example:


Switch(config)# interface 
gigabitethernet2/0/1

Specifies the port of the outbound traffic, and enters interface configuration mode.

Step 3

srr-queue bandwidth shape weight1 weight2 weight3 weight4

Example:


Switch(config-if)# srr-queue 
bandwidth shape 8 0 0 0

Assigns SRR weights to the egress queues. By default, weight1 is set to 25; weight2, weight3, and weight4 are set to 0, and these queues are in shared mode.

For weight1 weight2 weight3 weight4 , enter the weights to control the percentage of the port that is shaped. The inverse ratio (1/weight) controls the shaping bandwidth for this queue. Separate each value with a space. The range is 0 to 65535.

If you configure a weight of 0, the corresponding queue operates in shared mode. The weight specified with the srr-queue bandwidth shape command is ignored, and the weights specified with the srr-queue bandwidth share interface configuration command for a queue come into effect. When configuring queues in the same queue-set for both shaping and sharing, make sure that you configure the lowest number queue for shaping.

The shaped mode overrides the shared mode.

To return to the default setting, use the no srr-queue bandwidth shape interface configuration command.

Step 4

end

Example:


Switch(config-if)# end

Returns to privileged EXEC mode.

Step 5

show mls qos interface interface-id queueing

Example:


Switch# show mls qos interface 
interface-id queuing

Verifies your entries.

Step 6

copy running-config startup-config

Example:


Switch# copy running-config 
startup-config

(Optional) Saves your entries in the configuration file.

To return to the default setting, use the no srr-queue bandwidth shape interface configuration command.

Configuring SRR Shared Weights on Egress Queues

In shared mode, the queues share the bandwidth among them according to the configured weights. The bandwidth is guaranteed at this level but not limited to it. For example, if a queue empties and does not require a share of the link, the remaining queues can expand into the unused bandwidth and share it among them. With sharing, the ratio of the weights controls the frequency of dequeuing; the absolute values are meaningless.


Note

The egress queue default settings are suitable for most situations. You should change them only when you have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.


Beginning in privileged EXEC mode, follow these steps to assign the shared weights and to enable bandwidth sharing on the four egress queues mapped to a port. This procedure is optional.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

interface interface-id

Example:


Switch(config)# interface 
gigabitethernet2/0/1

Specifies the port of the outbound traffic, and enters interface configuration mode.

Step 3

srr-queue bandwidth share weight1 weight2 weight3 weight4

Example:


Switch(config-id)# srr-queue 
bandwidth share 1 2 3 4

Assigns SRR weights to the egress queues. By default, all four weights are 25 (1/4 of the bandwidth is allocated to each queue).

For weight1 weight2 weight3 weight4 , enter the weights to control the ratio of the frequency in which the SRR scheduler sends packets. Separate each value with a space. The range is 1 to 255.

To return to the default setting, use the no srr-queue bandwidth share interface configuration command.

Step 4

end

Example:


Switch(config-id)# end

Returns to privileged EXEC mode.

Step 5

show mls qos interface interface-id queueing

Example:


Switch# show mls qos interface 
interface_id queuing

Verifies your entries.

Step 6

copy running-config startup-config

Example:


Switch# copy-running-config 
startup-config

(Optional) Saves your entries in the configuration file.

To return to the default setting, use the no srr-queue bandwidth share interface configuration command.

Configuring the Egress Priority Queue

You can ensure that certain packets have priority over all others by queuing them in the egress priority queue. SRR services this queue until it is empty before servicing the other queues.

Beginning in privileged EXEC mode, follow these steps to enable the egress priority queue. This procedure is optional.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

mls qos

Example:


Switch(config)# mls qos

Enables QoS on a switch.

Step 3

interface interface-id

Example:


Switch(config)# interface 
gigabitethernet1/0/1

Specifies the egress port, and enters interface configuration mode.

Step 4

priority-queue out

Example:


Switch(config-if)# priority-queue out

Enables the egress priority queue, which is disabled by default.

When you configure this command, the SRR weight and queue size ratios are affected because there is one fewer queue participating in SRR. This means that weight1 in the srr-queue bandwidth shape or the srr-queue bandwidth share command is ignored (not used in the ratio calculation).

Note 

To disable the egress priority queue, use the no priority-queue out interface configuration command.

Step 5

end

Example:


Switch(config-if)# end

Returns to privileged EXEC mode.

Step 6

show running-config

Example:


Switch# show running-config

Verifies your entries.

Step 7

copy running-config startup-config

Example:


Switch# copy running-config 
startup-config

(Optional) Saves your entries in the configuration file.

To disable the egress priority queue, use the no priority-queue out interface configuration command.

Limiting the Bandwidth on an Egress Interface

You can limit the bandwidth on an egress port. For example, if a customer pays only for a small percentage of a high-speed link, you can limit the bandwidth to that amount.


Note

The egress queue default settings are suitable for most situations. You should change them only when you have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.


Beginning in privileged EXEC mode, follow these steps to limit the bandwidth on an egress port. This procedure is optional.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

interface interface-id

Example:


Switch(config)# interface 
gigabitethernet2/0/1

Specifies the port to be rate-limited, and enters interface configuration mode.

Step 3

srr-queue bandwidth limit weight1

Example:


Switch(config-if)# srr-queue 
bandwidth limit 80

Specifies the percentage of the port speed to which the port should be limited. The range is 10 to 90.

By default, the port is not rate-limited and is set to 100 percent.

Note 
To return to the default setting, use the no srr-queue bandwidth limit interface configuration command.
Step 4

end

Example:


Switch(config-if)# end

Returns to privileged EXEC mode.

Step 5

show mls qos interface [interface-id] queueing

Example:


Switch# show mls qos interface 
interface_id queueing

Verifies your entries.

Step 6

copy running-config startup-config

Example:


Switch# copy-running-config 
startup-config

(Optional) Saves your entries in the configuration file.

To return to the default setting, use the no srr-queue bandwidth limit interface configuration command.

Enabling DSCP Transparency Mode

The switch supports the DSCP transparency feature. It affects only the DSCP field of a packet at egress. By default, DSCP transparency is disabled. The switch modifies the DSCP field in an incoming packet, and the DSCP field in the outgoing packet is based on the quality of service (QoS) configuration, including the port trust setting, policing, and marking.

If DSCP transparency is enabled by using the no mls qos rewrite ip dscp command, the switch does not modify the DSCP field in the incoming packet, and the DSCP field in the outgoing packet is the same as that in the incoming packet.

Regardless of the DSCP transparency configuration, the switch modifies the internal DSCP value of the packet, which the switch uses to generate a class of service (CoS) value that represents the priority of the traffic. The switch also uses the internal DSCP value to select an egress queue and threshold.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

mls qos

Example:


Switch(config)# mls qos

Enables QoS globally.

Step 3

no mls qos rewrite ip dscp

Example:


Switch(config)# no mls qos rewrite ip dscp

Enables DSCP transparency. The switch is configured to not modify the DSCP field of the IP packet.

Step 4

end

Example:


Switch(config)# end

Returns to privileged EXEC mode.

Step 5

show mls qos interface [interface-id]

Example:


Switch# show mls qos interface gigabitethernet 2/1/1

Verifies your entries.

Step 6

copy running-config startup-config

Example:


Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

Configuring the Trust State on Ports Within the QoS Domain

Packets entering a QoS domain are classified at the edge of the QoS domain. When the packets are classified at the edge, the switch port within the QoS domain can be configured to one of the trusted states because there is no need to classify the packets at every switch within the QoS domain.

Figure 5. Port Trusted States on Ports Within the QoS Domain

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:


Switch# configure terminal

Enters global configuration mode.

Step 2

interface interface-id

Example:


Switch(config)# interface 
gigabitethernet 1/0/2

Specifies the port to be trusted, and enters interface configuration mode. Valid interfaces are physical ports.

Step 3

mls qos trust [cos]

Example:


Switch(config-if)# mls qos trust cos

Configures the port trust state.

By default, the port is not trusted. If no keyword is specified, the default is dscp .

The keywords have these meanings:

  • cos —Classifies an ingress packet by using the packet CoS value. For an untagged packet, the port default CoS value is used. The default port CoS value is 0.

Step 4

mls qos cos [override]

Example:


Switch(config-if)# mls qos cos override

Overrides the CoS of the incoming packets and applies the default CoS value on the port to all incoming packets.

Step 5

end

Example:


Switch(config-if)# end

Returns to privileged EXEC mode.

Step 6

show mls qos interface

Example:


Switch# show mls qos interface

Verifies your entries.

Step 7

copy running-config startup-config

Example:


Switch# copy running-config 
startup-config

(Optional) Saves your entries in the configuration file.

Monitoring Standard QoS

Table 5. Commands for Monitoring Standard QoS on the Switch

Command

Description

show mls qos

Displays global QoS configuration information.

show mls qos interface [interface-id] [queueing | statistics]

Displays QoS information at the port level, including the queueing strategy, and the ingress and egress statistics.

show mls qos maps [cos-dscp | cos-output-q]

Displays QoS mapping information.

show running-config | include rewrite

Displays the DSCP transparency setting.

Configuration Examples for QoS

Examples: Configuring Egress Queue Characteristics

This example shows how to configure bandwidth shaping on queue 1. Because the weight ratios for queues 2, 3, and 4 are set to 0, these queues operate in shared mode. The bandwidth weight for queue 1 is 1/8, which is 12.5 percent:


Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# srr-queue bandwidth shape 8 0 0 0

This example shows how to configure the weight ratio of the SRR scheduler running on an egress port. Four queues are used, and the bandwidth ratio allocated for each queue in shared mode is 1/(1+2+3+4), 2/(1+2+3+4), 3/(1+2+3+4), and 4/(1+2+3+4), which is 10 percent, 20 percent, 30 percent, and 40 percent for queues 1, 2, 3, and 4. This means that queue 4 has four times the bandwidth of queue 1, twice the bandwidth of queue 2, and one-and-a-third times the bandwidth of queue 3.


Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# srr-queue bandwidth share 1 2 3 4

This example shows how to enable the egress expedite queue when the SRR weights are configured. The egress expedite queue overrides the configured SRR weights.


Switch(config)# interface gigabitethernet1/0/1
Switch(config-if)# srr-queue bandwidth shape 25 0 0 0
Switch(config-if)# srr-queue bandwidth share 30 20 25 25
Switch(config-if)# priority-queue out
Switch(config-if)# end

This example shows how to limit the bandwidth on a port to 80 percent:


Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# srr-queue bandwidth limit 80

When you configure this command to 80 percent, the port is idle 20 percent of the time. The line rate drops to 80 percent of the connected speed, which is 800 Mb/s. These values are not exact because the hardware adjusts the line rate in increments of six.

Feature History and Information for QoS

Release Modification

Cisco IOS Release 15.2(5)E

This feature was introduced.