Class-based Quality-of-Service MIB

This chapter contains the following sections:

Class-based Quality-of-Service MIB

The Class-based Quality-of-Service MIB (cbQoSMIB) feature provides the Simple Network Management Protocol (SNMP) MIB that enables retrieval of class-map and policy-map configuration and statistics.

Information About Class-based Quality-of-Service MIB

CoPP and QoS policies now support Class-based Quality-of-Service MIB (cbQoSMIB). cbQoSMIB is the SNMP MIB that provides access to Modular QoS CLI (MQC) configuration and statistics.

The following cbQoSMIB tables are supported by QoS policies and CoPP:
  • cbQosClassMapCfg

  • cbQosMatchStmtCfg

  • cbQosPoliceStats

  • cbQosPolicyMapCfg

  • cbQosPoliceCfg

The following cbQoSMIB tables are supported by QoS policies:
  • cbQosInterfacePolicy

  • cbQosObjects

  • cbQosQueueingCfg

  • cbQosServicePolicy

  • cbQosSetCfg

Class-based Quality-of-Service MIB Phase 2

Beginning from Cisco NX-OS Release 7.3(0)N1(1), the following cbQoSMIB tables are also supported by QoS policies:

  • cbQosClassMapStats

  • cbQosMatchStmtStats

  • cbQosQueueingStats

More detailed information on cbQoSMIB tables and elements is available at the following url: http:/​/​tools.cisco.com/​Support/​SNMP/​do/​BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.4.1.9.9.166

Licensing Requirements for Class-based Quality-of-Service MIB

This feature does not require a license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.

Guidelines and Limitations for Class-based Quality-of-Service MIB

The guidelines and limitations for viewing statistics are as follows:

  • Statistics can be viewed per Access Control Entry (ACE) in an Access Control List (ACL) if there is no policer attached.

  • Statistics can be viewed per ACE in an ACL, if there is only one ACE in the ACL and if a policer is attached.

  • Statistics cannot be viewed per ACE in an ACL, if there are more than one ACEs in an ACL and a policer is attached.

  • The limitations above apply to QoS-based matches as well, such as match dscp dscp-list , match precedence precedence-list and so on.

  • Statistics cannot be viewed with match-all rules.

  • Statistics can be viewed only with match-any .

  • For instances when the statistics do not get enabled without a policer, follow these steps:
    • Create a class. You can add as many rules as required.

    • Create a policy-map and attach the above class to it.

    • Add a dummy policer to it (if you do not require a real policer).

    • Apply the policy to the interface.

    • Remove the dummy policer to display the statistics.

  • Statistics are shown per policy and not at an interface level.

  • Use the show ip access-list command to display statistics for matches based on access group. These statistics cannot be viewed with the show policy-map interface command.

Configuring a QoS Policy

The following configuration is a generic example to configure a QoS policy.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # snmp-server community com-name rw

Creates Simple Network Management Protocol (SNMP) communities for SNMPv1 or SNMPv2c.

Step 3

switch(config) # snmp-server community com-name rw

Creates Simple Network Management Protocol (SNMP) communities for SNMPv1 or SNMPv2c.

Step 4

switch(config) # class-map type qos match-any class-map-name

Specifies the component type qos for the class map and enters the class-map type qos configuration mode.

Step 5

switch(config-cmap-qos) # description text

Adds a description for the class-map.

Step 6

switch(config-cmap-qos) # match cos cos-list

Defines the class of traffic using the class of service (CoS) value in a type qos class map.

Step 7

switch(config-cmap-qos) # match dscp dscp-list

(Optional) Specifies differentiated services code point (DSCP) values in the DiffServ field of the IP Header (either IPv4 or IPv6) as a match criterion.

Step 8

switch(config-cmap-qos) # exit

Exits the class-map type qos configuration mode.

Step 9

switch(config) # policy-map type qos qos-policy-map-name

Specifies the type qos policy map and enters the policy-map qos configuration mode.

Step 10

switch(config-pmap-qos) # description text

Configures the policy-map description.

Step 11

switch(config-pmap-qos) # class class-map-name

Configures the service policy for a class-map.

Step 12

switch(config-pmap-c-qos) # set qos-group qos-group-value

Assigns the QoS group identifier for a class of traffic in a type qos policy map.

Step 13

switch(config-pmap-c-qos) # exit

Exits the policy-map type qos class configuration mode.

Step 14

switch(config-pmap-qos) # exit

Exits the policy-map qos configuration mode.

Step 15

switch(config) # interface type number

Enters the interface configuration mode.

Step 16

switch(config-if) # service-policy type qos input policy-map-name

Applies the service policy map to packets coming into the mentioned interface.

Step 17

switch(config-if) # exit

Exits the interface configuration mode.

Step 18

(Optional) switch(config) # copy running-config startup-config

