解析 IPv4 packet headers
IPv4 headers 包含源/目标 IPs, TTL, 协议, 和 fragmentation info. Learn 到解码 IP headers 为 packet 分析.
- 1
IPv4 头是 20-60 bytes. Fields: version + IHL (1 字节), DSCP + ECN (1), 总计长度 (2), identification (2), flags + 片段 offset (2), TTL (1), 协议 (1), checksum (2), 源 IP (4), dest IP (4), options (0-40). 协议: 6=TCP, 17=UDP, 1=ICMP, 89=OSPF.
- 2 十六进制解码器 →
解码 the hex representation of an IPv4 header. The first nibble is version (4), second is IHL (header length in 32-bit words, usually 5 = 20 bytes). Bytes 8-9 are TTL and protocol. Bytes 12-15 are source IP, 16-19 are destination IP.
- 3 IP 信息查询器 →
Look 上源 和目标 IP addresses 到理解网络上下文. Determine 如果它们是 私有/公共, 什么网络它们 belong 到, 和是否 packet 是是 routed 或 switched.
常见问题
- 什么是 TTL 和为什么它 matter?
- Time 到 Live 是 decremented 通过每个路由器. 当它 reaches 0, packet 是 dropped (和 ICMP Time Exceeded 是 sent). 此 prevents packets 从 circulating 永远在 routing loops. 典型 values: 64 (Linux), 128 (Windows), 255 (Cisco). Traceroute 我们 incrementing TTL 到发现路径.
- 如何 IP fragmentation 工作?
- 如果 packet exceeds MTU (通常 1500 bytes), 路由器 fragments 它. 每个片段有 相同 identification 字段但 不同片段 offsets. MF (更多 Fragments) 标志是 集合开 所有但 最后. 目标 reassembles. Avoid fragmentation 具有 PMTUD 或集合 DF (Don't 片段) 标志.