< Home

display ip socket

Function

The display ip socket command displays information about the created IPv4 socket. If no parameter of the command is specified, all types of sockets are displayed.

Format

display ip socket [ monitor ] [ task-id task-id socket-id socket-id | sock-type socket-type ]

Parameters

Parameter Description Value
monitor Displays information about the Socket Monitor. That is, information about the Socket Monitor needs to be displayed together with information about the Socket. -
task-id task-id Specifies the ID of the task to be displayed. The task ID must already exist.
socket-id socket-id Specifies ID of the socket to be displayed. The socket ID must already exist.
sock-type socket-type Specifies the Socket type. That is, information about the specified type of Socket is displayed. The value is an integer. The value range is shown in Table 1.
Table 1 Value ranges of sock-type socket-type

Value

Description

1

Socket of TCP streams

2

Socket of UDP packets

3

Socket of RAWIP

4

Socket of RAWLINK

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Socket Monitors are used to monitor and record each connection. In the RAWLINK, it also monitors the interface. A Socket Monitor records the specific focused events that happen during operations based on the differences of protocols. In addition, it also records some information in the form of log in the disk space.

Socket Monitors are equal to the black box of the system. They record the specific focused events that occur during the operations of the system. When the system fails, you can use the socket monitor to locate the fault.

You can also set the filtering rules, such as task ID, socket ID, and socket type, so only the information matching the rules are displayed. This reduces the number of the output information and improves the usability of the output information and the accuracy and efficiency of fault location.

Example

# Display the information of the IP socket.

<sysname> display ip socket monitor
SOCK_STREAM:
Task = VTYD (30), socketid = 1, Proto = 6,
LA = 0.0.0.0:23, FA = 0.0.0.0:0,
sndbuf = 8192, rcvbuf = 8192, sb_cc = 0, rb_cc = 0,
socket option = SO_ACCEPTCONN SO_KEEPALIVE SO_REUSEPORT SO_SENDVPNID (14849) SO_S
ETKEEPALIVE,
socket state = SS_PRIV SS_ASYNC
Socket Monitor:
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peerclose = 0, accept = 0, keepalivedown = 0,
 cram time = 00H00M00S, lost msg= 0, msg type=0x00000000;
Nothing else has been captured!

SOCK_DGRAM:
Task = ULOG (150), socketid = 2, Proto = 17,
LA = 0.0.0.0:67, FA = 0.0.0.0:0,
sndbuf = 9216, rcvbuf = 41600, sb_cc = 0, rb_cc = 0,
socket option = SO_BROADCAST SO_REUSEPORT SO_UDPCHECKSUM SO_SENDVPNID (14849),
socket state = SS_PRIV
                          Socket Monitor:
Statistics:
 Input packets = 6,Recv packets = 6,Output packets = 0;
Rcvbuf status:
 Cram time = 00H00M00S: full times = 0,dropped packets = 0;
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peerclose = 0, accept = 0, keepalivedown = 0,
 cram time = 00H00M00S, lost msg = 0, msg type = 0x00000000;

# Display information about the IP socket with the task ID as 23 and socket ID as 1.

<sysname> display ip socket monitor task-id 23 socket-id 1
Task = RSVP (23), socketid = 1, Proto = 46,
LA = 0.0.0.0, FA = 0.0.0.0,
sndbuf = 4194304, rcvbuf = 4194304, sb_cc = 0, rb_cc = 0,
socket option = 0,
socket state = SS_PRIV SS_NBIO SS_ASYNC
                          Socket Monitor:
Statistics:
 Input packets = 0,Recv packets = 0,Output packets = 0;
Rcvbuf status:
 Cram time = 00H00M00S: full times = 0,dropped packets = 0;
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peerclose = 0, accept = 0, keepalivedown = 0,
 cram time = 00H00M00S, lost msg = 0, msg type = 0x00000000;

# Display information about the IP socket with the socket type as TCP.

<sysname> display ip socket monitor sock-type 1
SOCK_STREAM:
Task = VTYD (30), socketid = 1, Proto = 6,
LA = 0.0.0.0:23, FA = 0.0.0.0:0,
sndbuf = 8192, rcvbuf = 8192, sb_cc = 0, rb_cc = 0,
socket option = SO_ACCEPTCONN SO_KEEPALIVE SO_REUSEPORT SO_SENDVPNID (14849) SO_S
ETKEEPALIVE,
socket state = SS_PRIV SS_ASYNC
                          Socket Monitor:
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peerclose = 0, accept = 0, keepalivedown = 0,
 cram time = 00H00M00S, lost msg= 0, msg type=0x00000000;
Nothing else has been captured!
Table 2 Description of the display ip socket command output

