Netstat (Windows CE 5.0)

Send Feedback

The netstat utility displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays Help text.

netstat [-e] [-n] [-p Proto] [-r] [-s] [Interval]

Parameters

  • -e
    Displays Ethernet statistics, such as the number of bytes and packets sent and received.
  • -n
    Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
  • -p Proto
    Shows connections for the protocol specified by Proto. In this case, the Protocol can be IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
  • -s
    Displays statistics by protocol. By default, statistics are shown for the IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6 protocols. The -p parameter can be used to specify a subset of the default.
  • -r
    Displays the contents of the IP routing table. This is equivalent to the route print command.
  • Interval
    Redisplays the selected information every Interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, netstat prints the selected information only once.
  • /?
    Displays help at the command prompt.

Remarks

  • Parameters used with this command can be prefixed with a hyphen (-) or a slash (/).
  • Used without parameters, netstat displays Help text.
  • The following table shows the items for which netstat provides statistics.
    Item Description
    Proto The name of the protocol (IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6).
    Local Address The IP address of the local computer and the port number being used. The name of the local computer that corresponds to the IP address and the name of the port is shown unless the -n parameter is specified. If the port is not yet established, the port number is shown as an asterisk (*).
    Foreign Address The IP address and port number of the remote computer to which the socket is connected. The names that correspond to the IP address and the port are shown unless the -n parameter is specified. If the port is not yet established, the port number is shown as an asterisk (*).
    (state) Indicates the state of a TCP connection. The possible states are shown in the following list:
    • CLOSE_WAIT
    • CLOSED
    • ESTABLISHED
    • FIN_WAIT_1
    • LAST_ACK
    • LISTEN
    • SYN_RECEIVED
    • SYN_SEND
    • TIMED_WAIT

    For more information about the states of a TCP connection, see RFC 793.

Examples

To display both the Ethernet statistics and the statistics for all protocols, type the following command:

netstat -e -s

To display the statistics for only the TCP protocol, type the following command:

netstat -s -p tcp 

See Also

Network Utilities Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.