Re: how to make bond between ifindex and real interfaces

231 views
Skip to first unread message

Peter Phaal

unread,
May 24, 2013, 3:03:53 PM5/24/13
to sflo...@googlegroups.com
You can use SNMP to get the ifName associated with an ifIndex reported in sFlow. For example, to retrieve the name associated with ifIndex=3 for agent 10.0.0.254:
$ snmpget -v2c -c public 10.0.0.254 1.3.6.1.2.1.2.2.1.2.3
iso.3.6.1.2.1.2.2.1.2.3 = STRING: "eth2"

Note: the last token in the query string corresponds to the ifIndex number.

I noticed that your switch is named ovs0. If you are interested in mapping OpenFlow port numbers to SNMP ifIndex numbers, then this has been discussed on the sFlow mailing list:

Unfortunately, there isn't a general solution available today. Solving the problem of interoperability between OpenFlow and CLI, NETCONF, SNMP, sFlow, NetFlow, IPFIX etc. requires a method to retrieve this mapping from the switches, either through the configuration protocol, or through OpenFlow.

The best place to look for most of the definitions are the sFlow specifications on sFlow.org:

sFlow-RT tries to use names that match up with the sFlow specifications. Most of the if* metrics derive from the SNMP MIB-2 ifTable. The ifinutilization metric is a derived value calculated by sFlow-RT based on the ifinoctets and ifspeed, i.e. ifinutilization = 100 * ( ifinoctets * 8 / ifspeed )

This value is meaningful for physical interfaces, but for vNICs the speed isn't well defined and the utilization can be reported as greater than 100%


On Friday, May 24, 2013 2:44:11 AM UTC-7, Marin Krznarević wrote:
hi

I'm trying to get some statistics like bandwidth and delay using sflow-RT REST API... is it posiblle to know which interface is using which ifindex?

here is example of my output

http://192.168.19.125:8008/metric/ovs0/json

{
 "3.ifindex": "3",
 "3.ifindiscards": 0,
 "3.ifinerrors": 0,
 "3.ifinmulticastpkts": 0.1001001001001001,
 "3.ifinoctets": 1245.3453453453453,
 "3.ifinpkts": 3.2032032032032034,
 "3.ifinucastpkts": 3.1031031031031033,
 "3.ifinutilization": 9.962762762762763E-4,
 "3.ifoutdiscards": 0,
 "3.ifouterrors": 0,
 "3.ifoutoctets": 1245.3453453453453,
 "3.ifoutpkts": 3.1031031031031033,
 "3.ifoutucastpkts": 3.1031031031031033,
 "3.ifoututilization": 9.962762762762763E-4,
 "3.ifspeed": 1000000000,
 "3.iftype": "ethernetCsmacd",
 "4.ifindex": "4",
 "4.ifindiscards": 0,
 "4.ifinerrors": 0,
 "4.ifinmulticastpkts": 0,
 "4.ifinoctets": 1239.6114949434266,
 "4.ifinpkts": 3.0039050765995796,
 "4.ifinucastpkts": 3.0039050765995796,
 "4.ifinutilization": 9.916891959547412E-4,
 "4.ifoutdiscards": 0,
 "4.ifouterrors": 0,
 "4.ifoutoctets": 1252.6284169420246,
 "4.ifoutpkts": 3.2041654150395513,
 "4.ifoutucastpkts": 3.2041654150395513,
 "4.ifoututilization": 0.0010021027335536197,
 "4.ifspeed": 1000000000,
 "4.iftype": "ethernetCsmacd",
 "5.ifindex": "5",
 "5.ifindiscards": 0,
 "5.ifinerrors": 0,
 "5.ifinmulticastpkts": 0,
 "5.ifinoctets": 0,
 "5.ifinpkts": 0,
 "5.ifinucastpkts": 0,
 "5.ifinutilization": 0,
 "5.ifoutdiscards": 0,
 "5.ifouterrors": 0,
 "5.ifoutoctets": 0,
 "5.ifoutpkts": 0,
 "5.ifoutucastpkts": 0,
 "5.ifoututilization": 0,
 "5.ifspeed": 100000000,
 "5.iftype": "ethernetCsmacd"
}

and one more question where can I find definition of atributes that collector returns
for wxample what is ifinutilization and how is measured?

Message has been deleted

Marin Krznarević

unread,
May 27, 2013, 3:02:38 PM5/27/13
to sflo...@googlegroups.com
thank you for your answer, it helped me a lot...

Marin Krznarević

unread,
Jun 6, 2013, 12:47:45 PM6/6/13
to sflo...@googlegroups.com
Hi
still have problems with mapping

How sFlow generates ifIndex?

I mean does I now have to install SNMP on every host in network and collector too?
when i execute
snmpget -v2c -c public 10.0.0.254 1.3.6.1.2.1.2.2.1.2.3
iso.3.6.1.2.1.2.2.1.2.3 = STRING: "eth2"

it keeps returning me that host is not responding:timeout. I can ping each host from collector. Is there some other way to fix this not by using SNMP?

thank you for your answe,

Marin
Reply all
Reply to author
Forward
0 new messages