Item

Description

SOCK_STREAM

Socket type:
  • SOCK_STREAM

  • SOCK_DGRAM

  • SOCK_RAW

  • SOCK_RAWLINK

Task = VTYD (30)

Type and ID of the task that needs to use the socket. For example, the task named VTYD uses the socket, with the task ID being 30.

socketid = 11

Socket ID.

Proto = 6

Protocol number.

LA = 0.0.0.0:23, FA = 0.0.0.0:0,

  • LA: the local address and local port number.

  • FA: the remote address and remote port number.

sndbuf = 8192, rcvbuf = 8192, sb_cc = 0, rb_cc = 0,

  • sndbuf: the upper limit of the cache of packet sending.

  • rcvbuf: the lower limit of the cache of packet receiving.

  • sb_cc: the number of the sent packets. This value is valid only when TCP can cache data packets.

  • rb_cc: the number of the received packets.

socket option = SO_ACCEPTCONN SO_KEEPALIVE SO_REUSEPORT SO_SENDVPNID (14849) SO_SETKEEPALIVE,

Displays the set socket options:
  • SO_DEBUG: the debugging is enabled.

  • SO_ACCEPTON: the socket that sets the option is the server. The socket is responsible for monitoring.

  • SO_REUSEADDR: the address overlapping. After the option is set, multiple identical addresses can be bound to the port.

  • SO_KEEPALIVE: the keepalive option of TCP connection. After the option is set, the keepalive timer is started after the TCP connection is set up.

  • SO_DONTROUTE: After the option is set, the socket must choose the direct route to the destination when setting up a connection.

  • SO_BROADCAST: After the option is set, the device can send broadcast packets on the interface.

  • SO_REUSEPORT: the port overlapping. After the option is set, multiple identical ports can be bound to the local port. Commonly, this optional which is set on servers.

  • SO_UDPCHECKSUM: after the option is set, the socket calculates the checksum of UDP packets.

  • SO_SENDVPNID: is an option for VPN.

  • SO_USELOOPBACK: After the option is set, socket can use Loopback interface to receive or send data.

  • SO_LINGER: After the option is set, the time for closing the TCP connection is considered. If the time is not set to 0, the TCP connection is closed after the timer times out. If the time is set to 0, the TCP connection is closed immediately.

  • SO_OOBINLINE: corresponds to the out-band data. When receiving data, the socket processes the out-band data first.

  • SO_SENDDATAIF: After the option is set, the socket uses the specified interface to receive or send data.

  • SO_SENDDATAIF_DONTSETTTL: After the option is set, socket uses the specified interface to receive or send data but does not set the value of life time to live (TTL).

  • SO_SETSRCADDR: After the option is set, the socket sets the address of the source that sends packets.

  • SO_SENDBY_IF_NEXTHOP: After the option is set, the socket sets the outbound interface and the next hop of the packet.

VPNID (14849)

VPN ID

socket state = SS_PRIV SS_ASYNC

Status of the socket:
  • SS_NOFDREF: socketid is deleted.

  • SS_ISCONNECTED: TCP connection is set up.

  • SS_ISCONNECTING: TCP is being connected.

  • SS_ISDISCONNECTING: TCP connection is being closed.

  • SS_CANTSENDMORE: The socket cannot send data.

  • SS_CANTRCVMORE: The socket cannot receive data.

  • SS_RCVMARK: The socket set the receiving option in the received packet.

  • SS_NBIO: The type of the socket is non-blocked.

  • SS_ISCONFIRMING: the connection to be processed by the upper layer.

  • SS_BLOCKING: the block in the receiving and sending of packets.

  • SS_RECALL: the message notification method set by the asynchronous socket.

  • SS_PRIV: the option transferred from the Unix. The option is pointless in the current socket.

  • SS_ASYNC: the state identifier of the asynchronous socket.

Asyn Que status

Status of the current asynchronous queue.

read=0

Number of the message read by the current asynchronous queue is 0.

write=0

Number of the messages written by the current asynchronous queue is 0.

connect=0

Number of the connection message in the current asynchronous queue is 0.

close=0

Number of the messages about closed connections in the current asynchronous queue is 0.

peerclose=0

Number of the messages about connections closed by the remote end in the current asynchronous queue is 0.

accept=0

Number of messages accepted by the current asynchronous queue is 0.

keepalivedown=0

Number of the keepalive messages in the asynchronous queue is 0.

cram time=00H00M00S

Time of the asynchronous queue becoming full is 0 hours 0 minutes, and 0 seconds.

lost msg=0

Number of the asynchronous messages discarded by the asynchronous queue is 0.

msg type

Type of the current asynchronous messages.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >