/proc/net/dev中字段的含义是什么? [英] What are meanings of fields in /proc/net/dev?

查看:579
本文介绍了/proc/net/dev中字段的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux文件/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

字段 drop errs 是什么意思?

drop 数据包中是否也包含一些 errs 数据包?

Are some errs packets also counted in the drop packets?

为什么将数据包视为 errs ,是因为它遭受校验和错误?

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

为什么数据包被丢弃?是因为系统没有足够的缓冲区,还是因为NIC上有一些突发事件?

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

这两个字段是否考虑了发往另一台主机的数据包(例如,当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?

推荐答案

您可以在源代码树中查看net/core/dev.c,以了解其含义:

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);

所以:

  • 接收错误表示任何种类的无效数据包,例如长度无效或校验和无效
  • 传输错误是
    • 运营商错误
    • 中止的错误
    • 窗口错误
    • 心跳错误
      (无论它们是什么意思)
    • 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.

      这篇关于/proc/net/dev中字段的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