TCPIP协议原理教学课件:Chapter 8 Internet Control Message Protocol(ICMP)_第1页
TCPIP协议原理教学课件:Chapter 8 Internet Control Message Protocol(ICMP)_第2页
TCPIP协议原理教学课件:Chapter 8 Internet Control Message Protocol(ICMP)_第3页
TCPIP协议原理教学课件:Chapter 8 Internet Control Message Protocol(ICMP)_第4页
TCPIP协议原理教学课件:Chapter 8 Internet Control Message Protocol(ICMP)_第5页
已阅读5页,还剩32页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Chapter 8 ICMPOverview Types of messagesMessage formatError reportingQueryChecksumICMP package7/15/20221TCP/IP Protocol SuiteOverviewIP lack of error controlIP has no error-reporting or error-correcting mechanismassistance mechanismA mechanism for host and management requires ICMP( Internet Control

2、Message Protocol)A companion to the IP, to compensate for the above two deficiencies Provide error reporting (而不是error-correcting!) for IPProvide assistance mechanism for other layers(TCP/UDP and application)主机可以通过使用ICMP与Internet中路由器或者主机实现控制报文的通信a router cannot find a route to the final destinationT

3、ime-to-live field has a 0 valuedestination discards all fragments of a datagram7/15/20222TCP/IP Protocol SuiteError Reporting VS Error CorrectionIP传输过程中出现差错是不可避免的IP分组传输出现差错时,会产生相应的ICMP报文通过ICMP报文提供差错报告ICMP差错报告只能送给IP分组的源站,协议只提供差错处理建议原因:IP数据报中只记录了IP源和目的地址,而没有记录完整路由检查到错误的路由器无法了解分组经过了哪些中间路由器差错纠正由上层协议负责源站

4、可能无法确定差错源,需要与网络管理员一起协作处理7/15/20223TCP/IP Protocol SuiteInternet Control Message ProtocolRFC792:Internet Control Message Protocol,1981RFC1256:ICMP Router Discovery Messages,1991IPLANsMANsWANsICMPIGMPARPRARPNetworkLayerNetworkAccessLayerTransport LayerApplication Layer7/15/20224TCP/IP Protocol SuiteMe

5、ssage delivery and EncapsulationICMP在IP之上实现,逻辑上与IP同在网络层Connectionless communication直接送达目的站点,沿途的转发路由器不能获知ICMP报文内容EncapsulationICMP messageIP headerIP dataFrame dataTrailer (if any)Frame headerICMP messageIP headerIP dataProtocol = 17/15/20225TCP/IP Protocol SuiteChapter 8 ICMPOverview Types of messag

6、esMessage formatError reportingQueryChecksumICMP package7/15/20226TCP/IP Protocol SuiteTypes of MessagesICMP messagesError-reporting差错报告Query测试查询To report problems that a router or a destination host may encounter when it processes an IP packetTo help a host or a network manager get specific informa

7、tion from a router or another host7/15/20227TCP/IP Protocol SuiteTypesCategoryTypeMessageReasonError-reporting messages3Destination unreachableUnreachable4Source quenchCongestion11Time exceededToo long route12Parameter problemFormat error5RedirectionRoute changedQuery messages8 or 0Echo request or r

8、eplyReachability13 or 14Timestamp request or replySynchronization17 or 18Address mask request or replyMask maintenance10 or 9Router solicitation or advertisementCoincidence between routers过时:15 Information request16 Information response7/15/20228TCP/IP Protocol SuiteChapter 8 ICMPOverview Types of m

9、essagesMessage formatError reportingQueryChecksumICMP package7/15/20229TCP/IP Protocol SuiteMessage FormatCodeChecksumContent depends on type and codeType8 bits8 bits16 bits差错报文:引起差错的原始数据报的一部分(首部 + 数据部分的前8个字节)查询报文:基于查询类型的额外信息Specify the reason for the particular message type 7/15/202210TCP/IP Protoc

10、ol SuiteChapter 8 ICMPOverview Types of messagesMessage formatError reportingQueryChecksumICMP package7/15/202211TCP/IP Protocol SuiteError ReportingICMP just simply report errors not correct ICMP always reports error messages to the original sourceICMP error message will NOT be generated for:A data

11、gram carrying an ICMP error messageA fragmented datagram that is NOT the first fragmentA datagram having a multicast addressA datagram having a special address such as 127.0.0.0 or 0.0.0.0Error reportingDestination unreachableSource quenchTime exceededParameter problemsRedirection7/15/202212TCP/IP P

12、rotocol SuiteContents of Data Field for Error MessagesIP header8 bytesIP dataIP header8 bytesICMP packetICMP headerIP header8 bytesSent IP datagramICMP headerIP headerReceived datagramProvide information about TCP and UDP7/15/202213TCP/IP Protocol SuiteDestination UnreachableWhen a router cannot rou

13、te a datagram or a host cannot deliver a datagramThe datagram is discardedThe router or the host sends a destination unreachable message back to the sourceCode = 012ChecksumType = 3IP header+8 bytes IP data0 x00000000不可达的原因供源站分析错误A router cannot detect all problems that prevent the delivery of a pac

14、ket7/15/202214TCP/IP Protocol SuiteDestination Unreachable CodesCodeDescriptionCodeDescription0网络不可达7目的主机未知1主机不可达8源主机被隔离2协议不可达9与目的网络的通信被禁止3端口不可达10与目的主机的通信被禁止4需要分片,但DF=111对指定TOS,网络不可达5源路由失败12对指定TOS,主机不可达6目的网络未知哪些目的不可达报文只能由目的主机产生?哪些目的不可达报文只能由路由器产生?7/15/202215TCP/IP Protocol SuiteSource Quench(源点抑止)The

