Monitoring BSD Socket Statistics
Purpose
Display basic information about BSD sockets that have been instantiated in the virtual router in whose context you issue the show ip socket statistics command. The information includes the connection information (source and destination IP address and port numbers), socket type, the options in effect on the socket, and the socket's state.
Use the detailed keyword to display blocks of extensive information about every socket, such as how many times various APIs have been called and the socket event log. The detailed keyword displays information about only the sockets that are associated with the virtual router in whose context you issue the command or sockets that are not associated with any virtual router.
![]() | Note: Baselining is not supported for the show ip socket statistics command. |
Action
To display basic information about BSD sockets that have been instantiated in the virtual router:
host1#show ip socket statistics 5 10.13.5.70:23 --> 10.10.132.71:2000 type: 1 (SOCK_STREAM) opts = 13 SO_DEBUG SO_REUSEADDR SO_KEEPALIVE so_state = 177 SS_NOFDREF SS_CANTSENDMORE SS_CANTRCVMORE SS_PRIV
18 0.0.0.0:23 --> 0.0.0.0:0 type: 1 (SOCK_STREAM) opts = 7 SO_DEBUG SO_ACCEPTCONN SO_REUSEADDR so_state = 128 SS_PRIV
To display detailed BSD socket statistics:
host1#show ip socket statistics detailed 18 0.0.0.0:23 --> 0.0.0.0:0 type: 1 (SOCK_STREAM) opts = 7 SO_DEBUG SO_ACCEPTCONN SO_REUSEADDR so_state = 128 SS_PRIV pending xmit byte count = 0 recv count 0 Keep alive idle time = 14400 keep alive poll time = 150 Additional state flags: so_Bound so_ListenOk ss_CalledRsSocreate
so_SendtoCalls = 0 so_SendMsgCalls = 0 so_SendCalls = 0 so_SockWriteCalls = 0 so_SendErrors = 0 so_SentBytes = 0 so_BsdCloseNotClosed = 0 so_RecvBytes = 0 so_RecvErrors = 0 so_RecvFroms = 0 so_Recvs = 0 so_RecvMsgs = 0 so_Reads = 0 Socket Event Log (most recent at bottom) rssocket sobind - 0 bind - 0 solisten - 0 listen - 0
Meaning
Table 1 lists the show ip socket statistics command output fields.
Table 1: show ip socket statistics Output Fields
Field Name | Field Description |
---|---|
socketNumber ipAddress:portNumber --> ipAddress:portNumber | Socket and the IP address and port number for each end of the connection, with the E Series router shown on the left and the remote peer on the right |
type | Type of connection: SOCK_STREAM (uses TCP) or DGRAM (datagram; uses UDP) |
opts | Options set on the individual sockets:
|
so_state | State of each socket; knowledge of BSD Sockets API is useful to understand this information:
|
pending xmit byte count = 0 recv count | Number of bytes that are pending to be sent (queued up) and received |
Keep alive idle time | Number of seconds before TCP sends an initial keepalive probe to an idle remote node |
keep alive poll time | Interval in seconds at which TCP sends keepalive probes to idle remote nodes |
Additional state flags | State of the following flags in the socket_stats structure: ss_Bound, ss_BindError, ss_ListenOk, ss_ListenError, ss_AcceptOk, ss_AcceptError, ss_RsAcceptOk, ss_RsAcceptError, ss_ConnectOk, ss_ConnectErrors, ss_ConnectToOk, ss_ConnectToError, ss_CalledShutdown, and ss_CalledRsSocreate. |
Socket Event Log (most recent at bottom) | Event log on this socket. Each one shows a call to a particular function within the socket library. Includes a repetition counter that displays only nonzero values.
|
Counters that show how often the indicated routine has been called: so_SendtoCalls, so_SendMsgCalls, so_SendCalls, so_SockWriteCalls, so_SendErrors, so_SentBytes, so_BsdCloseNotClosed, so_RecvBytes, so_RecvErrors, so_RecvFroms, so_Recvs, so_RecvMsgs, so_Reads |