使用 netstat 显示连接统计
可以使用 netstat 命令显示协议统计信息和当前的 TCP/IP 连接。netstat -a 命令将显示所有连接,而 netstat -r 显示路由表和活动连接。netstat -e 命令将显示Ethernet 统计信息,而 netstat -s 显示每个协议的统计信息。如果使用 netstat -n,则不能将地址和端口号转换成名称。下面是 netstat 的输出示例: C:\> netstat -e Interface Statistics Received Sent Bytes 3995837940 47224622 Unicast packets 120099 131015 Non-unicast packets 7579544 3823 Discards 0 0 Errors 0 0 Unknown protocols 363054211 C:\> netstat -a Active Connections Proto Local Address Foreign Address State TCP CORP1:1572 172.16.48.10:nbsession ESTABLISHED TCP CORP1:1589 172.16.48.10:nbsession ESTABLISHED TCP CORP1:1606 172.16.105.245:nbsession ESTABLISHED TCP CORP1:1632 172.16.48.213:nbsession ESTABLISHED TCP CORP1:1659 172.16.48.169:nbsession ESTABLISHED TCP CORP1:1714 172.16.48.203:nbsession ESTABLISHED TCP CORP1:1719 172.16.48.36:nbsession ESTABLISHED TCP CORP1:1241 172.16.48.101:nbsession ESTABLISHED UDP CORP1:1025 *:* UDP CORP1:snmp *:* UDP CORP1:nbname *:* UDP CORP1:nbdatagram *:* UDP CORP1:nbname *:* UDP CORP1:nbdatagram *:* C:\> netstat -s IP Statistics Packets Received = 5378528 Received Header Errors = 738854 Received Address Errors = 23150 Datagrams Forwarded = 0 Unknown Protocols Received = 0 Received Packets Discarded = 0 Received Packets Delivered = 4616524 Output Requests = 132702 Routing Discards = 157 Discarded Output Packets = 0 Output Packet No Route = 0 Reassembly Required = 0 Reassembly Successful = 0 Reassembly Failures = Datagrams Successfully Fragmented = 0 Datagrams Failing Fragmentation = 0 Fragments Created = 0 ICMP Statistics Received Sent Messages 693 4 Errors 0 0 Destination Unreachable 685 0 Time Exceeded 0 0 Parameter Problems 0 0 Source Quenches 0 0 Redirects 0 0 Echoes 4 0 Echo Replies 0 4 Timestamps 0 0 Timestamp Replies 0 0 Address Masks 0 0 Address Mask Replies 0 0 TCP Statistics Active Opens = 597 Passive Opens = 135 Failed Connection Attempts = 107 Reset Connections = 91 Current Connections = 8 Segments Received = 106770 Segments Sent = 118431 Segments Retransmitted = 461 UDP Statistics Datagrams Received = 4157136 No Ports = 351928 Receive Errors = 2 Datagrams Sent = 13809 |