Security code: There is no degree of loneliness is impossible to have inner peace.
we learn by TCP individual states , you can exclude and the It is helpful to locate network or system failures. View the number of connections to the server through the netstat command.
Netstat-an|awk '/tcp/{print $6} ' |sort|uniq-c 2 close_wait CLOSING established fin_wait1 Fin_wait2 4 last_ack 5 LISTEN syn_recv 295 time_wait
| State |
Describe |
| CLOSED |
Without any connection |
| LISTENING |
Listening for connection requests from a remote TCP port |
| Syn-sent |
Application has started, open a connection |
| Syn-received |
A connection request has arrived, waiting for confirmation |
| Established |
Represents an open connection |
| Fin-wait-1 |
Waiting for a remote TCP connection to interrupt the request, or the acknowledgement of a previous connection interrupt request |
| Fin-wait-2 |
Waiting for connection interrupt request from remote TCP |
| Close-wait |
Waiting for a connection interrupt request from a local user |
| CLOSING |
Wait for the remote TCP acknowledgement of the connection interruption |
| Last-ack |
Acknowledgement of the connection interrupt request waiting for the original send to remote TCP |
| Time-wait |
Wait enough time to ensure that the remote TCP receives a connection interrupt request acknowledgement |
1, the state of the client can be represented by the following process:
Closed->syn_sent->established->fin_wait_1->fin_wait_2->time_wait->closed
2, the status of the server can be represented by the following process:
Closed->listen->syn_received->established->close_wait->last_ack->closed
This article is from the "Concise Linux" blog, so be sure to keep this source http://easylinux.blog.51cto.com/9732761/1945539
Count the number of Linux server connections