Subject: Re: network byte transfer stats
To: Ross Harvey <ross@teraflop.com>
From: Jim Reid <jim@mpn.cp.philips.com>
List: tech-kern
Date: 10/23/1997 10:57:04
>>>>> "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.

    Ross> My interest is in seeing the ultimate figure of merit:
    Ross> bytes-transferred- per-second.  Of course, I'm mainly
    Ross> interested in this as a percentage of wire speed.

If you want to do this, you shouldn't to rely on the counts kept by
the kernel. The numbers may not be reliable - does a packet received
by an interface and then thrown away because of no mbufs count as a
packet in? - and you have to consider the quantum physics effect that
observing something changes that something's behaviour. There is a PD
benchmarking package - tcpstat? - which you can use to get the sort of
numbers that interest you.