맨 의는 netstat각각의 상태에 대한 간단한 설명이있다 :
ESTABLISHED
The socket has an established connection.
SYN_SENT
The socket is actively attempting to establish a connection.
SYN_RECV
A connection request has been received from the network.
FIN_WAIT1
The socket is closed, and the connection is shutting down.
FIN_WAIT2
Connection is closed, and the socket is waiting for a shutdown
from the remote end.
TIME_WAIT
The socket is waiting after close to handle packets still in the
network.
CLOSE The socket is not being used.
CLOSE_WAIT
The remote end has shut down, waiting for the socket to close.
LAST_ACK
The remote end has shut down, and the socket is closed. Waiting
for acknowledgement.
LISTEN The socket is listening for incoming connections. Such sockets
are not included in the output unless you specify the
--listening (-l) or --all (-a) option.
CLOSING
Both sockets are shut down but we still don't have all our data
sent.
UNKNOWN
The state of the socket is unknown.
상태 전환 다이어그램 (예 : 여기 , 여기 및 여기 )을 사용하여 상태를 더 잘 이해할 수 있습니다.
소켓 연결을 시도하는 두 개의 프로그램을 고려하십시오 ( a및 호출 b). 둘 다 소켓을 설정하고 LISTEN상태로 전환합니다 . 그런 다음 한 프로그램 (예 :)이 다른 프로그램 ( a)에 연결을 시도합니다 b. a요청을 보내고 SYN_SENT상태를 입력 한 b후 요청을 수신하고 SYN_RECV상태를 입력합니다 . 때 b수신 확인을 요청, 그들은 입력 ESTABLISHED상태를 자신의 사업을 할. 이제 몇 가지 일이 발생할 수 있습니다.
a연결을 닫고을 입력 FIN_WAIT1합니다. b수신하고 FIN, 요청을 전송 ACK(다음 a입사 FIN_WAIT2), 진입 CLOSE_WAIT, 지시 a가 폐쇄되고,이 들어간다 LAST_ACK. 이를 a확인하고 (를 입력 한 후 TIME_WAIT)를 b입력하십시오 CLOSE. a남아있는 것이 있는지 조금 기다렸다가을 입력 CLOSE합니다.
a그리고 b그들의 사업을 완료하고 연결 (동시 폐쇄를) 종료하기로 결정했다. 경우 a에 FIN_WAIT, 그리고 대신 수신 ACK에서 b, 그것은 수신 FIN(AS b소원뿐만 아니라 그것을 폐쇄) a들어간다 CLOSING. 그러나이 전송에 여전히 일부 메시지는합니다 (있는 ACK그 a원래 얻을 것으로 예상되는 FIN)이 일단 ACK도착, a들어가 TIME_WAIT평소처럼.