(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Example

This example shows how to configure a QoS policy on a switch:


Note


This is a generic example to configure a QoS policy.


switch# configure terminal
switch(config)# snmp-server community public rw
switch(config)# snmp-server community private rw
switch(config)# class-map type qos match-any cmap1
switch(config-cmap-qos) # description class map 1
switch(config-cmap-qos) # match cos 4
switch(config-cmap-qos) # match dscp 48
switch(config-cmap-qos) # exit
switch(config) # policy-map type qos pmap1
switch(config-pmap-qos) # description policy map 1
switch(config-pmap-qos) # class cmap1
switch(config-pmap-c-qos) # set qos-group 4
switch(config-pmap-c-qos) # exit
switch(config-pmap-qos) # exit
switch(config) # interface ethernet 1/3
switch(config-if) # service-policy type qos input pmap1

Displaying Class-based Quality-of-Service MIB Configuration and Statistics

Procedure

Command or Action Purpose

$ snmpwalk -v2c -c community-name ip-address oid

Displays class-map and policy-map configuration and statistics.

Note

 

Use the snmpwalk command on an SNMP-enabled server.

Example

The following examples show how to display class map and policy map configuration and statistics:

Use the show interface snmp-ifindex command to display the mapping of ifindices to interfaces:

switch(config)# show interface snmp-ifindex 

--------------------------------------------------------------------------------
Port             IFMIB Ifindex (hex)                                            
--------------------------------------------------------------------------------
Eth1/1          436207616  (0x1a000000)                                          
Eth1/2          436211712  (0x1a001000)                                         
Eth1/3          436215808  (0x1a002000)                                         
Eth1/4          436219904  (0x1a003000)                                         
Eth1/5          436224000  (0x1a004000) 

Use the show policy-map interface type number command to display statistics and the configured policy maps on a specified interface:

switch# show policy-map interface ethernet 1/3

Global statistics status :   enabled

 NOTE: Type qos policy-map configured on VLAN will take precedence
       over system-qos policy-map for traffic on the VLAN


Ethernet1/3

  Service-policy (qos) input:   pmap1
    policy statistics status:   enabled

    Class-map (qos):   cmap1 (match-any)
      14 packets
      Match: cos 4
        10 Match packets
      Match: dscp 48
        4 Match packets
      set qos-group 4

    Class-map (qos):   class-default (match-any)
      0 packets

Use the snmpwalk command on the Service Policy Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosServicePolicy


Service Policy Table (QoS only table) – corresponding to the service policy applied on eth1/3

CISCO-CLASS-BASED-QOS-MIB::cbQosIfType.285212681 = INTEGER: mainInterface(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyDirection.285212681 = INTEGER: input(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosIfIndex.285212681 = INTEGER: 436215808 //436215808 is the IFMIB Interface Index value
CISCO-CLASS-BASED-QOS-MIB::cbQosVlanIndex.285212681 = Gauge32: 1

//The interface is Eth1/3.


Use the snmpwalk command on the Objects Table:
$ snmpwalk -v2c -c public A.B.C.D cbQosObjects


Objects Table (QoS only table)  corresponding to the policy-map, class-map, match & set Statements

CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.285212681.285212681 = Gauge32: 285212836 //285212836 is the Policy Map Config Index
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.285212681.285212682 = Gauge32: 285212833 //285212833 is a Class Map Config Index
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.285212681.285212683 = Gauge32: 285212834 //285212834 is a Match Statement Config Index
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.285212681.285212684 = Gauge32: 285212835 //285212835 is a Match Statement Config Index


CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.285212681.285212681 = INTEGER: policymap(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.285212681.285212682 = INTEGER: classmap(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.285212681.285212683 = INTEGER: matchStatement(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.285212681.285212684 = INTEGER: matchStatement(3)

CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.285212681.285212681 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.285212681.285212682 = Gauge32: 285212681
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.285212681.285212683 = Gauge32: 285212682
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.285212681.285212684 = Gauge32: 285212682


Use the snmpwalk command on the Policy Map Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosPolicyMapCfg | grep 285212836  
//285212836 is the Policy Map Config Index obtained from the Objects Table 

Policy Map Table corresponding to the policy-map configured above

CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapName.285212836 = STRING: pmap1 //pmap1 is the policy map name
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapDesc.285212836 = STRING: policy map 1 //Policy map description

Use the snmpwalk command on the Class Map Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosClassMapCfg | grep 285212833  
//285212833 is the Class Map Config Index obtained from the Objects Table

Class Map Table corresponding to the class-map configured above

CISCO-CLASS-BASED-QOS-MIB::cbQosCMName.285212833 = STRING: cmap1 //class-map on which the service-policy is configured
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDesc.285212833 = STRING: class map 1  //class-map description 

Use the snmpwalk command on the Match Statement Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosMatchStmtCfg | grep 285212834

Match Stmt Table corresponding to the match statement configured above

CISCO-CLASS-BASED-QOS-MIB::cbQosMatchStmtName.285212834 = STRING: match cos 4

Use the snmpwalk command on the Queuing Config Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosQueueingCfg
Queueing Config Table(QoS only table, taken from default QoS policies)

CISCO-CLASS-BASED-QOS-MIB::cbQosQueueingCfgBandwidth.301990031 = INTEGER: 100
CISCO-CLASS-BASED-QOS-MIB::cbQosQueueingCfgBandwidthUnits.301990031 = INTEGER: percentage(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosQueueingCfgPriorityEnabled.301990031 = INTEGER: false(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosQueueingCfgQLimitUnits.301990031 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosQueueingCfgAggregateQLimit.301990031 = Gauge32: 0

Use the snmpwalk command on the Set Action Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosSetCfg
Set Action Table (QoS only table) corresponding to the set statement configured above

CISCO-CLASS-BASED-QOS-MIB::cbQosSetCfgIpDSCPValue.285212829 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosSetCfgIpPrecedenceValue.285212829 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosSetCfgQosGroupValue.285212838 = INTEGER: 4
CISCO-CLASS-BASED-QOS-MIB::cbQosSetCfgL2CosValue.285212829 = INTEGER: 0

Use the snmpwalk command on the Policing Config Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosPoliceCfg
Policing Config Table(no QoS config, displays only CoPP statistics)

CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgBurstSize.721420367 = Gauge32: 65535 Octets 
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgConformAction.721420367 = INTEGER: transmit(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgViolateAction.721420367 = INTEGER: drop(5)   
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgRate64.721420367 = Counter64: 1048576 bits/second  
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgRateType.721420367 = INTEGER: bps(1) 
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceCfgConditional.721420367 = INTEGER: false(2)

Use the snmpwalk command on the Policing Stats Table:

$ snmpwalk -v2c -c public A.B.C.D cbQosPoliceStats
Policing Stats Table(no QoS config, displays only CoPP statistics)

CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceConformedByte64.721420366.721420376 = Counter64: 80121 Octets
CISCO-CLASS-BASED-QOS-MIB::cbQosPoliceViolatedByte64.721420366.721420367 = Counter64: 0 Octets


Note


All CoPP configurations are available by default.


The sample snmpwalk outputs below display the cbQosMatchStmtStats and cbQosClassMapStats tables that are supported by the QoS policies starting from Cisco NX-OS Release 7.3(0)N1(1):

$ snmpwalk -v2c -c public A.B.C.D cbQosMatchStmtStats 
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyPkt64.285212681.285212683 = Counter64: 10 //The config indices match the objects displayed in the Objects Table above
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyPkt64.285212681.285212684 = Counter64: 4
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyPkt64.285212681.285212687 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyByte64.285212681.285212683 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyByte64.285212681.285212684 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyByte64.285212681.285212687 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyBitRate.285212681.285212683 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyBitRate.285212681.285212684 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosMatchPrePolicyBitRate.285212681.285212687 = Gauge32: 0 bits per second

$snmpwalk -v2c -c public A.B.C.D cbQosClassMapStats 
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.285212681.285212682 = Counter64: 14 //The config indices match the objects displayed in the Objects Table above
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.285212681.285212686 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.285212681.285212682 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.285212681.285212686 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.285212681.285212682 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.285212681.285212686 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.285212681.285212682 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.285212681.285212686 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.285212681.285212682 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.285212681.285212686 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.285212681.285212682 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.285212681.285212686 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.285212681.285212682 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.285212681.285212686 = Gauge32: 0 bits per second

Use the show policy-map interface control-plane command to display control plane statistics:

switch# show policy-map interface control-plane

Control Plane                                            

  service-policy  input: copp-system-policy-default

    class-map copp-system-class-igmp (match-any)
      match protocol igmp                       
      police cir 1024 kbps , bc 65535 bytes     
        conformed 0 bytes; action: transmit     
        violated 0 bytes;                       
    class-map copp-system-class-pim-hello (match-any)
      match protocol pim                             
      police cir 1024 kbps , bc 4800000 bytes        
        conformed 0 bytes; action: transmit          
        violated 0 bytes;                            
    class-map copp-system-class-bridging (match-any) 
      match protocol bridging                        
      police cir 20000 kbps , bc 4800000 bytes       
        conformed 0 bytes; action: transmit          
        violated 0 bytes;                            
    class-map copp-system-class-arp (match-any)      
      match protocol arp                             
      match protocol nd                              
      police cir 1024 kbps , bc 3600000 bytes        
        conformed 0 bytes; action: transmit          
        violated 0 bytes;                            
    class-map copp-system-class-dhcp (match-any)     
      match protocol dhcp                            
      police cir 1024 kbps , bc 4800000 bytes        
        conformed 0 bytes; action: transmit          
        violated 0 bytes;
    class-map copp-system-class-wccp (match-any)
      match protocol wccp
      police cir 1060 kbps , bc 4800000 bytes
        conformed 0 bytes; action: transmit
        violated 0 bytes;
.
.
.

Feature History for Class-based Quality-of-Service MIB

Table 1. Feature History for Class-based Quality-of-Service MIB

Feature Name

Releases

Feature Information

Class-based Quality-of-Service MIB Phase 2

7.3(0)N1(1)

The following cbQoSMIB tables are supported by QoS policies: cbQosClassMapStats, cbQosMatchStmtStats and cbQosQueueingStats

Class-based Quality-of-Service MIB

7.1(1) N1(1)

This feature was introduced.