What do the states displayed with the display tcp status command mean?
<NE40>dis tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
0c7c6564 79 /1 0.0.0.0:21 0.0.0.0:0 14849 Listening
0bf5a7e4 49 /1 0.0.0.0:23 0.0.0.0:0 14849 Listening
0c80e504 49 /3 126.96.36.199:23 188.8.131.52:4390 0 Established
0b1c57e4 49 /4 184.108.40.206:23 220.127.116.11:3617 0 Established
This command is generally used to locate problems related to TCP, especially the disconnection of BGP, LDP, FTP, or Telnet sessions. For all upper-layer protocols using TCP as the transmission protocol, we can use this command to immediately learn the current TCP status. Before viewing the TCP status, we need to know the roles of both ends, that is, which is the client and which is the server, between which the TCP connection is set up. Generally, the port of the server has the well-known port number, such as 179 for the BGP server, 646 for the LDP server, 21/20 for the FTP server, and 23 for the Telnet server.
From the preceding information, we can find four TCP connections exist currently, including three Telnet connections and one FTP connection. In addition, the local device at 18.104.22.168 serves as the server.
Note: What we need to learn is the TCP states, which are divided into the following:
Listening: Indicates that the server is in the listening state, that is, the initial TCP state. At this time, the TCP server only monitors the port.
syn_sent: Indicates that the client initiates the first handshake, that is, the first SYN packet.
syn_rcvd: Indicates that the server receives the first handshake, that is, the SYN packet received by the server from the client.
Established: Indicates that the TCP connection is established.
fin_wait_1: Indicates that the device initiatively shutting down the TCP connection sends the FIN packet to the peer device.
Fin_wait_2: Indicates that the device initiatively shutting down the TCP connection sends the FIN packet and receives the FIN packet from the peer device.
time_wait: Indicates that the device initiatively shutting down the TCP connection receives the FIN and ACK packets from the other device.
close_wait: Indicates that the device passively shutting down the TCP connection receives the FIN packet from the device initiatively shutting down the TCP connection.