< Home

display ip socket

Function

The display ip socket command displays information about the created IPv4 sockets.

Format

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

Parameters

Parameter Description Value
monitor Displays information about the socket monitor. Information about the socket monitor is displayed together with information about the socket. -
task-id task-id Displays socket information of the task with a specified ID. The value must be an existing task ID.
socket-id socket-id Displays information about the socket with a specified ID. The value must be an existing socket ID.
socket-type socket-type Displays information about a socket of a specified type. The value is an integer. Table 1 shows the value range.
Table 1 Value range of socket-type socket-type

Value

Description

1

TCP socket

2

UDP socket

3

RAWIP socket

4

RAWLINK socket

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

A socket monitor monitors and records each connection. A RawLink also monitors interfaces. The socket monitor records specific protocol events that occur during operations. In addition, it logs information in the disk space.

The socket monitor is similar to a black box of the system. It records specific events that happen during system operations. When the system fails, you can use information recorded by the socket monitor to locate faults.

You can also set the filtering rules, such as the task ID, socket ID, and socket type so that only the information matching the rules is displayed. This reduces information output and helps you locate faults accurately and efficiently.

Example

# Display information about the IP sockets.
<HUAWEI> 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_LINGER SO_REUSEPORT SO_SENDVPNID(23553) SO_SETKEEPALIVE SO_SETACL,
socket state = SS_PRIV SS_ASYNC
                          Socket Monitor:
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peer close = 0, accept = 0, keep alive down = 0,
 cram time = 0000-00-00 00:00:00+08:00, lost msg= 0, msg type=0x00000000;
Nothing else has been captured!
SOCK_DGRAM: 
Task = DHCP(54), 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 = 0000-00-00 00:00:00+00:00, full times = 0,dropped packets = 0;
Asyn Que status: 
 read = 0, write = 0, connect = 0, close = 0, 
 peer close = 0, accept = 0, keep alive down = 0, 
 smb input = 0, smb output = 0, smooth over = 0,
 cram time = 0000-00-00 00:00:00+00:00, lost msg = 0, msg type = 0x00000000;
# Display the information about the IP socket with the task ID as 23 and socket ID as 1.
<HUAWEI> 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,
 peer close = 0, accept = 0, keep alive down = 0,
 smb input = 0, smb output = 0, smooth over = 0,
 cram time = 00H00M00S, lost msg = 0, msg type = 0x00000000;
# Display information about the IP socket with the socket type as TCP.
<HUAWEI> display ip socket monitor socket-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_SETKEEPALIVE,
socket state = SS_PRIV SS_ASYNC
                          Socket Monitor:
Asyn Que status:
 read = 0, write = 0, connect = 0, close = 0,
 peer close = 0, accept = 0, keep alive down = 0,
 cram time = 0000-00-00 00:00:00+00:00, 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 types. There are the following socket types:
  • SOCK_STREAM

  • SOCK_DGRAM

  • SOCK_RAWLINK

  • SOCK_RAWIP

Task

Type and ID of the task that invokes the socket. For example, Task = VTYD(30) indicates that the task named VTYD uses the socket, with the task ID being 30.

socketid

Socket ID.

Proto

Protocol number.

LA

Local address/port number.

FA

Remote address/port number.

sndbuf

Maximum socket send buffer size. The value is in bytes.

rcvbuf

Maximum socket receive buffer size. The value is in bytes.

sb_cc

Number of sent packets. The value is in bytes and is valid only when TCP caches data packets.

rb_cc

Number of received packets. The value is in bytes.

socket option

Set socket options. There are the following socket options:
  • SO_DEBUG: indicates that debugging is enabled.

  • SO_ACCEPTCONN: indicates that the socket is the server and is responsible for monitoring.

  • SO_REUSEADDR: indicates that addresses are overlapped. After the option is set, multiple identical addresses can be bound to an interface.

  • SO_KEEPALIVE: indicates that the keepalive timer starts after a TCP connection is set up.

  • SO_DONTROUTE: indicates that a socket must choose the direct route to the destination when setting up a connection.

  • SO_BROADCAST: indicates that an interface can send broadcast packets.

  • SO_REUSEPORT: indicates that interfaces are overlapped. After the option is set, multiple identical interfaces can be bound to the local interface. This option is often set on servers.

  • SO_UDPCHECKSUM: indicates that the socket calculates the checksum of UDP packets.

  • SO_SENDVPNID: indicates an exclusive option for VPNs.

  • SO_SETKEEPALIVE: indicates that the keepalive timer starts after a TCP connection is set up.

  • SO_SETACL: indicates that an ACL can be configured on the interface.

  • SO_USELOOPBACK: indicates that a socket can use a loopback interface to receive or send data.

  • SO_LINGER: indicates the time for closing a TCP connection. If the time is not set to 0, a TCP connection is closed after the timer expires. If the time is set to 0, a TCP connection is closed immediately.

  • SO_OOBINLINE: indicates out-band data. When receiving data, a socket processes the out-band data first.

  • SO_SENDDATAIF: indicates that a socket uses the specified interface to receive or send data.

  • SO_SENDDATAIF_DONTSETTTL: indicates that a socket uses the specified interface to receive or send data but does not set the TTL value.

  • SO_SETSRCADDR: indicates that a socket sets the source address of outgoing packets.

  • SO_SENDBY_IF_NEXTHOP: indicates that a socket sets the outbound interface and next hop address of outgoing packets.

socket state

Socket status. There are the following socket states:
  • SS_NOFDREF: indicates that the socket ID is deleted.

  • SS_ISCONNECTED: indicates that a TCP connection is set up.

  • SS_ISCONNECTING: indicates that a TCP connection is being set up.

  • SS_ISDISCONNECTING: indicates that a TCP connection is being closed.

  • SS_CANTSENDMORE: indicates that a socket cannot send data.

  • SS_CANTRCVMORE: indicates that a socket cannot receive data.

  • SS_RCVMARK: indicates that a socket sets the receiving option in the received packet.

  • SS_NBIO: indicates that the type of a socket is non-blocking.

  • SS_ISCONFIRMING: indicates that the upper-layer application will complete processing a connection.

  • SS_BLOCKING: indicates that congestion occurs during packet receiving and sending.

  • SS_RECALL: indicates that the message notification method is set by an asynchronous socket.

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

  • SS_ASYNC: indicates the status identifier of an asynchronous socket.

Asyn Que status

Current asynchronous queue status.

read

Number of messages read by the asynchronous queue.

write

Number of messages written by the asynchronous queue.

connect

Number of connection messages in the asynchronous queue.

close

Number of messages about closed connections in the asynchronous queue.

peer close

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

accept

Number of messages received by the asynchronous queue.

keep alive down

Number of keepalivedown messages in the asynchronous queue.

cram time

Time for the asynchronous queue to become full.

lost msg

Number of asynchronous messages discarded by the asynchronous queue.

msg type

Current asynchronous message type.

smb input

Number of times of notifying the application layer to read received packets on the backup board.

smb output

Number of times of notifying the application layer to read sent packets on the backup board.

smooth over

Number of times of notifying the application layer that the smoothing is over.

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