Introduction
This document describes how to extract the various values related to Class Based Quality of Service (QoS) details (CISCO-CLASS-BASED-QOS-MIB) applied against Control Plane with Simple Network Management Protocol (SNMP).
Prerequisites
Requirements
- Net-SNMP or any similar command line based utility that runs on a UNIX based operating system that polls SNMP Management Information Bases (MIBs) from a Cisco device. Net-SNMP is a 3rd Party Open Source utility available for download here.
- Ensure Control Plane Policing (CoPP) is configured.
Components Used
The information in this document is based on these software and hardware versions:
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Procedure
- Get ifindex (1.3.6.1.2.1.2.2.1.1) for the Control Plane as this example output shows:
show snmp mib ifmib ifindex | include Cont
Control Plane: Ifindex = 268
You can also achieve this with SNMP as this example shows:
UNIX #snmpwalk -v2c -c <community-name> <ip address of device> | grep -i control plane
IF-MIB::ifDescr.268 = STRING: Control Plane
Note in this output that the ifIndex is 268.
- Get the cbQosIfindex (1.3.6.1.4.1.9.9.166.1.1.1.1.4 for the corresponding IfIndex in the router:
UNIX # snmpwalk -v 2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.1.1.1.4 | grep -i 268
SNMPv2-SMI::enterprises.9.9.166.1.1.1.1.4.225 = INTEGER: 268
The cbQosPolicyIndex (1.3.6.1.4.1.9.9.166.1.1.1.1.1) is 225.
- cbQosCMName (1.3.6.1.4.1.9.9.166.1.7.1.1.1) is the MIB Object that retrieves the names of class-maps configured on the router. This results in the output of the various class-maps configured with their indices..For example, cbQosConfigIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.2).
UNIX #snmpwalk -v2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.7.1.1.1
Example
UNIX # snmpwalk -v2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.7.1.1.1 | egrep -i "copp|class"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.1593 = STRING: "class-default"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.274033342 = STRING: "CoPP-IMPORTANT"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.280880137 = STRING: "CoPP-Match-all"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.321645237 = STRING: "CoPP-NORMAL"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.347132543 = STRING: "CoPP-CRITICAL2"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.373457077 = STRING: "CoPP-BAD"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.383240351 = STRING: "CoPP-CRITICAL"
Note the highlighted value of 274033342 which is the cbQosConfigIndex.
- Use cbQosConfigIndex in order to fetch the cbQosPolicyIndex (1.3.6.1.4.1.9.9.166.1.1.1.1.1) and cbQosObjectsIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.1) for the particular class-map. The example in this step shows how to monitor class-map CoPP-IMPORTANT:
UNIX #snmpwalk -v2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.5.1.1.2
Get the OID (Object Identifier) output by searching 274033342 (highlighted value taken from Step 3) in this output:
UNIX #snmpwalk -v2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.5.1.1.2
Example
UNIX# snmpwalk -v2c -c <community-name> <ip address of device>
1.3.6.1.4.1.9.9.166.1.5.1.1.2 | grep -i 'Gauge32: 274033342'
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.225.131072 = Gauge32: 274033342 <<<< Match these value
cbQosConfigIndex is 274033342, cbQosPolicyIndex is 225 and cbQosObjectsIndex is 131072.
Now we have various options in order to poll the specific data from the Policy-map:
+-- -R-- Counter cbQosCMPrePolicyPktOverflow(1)
+-- -R-- Counter cbQosCMPrePolicyPkt(2)
+-- -R-- Counter64 cbQosCMPrePolicyPkt64(3)
+-- -R-- Counter cbQosCMPrePolicyByteOverflow(4)
+-- -R-- Counter cbQosCMPrePolicyByte(5)
+-- -R-- Counter64 cbQosCMPrePolicyByte64(6)
+-- -R-- Gauge cbQosCMPrePolicyBitRate(7)
+-- -R-- Counter cbQosCMPostPolicyByteOverflow(8)
+-- -R-- Counter cbQosCMPostPolicyByte(9)
+-- -R-- Counter64 cbQosCMPostPolicyByte64(10)
+-- -R-- Gauge cbQosCMPostPolicyBitRate(11)
+-- -R-- Counter cbQosCMDropPktOverflow(12)
+-- -R-- Counter cbQosCMDropPkt(13)
+-- -R-- Counter64 cbQosCMDropPkt64(14)
+-- -R-- Counter cbQosCMDropByteOverflow(15)
+-- -R-- Counter cbQosCMDropByte(16)
+-- -R-- Counter64 cbQosCMDropByte64(17)
+-- -R-- Gauge cbQosCMDropBitRate(18)
+-- -R-- Counter cbQosCMNoBufDropPktOverflow(19)
-- -R-- Counter cbQosCMNoBufDropPkt(20)
-- -R-- Counter64 cbQosCMNoBufDropPkt64(21)
For example, cbQosCMPostPolicyBitRate (1.3.6.1.4.1.9.9.166.1.15.1.1.11) is an object that polls "The bit rate of the traffic after executing QoS policies".
UNIX #snmpwalk -v2c -c <community-name><ip address of device>
1.3.6.1.4.1.9.9.166.1.15.1.1.11.225.131072
SNMPv2-SMI::enterprises.9.9.166.1.15.1.1.11.225.131072 = Gauge32: 12000
!--- Match this from the output taken from the router for verification.
This show policy-map control-plane input class CoPP-IMPORTANT command output shows excerpts from the router in order to match values from snmpwalk and router counters:
Router # show policy-map control-plane input class CoPP-IMPORTANT
Control Plane
Service-policy input: CoPP
Hardware Counters:
class-map: CoPP-IMPORTANT (match-all)
Match: access-group 121
police :
10000000 bps 312000 limit 312000 extended limit
Earl in slot 1 :
2881610867 bytes
5 minute offered rate 13072 bps
aggregate-forwarded 2881610867 bytes action: transmit
exceeded 0 bytes action: drop
aggregate-forward 13248 bps exceed 0 bps
Earl in slot 2 :
0 bytes
5 minute offered rate 0 bps
aggregate-forwarded 0 bytes action: transmit
exceeded 0 bytes action: drop
aggregate-forward 0 bps exceed 0 bps
Earl in slot 3 :
0 bytes
5 minute offered rate 0 bps
aggregate-forwarded 0 bytes action: transmit
exceeded 0 bytes action: drop
aggregate-forward 0 bps exceed 0 bps
Earl in slot 5 :
0 bytes
5 minute offered rate 0 bps
aggregate-forwarded 0 bytes action: transmit
exceeded 0 bytes action: drop
aggregate-forward 0 bps exceed 0 bps
Software Counters:
Class-map: CoPP-IMPORTANT (match-all)
16197981 packets, 3101873552 bytes
5 minute offered rate 12000 bps, drop rate 0000 bps
Match: access-group 121
police:
cir 10000000 bps, bc 312500 bytes, be 312500 bytes
conformed 16198013 packets, 3101878887 bytes; actions:
transmit
exceeded 0 packets, 0 bytes; actions:
drop
violated 0 packets, 0 bytes; actions:
drop
conformed 12000 bps, exceed 0000 bps, violate 0000 bps
Also use this procedure in order to find out/confirm the required OID for polling.
Additional Information
You can use SNMP in order to retrieve these counters in relation to platform(s):
- 6500 - CoPP hardware counters
- 7600 - CoPP software counters
If you try to get the counters the other way around (hardware counters in place of software counters and vice versa) via SNMP for respective platforms as mentioned, it is not possible. This is because the respective codes are designed this way and understand that you might need to use CLI only in order to get the counters and there is no alternative.
Related Information