
计算机网络——理解TCP/IP网络协议栈
SYN包用于初始化包序号,用来解决网络包乱序问题。
ACK包用于确认收到,用来解决不丢包的问题。
Understanding TCP/IP Network Stack
The Send Case
The Steps for Sending a Single Ethernet Frame
The Steps for Receiving a Single Ethernet Frame
For these steps, it's presumed that the OS has already created buffer descriptors that point to free regions in host memory and that the NIC has read these buffer descriptors into local NIC memory via DMA.
IO有两种操作,同步IO和异步IO。同步IO指的是,必须等待IO操作完成后,控制权才返回给用户进程。异步IO指的是,无需等待IO操作完成,就将控制权返回给用户进程。
四个网络分析工具:ping、tcpdump、netstat和lsof
ping
tcpdump
tcpdump可以将网络中传送的数据包的“头”完全截获下来提供分析。它支持针对协议、主机、网络或端口的过滤,并提供and、or、not等逻辑语句进行筛选。
表达式是一个正则表达式,表达式中一般包含几个关键字,如下:
netstat
用于显示与IP、TCP、UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况。netstat是在内核中访问网络及相关信息的程序,它能提供TCP连接、对TCPhenomenonUDP的监听及获取进程内存管理的相关报告。
lsof
losf(list open file)是一个列出当前系统打开文件的工具。