Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

iostat(8)

vmstat(8)

hosts(5)

networks(5)

protocols(5)

services(5)

trpt(8C)

NETSTAT(8)  —  MAINTENANCE COMMANDS

NAME

netstat − show network status

SYNOPSIS

netstat [ −m|−i| −h|−r ] [ −a ] [ −n ] [ −s ] [ −t ] [ −A ] [ interval ] [ system ] [ core ]

DESCRIPTION

Netstat symbolically displays the contents of various network-related data structures. 

The arguments, system and core allow substitutes for the defaults ‘/vmunix’ and ‘/dev/kmem’. 

If an interval is specified, netstat continuously displays the information regarding packet traffic on the configured network interfaces, pausing interval seconds before refreshing the screen. 

There are a number of display formats, depending on the information that netstat presents.  The display formats are controlled by the options listed below and are described there. 

For each active socket, the internal TPC state is indicated as follows:

CLOSED Closed - socket not being used

LISTEN Listening for incoming connections

SYN_SENT Actively trying to establish connection

SYN_RECEIVED
Initial synchronization of the connection

ESTABLISHED Connection has been established

CLOSE_WAIT Remote shut down, waiting for socket to close

FIN_WAIT_1 Socket closed, shutting down connection

CLOSING Closed, then remote shutdown, awaiting acknowledgement

LAST_ACK Remote shutdown, then closed, awaiting acknowledgement

FIN_WAIT_2 Socket closed, waiting for shutdown from remote

TIME_WAIT Wait after close for remote shutdown retransmission

OPTIONS

Not all of the options listed here can be used in combination.  Some of select the information to be displayed, and others further qualify that specific display.  Netstat checks its options in the order −m (memory management statistics), −i (interface statistics), −h (host table state), and −r (routing tables), and presents a display for only one of these options. 

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.  Other display formats are controlled by the options listed below. 

−m Show statistics recorded by the memory management routines (the network manages a “private share” of memory)

−i 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) The interface display provides a table of cumulative statistics regarding packets transferred, errors, and collisions.  The network address (currently Internet specific) of the interface and the maximum transmission unit (“mtu”) are also displayed. 

−h Show the state of the IMP host table.  This does not work in an environment where the IMP host tables do not exist. 

−r Show the routing tables.  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”), and whether the route is to a gateway (“G”).  Direct routes are created for each interface attached to the local host.  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 then discard it.  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. 

Options listed below provide further qualification for the display formats listed above. 

−A Show the address of any associated protocol control blocks; used for debugging. 

−a Show the state of all sockets; normally sockets used by server processes are not shown

−n Show network addresses as numbers (normally netstat interprets addresses and attempts to display them symbolically). 

−s Show per-protocol statistics.  When used with the −r option, the −s option displays routing statistics. 

−t Add timer information to the interface display. 

FURTHER NOTES

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 in the Internet “dot format”; refer to inet(3N) for more information regarding this format. Unspecified, or “wildcard”, addresses and ports appear as “∗”.

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 summarizing information for all interfaces, and a column for the interface with the most traffic since the system was last rebooted.  Every 24th 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. 

SEE ALSO

iostat(8), vmstat(8), hosts(5), networks(5), protocols(5), services(5), trpt(8C)

BUGS

The notion of errors is ill-defined.  Collisions mean something else for the IMP. 

The kernel’s tables can change while netstat is examining them, creating incorrect or partial displays. 

Sun Release 3.2  —  Last change: 18 June 1986

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