Utoah
Utoah

Reputation: 1072

What are meanings of fields in /proc/net/dev?

The Linux file /proc/net/dev reads like this:

[me@host ~]$ cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed

What do fields drop and errs mean?

Are some errs packets also counted in the drop packets?

Why is a packet considered errs , is it because that it suffers from checksum error?

Why is a packet dropped? Is it because that the system has no enough buffer of because there is some burst on the NIC?

Do the two fields take packets that are destined to another host (e.g. when the NIC is working in promiscuous mode) into consider?

Upvotes: 34

Views: 46684

Answers (4)

ladysdarkness
ladysdarkness

Reputation: 1

Never thought I'd see the day where I might have some input.

Until I get my laptop up and running, I use a variety of apps on Android. I happened to be using the Terrible Termux, and came across this (I'll let the pros do the interpreting):

ifconfig
Warning: cannot open /proc/net/dev (Permission denied). Limited output.
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
    inet 192.168.87.31  netmask 255.255.255.0  broadcast 192.168.87.255
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 3000  (UNSPEC)

(I think that's the right format?)

Upvotes: -1

Naishy
Naishy

Reputation: 1835

According to http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html, the meanings of each of the columns are:

bytes The total number of bytes of data transmitted or received by the interface.

packets The total number of packets of data transmitted or received by the interface.

errs The total number of transmit or receive errors detected by the device driver.

drop The total number of packets dropped by the device driver.

fifo The number of FIFO buffer errors.

frame The number of packet framing errors.

colls The number of collisions detected on the interface.

compressed The number of compressed packets transmitted or received by the device driver. (This appears to be unused in the 2.2.15 kernel.)

carrier The number of carrier losses detected by the device driver.

multicast The number of multicast frames transmitted or received by the device driver.

Upvotes: 16

Mikel
Mikel

Reputation: 25596

You can have a look at net/core/dev.c in the source tree to see what it means:

seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
       "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
       dev->name,
       stats->rx_bytes,
       stats->rx_packets,
       stats->rx_errors,
       stats->rx_dropped + stats->rx_missed_errors,
       stats->rx_fifo_errors,
       stats->rx_length_errors + stats->rx_over_errors +
        stats->rx_crc_errors + stats->rx_frame_errors,
       stats->rx_compressed,
       stats->multicast,
       stats->tx_bytes,
       stats->tx_packets,
       stats->tx_errors,
       stats->tx_dropped,
       stats->tx_fifo_errors,
       stats->collisions,
       stats->tx_carrier_errors + stats->tx_aborted_errors +
        stats->tx_window_errors + stats->tx_heartbeat_errors,
       stats->tx_compressed);

So:

  • receive errors means any kind of invalid packet, e.g. invalid length or invalid checksum
  • transmit errors are
    • carrier errors
    • aborted errors
    • window errors
    • heartbeat errors
      (whatever they all mean)

And yes, I think drops means when the device dropped a packet because it ran out of buffer space.

Upvotes: 24

Teddy
Teddy

Reputation: 6163

Since noone has answered for almost six months, I feel free to speculate:

I don't think the errs and drops overlap. I also think that errs are checksum or other bad data in a received packet (i.e. not enough data to constitute a whole packet). Further, I believe drops only apply to outgoing packages - how would the system know about dropped packages somewhere else?

Upvotes: 0

Related Questions