Modular QoS Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Release

PDF

Modular QoS Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Release

Configure packet classification and specify QoS actions

Want to summarize with AI?

Log in

Provides instructions for classifying network traffic into user-defined classes and applying Quality of Service actions like traffic shaping. This process helps manage bandwidth and prioritize specific traffic flows on an interface using class maps and policy maps.


Use this task to classify traffic into user-defined classes and apply QoS actions such as traffic shaping. This helps manage bandwidth and prioritize traffic on an interface.

To classify and shape outgoing traffic, you apply a traffic policy to an interface. Classification is based on match criteria, such as QoS groups. Shaping controls the transmission rate of classified traffic.

Before you begin

Determine the match criteria for classifying traffic and the QoS actions based on the interface bandwidth.

Procedure

1.

Create a class map and specify the match criteria.

Example:

Router#configure
Router(config)#class-map match-any qos-1

This example creates a class map named qos-1 and specifies that traffic is matched if any of the defined conditions are met.

2.

Match traffic with QoS group 1 to the qos-1 class.

Example:

Router(config-cmap)#match qos-group 1
Router(config-cmap)#end-class-map
Router(config-cmap)#commit

QoS groups are internal markers that may be set based on ACLs, routing protocols, or other criteria.

3.

Create a policy map named test-shape-1 .

Example:

Router(config)#policy-map test-shape-1
4.

Bind or associate the qos-1 class to the policy map.

Example:

Router(config)#policy-map test-shape-1
5.

Specify QoS actions for the traffic class.

Example:

Router(config-pmap-c)#shape average percent 40
Router(config-pmap-c)#exit
Router(config-pmap)#end-policy-map

This example configures the policy to shape traffic in the qos-1 class to 40% of the interface bandwidth.

6.

Attach the traffic policy to an interface.

Example:

Router(config)#interface fourHundredGigE 0/0/0/2
Router(config-int)#service-policy output test-shape-1
Router(config-int)#commit

This example applies the policy map to the egress-direction of interface FourHundredGigE 0/0/0/2 .

7.

Verify policy configuration and traffic statistics.

Example:


Router# show qos interface fourHundredGigE 0/0/0/2 output

NOTE:- Configured values are displayed within parentheses
Interface FourHundredGigE0/0/0/2
  ifh 0x80000080 -- output policy
  NPU Id:                   0
  Total number of classes:    2
  Interface Bandwidth:        400000000 kbps
  Policy Name:                test-shape-1
  Accounting Type:            Layer1 (Include Layer 1 encapsulation and above)
------------------------------------------------------------------------------
Level1 Class
  =                      qos-1
    Level2 Class

Level1 Class
  =                      class-default

Node 0/0/CPU0, Interface FourHundredGigE0/0/0/2 Ifh 0x80000080 (FourHundredGigE) -- output policy
NPU Id:                                  0
Total number of classes:                   2
Interface Bandwidth:               400000000 kbps
Policy Name:                           test-shape-1
Accounting Type:                      Layer1 (Include Layer 1 encapsulation and above)
------------------------------------------------------------------------------
Level1 Class
  =                      qos-1
    Shape Average Rate(kbps)           160000000 (40%)
    Queue ID                             50331648 (LP queue)
    Tail Drop Packets                         0
    Tail Drop Bytes                           0

Level1 Class
  =                      class-default
    Queue ID                             50331647 (LP queue)
    Tail Drop Packets                         0
    Tail Drop Bytes                           0

The Shape Average Rate (kbps) 160000000 (40%) line shows the configured shaping rate (160 Gbps), which accounts for 40% of the 400 Gbps interface bandwidth.


Configure QoS actions for the default class

Use this task to apply a QoS marking action to unclassified traffic (the class-default class) in a traffic policy.

Traffic that does not match any user-defined class is automatically treated as part of the class-default class. Applying actions to this class ensures that even unclassified traffic receives appropriate QoS treatment, such as DSCP marking.

Use these steps to configure QoS actions for the default class.

Before you begin

Ensure that no other policy is applied to the same interface that would conflict with this default class policy.

Procedure

1.

Define a traffic policy and assign the default class.

Example:

Router# configure
Router(config)# policy-map egress_policy1
Router(config-pmap)# class class-default

This step creates a policy map named egress_policy1 and selects the class-default class, which handles all unmatched traffic.

2.

Set the QoS action—in this example, the DSCP value—for the default class.

Example:

Router(config-pmap-c)# set dscp default
Router(config-pmap-c)# exit
Router(config)# commit
This step marks all unclassified traffic with the DSCP value default (equivalent to DSCP 0 ), which typically indicates best-effort service.

The policy map egress_policy1 is created, and unclassified traffic is marked with DSCP 0 when the policy is applied to an interface.


Additional Guidelines for Packet Classification and QoS Actions

  • Hierarchical policy limitation: You cannot nest one policy map inside another or reference a policy map within another policy. Hierarchical policies are not supported.

  • Traffic rate accuracy: Traffic rate estimates in QoS statistics are approximations based on an exponential decay filter and may not reflect precise values.

  • BGP Flowspec impact: When a Flowspec police rule and a QoS policy apply to the same ingress traffic, the Flowspec action takes precedence. This may cause QoS counters for the policy map to display zero or incorrect values.