Monday, June 19, 2017

.::: How To Calculate Bandwidth Utilization Using SNMP :::.

Problem

It is sometimes necessary to calculate bandwidth use with SNMP.
Solution

Use this solution to solve this problem.

How you calculate use depends on how data is presented for what you want to measure. Interface use is the primary measure used for network use. Use this formulas, based on whether the connection you measure is half-duplex or full-duplex. Shared LAN connections tend to be half-duplex, mainly because contention detection requires that a device listen before it transmits. WAN connections are full-duplex because the connection is point-to-point; both devices can transmit and receive at the same time because they know there is only one other device that shares the connection. Because MIB-II variables are stored as counters, you must take two poll cycles and figure the difference between the two (hence, the delta used in the equation).

This explains the variables used in the formulas:



Note: ifSpeed does not accurately reflect the speed of a WAN interface.

For half-duplex media, use this formula for interface use:


It is more challenging to calculate for full-duplex media. For example, with a full T-1 serial connection, the line speed is 1.544 Mbps. Therefore, a T-1 interface can both receive and transmit 1.544 Mbps for a combined possible bandwidth of 3.088 Mbps!

When you calculate the interface bandwidth for full-duplex connections, you can use this formula, where you take the larger of the in and out values and generate a use percentage:


However, this method hides the use of the direction with the lesser value and provides less accurate results. A more accurate method is to measure the input use and output use separately, with this formula:


or



These formulas are simplified because they do not consider overhead associated with the protocol. For example, refer to RFC 1757 Ethernet-utilization formulas that consider packet overhead.

All of the MIB attributes listed are also in RFC1213 MIB.

Details of the MIB variables used in these formulas are:

    .1.3.6.1.2.1.2.2.1.10
    ifInOctets OBJECT-TYPE
    -- FROM RFC1213-MIB, IF-MIB
    SYNTAX          Counter
    MAX-ACCESS      read-only
    STATUS          Mandatory
    DESCRIPTION    "The total number of octets received on the interface, including framing characters."
    ::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) interfaces(2) ifTable(2) ifEntry(1) 10 }

    .1.3.6.1.2.1.2.2.1.16
    ifOutOctets OBJECT-TYPE
    -- FROM RFC1213-MIB, IF-MIB
    SYNTAX          Counter
    MAX-ACCESS      read-only
    STATUS          Mandatory
    DESCRIPTION    "The total number of octets transmitted out of the interface, including framing characters."
    ::= { ISO(1) org(3) DOD(6) Internet(1) mgmt(2) mib-2(1) interfaces(2) ifTable(2) ifEntry(1) 16 }

    .1.3.6.1.2.1.2.2.1.5
    ifSpeed OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "An estimate of the interface's current bandwidth in bits
            per second.  For interfaces which do not vary in bandwidth
            or for those where no accurate estimation can be made, this
            object should contain the nominal bandwidth.  If the
            bandwidth of the interface is greater than the maximum value
            reportable by this object then this object should report its
            maximum value (4,294,967,295) and ifHighSpeed must be used
            to report the interace's speed.  For a sub-layer which has
            no concept of bandwidth, this object should be zero."
    ::= { ifEntry 5 }

    ::= { ISO(1) org(3) DOD(6) Internet(1) mgmt(2) mib-2(1) interfaces(2) ifTable(2) ifEntry(1) 5 }

.1.3.6.1.2.1.31.1.1.1.15
ifHighSpeed OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "An estimate of the interface's current bandwidth in units
            of 1,000,000 bits per second.  If this object reports a
            value of `n' then the speed of the interface is somewhere in
            the range of `n-500,000' to `n+499,999'.  For interfaces
            which do not vary in bandwidth or for those where no
            accurate estimation can be made, this object should contain
            the nominal bandwidth.  For a sub-layer which has no concept
            of bandwidth, this object should be zero."
    ::= { ifXEntry 15 }


go to .::: example Calculate interface bandwidth utilization % :::.

source http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html
https://forums.manageengine.com/topic/how-to-use-delta-for-continuos-counter-oid-for-net-util

No comments:

Post a Comment

Popular Posts