Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm implementing an SNMP agent on Linux and want to get the following IF-MIB counters for Ethernet interfaces from the network device drivers: ifInUcastPkts, ifInMulticastPkts, ifInBroadcastPkts, ifOutUcastPkts, ifOutMulticastPkts, ifOutBroadcastPkts. I've looked at the /proc/net/dev info and it looks like it provides total packets, but does not break them down between unicast, multicast and broadcast. Is there any way to find this information (without rewriting the drivers)?
[on soapbox] It seems strange to me that some of these counters have been part of the original MIB-II (RFC 1213) Internet Standard since before 1991, and yet Unix doesn't seem to support them. Is the Linux community not aware of the IAB/IETF? [off soapbox]
netstat shows the network layer counters: IP, ICMP, TCP and UDP. I'm looking for the datalink layer counters for Ethernet. ifconfig -a shows what Linux is willing to collect; that is the total packet count, but not the breakdown that SNMP wants. If we look at /proc/net/dev, on versions after 2.2, there is a receive multicast counter (that doesn't show up on ifconfig -a) that is a step in the right direction, but that still doesn't allow me to calculate unicast packets, because I don't know the broadcast count (unless the "packets" value does not include broadcast).
Is there a man page (or other form of documentation) somewhere that explains the meaning of the fields in /proc/net/dev?
Thanks for the pointer. It has a little more info but still doesn't tell me if the multicast counter includes broadcasts or not.
I got kinda excited when I read "If you're [...] hungry for more network-related configuration and statistical information, you should explore the /proc/sys/net/ directory." I went there and found /proc/sys/net/ethernet/! But, alas there is nothing in it (on 2 different Linux systems). Another blind lead. :^(
Looks like I have to learn how to patch the drivers.
I've been digging into the drivers. On the old Linux (2.4.21) port to the PowerPC that we are using on one product, I can't even figure out how to get at the MAC address to see if it is a multicast or a broadcast. However in the version of Red Hat that we are using on another product (2.6.9), I have found all the counters (burried deep in the driver) and they are 64-bit values (which is what the lastest IF-MIB asks for). Now I just need to figure out how to get them out to the user process. Any ioctl gurus out there? (It's new turf for me.)
I am able to expose the counters on Red Hat 2.6.9. :^) I've created a /proc/net/dev_ifmib "file" which shows the 64-bit Ethernet counters needed to support the IF-MIB. (I only did it for the Ethernet so far. I don't have a need for other interface types yet.) My question now is, "How do I submit my enhancement so that it can become part of all furture releases?" It seems to me that others may want this code and I'd like it to be available on "off the shelf" platforms (without needing to build a special kernel).
ps, I tried to read the MAC address and count the packets on our PowerPC platform (2.4.21), but for some reason that totally eludes me, it causes the kernel to hang. :^(
Last edited by Ken Chapman; 05-02-2006 at 07:53 AM.
may you elaborate about exposing/retrieving counters for Ethernet interfaces from the network device drivers: ifInUcastPkts, ifInMulticastPkts, ifInBroadcastPkts, ifOutUcastPkts, ifOutMulticastPkts, ifOutBroadcastPkts