您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 计算机网络课后习题习题四、五
Chapterfive第五章习题38.ConverttheIPaddresswhosehexadecimalrepresentationisC22F1582todotteddecimalnotation.(38.如果一个IP地址的十六进制表示C22F1582,请将它转换成点分十进制标记.)Solution:Theaddressis194.47.21.130.解答:先写成二进制:11000010,0010101111,0001010,10000010所以,它的点分十进制为:194.47.21.13039.AnetworkontheInternethasasubnetmaskof255.255.240.0.Whatisthemaximumnumberofhostsitcanhandle?(39.Interent上一个网络的子网掩码为255.255.240.0.请问它最多能够处理多少台主机?)Solution:Themaskis20bitslong,sothenetworkpartis20bits.Theremaining12bitsareforthehost,so4096hostaddressesexist.Normally,thehostaddressis4096-2=4094.Becausethefirstaddressbeusedfornetworkandthelastoneforbroadcast.解答:从子网掩码255.255.240.0可知,它还有12位用于作主机号。故它的容量有2的12次方,也即有4096地址。除去全0和全1地址,它最多能够处理4094台主机40.AlargenumberofconsecutiveIPaddressareavailablestartingat198.16.0.0.Supposethatfourorganizations,A,B,C,andD,request4000,2000,4000,and8000addresses,respectively,andinthatorder.Foreachofthese,givethefirstIPaddressassigned,thelastIPaddressassigned,andthemaskinthew.x.y.z/snotation.(40.假定从198.16.0.0开始有大量连续的IP地址可以使用.现在4个组织A,B,C和D按照顺序依次申请4000,2000,4000和8000个地址.对于每一个申请,请利用w.x.y.z/s的形式写出所分配的第一个IP地址,以及掩码.)Solution:Tostartwith,alltherequestsareroundeduptoapoweroftwo.Thestartingaddress,endingaddress,andmaskareasfollows:A:198.16.0.0–198.16.15.255writtenas198.16.0.0/20B:198.16.16.0–198.23.15.255writtenas198.16.16.0/21C:198.16.32.0–198.16.47.255writtenas198.16.32.0/20D:198.16.64.0–198.16.95.255writtenas198.16.64.0/19解答:因为只能是2的整数次方的,故应分别借4096,2048,4096,8192个IP地址。它们分别为2的12次方,2的11次方,2的11次方,2的13次方.故可有如下分配方案:组织首地址末地址w.x.y.z/s的形式A198.16.0.0198.16.15.255198.16.0.0/20B198.16.16.0198.16.23.255198.16.16.0/21C198.16.32.0198.16.47.255198.16.32.0/20D198.16.64.0198.16.95.255198.16.64.0/1911111111111111111111000000000000128+64+32+16=240198.16.0.0198.16.16.0198.16.32.0198.16.48.0198.16.64.011111000000000002481110000000000000224198.16.0.0198.16.32.0198.16.64.0198.16.96.0——————————————————————————————————————41.ArouterhasjustreceivedthefollowingnewIPaddresses:57.6.96.0/21,57.6.104.0/21,57.6.112.0/21,and57.6.120.0/21.Ifallofthemusethesameoutgoingline,cantheybeaggregated?Ifso,towhat?Ifnot,whynot?(41.一台路由器刚刚接收到一下新的IP地址:57.6.96.0/27,57.6.104.0/21,57.6.112.0/21和57.6.120.0/21.如果所有这些地址都使用同一条输出线路,那么,它们可以被聚集起来吗?如果可以的话,它们被聚集到那个地址上?如果不可以的话,请问为什么?)Solution:Theycanbeaggregatedto57.6.96/19.解答:96=(01100000)2104=(01100100)2112=(01101000)2120=(01101110)2可以看出,四个IP地址前19位都是相同的(前面57的8位以及6的8位和后面011这3位,共19位)故得聚合到地址57.6.96.0/19上。42.ThesetofIPaddressesfrom29.18.0.0to19.18.128.255hasbeenaggregatedto29.18.0.0/17.However,thereisagapof1024unassignedaddressesfrom29.18.60.0to29.18.63.255thatarenowsuddenlyassignedtoahostusingadifferentoutgoingline.Isitnownecessarytosplituptheaggregateaddressintoitsconstituentblocks,addthenewblocktothetable,andthenseeifanyreaggregationispossible?Ifnot,whatcanbedoneinstead?(42.从29.18.0.0到29.18.128.255之间的IP地址集合已经被聚集到29.18.0.0/17.然而,这里有一段空隙地址,即从29.18.60.0到29.18.63.255之间的1024个地址还没有被分配.现在这段空隙地址突然要被分配给一台使用不同输出线路的主机.请问是否有必要将聚集地址分割成几块,然后把新的地址块加入到路由表中,再看一看是否可以重新聚集?如果没有必要的话,那该怎么办?)Solution:Itissufficienttoaddonenewtableentry:29.18.0.0/22forthenewblock.Ifanincomingpacketmatchesboth29.18.0.0/17and29.18.0.0./22,thelongestonewins.Thisrulemakesitpossibletoassignalargeblocktooneoutgoinglinebutmakeanexceptionforoneormoresmallblockswithinitsrange.解答:没有必要。只要在路由表中添加一项:29.18.0.0/22就可以了。当有一个分组到来时,如果它既匹配29.18.0.0/17,又匹配29.18.0.0/22,那么它将被发送到掩码位数较大的目标地址,即29.18.0.7/22。这样做的好处是使得一个大段的地址能够被指定到一个目标,但又允许其中少量的地址出现例外的情况。43.Arouterhasthefollowing(CIDR)entriesinitsroutingtable:Address/maskNexthop135.46.56.0/22Interface0135.46.60.0/22Interface1192.53.40.0/23Router1defaultRouter2ForeachofthefollowingIPaddresses,whatdoestherouterdoifapacketwiththataddressarrives?a.(a)135.46.63.10b.(b)135.46.57.14c.(c)135.46.52.2d.(d)192.53.40.7e.(e)192.53.56.743.一台路由器的路由表中有以下的(CIDR)表项:地址/掩码下一跳135.46.56.0/22接口0135.46.60.0/22接口1192.53.40.0/23路由器1默认路由器2对于下面的每一个IP地址,请问,如果一个到达分组的目标地址为该IP地址,那么路由器该怎么办?(a)135.46.63.10(b)135.46.57.14(c)135.46.52.2(d)192.53.40.7(e)192.53.56.7Solution:Thepacketsareroutedasfollows:(a)Interface1(b)Interface0(c)Router2(d)Router1解答:(a)135.46.63.10和255.255.252.0做与运算得到135.46.60.0,故发送给接口1;(b)135.46.57.14和255.255.252.0做与运算得到135.46.56.0,故发送给接口0;(c)135.46.52.2和255.255.252.0做与运算得到135.46.52.0,故发送给路由器2;(d)135.53.40.7和255.255.254.0做与运算得到135.53.40.0,故发送给路由器1;(e)135.53.56.7和255.255.254.0做与运算得到135.53.56.0,故发送给路由器2。第四章习题17.SketchtheManchesterencodingforthebitstream:0001110101.(17.画出位流0001110101的曼彻施特编码。)Solution:17.Thesignalisasquarewavewithtwovalues,high(H)andlow(L).ThepatternisLHLHLHHLHLHLLHHLLHHL.解答:设H为高电压,L为低电压,则曼彻施特编码为LHLHLHHLHLHLLHHLLHHL22.AnIPpackettobetransmittedbyEthernetis60byteslong,includingallitsheaders.IfLLCisnotinuse,ispaddingneededintheEthernetframe,andifso,howmanybytes?Solution:22.TheminimumEthernetframeis64bytes,includingbothaddressesintheEthernetframeheader,thetype/lengthfield,andthechecksum.Sincetheheaderfieldsoccupy18bytesandthepacketis60bytes,thetotalframesizeis78bytes,whichexceedsthe64-byteminimum.Therefore,nopaddingisused.24.SomebooksquotethemaximumsizeofanEthernetframeas1518bytesi
本文标题:计算机网络课后习题习题四、五
链接地址:https://www.777doc.com/doc-4535587 .html