且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

/proc/net/dev中字段的含义是什么?

更新时间:2022-06-21 04:53:45

您可以在源代码树中查看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.