[mrtg] Re: 32 versus 64 bit counters

Alex van den Bogaerdt alex at ergens.op.het.net
Mon Sep 16 17:01:34 MEST 2002

On Mon, Sep 16, 2002 at 06:14:47AM -0700, Charles Milhans wrote:
> I am sorry for this newby type of question.
> How do you determine what the polling interval should be when using 32bit
> and/or 64 bit counters and monitoring speeds of 2 Gbps?  I am trying to
> monitor fibre channel switches that use both 1 Gbps and 2 Gbps speeds.  I
> understand that the counters go from 0 to max value and then go back to 0.

MRTG has problems with counter wrapping:

1) It will not detect that a counter was incremented with 2^32 + some more
2) It will not use a decremented counter
         (or at least: That used to be the case)
3) It will not detect that a counter has wrapped more than once

If the counter increases with "2^32+x", SNMP reports only "x".
(the #1 case from above)

If the counter is decreased, this is an indication that the counter
wrapped  -or-  that the counter was reset.  MRTG discards the update.
(the #2 case from above)

If #1 happens a lot, your graph will show way too low values.
If #2 happens a lot, your graph will show repeated values.
If #3 happens, you shouldn't be using the 32 bit counters at all

Problem #1 occurs at 2^32 / number_of_seconds.  For a normal
setup, this will be at 14+ MBps or 114+ Mbps.

The other way around: 2^32/rate = number_of_seconds.
This means the problem will occur for a 2 Gbps interface every
17.something seconds.

Counter wrapping with a 64 bit counter on a fully utilized 2 Gbps
interface will happen every 73,786,976,294 seconds.  Let me know what
happens when you encounter this :)


Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list