我有一个问题。我有一块 Supermicro 的主板 – X11SBA-LN4F。有 4 个以太网端口。在第一个端口我连接到互联网。在第二个端口我连接到我的本地网络。
当我写入ifconfig
或时netstat -i
,我可以在第二个接口(我的本地网络)上看到丢弃的数据包。此计数会增加
em2 Link encap:Ethernet HWaddr 0c:c4:7a:7b:91:3e
inet addr:192.168.110.181 Bcast:192.168.110.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17441 errors:0 dropped:1380 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1226317 (1.2 MB) TX bytes:0 (0.0 B)
经过谷歌搜索,我发现了这个: https://www.novell.com/support/kb/doc.php?id=7007165
Beginning with kernel 2.6.37, it has been changed the meaning of dropped packet count. Before, dropped packets was most likely due to an error. Now, the rx_dropped counter shows statistics for dropped frames because of:
Softnet backlog full -- (Measured from /proc/net/softnet_stat)
Bad / Unintended VLAN tags
Unknown / Unregistered protocols
IPv6 frames when the server is not configured for IPv6
If any frames meet those conditions, they are dropped before the protocol stack and the rx_dropped counter is incremented.
首先,我写了这个命令:
tcpdump -vv -i em2
当此命令运行时,我的第二个接口上的丢包计数停止。但是,当我中止时tcpdump
,丢包计数再次增加。
- 我禁用了 IPv6
- 我检查了所有 VLAN。在该端口上,本地网络中只有一个未标记 VLAN
我检查了文件
/proc/net/softnet_stat
。该文件中只有第一列的信息,这很好00000013 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00002fbc 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000f3 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000268f 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
我用“tcpdump”分析了所有流量。我只得到了 ARP 请求、广播和 Rip。结果还不错
- 我启用了混杂模式,但这没有帮助
- 我检查了电缆和连接器
- 我安装最新的驱动程序
- 我增加了环形缓存的大小,但这没有帮助
我检查了所有 Unix 和 Linux:Zeroshell、Pfense、FreeBsd、Ubuntu Server(使用原生内核并由我编译)、CentOS(使用原生内核并由我编译)。所有都出现了相同的症状。
ethtool -i em2 driver: igb version: 5.3.4.4 firmware-version: 3.25, 0x800005d0 bus-info: 0000:06:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no
该接口上的所有统计信息:
ethtool -S em2
NIC statistics:
rx_packets: 29675
tx_packets: 0
rx_bytes: 2208735
tx_bytes: 0
rx_broadcast: 29636
tx_broadcast: 0
rx_multicast: 39
tx_multicast: 0
multicast: 39
collisions: 0
rx_crc_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_window_errors: 0
tx_abort_late_coll: 0
tx_deferred_ok: 0
tx_single_coll_ok: 0
tx_multi_coll_ok: 0
tx_timeout_count: 0
rx_long_length_errors: 0
rx_short_length_errors: 0
rx_align_errors: 0
tx_tcp_seg_good: 0
tx_tcp_seg_failed: 0
rx_flow_control_xon: 0
rx_flow_control_xoff: 0
tx_flow_control_xon: 0
tx_flow_control_xoff: 0
rx_long_byte_count: 2208735
tx_dma_out_of_sync: 0
lro_aggregated: 0
lro_flushed: 0
tx_smbus: 0
rx_smbus: 0
dropped_smbus: 0
os2bmc_rx_by_bmc: 0
os2bmc_tx_by_bmc: 0
os2bmc_tx_by_host: 0
os2bmc_rx_by_host: 0
tx_hwtstamp_timeouts: 0
rx_hwtstamp_cleared: 0
rx_errors: 0
tx_errors: 0
tx_dropped: 0
rx_length_errors: 0
rx_over_errors: 0
rx_frame_errors: 0
rx_fifo_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_queue_0_packets: 0
tx_queue_0_bytes: 0
tx_queue_0_restart: 0
rx_queue_0_packets: 29675
rx_queue_0_bytes: 2090035
rx_queue_0_drops: 0
rx_queue_0_csum_err: 0
rx_queue_0_alloc_failed: 0
我的问题出在哪里?请帮帮我。
ifconfig em2; ethtool -S em2
em2 Link encap:Ethernet HWaddr 0c:c4:7a:7b:91:3e
inet addr:192.168.110.181 Bcast:192.168.110.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15387 errors:0 dropped:1224 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1085031 (1.0 MB) TX bytes:0 (0.0 B)
NIC statistics:
rx_packets: 15387
tx_packets: 0
rx_bytes: 1146579
tx_bytes: 0
rx_broadcast: 15367
tx_broadcast: 0
rx_multicast: 20
tx_multicast: 0
multicast: 20
collisions: 0
rx_crc_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_window_errors: 0
tx_abort_late_coll: 0
tx_deferred_ok: 0
tx_single_coll_ok: 0
tx_multi_coll_ok: 0
tx_timeout_count: 0
rx_long_length_errors: 0
rx_short_length_errors: 0
rx_align_errors: 0
tx_tcp_seg_good: 0
tx_tcp_seg_failed: 0
rx_flow_control_xon: 0
rx_flow_control_xoff: 0
tx_flow_control_xon: 0
tx_flow_control_xoff: 0
rx_long_byte_count: 1146579
tx_dma_out_of_sync: 0
lro_aggregated: 0
lro_flushed: 0
tx_smbus: 0
rx_smbus: 0
dropped_smbus: 0
os2bmc_rx_by_bmc: 0
os2bmc_tx_by_bmc: 0
os2bmc_tx_by_host: 0
os2bmc_rx_by_host: 0
tx_hwtstamp_timeouts: 0
rx_hwtstamp_cleared: 0
rx_errors: 0
tx_errors: 0
tx_dropped: 0
rx_length_errors: 0
rx_over_errors: 0
rx_frame_errors: 0
rx_fifo_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_queue_0_packets: 0
tx_queue_0_bytes: 0
tx_queue_0_restart: 0
rx_queue_0_packets: 15387
rx_queue_0_bytes: 1085031
rx_queue_0_drops: 0
rx_queue_0_csum_err: 0
rx_queue_0_alloc_failed: 0
答案1
可能发生的情况是,您在子网上看到了 IPv6 广播流量,如您从此处的 tcpdump 输出中发布的那样:
12:19:41.622297 IP6 (hlim 1, next-header UDP (17) payload length: 112) fe80::a4a0:460b:c99a:c992.dhcpv6-client > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 solicit (xid=455863 (elapsed-time 700) (client-ID hwaddr/time type 1 time 495735714 e03f49b54e07) (IA_NA IAID:65027913 T1:0 T2:0) (Client-FQDN) (vendor-class) (option-request vendor-specific-info DNS-server DNS-search-list Client-FQDN))
根据您在此处的问题中所写的内容:
从内核 2.6.37 开始,丢弃数据包计数的含义已发生变化。以前,丢弃数据包很可能是由于错误造成的。现在,rx_dropped 计数器显示丢弃帧的统计信息,原因是:
Softnet 积压已满 ——(通过 /proc/net/softnet_stat 测量)
错误/非预期的 VLAN 标签
未知/未注册的协议
当服务器未配置 IPv6 时,IPv6 帧
如果任何帧满足这些条件,它们将在协议栈之前被丢弃,并且 rx_dropped 计数器会增加。
从您的输出和问题来看,您确实在服务器上禁用了 IPv6。
这使我得出结论:您看到的数据包丢失可能是由于来自网络上其他主机的 IPv6 广播流量造成的。
为了测试这一点,您可以重新启用 IPv6,看看丢包是否消失。如果确实如此,则无害。