netdev
[Top] [All Lists]

Network statistics counters missing 'broadcasts'

To: netdev@xxxxxxxxxxx
Subject: Network statistics counters missing 'broadcasts'
From: Matti Aarnio <matti.aarnio@xxxxxxxxxxx>
Date: Wed, 3 Jan 2001 15:50:10 +0200
Sender: owner-netdev@xxxxxxxxxxx
A thing to think about.   This is IMO 2.5 time stuff.


A generic network layer statistics thing is that there apparently is no 
counter for broadcasts, and thus usually multicasts and broadcasts do get
folded into the same counter.

Partly this is interface problem, as we can't very easily change the
/proc/net/dev  file format which has device counters on one long line
for each interface.  (When a change was done long while ago, it caused
lots of "ifconfig is broken" email, as some of us may recall.)

Perhaps we should create a *new* interface in parallel of that "dev",
which gives each interface in separate tagged format, something like:
        interface: %16s
        \t rxpackets: %12ld
        \t rxbytes:   %12ld
etc.  allowing us to add new tags when deemed necessary.

One important detail would be that the interface must produce same size
data globs for each interface so that when there is more than PAGESIZE-1k
of text output, code can quickly get to index with new interesting stuff
without need to do O(N^2) size iteration (like /proc/ksyms does now).
(Adding new tags will need adjusted size, nothing else.)

Another approach could be  /proc/sys/net/***/IFNAME/stats  style files
( or  /proc/sys/net/stats/IFNAME files ) per interface.


For counters I would suggest renaming 'collisions' to be 'tx_collisions',
and also renaming 'multicast' as 'rx_multicast', then adding counters:
  - rx_broadcast
  - tx_multicast
  - tx_broadcast


With VLAN work I have missed specifically separation of multicast and
broadcast counters, but also the lack of transmit direction counters
for the same.


The set of statistics counters as of 2.4.0-prerelease:


        unsigned long   rx_packets;             /* total packets received   */
        unsigned long   tx_packets;             /* total packets transmitted */
        unsigned long   rx_bytes;               /* total bytes received     */
        unsigned long   tx_bytes;               /* total bytes transmitted  */
        unsigned long   rx_errors;              /* bad packets received     */
        unsigned long   tx_errors;              /* packet transmit problems */
        unsigned long   rx_dropped;             /* no space in linux buffers  */
        unsigned long   tx_dropped;             /* no space available in linux  
*/
        unsigned long   multicast;              /* multicast packets received */
        unsigned long   collisions;

        /* detailed rx_errors: */
        unsigned long   rx_length_errors;
        unsigned long   rx_over_errors;         /* receiver ring buff overflow 
*/
        unsigned long   rx_crc_errors;          /* recved pkt with crc error */
        unsigned long   rx_frame_errors;        /* recv'd frame alignment error 
*/
        unsigned long   rx_fifo_errors;         /* recv'r fifo overrun     */
        unsigned long   rx_missed_errors;       /* receiver missed packet  */

        /* detailed tx_errors */
        unsigned long   tx_aborted_errors;
        unsigned long   tx_carrier_errors;
        unsigned long   tx_fifo_errors;
        unsigned long   tx_heartbeat_errors;
        unsigned long   tx_window_errors;

        /* for cslip etc */
        unsigned long   rx_compressed;
        unsigned long   tx_compressed;


<Prev in Thread] Current Thread [Next in Thread>