Use the Netstat-an command to view! Stat. Here are some English, simply say what these English specifically represent:
LISTEN: (Listening for a connection.) Listening for connection requests from a remote TCP port
Syn-sent: (Active; SENT SYN. Waiting for a matching connection request after having SENT a connection request.) Wait for a matching connection request after sending the connection request again
Syn-received: (Sent and RECEIVED SYN. Waiting for a confirming connection request acknowledgment after have both RECEIVED and sent connection requests.) Wait for confirmation of the connection request after receiving and sending a connection request
Established: (Connection established.) Represents an open connection
Fin-wait-1: (Closed; sent FIN.) Waiting for a remote TCP connection to interrupt the request, or the acknowledgement of a previous connection interrupt request
Fin-wait-2: (Closed; FIN is acknowledged; Awaiting FIN.) Waiting for connection interrupt request from remote TCP
Close-wait: (Received FIN; waiting to receive CLOSE.) Waiting for a connection interrupt request from a local user
CLOSING: (Closed; exchanged fin; waiting for Fin.) Wait for the remote TCP acknowledgement of the connection interruption
Last-ack: (Received fin and CLOSE; waiting for Fin ACK.) Acknowledgement of the connection interrupt request waiting for the original send to remote TCP
Time-wait: (in 2 MSL (twice the maximum segment length) quiet WAIT after close.) Wait enough time to ensure that the remote TCP receives a connection interrupt request acknowledgement
CLOSED: (Connection is CLOSED.) No connection Status
TCP connection Setup
The first thing to note is that the process of establishing a TCP connection requires 3 handshakes, and the following examples illustrate the moment of existence of the various states:
1. First open the FTP service on Server A and start listening for connection requests from the remote TCP port, at this time view Server a status: LISTENING
2. On client B, send an FTP connection request to A, this time packet synchronization location 1, this is the first step of the TCP three handshake. When the acknowledgment is confiscated after sending, on client B its status is: Syn-sent. At this point, client B initiates the connection timer. If the answer is not received within 75 seconds, the connection is discarded.
3. After receiving the SYN synchronization packet sent from B on Server A, confirm, and then send the SYN synchronization packet to B, this packet will both synchronize bits in TCP token and confirm location 1, it confirms the client synchronization packet in the first step, and indicates the willingness to synchronize with the client. Synchronous requests are made to the client host at the same time, which is the first step of the TCP connection. At this time on server A, the status is: Syn-received. At this point, server A initiates the connection timer. If the answer is not received within 75 seconds, the connection is discarded.
4. On client B received confirmation from the confirmation of the synchronization packet sent from a, this packet will be in the TCP token confirmation location 1, indicating that this is a confirmation packet, at this time in the client B state transitions to: established
5. When server A receives a confirmation packet sent from B, the status transitions to: Established
The TCP connection is now formally established.
TCP connection Shutdown
6. Client B is in the Fin-wait-1 state when the application sends a FIN packet of termination information to server A through client B when the connection is not needed.
7. From server A receives the terminating packet sent by client B, which tells client B to successfully receive the packet on the client and waits for the application to close the connection at which point server A enters the close_wait state.
8. After client B receives a packet with a confirmation bit, it confirms that it agrees to close the TCP connection at this point when client B is transferred to the Fin-wait-2 state. When the connection is transferred from the Fin-wait-1 state to the Fin-wait-2 state, a fin-wait-2 timer is set to 10 minutes.
9. Server A terminates the Fin packet to client B after the application has agreed to terminate the connection, and the server state is converted to last-act.
10. After receiving the termination packet from server A, client B agrees to terminate the connection and then sends the acknowledgement to the server, at which point the client B turns to the time-wait state. When the connection enters the time-wait state, the timer is activated.
11. Server A after receiving confirmation from client B, turn off the connection, and then turn on closed.
12. When client B expires in the time-wait timer, the kernel data block associated with the connection is deleted, the connection terminates, and the closed state is turned.
The TCP connection is formally closed at this time.
Note
1. A client-initiated shutdown of a TCP connection:
2. Connection termination request to the connection with the establishment of the two parties can be issued at the same time, after the termination of the request, both sides into the fin-wait-1 state, with the timer timeout, both sides into the closing state, after the timer again timeout, are transferred to Time-wait State, After the time-wait timer expires, both parties abandon the connection and the connection is switched to the close state. Shown
Netstat status classification