linux-netstat輸出的網路連接狀態資訊

來源:互聯網
上載者:User

標籤:netstat 網路連接數

[[email protected] ~]# netstat -n|head  -3Active Internet connections (w/o servers)Proto    Recv-Q   Send-Q    Local Address        Foreign Address         State      tcp        0        52     192.168.1.165:22     192.168.1.10:59337     ESTABLISHED 一共六列:第一列為socket使用的協議。[[email protected] ~]$ netstat -n |awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}‘TIME_WAIT 9137CLOSE_WAIT 207FIN_WAIT1 547ESTABLISHED 597FIN_WAIT2 74SYN_RECV 70CLOSING 55LAST_ACK 8[[email protected] ~]# man netstat OUTPUTActive Internet connections (TCP, UDP, raw)ProtoThe protocol (tcp, udp, raw) used by the socket.第一列為socket使用的協議。Recv-QThe count of bytes not copied by the user program connected to this socket.第二列為接到的但是還沒處理的位元組數。Send-QThe count of bytes not acknowledged by the remote host.第三列為已經發送的但是沒有被遠程主機確認收到的位元組數。Local AddressAddress and port number of the local end of the socket.Unless the --numeric(-n)optionisspecified,thesocketaddress is resolved to its canonical host name(FQDN), and the port number is translated into the corresponding service name.第四列為 本地的地址及連接埠。Foreign AddressAddress and port number of the remote endofthesocket.Analogousto"Local Address."第五列為外部的地址及連接埠。StateThestateofthesocket.Sincethere are no states in raw mode and usually nostates used in UDP, this column may be left blank. Normally this can be one of sev-eral values:第六列為socket的狀態,通常僅僅有tcp的狀態,狀態值可能有ESTABLISHED,SYN_SENT,SYN_RECV FIN_WAIT1,FIN_WAIT2,TIME_WAIT等,詳見下文。其中,最重要的是第六列。ESTABLISHED     establishedThe socket has an established connection.socket已經建立串連,表示處於串連的狀態,一般認為有一個ESTABLISHED認為是一個服務的並發串連。這個串連狀態在生產情境很重要,要重點關注。SYN_SENTThe socket is actively attempting to establish a connection. socket正在積極嘗試建立一個串連,即處於發送後串連前的一個等待但未匹配進入串連的狀態。SYN_RECVA connection request has been received from the network.已經從網路上收到一個串連請求。FIN_WAIT1The socket is closed, and the connection is shutting down. socket已關閉,串連正在或正要關閉。FIN_WAIT2Connectionisclosed,andthesocket is waiting for a shutdown from the remote end.串連已關閉,並且socket正在等待遠端結束。TIME_WAITThe socket is waiting after close to handle packets still in the network.socket正在等待關閉處理仍在網路上的資料包,這個串連狀態在生產情境很重要,要重點關注。CLOSED The socket is not being used.| socket不在被佔用了。CLOSE_WAITThe remote end has shutdown, waiting for the socket to close.遠端已經結束,等待socket關閉。LAST_ACKThe remote end has shut down, and the socket is closed. Waiting for acknowl-edgement.|遠端已經結束,並且socket也已關閉,等待acknowl-edgement。LISTEN Thesocketislisteningforincoming connections.Such sockets are notincluded in the output unless you specify the --listening (-l) or --all (-a)option.socket正在監聽串連請求。CLOSINGBoth sockets are shut down but we still don’t have all our data sent.sockets關閉,但是我們仍舊沒有發送資料。UNKNOWNThe state of the socket is unknown未知的狀態。


本文出自 “randolph” 部落格,請務必保留此出處http://randolph.blog.51cto.com/10900500/1909072

linux-netstat輸出的網路連接狀態資訊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.