好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

中科大计算机网络课件092.ppt

46页
  • 卖家[上传人]:新**
  • 文档编号:584201241
  • 上传时间:2024-08-30
  • 文档格式:PPT
  • 文档大小:1.10MB
  • / 46 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • Chapter 9Internet Control Message ProtocolChapter09 Internet Control Message Protocol控制报文协议控制报文协议lTYPES OF MESSAGES 报文类型l MESSAGE FORMAT 报文格式l ERROR REPORTING 差错报告l QUERY 查询l CHECKSUM 检验和l ICMP PACKAGE ICMP 软件包Chapter09 Position of ICMP in the network layerICMP 在网络层的位置在网络层的位置lICMP(Internet Control Message Protocol)协议主要用于发送网络故障消息及进行网络检测的一些控制消息lICMP各种类型的消息都被封装在IP分组中进行传输,IP分组头中的协议字段为1l一般在ICMP故障消息中同时携带引起错误的IP分组的头以及数据域中的前8个字节(包含端口号和报文序号),以便接收方与相应的用户进程进行联系Chapter09 Encapsulation of ICMP packetICMP 的封装的封装Chapter09 9.1 TYPES OF MESSAGES报文类型报文类型lICMP 报文可以分为差错报告报文差错报告报文和查询报文查询报文。

      l差错报告报文报告路由器或主机(目的端)在处理IP数据报时可能遇到的一些问题l查询报文是成对出现的,它帮助主机或网管人员从路由器或另一主机获得特定的信息Chapter09 Table 9.1 Table 9.1 ICMP messages ICMP ICMP messages ICMP 报文报文报文报文Chapter09 9.2 MESSAGE FORMAT 报文格式报文格式lICMP 报文有8字节的首部和可变长度的数据部分l首部的前4个字节对所有报文类型都一样Chapter09 9.3 ERROR REPORTING 差错报告差错报告lIP, as an unreliable protocol, is not concerned with error checking and error control. ICMP was designed, in part, to compensate for this shortcoming. ICMP does not correct errors, it simply reports them.l[IP 是不可靠的协议,它不考虑错误检验和差错控制。

      ICMP就是为补偿这个缺点而设计的ICMP不能纠正差错,它只能报告差错]Chapter09 Error-reporting messages 差错报告报文差错报告报文共有五种差错报告:共有五种差错报告:1.终点不可达终点不可达2.源点抑制源点抑制3.时间超时时间超时4.参数问题参数问题5.改变路由改变路由ICMP 总是向总是向原始的数据源报告差错报文原始的数据源报告差错报文Chapter09 四种情况不产生ICMP差错报文1.对于携带 ICMP 差错报文的数据报,不再产生 ICMP 差错报文2.对于分段的数据报,如果不是第一个分段,则不产生 ICMP 差错报文3.对于具有多播地址的数据报,不产生ICMP 差错报文4.对于具有特殊地址(如127.0.0.0或0.0.0.0)的数据报,不产生 ICMP 差错报文Chapter09 Contents of data field for error messages差错报文的数据字段内容差错报文的数据字段内容Chapter09 Destination-unreachable format终终点不可达报文的格式点不可达报文的格式0:网络不可达:网络不可达1:主机不可达:主机不可达2:协议不可达:协议不可达3:端口不可达:端口不可达4:需要进行分段:需要进行分段5:源路由选择不能完成:源路由选择不能完成6:目的网络未知:目的网络未知7:目的主机未知:目的主机未知8:源主机是孤立的:源主机是孤立的9:从管理上禁止与目的网络通信:从管理上禁止与目的网络通信10:从管理上禁止与目的主机通信:从管理上禁止与目的主机通信11:对指明的服务类型,网络不可达:对指明的服务类型,网络不可达12:对指明的服务类型,主机不可达:对指明的服务类型,主机不可达13:主机不可达:主机不可达14:主机不可达:主机不可达15:主机不可达:主机不可达Code:Chapter09 几点关注l具有代码2和代码3的目的端不可达报文只能有目的主机创建。

      l其余的目的端不可达报文只能由路由器创建l路由器无法检测出分组没有交付的所有问题l在IP协议中没有流量控制机制Chapter09 Source-quench format源端抑制的格式源端抑制的格式 源端抑制报文通知源端,由于拥塞,在路由器或目源端抑制报文通知源端,由于拥塞,在路由器或目的主机中已经丢弃了数据报源端必须放慢数据报的发的主机中已经丢弃了数据报源端必须放慢数据报的发送,直到拥塞程度减轻为止送,直到拥塞程度减轻为止Chapter09 Time-exceeded message format超时报文格式超时报文格式Code 0: Time to live 路由器路由器使用使用 当路由器收到生存时间字段值为当路由器收到生存时间字段值为0 0的数据报时,就丢弃这个数据报,的数据报时,就丢弃这个数据报,并向源端发送超时报文并向源端发送超时报文Code 1: Fragmentation 目的主机使用目的主机使用 当目的主机在规定的时间内没有收到所有分段时,就丢弃已收到的当目的主机在规定的时间内没有收到所有分段时,就丢弃已收到的分段,并向源端发送超时报文。

      分段,并向源端发送超时报文Chapter09 Parameter-problem message format参数问题报文格式参数问题报文格式 Code 0: Main header problem 首部首部问题,问题,在首部的某个字段中有差在首部的某个字段中有差错或存在二义性这时,指针字段指向有问题的字节错或存在二义性这时,指针字段指向有问题的字节 Code 1: Problem in the option field 选项问题,表示缺少所需要的选选项问题,表示缺少所需要的选项部分,这时不使用指针项部分,这时不使用指针 路由器和目的主机都可以创建参数问题报文Chapter09 Redirection concept改变路由的概念改变路由的概念 主机刚开始工作时只有很小的一个路由表,这个路由表逐渐增主机刚开始工作时只有很小的一个路由表,这个路由表逐渐增大和更新完成该工作的工具之一就是改变路由报文大和更新完成该工作的工具之一就是改变路由报文Chapter09 Redirection message format改变路由报文的格式改变路由报文的格式Code 0: Network specificCode 1: Host specificCode 2: Network specific (specified service)Code 3: Host specific (specified service)改变路由的报文是由路由器向同一个本地网络上的主机发送的Chapter09 9.4 QUERY 查询查询lICMP can also diagnose some network problems through the query messages, a group of four different pairs of messages. In this type of ICMP message, a node sends a message that is answered in a specific format by the destination node. l【ICMP 也能对某些网络问题进行诊断,这是通过使用由4对不同报文组成的查询报文来完成的。

      在这种类型的ICMP报文中,一个结点发送出报文,然后由目的结点用特定格式进行回答】l lEcho Request and Reply Echo Request and Reply 回送请求和回答回送请求和回答l lTimestamp Request and Reply Timestamp Request and Reply 时间戳请求和回答时间戳请求和回答l lAddress-Mask Request and Reply Address-Mask Request and Reply 地址掩码请求和回答地址掩码请求和回答l lRouter Solicitation and AdvertisementRouter Solicitation and Advertisement路由器询问和通告路由器询问和通告Chapter09 Query messages询问报文询问报文1.Echo Request and Reply 回送请求和回答2.Timestamp Request and Reply 时间戳请求和回答3.Address-Mask Request and Reply 地址掩码请求和回答4.Router Solicitation and Advertisement 路由器询问和通告Chapter09 Echo-request and echo-reply message format回送请求和回送回答报文格式回送请求和回送回答报文格式Ping command can use theses messages.l回送请求和回送回答报文可由主机或路由器发送。

      收到回送请求的主机或路回送请求和回送回答报文可由主机或路由器发送收到回送请求的主机或路由器发送回送回答报文由器发送回送回答报文l回送请求和回送回答报文可由网络管理员来使用,用来检查回送请求和回送回答报文可由网络管理员来使用,用来检查IP协议工作的情协议工作的情况况l用回送请求和回送回答报文可测试某个主机的可达性通常用用回送请求和回送回答报文可测试某个主机的可达性通常用Ping命令来命令来这样做这样做Chapter09 实例——Ping程序lPing程序是利用ICMP的类型8消息(回送请求,echo request)和类型0消息(回送回答,echo reply)来完成测试功能(距离和负载)的这时标识符( identifier))放置发送进程的进程号;序号( sequence number))从0开始,每发一个回送请求,序号加1Chapter09 Timestamp-request and timestamp-reply message format时间戳请求和时间戳回答报文格式时间戳请求和时间戳回答报文格式原始时间戳:原始时间戳:源端创建时间戳报文请求时填入它的时钟所显示的通用时间源端创建时间戳报文请求时填入它的时钟所显示的通用时间接收时间戳:接收时间戳:目的端接收到时间戳请求报文时填入的它的时钟所显示的通用时间目的端接收到时间戳请求报文时填入的它的时钟所显示的通用时间发送时间戳:发送时间戳:目的端在回答报文离开时填入的它的时钟所显示的通用时间目的端在回答报文离开时填入的它的时钟所显示的通用时间时间单位:时间单位:ms,最大值:,最大值:86400000==24×60×60Chapter09 Value of original timestamp: 46Value of receive timestamp: 59Value of transmit timestamp: 60Time the packet arrived: 67Given the following information:Sending time = 59 - 46 = 13 millisecondsReceiving time = 67 - 60 = 7 millisecondsRound-trip time = 13 + 7 = 20 milliseconds We can calculate:Chapter09 Mask-request and mask-reply message format掩码请求和掩码回答报文的格式掩码请求和掩码回答报文的格式 无盘站在启动时是需要掩码的。

      当无盘站第一次连网时,它会使用无盘站在启动时是需要掩码的当无盘站第一次连网时,它会使用RARP协议查找协议查找IP地址;在确定地址;在确定IP地址后便使用掩码请求报文并在掩码地址后便使用掩码请求报文并在掩码回答报文中获取掩码回答报文中获取掩码 得到子网信息的另一种方法是使用得到子网信息的另一种方法是使用BOOTP协议Chapter09 Router solicitation message format路由器询问报文的格式路由器询问报文的格式路由询问报文:用于主机查询路由和询问路由器工作状态路由询问报文:用于主机查询路由和询问路由器工作状态Chapter09 Router advertisement message format路由器通告报文格式路由器通告报文格式路由器通告报文:用于应答路由器询问报文或通告路由器状态及路由情况路由器通告报文:用于应答路由器询问报文或通告路由器状态及路由情况(地址参考等级)0:默认路由器:默认路由器80000000H:不能:不能选为默认路由选为默认路由Chapter09 9.5 CHECKSUM 检验和检验和lIn ICMP the checksum is calculated over the entire message (header and data). l【在ICMP中,检验和的计算覆盖了整个报文(首部和数据)】lChecksum Calculation 检验和的计算lChecksum Testing 检验和的测试Chapter09 lChecksum Calculation 检验和的计算检验和的计算1.把检验和字段置0。

      2.计算所有16位字(首部和数据)之和3.把得到的和求反码,得到检验和4.把检验和存入检验和字段lChecksum Testing 检验和的测试检验和的测试1.计算所有16位字(首部和数据)之和2.把得到的和求反码3.若步骤2结果为0,则接收报文,否则,丢弃报文Chapter09 Example of checksum calculation计算检验和的例子计算检验和的例子Chapter09 9.6 DEBUGGING TOOLSWe We introduce introduce two two tools tools that that use use ICMP ICMP for for debugging: debugging: pingping and and traceroutetraceroute. .The topics discussed in this section include:The topics discussed in this section include:PingPingTracerouteTraceroute Chapter09 We use the ping program to test the server fhda.edu. The result is shown below:exampleexample 2 2See Next Slide$ ping fhda.eduPING fhda.edu (153.18.8.1) 56 (84) bytes of data.64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=0 ttl=62 time=1.91 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=1 ttl=62 time=2.04 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=2 ttl=62 time=1.90 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=3 ttl=62 time=1.97 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=4 ttl=62 time=1.93 msChapter09 exampleexample 2 2 (Continued)(Continued)64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=5 ttl=62 time=2.00 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=6 ttl=62 time=1.94 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=7 ttl=62 time=1.94 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=8 ttl=62 time=1.97 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=9 ttl=62 time=1.89 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=10 ttl=62 time=1.98 ms--- fhda.edu ping statistics ---11 packets transmitted, 11 received, 0% packet loss, time 10103msrtt min/avg/max = 1.899/1.955/2.041 msChapter09 For the this example, we want to know if the mail server is alive and running. The result is shown below:exampleexample 3 3$ ping PING (68.168.78.100) 56(84) bytes of data.64 bytes from (68.168.78.100): icmp_seq=0 ttl=48 time=85.4 ms64 bytes from (68.168.78.100): icmp_seq=1 ttl=48 time=84.6 ms64 bytes from (68.168.78.100): icmp_seq=2 ttl=48 time=84.9 ms64 bytes from (68.168.78.100): icmp_seq=3 ttl=48 time=84.3 ms64 bytes from (68.168.78.100): icmp_seq=4 ttl=48 time=84.5 msSee Next SlideChapter09 exampleexample 3 3 (Continued)(Continued)64 bytes from (68.168.78.100): icmp_seq=5 ttl=48 time=84.7 ms64 bytes from (68.168.78.100): icmp_seq=6 ttl=48 time=84.6 ms64 bytes from (68.168.78.100): icmp_seq=7 ttl=48 time=84.7 ms64 bytes from (68.168.78.100): icmp_seq=8 ttl=48 time=84.4 ms64 bytes from (68.168.78.100): icmp_seq=9 ttl=48 time=84.2 ms64 bytes from (68.168.78.100): icmp_seq=10 ttl=48 time=84.9 ms64 bytes from (68.168.78.100): icmp_seq=11 ttl=48 time=84.6 ms64 bytes from (68.168.78.100): icmp_seq=12 ttl=48 time=84.5 ms--- ping statistics ---14 packets transmitted, 13 received, 7% packet loss, time 13129msrtt min/avg/max/mdev = 84.207/84.694/85.469Chapter09 Figure 9.20 The traceroute program operationChapter09 We use the traceroute program to find the route from the computer voyager.deanza.edu to the server fhda.edu. The following shows the result:exampleexample 4 4See Next Slide$ traceroute fhda.edutraceroute to fhda.edu (153.18.8.1), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 0.995 ms 0.899 ms 0.878 ms2 Dbackup.fhda.edu (153.18.251.4) 1.039 ms 1.064 ms 1.083 ms3 tiptoe.fhda.edu (153.18.8.1) 1.797 ms 1.642 ms 1.757 msChapter09 The un-numbered line after the command shows that the destination is 153.18.8.1. The TTL value is 30 hops. The packet contains 38 bytes: 20 bytes of IP header, 8 bytes of UDP header, and 10 bytes of application data. The application data is used by traceroute to keep track of the packets.exampleexample 4 4 (Continued)(Continued) The first line shows the first router visited. The router is named Dcore.fhda.edu with IP address 153.18.31.254. The first round trip time was 0.995 milliseconds, the second was 0.899 milliseconds, and the third was 0.878 milliseconds. The second line shows the second router visited. The router is named Dbackup.fhda.edu with IP address 153.18.251.4. The three round trip times are also shown. The third line shows the destination host. We know that this is the destination host because there are no more lines. The destination host is the server fhda.edu, but it is named tiptoe. fhda.edu with the IP address 153.18.8.1. The three round trip times are also shown.Chapter09 In this example, we trace a longer route, the route to exampleexample 5 5$ traceroute traceroute to (13.1.64.93), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 0.622 ms 0.891 ms 0.875 ms2 Ddmz.fhda.edu (153.18.251.40) 2.132 ms 2.266 ms 2.094 ms...18 alpha.Xerox.COM (13.1.64.93) 11.172 ms 11.048 ms 10.922 msHere there are 17 hops between source and destination. Note that some round trip times look unusual. It could be that a router is too busy to process the packet immediately.Chapter09 An interesting point is that a host can send a traceroute packet to itself. This can be done by specifying the host as the destination. The packet goes to the loopback address as we expect.exampleexample 6 6$ traceroute voyager.deanza.edutraceroute to voyager.deanza.edu (127.0.0.1), 30 hops max, 38 byte packets1 voyager (127.0.0.1) 0.178 ms 0.086 ms 0.055 msChapter09 Finally, we use the traceroute program to find the route between fhda.edu and (McGraw-Hill server). We notice that we cannot find the whole route. When traceroute does not receive a response within 5 seconds, it prints an asterisk to signify a problem, and then tries the next hop..exampleexample 7 7$ traceroute traceroute to (198.45.24.104), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 1.025 ms 0.892 ms 0.880 ms2 Ddmz.fhda.edu (153.18.251.40) 2.141 ms 2.159 ms 2.103 ms3 Cinic.fhda.edu (153.18.253.126) 2.159 ms 2.050 ms 1.992 ms ...16 * * *17 * * *...............Chapter09 9.6 ICMP PACKAGE ICMP软件包软件包lTo give an idea of how ICMP can handle the sending and receiving of ICMP messages, we present our version of an ICMP package made of two modules: an input module and an output module. l【为了给出ICMP是如何处理发送和接收ICMP报文的概念,我们给出了ICMP软件包,它由两个模块组成:输入模块和输出模块。

      Chapter09 ICMP package ICMP 软件包软件包Chapter09 输入模块接收:从IP层来的ICMP分组1.若(该类型是三种请求类型中的任何一种)1.创建回答报文2.发送这个回答报文2.若(该类型是路由器询问报文)1.若(该站是路由器)2.创建路由器通告报文3.发送这个路由器通告报文3.若(该类型是三种回答报文中的一种或路由器通告报文)1.在分组的数据部分提取信息2.把提取的信息提交给请求它的进程4.若(该类型定义改变路由报文)1.修改路由表5.若(该类型定义差错报文而不是改变路由报文)1.把情况通知适当的源协议6.返回Chapter09 输出模块接收:一个要求1.若(该要求定义了差错报文)1.若(该要求是从IP来的)1.若(该要求是被禁止的)1.返回2.若(这个类型定义了改变路由报文)1.若(这个站不是路由器)1.返回3.使用这个类型、代码和IP分组创建差错报文2.若(该要求定义了请求或询问报文)1.创建请求或询问报文3.发送该报文4.返回Chapter09 作业 •Chapter–1,2,4,10,15,18.•使用Ethereal抓包工具,对照ICMP报文格式逐项分析每一个字段的含义。

      该道题无需提交纸质作业)Chapter09 。

      点击阅读更多内容
      相关文档
      安徽省安全员《A证(企业负责人)》冲刺试卷三.docx 2026年房地产经纪人《房地产经纪业务操作》预测试卷三.docx 安徽省安全员《A证(企业负责人)》模拟试卷一.docx 2026年房地产经纪人《房地产交易制度政策》模拟试卷四.docx 安徽省安全员《B证(项目负责人)》冲刺试卷二.docx 2026年房地产经纪人《房地产经纪专业基础》预测试卷四.docx 2026年房地产经纪人《房地产经纪业务操作》考前点题卷一.docx 2023年通信工程师《通信专业实务(传输与接入-无线)》试题真题及答案.docx 安徽省安全员《A证(企业负责人)》试题精选.docx 2026年房地产经纪人《房地产经纪专业基础》预测试卷二.docx 2026年房地产经纪人《房地产经纪业务操作》考前点题卷二.docx 2026年房地产经纪人《房地产经纪职业导论》冲刺试卷三.docx 2026年房地产经纪人《房地产交易制度政策》冲刺试卷三.docx 2026年房地产经纪人《房地产经纪专业基础》考前点题卷二.docx 2026年房地产经纪人《房地产经纪职业导论》冲刺试卷五.docx 2026年房地产经纪人《房地产经纪职业导论》冲刺试卷四.docx 2026年房地产经纪人《房地产交易制度政策》冲刺试卷一.docx 2026年房地产经纪人《房地产交易制度政策》冲刺试卷四.docx 安徽省安全员《B证(项目负责人)》冲刺试卷三.docx 2026年房地产经纪人《房地产经纪业务操作》模拟试卷二.docx
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.