Network Note

Daily Note

Netstat

1
2
3
4
5
6
7
8
$ netstat
-a : All Ports
-at : TCP Ports
-au : UDP Ports
-l : List Listened Ports
-p : List PID && Name
-ie : Network List
-s : Statistic Data

TCP && UDP

TCP: 三次握手 connect() (Stream Type)
ACK ACKnum SYN seq
close() 四次挥手
FIN seq

 优化: KeepAlive => avoid half-connection usage waste
 send package to check whether the connection is alive

 Disadvantage: - More useless wlan transition
               - Fail when process unit is 100%

优化: 超时重传、累计重传

 SYN攻击(Netstat 检测)

UDP: 不可靠的文件传输协议 (报文 长度Limit)
拥塞不支持
假的校验头
数据不备份
无连接

But => 速度快 方便 容错
(TFTP)

优化: DCCP

lsof

1
$ lsof

-u: search for user

-attach with files(exp. /bin/bash)

-c $argv === | grep $argv

-i network list

-n nfs files list

Linux environment path and stat command

All the command can be run in the terminal must be registed in the environment path.

use nlof to get back rm-ed files seems unpromising…

Share