Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ netstat(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hosts

networks

protocols

rc.tcpip, rc.tcpip.local



NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



-------------------------------------------------------------------------------
netstat



PURPOSE

Shows network status.

SYNTAX



                      +----------------+   +------------+
                    +-|                |---|            |---------------+
           +------+ | +- -I interface -+   +- interval -+               |
netstat ---|      |-|   +------+  +------+                              |-...
           +- -n -+ | +-|      |--|      |--+  +---------------------+  |
                    +-| +- -A -+  +- -a -+  |--|                     |--+
                      | +----+              |  +- -f address_family -+
                      +-| -h |--------------+
                       ^| -i ||
                       || -m ||
                       || -r ||
                       || -s ||
                       |+----+|
                       +------+


               +----------+   +--------+
           ...-|          |---|        |---|
               +- system -+   +- core -+



DESCRIPTION

The netstat command symbolically displays the contents of various
network-related data structures.  There are a number of output formats,
depending on the options for the information presented.  With the -a option,
the command displays a list of active sockets for each protocol.  With the -h,
-i, -m, -r, and -s options, the command presents the contents of one of the
other network data structures according to the option selected.  If -I
interface options is used with an interval specified, netstat continuously
displays the information regarding packet traffic on the configured network
interfaces.

FLAGS

The netstat command options are:





Processed October 29, 1990       NETSTAT(1,C)                                 1





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



-A     Shows the address of any protocol control blocks associated with sockets
       used for debugging, with the default display.

-a     Shows the state of all sockets with the default display.  Normally
       sockets used by server processes are not shown.  Used only with the -A
       option.

-h     Prints the host table associated with the Arpanet IMP if one is attached
       to the system and support for it has been added to the AIX kernel.

-i     Shows the state of interfaces which have been auto-configured
       (interfaces statically configured into a system, but not located at boot
       time are not shown).

-m     Shows statistics recorded by the memory management routines (the network
       manages a private pool of memory buffers).

-n     Shows network addresses as numbers (normally netstat interprets
       addresses and attempts to display them symbolically).  This option may
       be used with any of the display formats.

-r     Shows the routing tables.  When -s is also present, shows routing
       statistics instead.

-s     Shows per-protocol statistics.

-t     Used only with the -i flag to print interface timer information.  You
       can specify a watchdog function for each network interface that will run
       when the watchdog timer is decremented to zero.  The watchdog timer is
       decremented once per second.
       Only looks at UNIX-domain sockets.

-f address_family
       Limits statistics or address control block reports to those of the
       specified address family.  The following address families are
       recognized:

          inet for AF_INET

          ns for AF_NS

          UNIX for AF_UNIX

-I interface
       Shows information only about this interface.  Used with an interval as
       described below.

The arguments, system and core, allow substitutes for the defaults /unix and
/dev/kmem.

The default display, for active sockets, shows the local and remote addresses,
sends and receives queue sizes (in bytes), protocol, and the internal state of



Processed October 29, 1990       NETSTAT(1,C)                                 2





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



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 /etc/hosts and /etc/networks, respectively.  If a symbolic name for an
address is unknown, or if the -n option is specified, the address is printed
numerically, according to the address family.  For more information regarding
the Internet dot format, refer to inet in the AIX Operating System Technical
Reference.  Unspecified or wildcard addresses and ports appear as *.

The interface display provides a table of cumulative statistics 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), and whether the route was created
dynamically by a redirect (D).  Direct routes are created for each interface
attached to the local 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.






























Processed October 29, 1990       NETSTAT(1,C)                                 3





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)




When netstat is invoked with an interval argument, it displays a running count
of statistics related to network interfaces.  This display consists of a column
for the primary interface (the first interface found during autoconfiguration)
and a column summarizing information for all interfaces.  The primary interface
may be replaced with another interface with the -I option.  The first line of
each screen of information contains a summary since the system was last
rebooted.  Subsequent lines of output show values accumulated over the
preceding interval.

