Click here to Skip to main content
15,916,398 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to find the network flow through a particular port in a cisco 2960 switch. For this I have to write a code using SNMP and C# only. I am already in the middle of the project and I would like to add this feature too in my project. I have referred from the particular sit and am using the same library files to do it.

^http://www.snmpsharpnet.com/^
^http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html^


If anyone know the proper mib to find the network information/status to find the info, please help.[^][^][^]

What I have tried:

IF-MIB... details matter though.

You can correlate all OIDs to an interface name below by snmp walking ifName: 1.3.6.1.2.1.31.1.1.1.1.

High Speed interfaces

For high-speed interfaces (100Mbps or above) you should use 64-bit counters if the device supports them:

ifHCInOctets: 1.3.6.1.2.1.31.1.1.1.6 (64-bit Octets in counter)
ifHCOutOctets: 1.3.6.1.2.1.31.1.1.1.10 (64-bit Octets out counter)
ifHCInUcastPkts: 1.3.6.1.2.1.31.1.1.1.7 (64-bit Packets in counter)
ifHCOutUcastPkts: 1.3.6.1.2.1.31.1.1.1.11 (64-bit Packets out counter)
ifHighSpeed: 1.3.6.1.2.1.31.1.1.1.15 (An estimate of the interface's current bandwidth in units of 1Mbps)
Low Speed interfaces

Lower speed interfaces can get by with 32-bit counters. If you use 32-bit counters on high-speed interfaces, they can wrap quickly; a 10 Mbps stream of back-to-back, full-size packets causes ifInOctets to wrap in just over 57 minutes. At 100 Mbps, the minimum wrap time is 5.7 minutes, and at 1 Gbps, the minimum is 34 seconds Note 1

ifInOctets: 1.3.6.1.2.1.2.2.1.10 (32-bit Octets in counter)
ifOutOctets: 1.3.6.1.2.1.2.2.1.16 (32-bit Octets out counter)
ifInUcastPkts: 1.3.6.1.2.1.2.2.1.11 (32-bit Packets in counter)
ifOutUcastPkts: 1.3.6.1.2.1.2.2.1.17 (32-bit Packets out counter)
ifSpeed: 1.3.6.1.2.1.2.2.1.5 (Currently negotiated speed of the interface - Max: 4.294 Gbps)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900