Subject: Re: network byte transfer stats
To: Herb Peyerl <hpeyerl@beer.org>
From: Darren Reed <darrenr@arbld.unimelb.edu.au>
List: tech-kern
Date: 11/21/1997 11:30:34
In some email I received from Herb Peyerl, sie wrote:
> 
> Jim Reid <jim@mpn.cp.philips.com>  wrote:
>  > >>>>> "Ross" == Ross Harvey <ross@teraflop.com> writes:
>  >     Ross> Digital Unix keeps track of the byte counts transferred in
>  >     Ross> each direction on network interfaces. I can't find anyplace
>  >     Ross> in netbsd or any other system where this info is available.
>  > The closest thing most (all?) UNIX systems will have to this is the
>  > per packet counts in the ifnet structure of each network interface.
>  > Some - like FreeBSD and BSDI - do keep byte counts as well, but I
>  > suppose you have to fish around in /dev/kmem to get them.
> 
> err, I use:
> 
> /etc/ipf.conf:
> 		count in on ep0 from any to any
> 		count out on ep0 from any to any
> 
> Or something to that effect and then retrieve the data with ipfstat...

For outgoing packets, if the network card doesn't deliver them (queue is
too full, etc), ip filter will increase the count misleadingly.  I can't
imagine this will be a huge difference, in reality.

Likewise, there maybe situations where incoming packets will be dropped
by the interface before they get to IP or after IP Filter counts them.

Such is life.

Darren