TCPIP_Chapter8InternetControlMessageProtocol(ICMP)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

TCP/IP协议原理吴凡通信与信息工程学院网络工程系E-mail:wufan@uestc.edu.cnPhone:61830521(O)2020/1/10TCP/IPProtocolSuite2Chapter8ICMPOverviewTypesofmessagesMessageformatErrorreportingQueryChecksumICMPpackage2020/1/10TCP/IPProtocolSuite3OverviewIPlackoferrorcontrolIPhasnoerror-reportingmechanismassistancemechanismAmechanismforhostandmanagementrequiresICMP(InternetControlMessageProtocol)AcompaniontotheIP,tocompensatefortheabovetwodeficienciesProvideerrorreporting(而不是error-correcting!)forIPProvideassistancemechanismforotherlayers(TCP/UDPandapplication)主机可以通过使用ICMP与Internet中路由器或者主机实现控制报文的通信1.aroutercannotfindaroutetothefinaldestination2.Time-to-livefieldhasa0value3.destinationdiscardsallfragmentsofadatagram2020/1/10TCP/IPProtocolSuite4ErrorReportingVSErrorCorrectionIP传输过程中出现差错是不可避免的IP分组传输出现差错时,会产生相应的ICMP报文通过ICMP报文提供差错报告ICMP差错报告只能送给IP分组的源站,协议只提供差错处理建议原因:IP数据报中只记录了IP源和目的地址,而没有记录完整路由检查到错误的路由器无法了解分组经过了哪些中间路由器差错纠正由上层协议负责源站可能无法确定差错源,需要与网络管理员一起协作处理2020/1/10TCP/IPProtocolSuite5InternetControlMessageProtocolRFC792:InternetControlMessageProtocol,1981RFC1256:ICMPRouterDiscoveryMessages,1991IPLANsMANsWANsICMPIGMPARPRARPNetworkLayerNetworkAccessLayerTransportLayerApplicationLayer2020/1/10TCP/IPProtocolSuite6MessagedeliveryandEncapsulationICMP在IP之上实现,逻辑上与IP同在网络层Connectionlesscommunication直接送达目的站点,沿途的转发路由器不能获知ICMP报文内容EncapsulationICMPmessageIPheaderIPdataFramedataTrailer(ifany)FrameheaderICMPmessageIPheaderIPdataProtocol=12020/1/10TCP/IPProtocolSuite7Chapter8ICMPOverviewTypesofmessagesMessageformatErrorreportingQueryChecksumICMPpackage2020/1/10TCP/IPProtocolSuite8TypesofMessagesICMPmessagesError-reporting差错报告Query测试查询ToreportproblemsthatarouteroradestinationhostmayencounterwhenitprocessesanIPpacketTohelpahostoranetworkmanagergetspecificinformationfromarouteroranotherhost2020/1/10TCP/IPProtocolSuite9TypesCategoryTypeMessageReasonError-reportingmessages3DestinationunreachableUnreachable4SourcequenchCongestion11TimeexceededToolongroute12ParameterproblemFormaterror5RedirectionRoutechangedQuerymessages8or0EchorequestorreplyReachability13or14TimestamprequestorreplySynchronization17or18AddressmaskrequestorreplyMaskmaintenance10or9RoutersolicitationoradvertisementCoincidencebetweenrouters过时:15Informationrequest16Informationresponse2020/1/10TCP/IPProtocolSuite10Chapter8ICMPOverviewTypesofmessagesMessageformatErrorreportingQueryChecksumICMPpackage2020/1/10TCP/IPProtocolSuite11MessageFormatCodeChecksumContentdependsontypeandcodeType8bits8bits16bits差错报文:引起差错的原始数据报的一部分(首部+数据部分的前8个字节)查询报文:基于查询类型的额外信息Specifythereasonfortheparticularmessagetype2020/1/10TCP/IPProtocolSuite12Chapter8ICMPOverviewTypesofmessagesMessageformatErrorreportingQueryChecksumICMPpackage2020/1/10TCP/IPProtocolSuite13ErrorReportingICMPjustsimplyreporterrorsnotcorrectICMPalwaysreportserrormessagestotheoriginalsourceICMPerrormessagewillNOTbegeneratedfor:AdatagramcarryinganICMPerrormessageAfragmenteddatagramthatisNOTthefirstfragmentAdatagramhavingamulticastaddressAdatagramhavingaspecialaddresssuchas127.0.0.0or0.0.0.0ErrorreportingDestinationunreachableSourcequenchTimeexceededParameterproblemsRedirection2020/1/10TCP/IPProtocolSuite14ContentsofDataFieldforErrorMessagesIPheader8bytesIPdataIPheader8bytesICMPpacketICMPheaderIPheader8bytesSentIPdatagramICMPheaderIPheaderReceiveddatagramProvideinformationaboutTCPandUDP2020/1/10TCP/IPProtocolSuite15DestinationUnreachableWhenaroutercannotrouteadatagramorahostcannotdeliveradatagramThedatagramisdiscardedTherouterorthehostsendsadestinationunreachablemessagebacktothesourceCode=0~12ChecksumType=3IPheader+8bytesIPdata0x00000000不可达的原因供源站分析错误Aroutercannotdetectallproblemsthatpreventthedeliveryofapacket2020/1/10TCP/IPProtocolSuite16DestinationUnreachableCodesCodeDescriptionCodeDescription0网络不可达7目的主机未知1主机不可达8源主机被隔离2协议不可达9与目的网络的通信被禁止3端口不可达10与目的主机的通信被禁止4需要分片,但DF=111对指定TOS,网络不可达5源路由失败12对指定TOS,主机不可达6目的网络未知哪些目的不可达报文只能由目的主机产生?哪些目的不可达报文只能由路由器产生?2020/1/10TCP/IPProtocolSuite17SourceQuench(源点抑止)ThelackofflowcontrolinIPcongestion拥塞:路由器中队列溢出源站点,中继节点(Router),目的站点间没有关于流量信息的通信主机产生的数据量可能比网络快不适当的路由使流量过分集中,超过信道容量路由器的转发性能低路由器或主机因拥塞丢弃IP分组时,向源站发送ICMP源抑制报文,通知源站ThedatagramhasbeendiscardedThereisacongestionsomewhereinthepathandthesourceshouldslowdownthesendingprocess——quench2020/1/10TCP/IPProtocolSuite18SourceQuench(源点抑止)Congestedrouterordestinationsendsonesource-quenchICMPforeachdiscardeddatagramtothesourceThereisnomechanismtotellthesourcethatthecongestionhasbeenrelieveCode=0ChecksumType=4IPheader+8bytesIPdata0x000000002020/1/10TCP/IPProtocolSuite19TheSolutionoftheCongestion发送队列缓冲:缓解短暂的突发数据丢弃报文,产生源抑制ICMP报文给源站丢弃算法——QoS源站减缓发送速率源站没有收到源抑制报文后逐步提高发送速率源抑制报文的拥塞控制能力只能解决因某个特定主机问题造成的拥塞对因路由或路由器问题造成的拥塞不起作用2020/1/10TCP/IPProtocolSuite20TimeExceeded若数据报的TTL=0,路由器丢弃分组,并向源站发送ICMP超时报文路由器对每一个被处理数据报的TTL值自动减1目的主机为需要重组的数据报启动定时器,如果重组无法在定时内完成,丢弃分组,并向源站发送ICMP超时报文Code=0,1ChecksumType=11IPheader+8bytesIPdata0x00000000Code=0——路由器检测到分组的TTL值为0Code=1——目的站在规定时间内没有收到所有分片2020/1/10TCP/IPProtocolSuite21ParameterProblem路由器或主机因首部字段格式或取值错误而

1 / 38
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功