tcpdump-icmp-ip报文分片
介绍主要演示了tcpdump捕捉icmp报文以及用ping命令指定icmp长度后ip分组的查看。 A发起正常包pingC:\Users\yaxia>ping 10.70.30.60正在 Ping 10.70.30.60 具有 32 字节的数据:来自 10.70.30.60 的回复: 字节=32 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=32 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=32 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=32 时间<1ms TTL=6410.70.30.60 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位): 最短 = 0ms,最长 = 0ms,平均 = 0msB 端查看结果root@php56:/home/tb# tcpdump -ntv -i enp0s3 icmptcpdump: listening on enp0s3, link-type EN10MB (Ethernet), capture size 262144 bytesIP (tos 0x0, ttl 128, id 27746, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4795, length 40IP (tos 0x0, ttl 64, id 30075, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4795, length 40IP (tos 0x0, ttl 128, id 27748, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4796, length 40IP (tos 0x0, ttl 64, id 30127, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4796, length 40IP (tos 0x0, ttl 128, id 27750, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4797, length 40IP (tos 0x0, ttl 64, id 30365, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4797, length 40IP (tos 0x0, ttl 128, id 27752, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4798, length 40IP (tos 0x0, ttl 64, id 30534, offset 0, flags [none], proto ICMP (1), length 60) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4798, length 40A发送大于MTU的数据包C:\Users\yaxia>ping 10.70.30.60 -l 1473正在 Ping 10.70.30.60 具有 1473 字节的数据:来自 10.70.30.60 的回复: 字节=1473 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=1473 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=1473 时间<1ms TTL=64来自 10.70.30.60 的回复: 字节=1473 时间<1ms TTL=6410.70.30.60 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位): 最短 = 0ms,最长 = 0ms,平均 = 0msB接收结果(可以看到ip包多了一倍)P (tos 0x0, ttl 128, id 27801, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4799, length 1480IP (tos 0x0, ttl 128, id 27801, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.47 > 10.70.30.60: ip-proto-1IP (tos 0x0, ttl 64, id 10022, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4799, length 1480IP (tos 0x0, ttl 64, id 10022, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.60 > 10.70.30.47: ip-proto-1IP (tos 0x0, ttl 128, id 27803, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4800, length 1480IP (tos 0x0, ttl 128, id 27803, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.47 > 10.70.30.60: ip-proto-1IP (tos 0x0, ttl 64, id 10189, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4800, length 1480IP (tos 0x0, ttl 64, id 10189, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.60 > 10.70.30.47: ip-proto-1IP (tos 0x0, ttl 128, id 27805, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4801, length 1480IP (tos 0x0, ttl 128, id 27805, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.47 > 10.70.30.60: ip-proto-1IP (tos 0x0, ttl 64, id 10418, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4801, length 1480IP (tos 0x0, ttl 64, id 10418, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.60 > 10.70.30.47: ip-proto-1IP (tos 0x0, ttl 128, id 27807, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4802, length 1480IP (tos 0x0, ttl 128, id 27807, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.47 > 10.70.30.60: ip-proto-1IP (tos 0x0, ttl 64, id 10429, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.60 > 10.70.30.47: ICMP echo reply, id 1, seq 4802, length 1480IP (tos 0x0, ttl 64, id 10429, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.60 > 10.70.30.47: ip-proto-1摘出来一个被分片的ip数据包IP (tos 0x0, ttl 128, id 27801, offset 0, flags [+], proto ICMP (1), length 1500) 10.70.30.47 > 10.70.30.60: ICMP echo request, id 1, seq 4799, length 1480IP (tos 0x0, ttl 128, id 27801, offset 1480, flags [none], proto ICMP (1), length 21) 10.70.30.47 > 10.70.30.60: ip-proto-1简单解释id都为27081,说明为同一个ip数据报的分片。第一个ip分组的offset 为0,第二个为1480.第一个ip分组的flags为+,实则设置了MF标志,表示后续还有分片,第二个flag为none第一个ip分组长度为1500,第二个为21-l 1473字节的由来win下查看A端mtu ...