Subject: Re: Resetting ip, icmp etc statistics
To: Liam J. Foy <liamfoy@sepulcrum.org>
From: None <jonathan@dsg.stanford.edu>
List: tech-net
Date: 03/31/2006 16:01:54
In message <20060331215119.GA649@nikita>, "Liam J. Foy" writes:

>On 22:54, Fri 31 Mar 06, Havard Eidnes wrote:
>> "Real" routers where statistics is normally collected using SNMP
>> and who also have this "clear counters" function do this IMO the
>> right way, i.e. by checkpointing the base level for the counters
>> and only displaying the difference compared to this base level
>> when commands equivalent to "netstat" are run.
>
>Could you explain this approach a little more to me please? How and when
>are the 'checkpoints' made?

The kernel keeps two sets of counters: a set of monotonic counters,
and a duplicat set holding the values at the point when a
"zeroization" was last requested. A 'zeroization' (e.g., ifconfig -z,
or the proposed reset for our BSD per-protocol "mib" counters) would
no longer zeroize the monotonic counters, but would instead copy the
current value of the monotonic counters to the duplicate,
"count-at-last-zeroization" counter set.

Showing monotonic-since-boot (or since last wrap, which given that
we've had 64-bit counters for years now, is a very rare case) then
becomes a user-interface presentation issue: does the UI tool show
you the raw monotonic counters, or does it instead show

	(monotonic count - counter-value-at-last-zeroization)?

Dennis Ferguson proposed, some years back, that we implement changes
in wall-time in a similar fashion.  We should've listened harder :-/.