< Home

display tcp status

Function

The display tcp status command displays current TCP connection status.

Format

display tcp status [ [ task-id task-id ] [ socket-id socket-id ] | [ local-ip ip-address ] [ local-port local-port-number ] [ remote-ip ip-address ] [ remote-port remote-port-number ] ]

Parameters

Parameter Description Value
task-id task-id Displays the TCP connection status of the task with a specified ID. The value must be an existing task ID.
socket-id socket-id Displays the TCP connection status of the socket with a specified ID. The value must be an existing socket ID.
local-ip ip-address Displays the TCP connection status of a specified local IP address. The value is in dotted decimal notation.
local-port local-port-number Displays the TCP connection status of a specified local port ID. The value must be an existing local port ID.
remote-ip ip-address Displays the TCP connection status a specified remote IP address. The value is in dotted decimal notation.
remote-port remote-port-number Displays the TCP connection status of a specified remote port ID. The value must be an existing remote port ID.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

The transmission control protocol defined in RFC 793 ensures high reliability of transmission between hosts. TCP provides reliable and connection-oriented services in full duplex mode. Run the display tcp status command to monitor the TCP connection status. The following information is displayed.
  • ID of the TCP task control block.
  • ID of the IPv4 TCP task and socket.
  • Local IPv4 address and port ID.
  • Remote IPv4 address and port ID.
  • ID of the VPN instance to which the TCP connection belongs.
  • IPv4 TCP connection status.

You can set filtering rules based on the Task ID, socket ID, IP address and port number of the local device, and IP address and port number of the remote device so that only the information matching the rules is displayed. This prevents unnecessary information from being displayed and helps you locate faults accurately and efficiently.

Precautions

The command output is null if there is no TCP connection.

Example

# Display the TCP connection status on the local device.

<HUAWEI> display tcp status
TCPCB    Tid/Soid Local Add:port        Foreign Add:port      VPNID  State
0a5d560c 30 /1    0.0.0.0:23            0.0.0.0:0             14849 Listening

# Display the status of the TCP connection originated from the local IP address 0.0.0.0 and port 23.

<HUAWEI> display tcp status local-ip 0.0.0.0 local-port 23
TCPCB    Tid/Soid Local Add:port        Foreign Add:port      VPNID  State
0a5d560c 30 /1    0.0.0.0:23            0.0.0.0:0             14849 Listening
Table 1 Description of the display tcp status command output

Field

Description

TCPCB

ID of the TCP task control block.

Tid/Soid

Task ID and socket ID.

Local Add: port

IP address and port number of the local device. If the value of Local Add is 0.0.0.0, TCP connections of all IP addresses are monitored. If the value of port is 0, the TCP connection of all ports is monitored.

Foreign Add: port

IP address and port number of the remote device. If the value of Foreign Add is 0.0.0.0, the TCP connection of all IP addresses is monitored. If the value of port is 0, TCP connections of all ports are monitored.

VPNID

ID of the VPN instance to which the TCP connection belongs.
  • -1: indicates all VPNs.
  • 0: indicates the public VPN.
  • Other values: indicates the private VPN. The VPNID is defined by users.

State

TCP connection status:
  • Closed: indicates that the TCP connection is closed.

  • Listening: indicates that the TCP connection is being monitored.

  • Syn_Rcvd: indicates that a packet with the SYN flag is received.

  • Established: indicates that the TCP connection has been set up.

  • Close_Wait: indicates that a user sends a packet with the FIN flag to the server to close the TCP connection in Established state. The server then sends an ACK packet to the user after receiving the packet and enters the Close_Wait state.

  • Fin_Wait1: indicates that a user sends a packet with the FIN flag to the server to close the TCP connection and enter this state.

  • Fin_Wait2: indicates that a user receives an ACK packet that responds to the sent packet with the FIN flag.

  • Time_Wait: indicates that TCP enters this state after the TCP connection is closed. When TCP has been in Time_Wait state two times the lifetime of the longest packets, records about the closed connection are deleted.

  • Closing: indicates that the user and server close the TCP connection simultaneously.

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