< Home

display tcp status

Function

The display tcp status command displays and monitors TCP connections at any time.

Format

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

Parameters

Parameter Description Value

task-id task-id

Specifies the task ID. The status of the TCP connection with the specified task ID is displayed.

The value is an integer, ranging from 1 to 200.

socket-id socket-id

Specifies the socket ID. The status of the TCP connection with the specified socket ID is displayed.

The value is an integer, ranging from 1 to 14848.

local-ip ipv4-address

Specifies the IP address of the local device. The TCP connection status of the specified IP address is displayed.

-

local-port local-port-number

Specifies the port number of the local device. The TCP connection status of the specified port number is displayed.

The value ranges from 0 to 65535.

remote-ip ipv4-address

Specifies the IP address of the remote device. The TCP connection status of the specified IP address is displayed.

-

remote-port remote-port-number

Specifies the port number of the remote device. The TCP connection status of the specified port number is displayed.

The value ranges from 0 to 65535.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

You can set the filtering rules, such as task ID, socket ID, and socket type in the display tcp status command to view only information matching the rules. 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 TCP connection status on the local host.

<sysname> 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 TCP connection originated from the local IP address 0.0.0.0 and port 23.

<sysname> 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

# Display the TCP connection originated from the local IP address 0.0.0.0 and port 24.

<sysname> display tcp status local-ip 0.0.0.0 local-port 24
TCPCB    Tid/Soid Local Add:port        Foreign Add:port      VPNID  State
Table 1 Description of the display tcp status command output

Item

Description

TCPCB

TCP task control block number.

Tid/Soid

Task ID and socket ID.

Local Add:port

Local IP address of TCP connection and local port number.

Foreign Add:port

Remote IP address of TCP connection and remote port number.

VPNID

VPN ID.

State

Status of TCP connection:
  • Closed: The connection is closed.

  • Listening: The connection is being monitored.

  • Syn_Rcvd: a SYN packet is received.

  • Established: The connection has been set up.

  • Close_Wait: The user sends a FIN packet to the server to close the connection in the Established status. The server then sends an ACK packet to the user after receiving the FIN packet and changes to the Close_Wait status.

  • Fin_Wait1: The user changes to this status after sending an FIN packet to the server to close the connection.

  • Fin_Wait2: The user changes to this status after receiving an ACK packet that responds to the sent FIN packet.

  • Time_Wait: TCP enters this status after a connection is closed. When it keeps this status as two times long as the lifetime of the longest packets, the records about the closed connection are cleared.

  • Closing: The two ends close the connection simultaneously.

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