Using Model-Driven Telemetry (MDT) for IF-MIB Data

1 minute read

Data from the IF-MIB

One of the most commonly polled MIBs is the Interfaces MIB (IF-MIB). Pretty much everyone needs to know how many packets and bytes were sent and received on a given interface. So it’s not surprising that one of the first questions we get is how to get the IF-MIB data from MDT.

MDT Configuration for IF-MIB equivalence

As you can see from the table below, most of the interface statistics are in the Cisco-IOS-XR-infra-statsd-oper.yang model, with some state parameters in Cisco-IOS-XR-infra-statsd-oper.yang, and a couple SNMP-specific values in Cisco-IOS-XR-snmp-agent-oper.yang.

Leaving aside the SNMP-specific parameters, here is what the sensor-path configuration in MDT would look like for the IF-MIB:

RP/0/RP0/CPU0:SunC(config)#telemetry model-driven
RP/0/RP0/CPU0:SunC(config-model-driven)#sensor-group SGroup1
RP/0/RP0/CPU0:SunC(config-model-driven-snsr-grp)# sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters
RP/0/RP0/CPU0:SunC(config-model-driven-snsr-grp)# sensor-path Cisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interface
RP/0/RP0/CPU0:SunC(config-model-driven-snsr-grp)# commit

For the complete MDT configuration, see my configuration tutorial.

With that, you should be streaming all your favorite IF-MIB data at a fraction of the cost of doing an SNMP poll.

OID-YANG Table

Below is a table of the most commonly requested IF-MIB OIDs, their corresponding YANG models, containers, leafs and any usage notes.

OIDYang-PathYANG LeafNotes
ifAliasCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacedescription 
ifHCInBroadcastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbroadcast-packets-received 
ifHCInMulticastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersmulticast-packets-received 
ifHCInUcastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersN/AMust be calculated: packets-received - multicast-packets-received - broadcast-packets-received
ifHCOutBroadcastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbroadcast-packets-sent 
ifHCOutMulticastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersmulticast-packets-sent 
ifHCOutUcastPktsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersN/AMust be calculated: packets-sent - multicast-packets-sent - broadcast-packets-sent
ifIndexCisco-IOS-XR-snmp-agent-oper:snmp/interface-indexes/if-index 
ifLastChangeCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacelast-state-transition-timelast-state-transition-time is the elapsed time since last state change while ifLastChange is the sysUpTime value of the last state change
ifOutDiscardsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersoutput-drops 
ifOutErrorsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersoutput-errors 
ifStackStatusCisco-IOS-XR-snmp-agent-oper/snmp/if-stack-status 
ifAdminStatusCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacestate 
ifDescrCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfaceinterface-name 
ifHCInOctetsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbytes-received 
ifHCOutOctetsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbytes-sent 
ifHighSpeedCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacespeedifHighSpeed is in Mbps, speed is in kbps
ifInErrorsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersinput-errors 
ifOperStatusCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacestate 
ifPhysAddressCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfaceaddress 
ifTypeCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfaceinterface-type 
ifInDiscardsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersinput-drops 
ifInOctetsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbytes-received 
ifMtuCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacemtu 
ifNameCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersinterface-nameinterface-name format is “HundredGigE0_3_0_0”
ifOutOctetsCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-countersbytes-sent 
ifSpeedCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-xr/interfacebandwidth 

Tags:

Updated:

Leave a Comment