1. 查看网卡统计信息(来自网卡驱动)
# ethtool -S eth0 (不同的网卡和驱动的输出可能不一样)
NIC statistics:
rx_packets: 60
tx_packets: 32
rx_bytes: 7371
tx_bytes: 3061
rx_broadcast: 0
tx_broadcast: 0
rx_multicast: 0
tx_multicast: 0
rx_errors: 0
tx_errors: 0
tx_dropped: 0
multicast: 0
collisions: 0
rx_length_errors: 0
rx_over_errors: 0
rx_crc_errors: 0
rx_frame_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
tx_heartbeat_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
tx_restart_queue: 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: 7371
rx_csum_offload_good: 52
rx_csum_offload_errors: 0
alloc_rx_buff_failed: 0
tx_smbus: 0
rx_smbus: 0
dropped_smbus: 0
2. 查看操作系统UDP报文统计信息(来自Linux内核)
sender:~ # netstat -su -A inet6
12500 total packets received
0 incoming packets discarded
12220 incoming packets delivered
0 forwarded
39227597 requests sent out
20 outgoing packets dropped
506 incoming multicast packets
79 outgoing multicast packets
Ip6InOctets: 1784565
Ip6OutOctets: 44396413753
Ip6InMcastOctets: 31144
Ip6OutMcastOctets: 5776
Ip6InBcastOctets: 0
Ip6OutBcastOctets: 0
955 ICMP messages received
0 input ICMP message failed.
786 ICMP messages sent
Icmp6OutErrors: 0
ICMP input histogram:
echo requests: 220
group member queries: 18
group member responses: 19
neighbour solicits: 452
neighbour advertisement: 246
Icmp6InMLDv2Reports: 0
ICMP output histogram:
echo replies: 220
group member responses: 33
router solicits: 3
Icmp6OutRouterAdvertisements: 0
neighbor solicits: 74
neighbor advertisements: 452
Icmp6OutMLDv2Reports: 4
Icmp6InType128: 220
Icmp6InType130: 18
Icmp6InType131: 19
Icmp6InType135: 452
Icmp6InType136: 246
Icmp6OutType129: 220
Icmp6OutType131: 33
Icmp6OutType133: 3
Icmp6OutType135: 74
Icmp6OutType136: 452
Icmp6OutType143: 4
Udp6:
0 packets received
0 packets to unknown port received.
0 packet receive errors
39219160 packets sent
Udp6RcvbufErrors: 0