North American Network Operators Group

Date Prev | Date Next | Date Index | Thread Index | Author Index | Historical

Re: Precise per GB traffic calculations.

  • From: Scott Weeks
  • Date: Mon Aug 23 10:36:07 2004

On Fri, 20 Aug 2004, Patrick W Gilmore wrote:
: On Aug 20, 2004, at 5:06 PM, Drew Weaver wrote:
:
: >             Does anyone know of a solution that offers precise methods
: > of tracking bandwidth utilizations at the per Megabyte or Gigabyte
: > level and not at the rate of transfer level?
:
: I don't know of any equipment that does NOT measure per-byte
: transferred.  The Mbps is done by taking the bytes transferred
: (multiply by 8) and divide by the time involved, usually 5 minute
: periods.


I just want to point out that this is not a strict average over 5 minutes
in the case of cisco's output for the "show interface" bits per second.
It's an exponentially weighted average:

http://cisco.com/en/US/products/sw/iosswrel/ps1818/products_tech_note09186a0080191323.shtml

     Bits per second include all packet/frame overhead. It does not
     include stuffed zeros. The size of each frame is added to the total
     bytes of output. The rate is calculated by taking the difference
     every 5 seconds.  The algorithm for the five-minute moving average
     is:

     new average = ((average - interval) * exp (-t/C)) + interval

     where:
     - t is five seconds and C is 5 minutes. exp(-5/(60*5)) == .983
     - newaverage = the value we are trying to compute
     - average = the "newaverage" value calculated from the previous
                 sample
     - interval = the value of the current sample
     - (.983) is the weighting factor

     What you are basically doing is taking the average from the last
     sample less what we gathered in this sample and weighting that down
     by a decay factor. This quantity can be referred to as an "historical
     average". To the weighted (decayed) historical average, we add our
     current sample and come up with a new weighted (decayed) average.

scott