http://www.cublog.cn/u1/37897/showart_311127.html
IP/IPv4协议结构 4 8 16 32bit
Version IHL Type of service Total length
Identification Flags Fragment offset
Time to live Protocol Header checksum
Source address
Destination address
Option + Padding
Data
Version - 4位字段,指出当前使用的 IP 版本。
IP Header Length (IHL) ― 指数据报协议头长度,具有32位字长。指向数据起点。正确协议头最小值为5。
从资料上找和图上看 IHL的长度是4位 ,可这里为什么说具有32位字长????
IP/IPv4协议结构 4 8 16 32bit
Version IHL Type of service Total length
Identification Flags Fragment offset
Time to live Protocol Header checksum
Source address
Destination address
Option + Padding
Data
Version - 4位字段,指出当前使用的 IP 版本。
IP Header Length (IHL) ― 指数据报协议头长度,具有32位字长。指向数据起点。正确协议头最小值为5。
从资料上找和图上看 IHL的长度是4位 ,可这里为什么说具有32位字长????
4BYTE = 32bit
不带选项的IP头IHL为:
1、Version IHL Type of service Total length
2、Identification Flags Fragment offset
3、Time to live Protocol Header checksum
4、Source address
5、Destination address
共5个
ihl值为1 则ip头为4字节 即32bit
ihl值为2 则ip头为8字节其实iph的值至少为5,因为ip头最短为20字节这些都是tcp/ip协议中最基础的东西了