TCPIP_Chapter6ARPandRARP.

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

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

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

资源描述

TCP/IP协议原理吴凡通信与信息工程学院网络工程系E-mail:wufan@uestc.edu.cnPhone:61830521(O)2020/1/10TCP/IPProtocolSuite2Chapter6ARPandRARPARPARPpackage(ARP软件包)RARP2020/1/10TCP/IPProtocolSuite3两级地址IP分组交付到主机或路由器需要两级地址互连网级:逻辑地址标识主机/路由器全网统一编址,具有全局唯一性——全局地址所有与互联网打交道的软件都要使用逻辑地址在Internet中,逻辑地址就是IP地址(32bit)物理网级:物理地址标识主机/路由器本地范围内具有唯一性,但在整个互联网内不一定具有全局唯一性——本地地址分组需要通过物理网络才能到达路由器或主机以太网中,物理地址就是MAC地址(48bit)NetworkAddressMaskNext-hopAddressInterface路由表项(至少4项)MACAMACEMACBMACCMACR2020/1/10TCP/IPProtocolSuite4MappingLogicaladdress(IP)PhysicaladdressNetworkDataLinkPhysicalMappingTo:电子科技大学成都市建设北路2段4号单位名称(逻辑)单位地址(物理)2020/1/10TCP/IPProtocolSuite5IssuesA送往E的分组需封装在Ethernet帧中传送IP地址:全局性物理地址:本地性AA仅知道:IPA,MACA,IPEEthernetFrame:IPPacket?EBCD目的MAC类型FCS源MACMACA2020/1/10TCP/IPProtocolSuite6AddressMapping(地址映射)LogicaladdressPhysicaladdressStaticmapping映射表固定设置DynamicmappingStaticTableLogicaladdressPhysicaladdress……………………Consider:NICchangedMobilecomputerCacheLogicaladdressPhysicaladdress……………………Lookforthetargetondemanding,usingdynamicAddressResolutionProtocol2020/1/10TCP/IPProtocolSuite7ARPandRARPARPLogicaladdressPhysicaladdressRARPLogicaladdressPhysicaladdress2020/1/10TCP/IPProtocolSuite8ARPAddressResolutionProtocol,RFC826地址解析协议:IPaddressMACaddressIPLANsMANsWANsICMPIGMPARPRARPNetworkLayerNetworkAccessLayerTransportLayerApplicationLayer2020/1/10TCP/IPProtocolSuite9ARPOperationA:1.2.3.1E:1.2.3.5I’mlookingforthephysicaladdressofanodewhoseIPaddressis:1.2.3.5Iamthenodeyouarelookingfor,andmyphysicaladdressis:0005.5D06.1418RequestRequestRequestReplyRequestBroadcastUnicastB:1.2.3.2C:1.2.3.3D:1.2.3.4IPaddressMACaddressA’sARPCache:1.2.3.50005.5D06.1418bind2020/1/10TCP/IPProtocolSuite10ARPCacheARPcacheTomaintaintherecentmappingsfromlogicaladdresses(IP)tohardwareaddresses(MAC)典型存活时间:2minutesEssentialtotheefficientoperationofARP举例:主机ARPCacheC:arp–aInterface:172.18.64.38---0x50002InternetAddressPhysicalAddressType172.18.64.6200-03-31-b5-50-00Dynamic2020/1/10TCP/IPProtocolSuite11用户输入命令“ftp主机名”时的操作FTPTCPIPARP以太网驱动程序主机名解析器以太网驱动程序以太网驱动程序主机名IP地址(1)(2)(3)(4)(6)ARPARPFTPTCPIP(5)(7)目的源2020/1/10TCP/IPProtocolSuite12ARPPacketHardwareTypeProtocolTypeHardwareaddresslenProtocoladdresslenOperationRequest1,Reply2Senderhardwareaddress(Forexample,6bytesforEthernet)Senderprotocoladdress(Forexample,4bytesforIP)Targethardwareaddress(Forexample,6bytesforEthernet)Targetprotocoladdress(Forexample,4bytesforIP)Itisnotfilledinarequest2020/1/10TCP/IPProtocolSuite13EncapsulationofARPpacketThebyteorderofARPpacketExample:EthernetframeHTypePTypeHLPLOPsMACsIPtMACtIP222116644byteARPPacket目的MAC类型FCS源MACPacket66246~15004pad28bytes460x0806byte2020/1/10TCP/IPProtocolSuite14Example:ARPRequestPacket2020/1/10TCP/IPProtocolSuite15Example:ARPReplyPacket2020/1/10TCP/IPProtocolSuite16IPPacketandARPPacketIPIPIPIPARPrequestARPreplyIPpacketBindingIPpacketIPpacketIPpacketNobinding2020/1/10TCP/IPProtocolSuite17ARPProcessCase1:ABInsameIPnetworkCase2:ADIndifferentIPnetworkACBDR1R2IPA,MACAIPB,MACBIPC,MACCIPD,MACDIP1MAC1IP2MAC2IP3MAC3IP4MAC42020/1/10TCP/IPProtocolSuite18Case1:ABACBDR1R2IPA,MACAIPB,MACBIPC,MACCIPD,MACDIP1MAC1IP2MAC2IP3MAC3IP4MAC4IPAddressMACAddressA’sARPCache:IPBMACBB’sARPCache:IPAMACAR1’sARPCache:IPAMACAsIP=IPA,dIP=IPBARPrequestARPrequestARPrequestARPrequestARPreplyIPIPsMAC=MACA,dMAC=MACBsIP=IPA,dIP=IPBdMAC=广播,Target_IP=IPBSenderhardwareaddress:MACASenderprotocoladdress:IPATargethardwareaddress:0x00000000Targetprotocoladdress:IPBSenderhardwareaddress:MACBSenderprotocoladdress:IPBTargethardwareaddress:MACATargetprotocoladdress:IPA2020/1/10TCP/IPProtocolSuite19Case2:ADACBDR1R2IPA,MACAIPB,MACBIPC,MACCIPD,MACDIP1MAC1IP2MAC2IP3MAC3IP4MAC4IPAddressMACAddressA’sARPCache:IP1MAC1B’sARPCache:IPAMACAR1’sARPCache:IPAMACAsIP=IPA,dIP=IPDARPrequestARPrequestARPrequestARPrequestARPreplyIPIPsMAC=MACA,dMAC=MAC1sIP=IPA,dIP=IPDdMAC=广播,Target_IP=IP1IPD不在本网内,分组由R1转发sMAC=MAC2,dMAC=MAC3sIP=IPA,dIP=IPDsMAC=MAC4,dMAC=MACDsIP=IPA,dIP=IPDIP1是A的缺省网关(DefaultGateway)2020/1/10TCP/IPProtocolSuite20关键问题:ARP解析谁的IP地址?交付类型2020/1/10TCP/IPProtocolSuite21ExampleAhostwithIPaddress130.23.43.20andphysicaladdress0xB23455102210hasapackettosendtoanotherhostwithIPaddress130.23.43.25andphysicaladdress0xA46EF45983AB.ThetwohostsareonthesameEthernetnetwork.ShowtheARPrequestandreplypacketsencapsulatedinEthernetframes.2020/1/10TCP/IPProtocolSuite22Example:ARPRequest2020/1/10TCP/IPProtocolSuite23Example:ARPReply12020/1/10TCP/IPProtocolSuite24ProxyARP(代理ARP)ProxyARP:——产生子网效应代表另一个物理网络中一组主机回答ARPRequest,在ARPReply中通告自己的MAC地址(即将解析的IP与代理ARP的MAC绑定)TofoolthesenderoftheARPrequestintothinkingthattherouteristhedestinationhost,wheninfactthedestinationhostisontheothersideoftherouter“Honest”HidedQ:InthesameIPnetworkornot?子网效应:属于相同IP子网的节点间通信仍然需要经过路由器转发2020/1/10TCP/IPProtocolSuite25AnswerRFC925:Multi-LANAddressResolutionExplicitsubnetsTransparentsubnets(ExtendedARP)RFC1027:UsingARPtoImplementTransparentSubnetGatewaysRouters:ExplicitsubnetsHosts:Transparentsubnets“Fromthehostpointofview,therearenosubnets,andtheirphysicalnetworksaresim

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

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

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

×
保存成功