display tcp status

Function

The display tcp status command displays information about IPv4 TCP connections.

Format

display tcp status [ local-ip ipv4-address | local-port local-port-number | remote-ip ipv4-address | remote-port remote-port-number ] * [ cid cid ] [ socket-id socket-id ]

Parameters

Parameter Description Value
local-ip ipv4-address

Displays the IPv4 TCP connection with a specified local IP address.

The address is a 4-digit number, in the format of X.X.X.X.

local-port local-port-number

Displays the IPv4 TCP connection with a specified local port number.

The value ranges from 0 to 65535.

remote-ip ipv4-address

Displays the IPv4 TCP connection with a specified remote IP address.

The address is a 4-digit number, in the format of X.X.X.X.

remote-port remote-port-number

Displays the IPv4 TCP connection with a specified remote port number.

The value ranges from 0 to 65535.

cid cid

Displays the IPv4 TCP connection with a specified APP CID.

The value is a hexadecimal integer that ranges from 0 to ffffffff.

socket-id socket-id

Displays the IPv4 TCP connection with a specified socket ID.

TThe value is an integer that ranges from 0 to 2147418111.

Views

All views

Default Level

1: Monitoring level

Task Name and Operations

Task Name Operations
ip-stack read

Usage Guidelines

Usage Scenario

TCP defined in standard protocols ensures high-reliability transmission between hosts. TCP provides reliable, connection-oriented, and full-duplex services for user processes. To monitor the TCP connection status, run the display tcp status command to check the following information:

  • IPv4 TCP socket ID
  • APP CID
  • Local IPv4 address and port number
  • Remote IPv4 address and port number
  • VPN ID
  • IPv4 TCP connection status

    A filtering rule, such as a socket ID, local IP address, local port number, remote IP address, or remote port number, can be specified so that only the information matching the rule is displayed. This reduces the amount of output information, improving output information usability and fault locating accuracy and efficiency.

Precautions

If no TCP connection is available, the command output is empty.

Example

The actual command output varies according to the device. The command output here is only an example.

# Display the status of IPv4 TCP connections.
<HUAWEI> display tcp status
* - MD5 Authentication is enabled.
# - Keychain Authentication is enabled.
@ - TCP-AO Authentication is enabled.
--------------------------------------------------------------------------------
Cid/SocketID     Local Addr:Port       Foreign Addr:Port     VPNID      State        
--------------------------------------------------------------------------------
0x80C8272D/2     0.0.0.0:23            0.0.0.0:0             1          LISTEN*       
0x80932727/6     0.0.0.0:22            0.0.0.0:0             1          LISTEN#       
0x8013048B/3     0.0.0.0:179           10.0.2.2:0            1          LISTEN@ 
--------------------------------------------------------------------------------
Table 1 Description of the display tcp status command output
Item Description
MD5 Authentication is enabled

MD5 authentication mode enabled.

Keychain Authentication is enabled

Keychain authentication mode enabled.

TCP-AO Authentication is enabled

TCP-AO authentication mode enabled.

Cid/SocketID

Task ID and socket ID.

Local Addr:Port

Local IP address and port number of a TCP connection.

If the value of Local Add is 0.0.0.0, all addresses are monitored. If the value of port number is 0, all port number are monitored.

Foreign Addr:Port

Remote IP address and port number of a TCP connection.

If the value of Foreign Add is 0.0.0.0, all addresses are monitored. If the value of port number is 0, all port number are monitored.

VPNID

Local VPN ID.

State

TCP connection status:

  • Closed: A TCP connection has not been started or has been torn down.
  • Listening: A TCP connection is being listened to.
  • Syn_Rcvd: A packet with the SYN flag is received.
  • Established: A TCP connection has been established.
  • Close_Wait: In the Established state, a user sends a FIN packet to the server, requesting connection termination. After receiving the FIN packet, the server sends an ACK packet to the user and enters the Close_Wait state.
  • Fin_Wait1: A user enters this state after sending a FIN packet to the server to request the server to tear down the connection.
  • Fin_Wait2: A user enters this state after receiving an ACK packet from the server.
  • Time_Wait: TCP enters this state after a TCP connection is torn down. When TCP remains in this state for twice the length of the longest packet's lifetime, information about the TCP connection will be cleared.
  • Closing: Both ends are closing the TCP connection.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >