missing statistics in network drivers

Michael Dillon (michael@junction.net)
Tue, 11 Jul 1995 13:09:13 -0700 (PDT)

I have just implemented an SNMP agent (snmpd) on our Linux machines using
the CMU SNMP ported by Erik Schoenfeld. I picked it up at ibr.cs.tu-bs.de
but it's on sunsite as well. While tracking down a bug in the SNMP agent,
I discovered that the ifInOctets and ifOutOctets reported by the snmpd
are actually ifInUCastPkts and ifOutUCastPkts multiplied by the constant 308.

I'm no TCP/IP expert but I don't think that all packets are 308 bytes
long which means the number reported by the snmpd are wrong and could, in
some cases, be wildly wrong. In searching through the kernel to see where
the stats come from I found /proc/net/dev and /proc/net/snmp but neither
spot reports octets. Then I dug into the device drivers such as 3c509.c
and discovered that octets are not recorded.

It seems to me that all device drivers need to be modified if accurate
octet statistics are to be reported. It also seems to me that the absence
of these stats makes it a bad choice to run Linux on a router that is
SNMP managed (quite common if not standard in corporate environments).

I am hoping that some people who understand the kernel and network
drivers better than I do can add octet statistics to the drivers. I
personally would consider this a bug which means that it should be fixed
in 1.2.12 or whatevere the next 1.2.x is.

Now that people are promoting Linux as a viable operating system for
corporate environments, this lack of true octet statistics is IMHO an
impediment and since corporate people really aren't interested in beta
test (i.e 1.3.x) kernels, IMHO the fix should go into 1.2.x.

Of course, as always, YMMV

Michael Dillon Voice: +1-604-546-8022
Memra Software Inc. Fax: +1-604-542-4130
http://www.memra.com E-mail: michael@memra.com