BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / netstat.0
NETSTAT(1) UNIX Programmer's Manual NETSTAT(1)
N\bNA\bAM\bME\bE
netstat - show network status
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
n\bne\bet\bts\bst\bta\bat\bt [ -\b-A\bAa\ban\bn ] [ -\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs__\bf_\ba_\bm_\bi_\bl_\by ] [ _\bs_\by_\bs_\bt_\be_\bm ] [ _\bc_\bo_\br_\be ]
n\bne\bet\bts\bst\bta\bat\bt [ -\b-h\bhi\bim\bmn\bnr\brs\bs ] [ -\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs__\bf_\ba_\bm_\bi_\bl_\by ] [ _\bs_\by_\bs_\bt_\be_\bm ] [ _\bc_\bo_\br_\be
]
n\bne\bet\bts\bst\bta\bat\bt [ -\b-n\bn ] [ -\b-I\bI _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be ] _\bi_\bn_\bt_\be_\br_\bv_\ba_\bl [ _\bs_\by_\bs_\bt_\be_\bm ] [ _\bc_\bo_\br_\be ]
n\bne\bet\bts\bst\bta\bat\bt [ -\b-p\bp _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl ] [ _\bs_\by_\bs_\bt_\be_\bm ] [ _\bc_\bo_\br_\be ]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The _\bn_\be_\bt_\bs_\bt_\ba_\bt command symbolically displays the contents of
various network-related data structures. There are a number
of output formats, depending on the options for the informa-
tion presented. The first form of the command displays a
list of active sockets for each protocol. The second form
presents the contents of one of the other network data
structures according to the option selected. Using the
third form, with an _\bi_\bn_\bt_\be_\br_\bv_\ba_\bl specified, _\bn_\be_\bt_\bs_\bt_\ba_\bt will con-
tinuously display the information regarding packet traffic
on the configured network interfaces. The fourth form
displays statistics about the named protocol.
The options have the following meaning:
-\b-A\bA With the default display, show the address of any pro-
tocol control blocks associated with sockets; used for
debugging.
-\b-a\ba With the default display, show the state of all sock-
ets; normally sockets used by server processes are not
shown. -\b-d\bd With either interface display (option -\b-i\bi or
an interval, as described below), show the number of
dropped packets.
-\b-h\bh Show the state of the IMP host table.
-\b-i\bi Show the state of interfaces which have been auto-
configured (interfaces statically configured into a
system, but not located at boot time are not shown).
-\b-I\bI _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be
Show information only about this interface; used with
an _\bi_\bn_\bt_\be_\br_\bv_\ba_\bl as described below.
-\b-m\bm Show statistics recorded by the memory management rou-
tines (the network manages a private pool of memory
buffers).
-\b-n\bn Show network addresses as numbers (normally _\bn_\be_\bt_\bs_\bt_\ba_\bt
interprets addresses and attempts to display them sym-
bolically). This option may be used with any of the
Printed 7/9/88 May 14, 1988 1
NETSTAT(1) UNIX Programmer's Manual NETSTAT(1)
display formats.
-\b-p\bp _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl
Show statistics about _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl, which is either a
well-known name for a protocol or an alias for it.
Some protocol names and aliases are listed in the file
/_\be_\bt_\bc/_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\bs. A null response typically means that
there are no interesting numbers to report. The pro-
gram will complain if _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl is unknown or if there
is no statistics routine for it.
-\b-s\bs Show per-protocol statistics.
-\b-r\br Show the routing tables. When -\b-s\bs is also present, show
routing statistics instead.
-\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs__\bf_\ba_\bm_\bi_\bl_\by
Limit statistics or address control block reports to
those of the specified _\ba_\bd_\bd_\br_\be_\bs_\bs _\bf_\ba_\bm_\bi_\bl_\by. The following
address families are recognized: _\bi_\bn_\be_\bt, for A\bAF\bF_\b_I\bIN\bNE\bET\bT, _\bn_\bs,
for A\bAF\bF_\b_N\bNS\bS, and _\bu_\bn_\bi_\bx, for A\bAF\bF_\b_U\bUN\bNI\bIX\bX.
The arguments, _\bs_\by_\bs_\bt_\be_\bm and _\bc_\bo_\br_\be allow substitutes for the
defaults ``/vmunix'' and ``/dev/kmem''.
The default display, for active sockets, shows the local and
remote addresses, send and receive queue sizes (in bytes),
protocol, and the internal state of the protocol. Address
formats are of the form ``host.port'' or ``network.port'' if
a socket's address specifies a network but no specific host
address. When known the host and network addresses are
displayed symbolically according to the data bases
/_\be_\bt_\bc/_\bh_\bo_\bs_\bt_\bs and /_\be_\bt_\bc/_\bn_\be_\bt_\bw_\bo_\br_\bk_\bs, respectively. If a symbolic
name for an address is unknown, or if the -\b-n\bn option is
specified, the address is printed numerically, according to
the address family. For more information regarding the
Internet ``dot format,'' refer to _\bi_\bn_\be_\bt(3N). Unspecified, or
``wildcard'', addresses and ports appear as ``*''.
The interface display provides a table of cumulative statis-
tics regarding packets transferred, errors, and collisions.
The network addresses of the interface and the maximum
transmission unit (``mtu'') are also displayed.
The routing table display indicates the available routes and
their status. Each route consists of a destination host or
network and a gateway to use in forwarding packets. The
flags field shows the state of the route (``U'' if ``up''),
whether the route is to a gateway (``G''), whether the route
was created dynamically by a redirect (``D''), and whether
the route has been modified by a redirect (``M''). Direct
routes are created for each interface attached to the local
Printed 7/9/88 May 14, 1988 2
NETSTAT(1) UNIX Programmer's Manual NETSTAT(1)
host; the gateway field for such entries shows the address
of the outgoing interface. The refcnt field gives the
current number of active uses of the route. Connection
oriented protocols normally hold on to a single route for
the duration of a connection while connectionless protocols
obtain a route while sending to the same destination. The
use field provides a count of the number of packets sent
using that route. The interface entry indicates the network
interface utilized for the route.
When _\bn_\be_\bt_\bs_\bt_\ba_\bt is invoked with an _\bi_\bn_\bt_\be_\br_\bv_\ba_\bl argument, it
displays a running count of statistics related to network
interfaces. This display consists of a column for the pri-
mary interface (the first interface found during autoconfi-
guration) and a column summarizing information for all
interfaces. The primary interface may be replaced with
another interface with the -_\bI option. The first line of
each screen of information contains a summary since the sys-
tem was last rebooted. Subsequent lines of output show
values accumulated over the preceding interval.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
iostat(1), vmstat(1), hosts(5), networks(5), protocols(5),
services(5), trpt(8C)
B\bBU\bUG\bGS\bS
The notion of errors is ill-defined. Collisions mean some-
thing else for the IMP.
Printed 7/9/88 May 14, 1988 3