课件:ICMP协议
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Page 6
ICMP错误报告
主机 A RTA
.2 10.0.0.0/24 .1
RTB .2
服务器 A 20.0.0.0/24 .1
数据包 ICMP 目的不可达
当网络设备无法访问目标时,会自动发送ICMP目的不可达报文到发送 端设备。
Page 7
ICMP数据包格式
Ethernet_II IP Header
Page 14
主机 A RTA
RTC
主机 B
RTB
20.0.0.2/24
30.0.0.2/24
10.0.0.2/24
<RTA>tracert ?
-a
Set source IP address, the default is the IP
address of the output interface
-f
First time to live, the default is 1
-m
Max time to live, the default is 30
-name
Display the host name of the router on each hop
-p
Destination UDP port number, the default is 33434
STRING<1-255> IP address or hostname of a remote system
……
<RTA>ping 10.0.0.2
Page 10
ICMP应用-Ping
[RTA]ping 10.0.0.2 PING 10.0.0.2 : 56 data bytes, press CTRL_C to break Reply from 10.0.0.2 : bytes=56 Sequence=1 ttl=255 time=340 ms Reply from 10.0.0.2 : bytes=56 Sequence=2 ttl=255 time=10 ms Reply from 10.0.0.2 : bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 10.0.0.2 : bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 10.0.0.2 : bytes=56 Sequence=5 ttl=255 time=30 ms
………………………………………………
<RTA>tracert 30.0.0.2
Page 12
ICMP应用-Tracert
主机 A RTA
RTC
主机 B
RTB
10.0.0.2/24
20.0.0.2/24
30.0.0.2/24
<RTA>tracert 30.0.0.2 Tracert to 30.0.0.2(30.0.0.2), max hops:30, packet length:40, press CTRL_C to break
Page 2
学习目标
学完本课程后,您应该能:
描述ICMP的应用场景 理解常见的ICMP报文类型 掌握Ping和Tracert的应用
Page 3
ICMP
主机 A
Message Return Message
ICMP用来传递差错、控制、查询等信息。
Page 4
ICMP重定向
服务器 A
20.0.0.1/24 20.0.0.2/24
重定向 Echo Request
Page 9
ICMP应用-Ping
RTA
.1
10.0.0.0/24
RTB
.2
<RTA>ping ?
-a
Select source IP address, the default is the IP address of
the output interface
-c
Specify the number of echo requests to be sent, the
1 10.0.0.2 130 ms 50 ms 40 ms 2 20.0.0.2 80 ms 60 ms 80 ms 3 30.0.0.2 80 ms 60 ms 70 ms
Tracert显示数据包在网络传输过程中所经过的每一跳。
Page 13
总结
Ping使用到的是哪两类ICMP消息? 当网络设备收到TTL值为0的IP报文时,会如何操作?
10.0.0.200/24
RTA
③
IP地址: 10.0.0.1/24 默认网关: 10.0.0.100/24
主机 A
公网
RTB
①
10.0.0.100/24
② ICMP 重定向
Page 5
ICMP差错检测
主机 A
ICMP Echo Request
服务器 A
ICMP Echo Reply
ICMP Echo Request和ICMP Echo Reply分别用来查询和响应某些信息 ,进行差错检测。
default is 5
-h
Specify TTL value for echo requests to be sent, the
default is 255
-t
Timeout in milliseconds to wait for each reply, the
default is 2000ms
STRING<1-255> IP address or hostname of a remote system
--- 10.0.0.2 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/88/340 ms
Page 11
ICMP应用-Tracert
ICMP协议
HUAWEI TECHNOLOGIES CO., LTD.
前言
Internet控制报文协议ICMP(Internet Control Message Protocol)是网络层 的一个重要协议。ICMP协议用来在网络设备间传递各种差错和控制信息, 它对于收集各种网络信息、诊断和排除各种网络故障具有至关重要的作用。 使用基于ICMP的应用时,需要对ICMP的工作原理非常熟悉。
Header
ICMP
FCS
0 Type
ห้องสมุดไป่ตู้
7
15
31
Code
Checksum
不同类型和代码标识不同的内容
Type表示ICMP消息类型,Code表示同一消息类型中的不同信息。
Page 8
ICMP消息类型和编码类型
类型 0 3 3 3 3 5 8
编码 0 0 1 2 3 0 0
描述 Echo Reply 网络不可达 主机不可达 协议不可达 端口不可达
ICMP错误报告
主机 A RTA
.2 10.0.0.0/24 .1
RTB .2
服务器 A 20.0.0.0/24 .1
数据包 ICMP 目的不可达
当网络设备无法访问目标时,会自动发送ICMP目的不可达报文到发送 端设备。
Page 7
ICMP数据包格式
Ethernet_II IP Header
Page 14
主机 A RTA
RTC
主机 B
RTB
20.0.0.2/24
30.0.0.2/24
10.0.0.2/24
<RTA>tracert ?
-a
Set source IP address, the default is the IP
address of the output interface
-f
First time to live, the default is 1
-m
Max time to live, the default is 30
-name
Display the host name of the router on each hop
-p
Destination UDP port number, the default is 33434
STRING<1-255> IP address or hostname of a remote system
……
<RTA>ping 10.0.0.2
Page 10
ICMP应用-Ping
[RTA]ping 10.0.0.2 PING 10.0.0.2 : 56 data bytes, press CTRL_C to break Reply from 10.0.0.2 : bytes=56 Sequence=1 ttl=255 time=340 ms Reply from 10.0.0.2 : bytes=56 Sequence=2 ttl=255 time=10 ms Reply from 10.0.0.2 : bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 10.0.0.2 : bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 10.0.0.2 : bytes=56 Sequence=5 ttl=255 time=30 ms
………………………………………………
<RTA>tracert 30.0.0.2
Page 12
ICMP应用-Tracert
主机 A RTA
RTC
主机 B
RTB
10.0.0.2/24
20.0.0.2/24
30.0.0.2/24
<RTA>tracert 30.0.0.2 Tracert to 30.0.0.2(30.0.0.2), max hops:30, packet length:40, press CTRL_C to break
Page 2
学习目标
学完本课程后,您应该能:
描述ICMP的应用场景 理解常见的ICMP报文类型 掌握Ping和Tracert的应用
Page 3
ICMP
主机 A
Message Return Message
ICMP用来传递差错、控制、查询等信息。
Page 4
ICMP重定向
服务器 A
20.0.0.1/24 20.0.0.2/24
重定向 Echo Request
Page 9
ICMP应用-Ping
RTA
.1
10.0.0.0/24
RTB
.2
<RTA>ping ?
-a
Select source IP address, the default is the IP address of
the output interface
-c
Specify the number of echo requests to be sent, the
1 10.0.0.2 130 ms 50 ms 40 ms 2 20.0.0.2 80 ms 60 ms 80 ms 3 30.0.0.2 80 ms 60 ms 70 ms
Tracert显示数据包在网络传输过程中所经过的每一跳。
Page 13
总结
Ping使用到的是哪两类ICMP消息? 当网络设备收到TTL值为0的IP报文时,会如何操作?
10.0.0.200/24
RTA
③
IP地址: 10.0.0.1/24 默认网关: 10.0.0.100/24
主机 A
公网
RTB
①
10.0.0.100/24
② ICMP 重定向
Page 5
ICMP差错检测
主机 A
ICMP Echo Request
服务器 A
ICMP Echo Reply
ICMP Echo Request和ICMP Echo Reply分别用来查询和响应某些信息 ,进行差错检测。
default is 5
-h
Specify TTL value for echo requests to be sent, the
default is 255
-t
Timeout in milliseconds to wait for each reply, the
default is 2000ms
STRING<1-255> IP address or hostname of a remote system
--- 10.0.0.2 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/88/340 ms
Page 11
ICMP应用-Tracert
ICMP协议
HUAWEI TECHNOLOGIES CO., LTD.
前言
Internet控制报文协议ICMP(Internet Control Message Protocol)是网络层 的一个重要协议。ICMP协议用来在网络设备间传递各种差错和控制信息, 它对于收集各种网络信息、诊断和排除各种网络故障具有至关重要的作用。 使用基于ICMP的应用时,需要对ICMP的工作原理非常熟悉。
Header
ICMP
FCS
0 Type
ห้องสมุดไป่ตู้
7
15
31
Code
Checksum
不同类型和代码标识不同的内容
Type表示ICMP消息类型,Code表示同一消息类型中的不同信息。
Page 8
ICMP消息类型和编码类型
类型 0 3 3 3 3 5 8
编码 0 0 1 2 3 0 0
描述 Echo Reply 网络不可达 主机不可达 协议不可达 端口不可达