Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All
     

    Related Documentation

     

    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_DEBUG—Turn on debugging; has no effect
    • SO_ACCEPTCONN—Socket can accept incoming connections
    • SO_REUSEADDR—Allow reuse of the local address
    • SO_KEEPALIVE—Do keepalives on the connection
    • SO_DONTROUTE—Do not route packets, use interface addresses
    • SO_BROADCAST—Broadcasts can be sent over the socket
    • SO_USELOOPBACK—Bypass the hardware if/when possible
    • SO_LINGER—Linger on a close() if data is present
    • SO_OOBINLINE—Leave received out-of-band data in-line
    • SO_REUSEPORT—Allow reuse of local port

    so_state

    State of each socket; knowledge of BSD Sockets API is useful to understand this information:

    • SS_NOFDREF—No file table reference any more
    • SS_ISCONNECTED—Socket is connected to a peer
    • SS_ISCONNECTING—Socket is in process of connecting to peer
    • SS_ISDISCONNECTING—Socket is in process of disconnecting
    • SS_CANTSENDMORE—Socket cannot send more data to peer
    • SS_CANTRCVMORE—Socket cannot receive more data from peer
    • SS_RCVATMARK—Socket at mark on input
    • SS_PRIV—Socket is privileged for broadcast, raw
    • SS_NBIO—Socket allows nonblocking operations
    • SS_ASYNC—Socket allows asynchronized I/O notifications
    • SS_ISCONFIRMING—Socket is deciding to accept connection request

    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.

    • Call to sofree()—Call included because in some circumstances an sofree() call does not result in the socket being destroyed (and memory being returned to the free pool)
    • Call to rsSocket()—Call to create the socket using rsSocket() as opposed to socket()
    • Call to socket()—8-bit value indicating how the call went
    • Call to connect()—8-bit value indicating how the call went
    • Call to listen()—8-bit value indicating how the call went
    • Call to accept()—8-bit value indicating how the call went
    • Call to bind()—8-bit value indicating how the call went
    • Call to connectto()—8-bit value indicating how the call went
    • Call to rsAccept()—8-bit value indicating how the call went
    • Call to sobind()—8-bit value indicating how the call went
    • Call to solisten()—8-bit value indicating how the call went
    • Call to soclose()—8-bit value indicating how the call went
    • Call to soabort()—8-bit value indicating how the call went
    • Call to soaccept()—8-bit value indicating how the call went
    • Call to soconnect()—8-bit value indicating how the call went
    • Call to soconnect2()—8-bit value indicating how the call went
    • Call to sodisconnect()—8-bit value indicating how the call went
    • Call to soshutdown()—8-bit value indicating how the call went
    • Call to sowakeup()—8-bit value indicating what kind of wakeup it is. 1 (SELREAD) indicates that data is available on the socket for the application. 2 (SELWRITE) means that more buffer space is available and the application can queue up more data to be transmitted.
    • Call to soclose()—8-bit value indicating how the call went
    • Call to sendto()—16-bit value indicating the return status
    • Call to write()—16-bit value indicating the return status
    • Call to sendmsg()—16-bit value indicating the return status
    • Call to send()—16-bit value indicating the return status
    • Call to recvfrom()—16-bit value indicating the return status
    • Call to recv()—16-bit value indicating the return status
    • Call to recvmsg()—16-bit value indicating the return status
    • Call to read()—16-bit value indicating the return status

    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

     

    Related Documentation

     

    Published: 2014-08-13