EXAMPLES

  $ netstat
  Active Internet connections
  Proto Recv-Q Send-Q  Local Address        Foreign Address        (state)
  tcp        0      0  host1.1052           host1.ftp              ESTABLISHED
  tcp        0      0  host1.1051           host1.telnet           ESTABLISHED
  tcp        0      0  host1.1050           host1.telnet           ESTABLISHED

  $ netstat -A
  Active Internet connections
  PCB      Proto Recv-Q Send-Q  Local Address    Foreign Address    (state)
  f1043b0c tcp        0      0  host1.1052       host1.ftp         ESTABLISHED
  f1037f8c tcp        0      0  host1.1051       host1.telnet      ESTABLISHED
  f103818c tcp        0      0  host1.1050       host1.telnet      ESTABLISHED

  $ netstat -a
  Active Internet connections (including servers)
  Proto Recv-Q Send-Q  Local Address        Foreign Address        (state)
  tcp        0      0  host1.1052           host1.ftp              ESTABLISHED
  tcp        0      0  host1.1051           host1.telnet           ESTABLISHED
  tcp        0      0  host1.1050           host1.telnet           ESTABLISHED
  tcp        0      0  *.sunrpc             *.*                    LISTEN
  tcp        0      0  *.time               *.*                    LISTEN
  tcp        0      0  *.daytime            *.*                    LISTEN
  tcp        0      0  *.chargen            *.*                    LISTEN
  tcp        0      0  *.discard            *.*                    LISTEN
  tcp        0      0  *.echo               *.*                    LISTEN
  tcp        0      0  *.smtp               *.*                    LISTEN
  tcp        0      0  *.finger             *.*                    LISTEN
  tcp        0      0  *.exec               *.*                    LISTEN
  tcp        0      0  *.login              *.*                    LISTEN
  tcp        0      0  *.telnet             *.*                    LISTEN
  tcp        0      0  *.ftp                *.*                    LISTEN
  udp        0      0  *.1031               *.*
  udp        0      0  *.2049               *.*
  udp        0      0  *.who                *.*
  udp        0      0  *.sunrpc             *.*
  udp        0      0  *.time               *.*
  udp        0      0  *.daytime            *.*
  udp        0      0  *.chargen            *.*
  udp        0      0  *.discard            *.*



Processed October 29, 1990       NETSTAT(1,C)                                 4





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



  udp        0      0  *.echo               *.*
  udp        0      0  *.talk               *.*
  udp        0      0  *.tftp               *.*

  $ netstat -i
  Name  Mtu   Network     Address      Ipkts   Ierrs Opkts   Oerrs Collis
  tk0   1500  192.100.20  host1        1698272 0     507349  0     0
  lo0   1536  loopback-n  localhost    13098   0     13098   0     0















































Processed October 29, 1990       NETSTAT(1,C)                                 5





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



  $ netstat -s -r
  routing:
   0 bad routing redirects
   0 dynamically created routes
   0 new gateways due to redirects
   5 destinations found unreachable
   0 uses of a wildcard route
  $ netstat -s
  ip:
   591797 total packets received
   0 bad header checksums
   0 with size smaller than minimum
   0 with data size < data length
   0 with header length < data size
   0 with data length < header length
   12654 fragments received
   0 fragments dropped (dup or out of space)
   1 fragment dropped after timeout
   0 packets forwarded
   68856 packets not forwardable
   0 redirects sent
  icmp:
        10336 calls to icmp_error
   0 errors not generated 'cuz old message was icmp
   Output histogram:
    echo reply: 9
    destination unreachable: 10336
   0 messages with bad code fields
   0 messages < minimum length
   0 bad checksums
   0 messages with bad length
   Input histogram:
    destination unreachable: 9281
    echo: 9
   9 message responses generated
  tcp:
   0 incomplete headers
   0 bad checksums
   0 bad header offset fields
  udp:
   0 incomplete headers
   0 bad data length fields
   0 bad checksums

  $ netstat -m
  77/160 mbufs in use:
   3 mbufs allocated to packet headers
   26 mbufs allocated to socket structures
   41 mbufs allocated to protocol control blocks
   5 mbufs allocated to routing table entries
   2 mbufs allocated to interface addresses
  0/36 mapped pages in use



Processed October 29, 1990       NETSTAT(1,C)                                 6





NETSTAT(1,C)                AIX TCP/IP User's Guide                NETSTAT(1,C)



  164 Kbytes allocated to network (5% in use)
  0 requests for memory denied

  $ netstat -n
  Active Internet connections
  Proto Recv-Q Send-Q  Local Address         Foreign Address       (state)
  tcp        0      0  193.255.2.4.1052      193.255.1.4.21        ESTABLISHED
  tcp        0      0  193.255.2.4.1051      193.255.1.5.23        ESTABLISHED
  tcp        0      0  193.255.2.4.1050      193.255.1.7.23        ESTABLISHED

  $ netstat -f inet
  Active Internet connections
  Proto Recv-Q Send-Q  Local Address         Foreign Address       (state)
  tcp        0      0  host1.1082            host1.telnet          ESTABLISHED
  tcp        0      0  host1.1052            host1.ftp             ESTABLISHED
  $

RELATED INFORMATION

In this book:
"hosts"
"networks"
"protocols"
"rc.tcpip, rc.tcpip.local"































Processed October 29, 1990       NETSTAT(1,C)                                 7



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026