计网第五次作业

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

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

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

资源描述

ReviewQuestions:1.Whataresomeofthepossibleservicesthatalink-layerprotocolcanoffertothenetworklayer?Whichoftheselink-layerserviceshavecorrespondingservicesinIP?InTCP?链路层协议提供给网络层的服务有哪些?哪些是给IP的?哪些是给TCP的?Linkaccess,framing,reliabledeliverybetweenadjacentnodes,flowcontrol,errordetection,errorcorrection,half-duplexandfull-duplex.InIP:framing,errordetection.InTCP:framing,reliabledeliverybetweenadjacentnodes,errordetection,half-duplexandfull-duplex.2.IfallthelinksintheInternetweretoprovidereliabledeliveryservice,wouldtheTCPreliabledeliveryserviceberedundant?Whyorwhynot?不会多余,因为TCP保证的是传输层的数据传送,而link提供稳定可靠传输保证链路层的传输稳定,二者不完全重叠,所以TCP可靠传输也不会多余。3.InSection5.3,welistedfourdesirablecharacteristicsofabroadcastchannel.WhichofthesecharacteristicsdoesslottedALOHAhave?Whichofthesecharacteristicsdoestokenpassinghave?4.SupposetwonodesstarttotransmitatthesametimeapacketoflengthLoverabroadcastchannelofrateR.Denotethepropagationdelaybetweenthetwonodesasdprop.WilltherebeacollisionifdpropL/R?Whyorwhynot?因为L/R=包传递的时间,如果dpropL/R,也就意味着A的信号跑到B的时候B的最后一个分组还没离开B,所以发生碰撞。7.SupposenodesA,B,andCeachattachtothesamebroadcastLAN(throughtheiradapters).IfAsendsthousandsofIPdatagramstoBwitheachencapsulatingframeaddressedtotheMACaddressofB,willC’sadapterprocesstheseframes?Ifso,willC’sadapterpasstheIPdatagramsintheseframestothenetworklayerC?HowwouldyouranswerschangeifAsendsframeswiththeMACbroadcastaddress?不会,C会拆封帧从而读取报头的MAC,因为每一个host的MAC都唯一,C读取到数据报中的MAC和自己的不一样就不会继续拆封数据报,不会投递给C。当使用LAN口广播地址的时候,C的适配器就会拆封帧,向C传递数据。8.HowbigistheMACaddressspace?TheIPv4addressspace?TheIPv6addressspace?2^48,2^32,2^128.9.WhyisanARPquerysentwithinabroadcastframe?WhyisanARPresponsesentwithinaframewithaspecificdestinationMACaddress?因为新加入网络的主机是不知道路由器的IP的,自己也没有IP,所以只能广播才能得到IP。因为每个主机的MAC地址都是唯一的,而ARP建立转发表的时候会带上MAC地址。12.InCSMA/CD,afterthefifthcollision,whatistheprobabilitythatanodechoosesK=4?TheresultK=4correspondstoadelayofhowmanysecondsona10MbpsEthernet?可能,因为第五次K的取值范围是0-(2^5-1)即0-31。Bittime=1bit/R=1bit/10Mbps=1msec,K=4,waittime=4*512*1msec=2048msec。Problems:1.Supposetheinformationcontentofapacketisthebitpattern1110110010001010andanevenparityschemeisbeingused.Whatwouldthevalueofthefieldcontainingtheparitybitsbeforthecaseofatwo-dimensionalparityscheme?Youranswershouldbesuchthataminimum-lengthchecksumfieldisused.假设一个数据包的信息含量是XXX,使用偶校验方案。采用二位奇偶校验方案的字段包含的奇偶校验位的字段的值是多少?答案要使用最小长度校验。10100101001010010111000112.Supposetheinformationportionofapacket(DinFigure5.4)contains10bytesconsistingofthe8-bitunsignedbinaryASCIIrepresentationoftheintegers0through9.ComputetheInternetchecksumforthisdata.假设一个包的信息的一部分包括10bytes组成的8-bit无符号二进制码表示的整数0-9,计算该数据的网络校验。算校验码先把0-9加起来000000000000000100000010000000110000010000000101000001100000011100001000000010010001010000011001→→→→取反可得校验码为11101011111001103.Considerthepreviousproblem,butinsteadofcontainingthebinaryofthenumbers0through9supposethese10bytescontain.ComputetheInternetchecksumforthisdata.a.thebinaryrepresentationofthenumbers1through10.000000010000001000000011000001000000010100000110000001110000100000001001000101000001101100011110→→→→取反可得1110010011100001b.theASCIIrepresentationofthelettersAthroughJ(uppercase).010000010100001001000011010001000100010101000110010001110100100001001001010010100101100001011111→→→→取反可得1010011110100000c.theASCIIrepresentationofthelettersathroughj(lowercase).小写字母表示011000010110001001100011011001000110010101100110011001110110100001101001011010101111100111111101→→→→取反可得00000110000000106.Considerthepreviousproblem,butsupposethatDhasthevaluea.10010001.b.10100011.c.01010101.前一题题目:Considerthe7-bitgenerator,G=10011,andsupposethatDhasthevalue1010101010.WhatisthevalueofR?求余而已,记住不要做减法而是做与运算就好。a.R=001b.R=101c.R=10112.ConsiderthreeLANsinterconnectedbytworouters,asshowninFigure5.38.a.Redrawthediagramtoincludeadapters.重新画图b.AssignIPaddressestoalloftheinterfaces.ForSubnet1useaddressesoftheform111.111.111.xxx;forSubnet2usesaddressesoftheform122.122.122.xxx;andforSubnet3useaddressesoftheform133.133.133.xxx.所有的接口分配IP地址。c.AssignMACaddressestoalloftheadapters.a.b.c如图d.ConsidersendinganIPdatagramfromHostAtoHostF.SupposealloftheARPtablesareuptodate.Enumerateallthesteps,asdoneforthesingle-routerexampleinSection5.4.2.1.hostA发送一个数据报,通过转发表查询F的IP,向路由器1发送,其中destinationIP为133.133.133.12,MAC未知,sourceIP为111.111.111.12,sourceMAC为aa-aa-aa-aa-aa-aa。2.适配器更改destination的IP为111.111.111.12,MAC地址变为gg-gg-gg-gg-gg-gg3.路由器1发现目标IP和MAC不属于子网1中任何host,属于子网3(图中忘了画了,意会一下)。于是根据转发表向路由器2进行转发。Destination的IP为122.122.122.20,MAC为ii-ii-ii-ii-ii-ii。4.路由器2收到了数据报,发现hostF在自己的子网内,于是修改destination的IP为133.133.133.12,MAC地址为ff-ff-ff-ff-ff-ff。修改sourceIP为133.133.133.20,MAC为jj-jj-jj-jj-jj-jj,然后向F发送数据报。5.F收到来自A的数据报。e.Repeat(d),nowassumingthattheARPtableinthesendinghostisempty(andtheothertablesareuptodate).发送方的ARP表为空,首先需要建立ARP表1.hostA发送一个广播,destinationIP是255.255.255.255,MAC为空。SourceIP为111.111.111.12,MAC为aa-aa-aa-aa-aa-aa2.适配器收到了来自hostA的数据报,更新自己的ARP表,同时发送一个ACK给hostA,告诉hostA自己的IP、MAC。3.hostA建立ARP表4.如d小问所答,开始进行数据发送。14.RecallthatwiththeCSMA/CDprotocol,theadapterwaitsK·512bittimesafteracollision,whereKisdrawnrandomly

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

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

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

×
保存成功