15、 lack of flow control in IP congestion拥塞:路由器中队列溢出源站点,中继节点(Router),目的站点间没有关于流量信息的通信主机产生的数据量可能比网络快不适当的路由使流量过分集中,超过信道容量路由器的转发性能低路由器或主机因拥塞丢弃IP分组时,向源站发送ICMP源抑制报文,通知源站The datagram has been discarded There is a congestion somewhere in the path and the source should slow down the sending processquench7/15/2

16、02216TCP/IP Protocol SuiteSource Quench(源点抑止)Congested router or destination sends one source-quench ICMP for each discarded datagram to the sourceThere is no mechanism to tell the source that the congestion has been relieve Code = 0ChecksumType = 4IP header+8 bytes IP data0 x000000007/15/202217TCP/

17、IP Protocol SuiteThe Solution of the Congestion发送队列缓冲:缓解短暂的突发数据丢弃报文,产生源抑制ICMP报文给源站丢弃算法 QoS源站减缓发送速率源站没有收到源抑制报文后逐步提高发送速率源抑制报文的拥塞控制能力只能解决因某个特定主机问题造成的拥塞对因路由或路由器问题造成的拥塞不起作用7/15/202218TCP/IP Protocol SuiteTime Exceeded若数据报的TTL0,路由器丢弃分组,并向源站发送ICMP超时报文路由器对每一个被处理数据报的TTL值自动减1目的主机为需要重组的数据报启动定时器,如果重组无法在定时内完成,丢弃

18、分组,并向源站发送ICMP超时报文Code = 0,1ChecksumType = 11IP header+8 bytes IP data0 x00000000Code = 0 路由器检测到分组的TTL值为0Code = 1 目的站在规定时间内没有收到所有分片7/15/202219TCP/IP Protocol SuiteParameter Problem路由器或主机因首部字段格式或取值错误而丢弃报文时,向源站发送ICMP参数问题报文Code = 0,1ChecksumType = 12IP header+8 bytes IP data0 x00000000Code = 0 首部字段错误,指针

19、字段指向错误字节Code = 1 缺少所需的选项部分,指针字段无效Pointer7/15/202220TCP/IP Protocol SuiteRedirection重定向(改变路由):主机配置最少的路由信息(并且不参与更新),可以从路由器了解新的路由A want to send datagrams to B, but it doesnt know R2 is the better choice. What will it do?IP packetRedirection messageNet 1Net 2Host AHost BR1R2Net 1直接交付0.0.0.0/0R1Net 1直接交付

20、Net 2R20.0.0.0/0R17/15/202221TCP/IP Protocol SuiteFormatCode = 03ChecksumType = 5IP header+8 bytes IP dataIP address of the target routerCodeDescription0Network specific1Host specific2Network specific (specified service)3Host specific (specified service)缩小路由改变的范围7/15/202222TCP/IP Protocol Suite思考在以下

21、情况中,重定向报文是否有用?Host AHost BR1R2R3重定向分组R2发出的重定向报文应该送给谁?路由器重定向源主机路由器路由协议7/15/202223TCP/IP Protocol SuiteChapter 8 ICMPOverview Types of messagesMessage formatError reportingQueryChecksumICMP package7/15/202224TCP/IP Protocol SuiteQuery功能:帮助主机从某个路由器或主机处得到特定的信息对某些网络问题进行诊断这种类型的ICMP报文的通信特点:成对出现一个节点产生请求ICMP

22、目的节点用特定格式的ICMP报文应答7/15/202225TCP/IP Protocol SuiteQueryQueryEcho request and replyTimestamp request and replyAddress mask request and replyRouter solicitation and advertisementPingTrace route7/15/202226TCP/IP Protocol SuiteEcho Request and ReplyFor diagnostic (诊断) purposes:whether two systems can co

23、mmunicate with each other确定IP层能否通信Ping commandTCPUDPICMPIPICMPIPEchoEcho replyApproximateround-trip timeCode = 0ChecksumType = 8,0Optional data( Send by the request message; repeated by the reply message)IdentifierSequence number7/15/202227TCP/IP Protocol SuiteTimestamp Request and ReplyUsed to calc

24、ulate the round-trip time(ms)发时间= 收时戳- 初始时戳,收时间= 返回时间- 发时戳往返时间 = 发时间 + 收时间Used to synchronize two clocks in two machines由于路径、传输,难以得到非常精确的时间Code = 0ChecksumType = 13, 14Original timestamp (filled by source)IdentifierSequence numberReceive timestamp (filled by destination)Transmit timestamp (filled by

25、 destination)7/15/202228TCP/IP Protocol SuiteCalculate the timeNetwork LayertST1ST2ST3ST4ABNetwork LayerSending time = ST1 - ST2Receiving time = ST4 ST3Round-trip time = Sending time + Receiving time 7/15/202229TCP/IP Protocol SuiteMask Request and Reply应用供IP协议软件使用主机知道路由器地址时,可以向路由器发送请求不知道路由器时,可广播发送,

26、路由器作应答Code = 0ChecksumType = 17, 18MaskIdentifierSequence number7/15/202230TCP/IP Protocol SuiteRoute Solicitation and Advertisement主机发送路由器询问报文,查询本网中的路由器路由器发送路由器通告报文,通告自己以及所知的本网中其他路由器的存在Code = 0ChecksumType = 10IdentifierSequence numberCode = 0ChecksumType = 10Router address 1IdentifierSequence numberAddress preference 1Router address

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论