WALL-E / Practice

练习手册
0 stars 0 forks source link

ss - another utility to investigate sockets #10

Open WALL-E opened 7 years ago

WALL-E commented 7 years ago

Q: ss -m

ESTAB  0  0   172.16.31.158:55266    115.114.106.17:imap2    mem:(r0,w0,f0,t0)

A:

r represents the read (inbound) buffer
w represents the write (outbound) buffer
f represents the "forward allocated memory" (memory available to the socket)
t represents the transmit queue (stuff waiting to be sent or waiting on an ACK)

rmem = sk->sk_rmem_alloc; 
wmem = sk->sk_wmem_queued; 
fmem = sk->sk_forward_alloc; 
tmem = sk->sk_wmem_alloc;
WALL-E commented 7 years ago

Q: ss -t4 state established

Recv-Q Send-Q         Local Address:Port             Peer Address:Port   
0      0                192.168.1.2:54436          165.193.246.23:https   
0      0                192.168.1.2:43386          173.194.72.125:xmpp-client 
0      0                192.168.1.2:38355           199.59.150.46:https   
0      0                192.168.1.2:56198          108.160.162.37:http

A:

1. established
2. syn-sent
3. syn-recv
4. fin-wait-1
5. fin-wait-2
6. time-wait
7. closed
8. close-wait
9. last-ack
10. closing
11. all – All of the above states
12. connected – All the states except for listen and closed
13. synchronized – All the connected states except for syn-sent
14. bucket – Show states, which are maintained as minisockets, i.e. time-wait and syn-recv.
15. big – Opposite to bucket state.
WALL-E commented 7 years ago

Ref:https://www.cyberciti.biz/files/ss.html

WALL-E commented 7 years ago

查看当前通信节点以及它们响应的连接设置

ss --options --extended --memory --processess --info