![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The TCP implementation prior to Cisco IOS Software Release 11.2(3) did not have a socket API, and porting socket-based applications from other vendors to the Cisco IOS software was cumbersome. This feature implements some basic socket interface functions to reduce porting efforts. The new socket interface enables TCP applications to open and manage multiple connections asynchronously.
This feature is supported on these platforms:
There are no configuration tasks associated with this feature; however, you can display socket information with the debug ip socket command.
None
None
This section describes the debug command related to the TCP socket interface.
Use the debug ip socket EXEC command to display all state change information for all sockets. Use the no form of this command to disable debugging output.
debug ip socketUse this command to collect information on the socket interface. In order to get more complete information on a socket/TCP port pair, use this command in conjunction with debug ip tcp transaction.
Because the socket debugging information is state-change oriented, you will not see the debug message on a per packet basis. However, if the connections normally have very short lives (few packet exchanges during the life cycle of a connection), then socket debugging could become expensive because of the state changes involved during connection setup and teardown.
Figure 1 shows sample debug ip socket output from a server process.
Router# debug ip socket
Added socket 0x60B86228 to process 40
SOCKET: set TCP property TCP_PID, socket 0x60B86228, TCB 0x60B85E38
Accepted new socket fd 1, TCB 0x60B85E38
Added socket 0x60B86798 to process 40
SOCKET: set TCP property TCP_PID, socket 0x60B86798, TCB 0x60B877C0
SOCKET: set TCP property TCP_BIT_NOTIFY, socket 0x60B86798, TCB 0x60B877C0
SOCKET: created new socket to TCP, fd 2, TCB 0x60B877C0
SOCKET: bound socket fd 2 to TCB 0x60B877C0
SOCKET: set TCP property TCP_WINDOW_SIZE, socket 0x60B86798, TCB 0x60B877C0
SOCKET: listen on socket fd 2, TCB 0x60B877C0
SOCKET: closing socket 0x60B86228, TCB 0x60B85E38
SOCKET: socket event process: socket 0x60B86228, TCB new state --> FINWAIT1
socket state: SS_ISCONNECTED SS_CANTSENDMORE SS_ISDISCONNECTING
SOCKET: Removed socket 0x60B86228 from process 40 socket list
Figure 2 shows sample debug ip socket output from a client process.
Router# debug ip socket
Added socket 0x60B70220 to process 2
SOCKET: set TCP property TCP_PID, socket 0x60B70220, TCB 0x60B6CFDC
SOCKET: set TCP property TCP_BIT_NOTIFY, socket 0x60B70220, TCB 0x60B6CFDC
SOCKET: created new socket to TCP, fd 0, TCB 0x60B6CFDC
SOCKET: socket event process: socket 0x60B70220, TCB new state --> SYNSENT
socket state: SS_ISCONNECTING
SOCKET: socket event process: socket 0x60B70220, TCB new state --> ESTAB
socket state: SS_ISCONNECTING
SOCKET: closing socket 0x60B70220, TCB 0x60B6CFDC
SOCKET: socket event process: socket 0x60B70220, TCB new state --> FINWAIT1
socket state: SS_ISCONNECTED SS_CANTSENDMORE SS_ISDISCONNECTING
SOCKET: Removed socket 0x60B70220 from process 2 socket list
Table 4 describes the significant fields in the first sample output.
Field | Description |
---|---|
Added socket 0x60B86228 process 40 | New socket is opened for process 40. |
SOCKET | Indicates that this is a SOCKET transaction. |
set TCP property TCP_PID | Set process ID to the TCP associated with the socket. |
socket 0x60B86228, TCB 0x60B85E38 | Address for the socket/TCP pair. |
set TCP property TCP_BIT_NOTIFY | Set the method for how the socket wants to be notified for an event. |
created new socket to TCP, fd 2 | Opened a new socket referenced by file descriptor 2 to TCP. |
bound socket fd 2 to TCB | Bound the socket referenced by file descriptor 2 to TCP. |
listen on socket fd 2 | Indicates which file descriptor the application is listening to. |
closing socket | Indicates the socket is being closed. |
socket event process | Processed a state change event occurred in the transport layer. |
TCB new state --> FINWAIT1 | TCP state machine changed to FINWAIT1. (See the debug ip tcp transaction command for more information on TCP state machines.) |
socket state: SS_ISCONNECTED SS_CANTSENDMORE SS_ISDISCONNECTING | New SOCKET state flags after the transport event processing. This socket is still connected, but disconnecting is in progress, and it will not send more data to peer.
Possible SOCKET state flags follow: SS_NOFDREF No file descriptor reference for this socket. SS_ISCONNECTING Socket connecting is in progress. SS_ISBOUND Socket is bound to TCP. SS_ISCONNECTED Socket is connected to peer. SS_ISDISCONNECTING Socket disconnecting is in progress. SS_CANTSENDMORE Can't send more data to peer. SS_CANTRCVMORE Can't receive more data from peer. SS_ISDISCONNECTED Socket is disconnected. Connection is fully closed. |
Removed socket 0x60B86228 from process 40 socket list | Connection is closed, and the socket is removed from the process socket list. |
debug ip tcp transaction
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |