中科大,计算机网络课件07.ppt_第1页
中科大,计算机网络课件07.ppt_第2页
中科大,计算机网络课件07.ppt_第3页
中科大,计算机网络课件07.ppt_第4页
中科大,计算机网络课件07.ppt_第5页
已阅读5页,还剩32页未读 继续免费阅读

下载本文档

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

文档简介

TCP IPProtocolSuite 1 Chapter7 Uponcompletionyouwillbeableto ARPandRARP UnderstandtheneedforARPUnderstandthecasesinwhichARPisusedUnderstandthecomponentsandinteractionsinanARPpackageUnderstandtheneedforRARP Objectives TCP IPProtocolSuite 2 Figure7 1ARPandRARP TCP IPProtocolSuite 3 Figure7 2PositionofARPandRARPinTCP IPprotocolsuite TCP IPProtocolSuite 4 7 1ARP ARPassociatesanIPaddresswithitsphysicaladdress Onatypicalphysicalnetwork suchasaLAN eachdeviceonalinkisidentifiedbyaphysicalorstationaddressthatisusuallyimprintedontheNIC Thetopicsdiscussedinthissectioninclude PacketFormatEncapsulationOperationProxyARP TCP IPProtocolSuite 5 Figure7 3ARPoperation TCP IPProtocolSuite 6 Figure7 4ARPpacket 硬件类型表示硬件地址的类型 以太网为1 协议类型字段表示要映射的协议地址类型 IP协议对应的值为0 x0800 硬件地址长度 以太网为6 协议地址长度 以太网为4 即IP地址长度 IPv4 ipv6添16 这里单位是字节 操作字段 ARP请求 1 ARP应答 2 RARP请求 3 RARP应答 4 当系统收到一份目的端为本机的ARP请求报文时 它就把硬件地址填进去 然后用两个目的端地址分别替换两个发送端地址 源和目的地址交换 并把操作字段置为2 最后把它发送出去 TCP IPProtocolSuite 7 TCP IPProtocolSuite 8 Figure7 5EncapsulationofARPpacket 目的地址 源地址 类型 CRC 数据 46 1500字节 6 6 2 4 0800IP数据报 46 1500字节 2 0806ARP请求 应答PAD 0835RARP请求 应答PAD 2 28 18 类型 TCP IPProtocolSuite 9 TCP IPProtocolSuite 10 含有ARP消息的以太网帧 TCP IPProtocolSuite 11 含有ARP消息的以太网帧 129 84 25 02 TCP IPProtocolSuite 12 Figure7 6FourcasesusingARP TCP IPProtocolSuite 13 AnARPrequestisbroadcast anARPreplyisunicast Note TCP IPProtocolSuite 14 AhostwithIPaddress130 23 43 20andphysicaladdressB2 34 55 10 22 10hasapackettosendtoanotherhostwithIPaddress130 23 43 25andphysicaladdressA4 6E F4 59 83 AB whichisunknowntothefirsthost ThetwohostsareonthesameEthernetnetwork ShowtheARPrequestandreplypacketsencapsulatedinEthernetframes Example1 SeeNextSlide TCP IPProtocolSuite 15 SolutionFigure7 7showstheARPrequestandreplypackets NotethattheARPdatafieldinthiscaseis28bytes andthattheindividualaddressesdonotfitinthe4 byteboundary Thatiswhywedonotshowtheregular4 byteboundariesfortheseaddresses AlsonotethattheIPaddressesareshowninhexadecimal ForinformationonbinaryorhexadecimalnotationseeAppendixB Example1 Continued SeeNextSlide TCP IPProtocolSuite 16 Figure7 7Example1 TCP IPProtocolSuite 17 Figure7 8ProxyARP TCP IPProtocolSuite 18 7 2ARPPACKAGE Inthissection wegiveanexampleofasimplifiedARPsoftwarepackagetoshowthecomponentsandtherelationshipsbetweenthecomponents ThisARPpackageinvolvesfivemodules acachetable queues anoutputmodule aninputmodule andacache controlmodule Thetopicsdiscussedinthissectioninclude CacheTableQueuesOutputModuleInputModuleCache ControlModule TCP IPProtocolSuite 19 Figure7 9ARPcomponents TCP IPProtocolSuite 20 Table7 1Originalcachetableusedforexamples TCP IPProtocolSuite 21 输出模块 算法 睡眠 直到从IP软件收到IP分组 检查高速缓存表 查找对应该IP分组的目的端的项目 若找到若状态是RESOLVED从项目中提取硬件地址值 将分组连同硬件地址一起发送到数据链路层 返回 若状态是PENDINGpending把分组放入相应的队列 返回 若未找到创建一个高速缓存项目 状态置为P且尝试置1 创建一个队列将分组放入队列 发送ARP请求 返回 TCP IPProtocolSuite 22 输入模块 算法 睡眠 直到ARP分组 请求或回答 到达 检查高速缓存表 查询对应该ARP分组的项目 若找到更新这个项目 若状态是PENDING当队列非空把一个分组从队列中取出 将分组连同硬件地址一起发送给数据链路层 若找不到创建一个项目 在高速缓存表中添加该项目 若分组是请求发送ARP回答 返回 TCP IPProtocolSuite 23 高速缓存控制模块 算法 睡眠 直到周期性计时器到时间 对高速缓存表中的每一个项目若状态为FREE继续 若状态为PENDING把尝试值加1 若尝试值大于最大数把状态改为FREE 撤销相应的队列 否则发送ARP请求 继续若状态为RESOLVED把超时字段的值减去已经过的时间 若超时字段的值小于或等于零把状态改为FREE 撤销相应的队列 返回 TCP IPProtocolSuite 24 TheARPoutputmodulereceivesanIPdatagram fromtheIPlayer withthedestinationaddress114 5 7 89 ItchecksthecachetableandfindsthatanentryexistsforthisdestinationwiththeRESOLVEDstate Rinthetable Itextractsthehardwareaddress whichis457342ACAE32 andsendsthepacketandtheaddresstothedatalinklayerfortransmission Thecachetableremainsthesame Example2 TCP IPProtocolSuite 25 Twentysecondslater theARPoutputmodulereceivesanIPdatagram fromtheIPlayer withthedestinationaddress116 1 7 22 Itchecksthecachetableanddoesnotfindthisdestinationinthetable ThemoduleaddsanentrytothetablewiththestatePENDINGandtheAttemptvalue1 Itcreatesanewqueueforthisdestinationandenqueuesthepacket ItthensendsanARPrequesttothedatalinklayerforthisdestination ThenewcachetableisshowninTable7 2 Example3 SeeNextSlide TCP IPProtocolSuite 26 Table7 2UpdatedcachetableforExample3 TCP IPProtocolSuite 27 Fifteensecondslater theARPinputmodulereceivesanARPpacketwithtargetprotocol IP address188 11 8 71 Themodulechecksthetableandfindsthisaddress ItchangesthestateoftheentrytoRESOLVEDandsetsthetime outvalueto900 Themodulethenaddsthetargethardwareaddress E34573242ACA totheentry Nowitaccessesqueue18andsendsallthepacketsinthisqueue onebyone tothedatalinklayer ThenewcachetableisshowninTable7 3 Example4 SeeNextSlide TCP IPProtocolSuite 28 Table7 3UpdatedcachetableforExample4 TCP IPProtocolSuite 29 Twenty fivesecondslater thecache controlmoduleupdateseveryentry Thetime outvaluesforthefirstthreeresolvedentriesaredecrementedby60 Thetime outvalueforthelastresolvedentryisdecrementedby25 Thestateofthenext to thelastentryischangedtoFREEbecausethetime outiszero Foreachofthethreependingentries thevalueoftheattempts Example5 SeeNextSlide TCP IPProtocolSuite 30 Table7 4UpdatedcachetableforExample5 TCP IPProtocolSuite 31 7 3RARP RARPfindsthelogicaladdressforamachinethatonlyknowsitsphysicaladdress Thetopicsdiscussedinthissectioninclude PacketFormatEncapsulationRARPServerAlternativeSolutionstoRARP TCP IPProtocolSuite 32 TheRARPrequestpacketsarebroadcast theRARPreplypacketsareunicast Note TCP IPProtocolSuite 33 Figure7 10RARPoperation TCP IPProtocolSuite 34 Figure7 11RARPpacket TCP IPProtocolSuite 35 Figure7 12EncapsulationofRARPpacket TCP IPProtocolSuite 36 AlternativeSolutionstoRARPWhenadisklesscomputerisbooted itneedsmoreinformationinadditiontoitsIPaddress Itneedstoknowitssubnetmask theIPaddressofarouter andtheIPaddressofanam

温馨提示

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

评论

0/150

提交评论