http://www.2cto.com/net/201307/227923.html
有关 ICMP 报文的格式和规则的介绍。
ICMP 协议问题。
1. What is the IP address of your host? What is the IP address of the destination
host?
答:目的地址:143.89.14.2;主机 ip:10.77.11.217;
2. Why is it that an ICMP packet does not have source and destination port
numbers?
答:ICMP 数据包里没有保护源主机和目的主机的端口信息是因为:ICMP 协议是运行在网
络层之上,基于主机和路由器之间,而不是应用层的应用进程。每个 ICMP 数据包用类型和
编号累标识特定的信息。既然 ICMP 数据包是由网络层软件负责解释,那没有必要使用端口
号。
3. Examine one of the ping request packets sent by your host. What are the ICMP type and
code numbers? What other fields does this ICMP packet have? How many bytes are the
checksum, sequence number and identifier fields?
答:类型是 8;code 编号是 0;
ICMP 还包括:checksum 检查和;sequence number(序列号); identifier(标识符);
data(数据);
checksum 检查和;sequence number(序列号); identifier(标识符)都有 2 bytes;
4. Examine the corresponding ping reply packet. What are the ICMP type and code
numbers? What other fields does this ICMP packet have? How many bytes are the
checksum, sequence number and identifier fields?
答:type:0;code:0;
和 request 相同的是 checksum 检查和;sequence number(序列号); identifier(标
识符);data(数据);其次还有一个 response time;
checksum 检查和;sequence number(序列号); identifier(标识符)都有 2 bytes;
5. What is the IP address of your host? What is the IP address of the target
destination host?
答:destination ip:128.93.162.84;
6. If ICMP sent UDP packets instead (as in Unix/Linux), would the IP protocol number still
be 01 for the probe packets? If not, what would it be?
答::如果 ICMP 发送 UDP 数据报,IP 协议号应该为 0x11.十进制为 17,表明交给 UDP
7. Examine the ICMP echo packet in your screenshot. Is this different from the
ICMP ping query packets in the first half of this lab? If yes, how so?
答:二者具有相同的字段。
(有问题)8. Examine the ICMP error packet in your screenshot. It has more fields than
the ICMP echo packet. What is included in those fields?
答:当 checksum status 的 good 的时候是这样的:包括一个 IP 字段和上一个 ICMP 字段。
(该字段包括了 IP 数据包首部和引起该 ICMP 报文首次生成的 IP 数据包的前 8 bytes 内容,
以便发送方能够确定引发该差错的数据报)
如果 checksum status 的显示是 incorrect ,则只有 ip 没有 icmp。
解释如下:
超时 ICMP 中的显示的 ICMP 信息,与它上一个 request 中的一样。
上一个 request 的 icmp
9. Examine the last three ICMP packets received by the source host. How are these packets
different from the ICMP error packets? Why are they different?
答:reply 数据报的类型是 0;但是超时的 icmp 的类型是 11;
(有问题)原因:由于数据包的原因,使得这些 ICMP 报文可以在 TTL 过期之前到达目的地。
10. Within the tracert measurements, is there a link whose delay is significantly longer than
others? Refer to the screenshot in Figure 4, is there a link whose delay is significantly longer
than others? On the basis of the router names, can you guess the location of the two routers
on the end of this link?
答:由于这个超时过多,所以根据仅有的数据分析,在最后一跳中时延比较大,但是我无法
分析出该链路的两端。
ICMP
英文原义:Internet Control Message Protocol
中文释义:(RFC-792)Internet 控制消息协议
注解:该协议是 TCP/IP 协议集中的一个子协议,属于网络层协议,主要用于在
主机与路由器之间传递控制信息,包括报告错误、交换受限控制和状态信息等。
当遇到 IP 数据无法访问目标、IP 路由器无法按当前的传输速率转发数据包等情
况时,会自动发送 ICMP 消息。我们可以通过 Ping 命令发送 ICMP 回应请求消
息并记录收到 ICMP 回应回复消息,通过这些消息来对网络或主机的故障提供参
考依据。
应 用:要使用该协议,我们可以进行相应的 ICMP 设置,比如在 Windows XP
中,首先打开“网络连接”,右键单击启用 Internet 连接防火墙的“网络连接”,
选择“属性”打开属性窗口。接着,选择“高级”选项卡,单击右下角“设置”
按钮。然后,在高级设置窗口中选择“ICMP”选项卡,在其中就可以进行相应
的设置,包括允许传入的回显请求等。
ICMP 是“Internet Control Message Protocol”(Internet 控制消息协议)
的缩写。它是 TCP/IP 协议族的一个子协议,用于在 IP 主机、路由器之间传递控
制消息。控制消息是指网络通不通、主机是否可达、路由是否可用等网络本身的
消息。这些控制消息虽然并不传输用户数据,但是对于用户数据的传递起着重要
的作用。
我们在网络中经常会使用到 ICMP 协议,只不过我们觉察不到而已。比如我们经
常使用的用于检查网络通不通的 Ping 命令,这个“Ping”的过程实际上就是
ICMP 协议工作的过程。还有其他的网络命令如跟踪路由的 Tracert 命令也是基
于 ICMP 协议的。
ICMP 的重要性
ICMP 协议对于网络安全具有极其重要的意义。ICMP 协议本身的特点决定了它
非常容易被用于攻击网络上的路由器和主机.
比如,可以利用操作系统规定的 ICMP 数据包最大尺寸不超过 64KB 这一规定,
向主机发起“Ping of Death”(死亡之 Ping)攻击。“Ping of Death” 攻击
的原理是:如果 ICMP 数据包的尺寸超过 64KB 上限时,主机就会出现内存分配
错误,导致 TCP/IP 堆栈崩溃,致使主机死机。
此外,向目标主机长时间、连续、大量地发送 ICMP 数据包,也会最终使系统瘫
痪。大量的 ICMP 数据包会形成“ICMP 风暴”,使得目标主机耗费大量的 CPU
资源处理,疲于奔命。
应对 ICMP 攻击
虽然 ICMP 协议给黑客以可乘之机,但是 ICMP 攻击也并非无药可医。只要在日
常网络管理中未雨绸缪,提前做好准备,就可以有效地避免 ICMP 攻击造成的损
失。
对于“Ping of Death”攻击,可以采取两种方法进行防范:第一种方法是在路
由器上对ICMP数据包进行带宽限制,将 ICMP占用的带宽控制在一定的范围内,
这样即使有 ICMP 攻击,它所占用的带宽也是非常有限的,对整个网络的影响非
常少;第二种方法就是在主机上设置 ICMP 数据包的处理规则,最好是设定拒绝
所有的 ICMP 数据包。
设置 ICMP 数据包处理规则的方法也有两种,一种是在操作系统上设置包过滤,
另一种是在主机上安装防火墙。