cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8793
Views
0
Helpful
5
Replies

Calculate bandwidth using SNMP index

marchanamendon
Level 1
Level 1

Hi

Can you tell me how to calculate bandwidth using snmp index ifInoctets and ifOutOctets.

I can see the output of this indexes using snmpwalk command at different time interval.

But how do I derive the utilization when it reaches 80%.

Archana.

5 Replies 5

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Archana,

to measure link usage you need to perform the difference between two readings divided for the time interval between the readings and by 8 (bits/byte)

[Ifinoctects (readingN+1) - Ifinoctects (readingN)] /8* (time_readingN+1 -time_readingN)

so now you now the speed and you need to compare to link speed to see when it reaches 80%.

Be aware that being these 32bits counters on high speed links they can wrap:

when the counter reaches 2^32-1 next read will be a lower number then the previous.

There are different ways to deal with this.

One is to use if available the HC versions of counters (64 bits counters)

Another is to read other mibs that track if wrapping has happened

Hope to help

Giuseppe

Hello

Since this parameters are new for me and trying to find the formula,it would be great if you can tell me how do I know what is the bandwidth usage and formula to calculate.

I have collected the MIB value for serial interface of router for 1 min time interval.

At 12.25

IF-MIB::ifInOctets.7 = Counter32: 1427402450

IF-MIB::ifOutOctets.7 = Counter32: 4040163899

At 12.26

IF-MIB::ifInOctets.7 = Counter32: 1427697887

IF-MIB::ifOutOctets.7 = Counter32: 4041427307

ifspeed value for serial interface is this.

IF-MIB::ifSpeed.6 = Gauge32: 1544000

With these value how can I derive the percentage of bandwidth usage for the time period of 1 min.

It would great if you can work it out and explain me.

Thanks,

Archana.

Hello Archana,

providing an example is a good idea.

time= 60 seconds

Diff. Inoctets = 1427697887 - 1427402450 = 295437 octets received in 60 seconds

1 octet = 8 bits

average bit rate = Diff.InOcoctets*8/60 =

39391,6 bps

so the usage is :

39391,6 / 1544000 = 2,55 % usage of BW inbound direction

you can perform a similar calculation for outbound direction

Hope to help

Giuseppe

Hello Giuseppe,

Its really helpful with the way you have explained.

But I have one more doubt,the 2.55% which gives the utilization for an inbound direction.

How do I calculate the total bandwidth utilization for the link?

Thanks,

Archana.

Hello Archana,

from a technical point of view I would keep separated the two directions because it is really normal that usage in the two directions can be quite different.

However, if you want to associate a usage percentage to both direction you can use:

overall_usage= (usage_inbound+usage_outbound)/2

Hope to help

Giuseppe

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card