需要哈尔滨工业大学深圳高级计算机网络习题集.docx
《需要哈尔滨工业大学深圳高级计算机网络习题集.docx》由会员分享,可在线阅读,更多相关《需要哈尔滨工业大学深圳高级计算机网络习题集.docx(10页珍藏版)》请在冰豆网上搜索。
需要哈尔滨工业大学深圳高级计算机网络习题集
【关键字】需要
1.Achannelhasabitrateof4kbpsandapropagationdelayof20msec.Forwhatrangeofframesizesdoesstop-and-waitgiveanefficiencyofatleast50%?
answer:
发送一帧的时间等于信道的传播延迟的2倍,信道的利用率为50%,所以,在帧长满足发送时间大于延迟时间的2倍是,效率将会高于50%。
由于4kbps=4000bps故
4000*20*0.001*2=160bit
只有在帧长不小于160bit时,停止等待协议的效率才会至少是50%。
解此题可供参照的公式有两个,下面这两种情况下都可以得到答案:
一个是效率=其中P是传输一帧所需要的时间,t是端到端传送时延。
所以可以由>=50%,解出帧N>=160bit;
二是中第42张中讲到的公式,公式综合考虑了多种因素,信道丢失率,帧头的大小,以及ACK的发送时间。
在不考虑数据帧的处理时间tproc和ACK发送时间的情况下,我们可以推出帧的最小大小为160bit。
答案详情参看上次文档。
作业中得到错误答案有两个
(1)N>=80bit得出此答案的同学没有弄清楚停等协议,在停等协议公式1分母下面的2t是往返时间,而不是t。
(2)160kbit,单位换算错误。
我可以负责任的告诉你没有哪个网络里面帧能够有十几万比特大小的,以太网里最大帧不过1526字节。
2.Imagineaslidingwindowprotocolusingsomanybitsforsequencenumbersthatwraparoundneveroccurs.Whatrelationsmustholdamongthefourwindowedgesandthewindowsize,whichisconstantandthesameforboththesenderandthereceiver?
answer:
假设发送者的窗口为(S1,Sn),接受者的窗口为(R1,Rn),窗口大小为W,则
需满足:
0<=Sn-S1+1<=W
Rn-R1+1=W
S1<=R1<=Sn+1即可。
这题答案很简单,可能有疑问的同学被题目的第一句话给迷惑了。
第一句话是滑动窗口协议正常运行必要条件。
第一个式子很好理解,是已发送但未确认数据包和等待发送数据包的序列范围内的数据包总个数,如果窗口是从左向右滑动,已发送但未确认数据包序列号在等待发送数据包左侧。
很显然这个值是不能大于窗口大小的。
第二个式子,通常在滑动窗口协议里,窗口的大小是在链接初期协商的,在此题中接收窗口等于发送窗口,表示接收方可以缓存发送方的任何帧。
接收方可以通过接受的第一个帧的序列号R1来确认自己可以接收的帧序列号范围为W+R1-1。
因此在接收方,可接收序列号范围就是窗口的小。
序列号范围内的数据包个数是Ru-Rl+1而不是Ru-Rl。
并不代表接收方缓存是满的。
第三个式子,Rl就是已发送但未确认数据包和等待发送数据包的边界,由于接收方缓存里只有那些已接受但未确认数据包,所以Rl>=Sl但一定有Rl<=Su+1,因为接收者缓存里不可能有发送者等待队列之外的数据。
3.AlargepopulationofALOHAusersmanagestogenerate50requests/sec,includingbothoriginalsandretransmissions.Timeisslottedinunitsof40msec.
(a)Whatisthechanceofsuccessonthefirstattempt?
(b)Whatistheprobabilityofexactlykcollisionsandthenasuccess?
(c)Whatistheexpectednumberoftransmissionattemptsneeded?
answers:
(a)accordingtothedefinition,throughputofSlottedALOHA,aframewillnotsufferacollosionifnootherframesaresentatthebeginningofthesameframetime,theprobabilityofnoothertrafficduringthesameslotisP=e^-G;
50*40*0.001=2,so,G=2
P=e^-2=1/e^2
So,thechanceofsuccessonthefirstattemptis1/e^2.
(b)thatistosay,atransmissionrequiringexactlyK+1attempts.So,theprobabilityisP=(e^-G)*(1-e^-G)^K,G=2,
So,P=(1-e^2)^K(e^-2)=0.135*(1-0.135)^K=0.135*0.865^K
(c)accordingtothedefinitionofthroughputofslottedALOHA,theexpectednumberoftransmissionsE=e^G,G=2,
So,E=e^2
参照《计算机网络(第五版)》美·特南鲍姆204~205页内容,解题关键是先求出G(单位时隙里生成的帧数),剩下的都是套公式。
3.What’stheremainderobtainedbydividingx7+x5+1bythegeneratorpolynomialx3+1?
Solution:
Thepolynomialx7+x5+1correspondsto,thegeneratorpolynomialis1001.Sotheremainderis%1001=111.
1.AgroupofNstationssharea56-kbpspureALOHAchannel.Eachstationoutputsa1000-bitframeonanaverageofonceevery100sec,evenifthepreviousonehasnotyetbeensent(e.g.,thestationscanbufferoutgoingframes).What“isthemaximumvalueofN?
答:
对于100%的ALOHA,可用的带宽是0.184×56Kb/s?
=10.304?
Kb/s。
每个站需要的带宽为1000/100=10b/s。
而N=10304/10≈1030所以,最多可以有1030个站,即N的最大值为1030。
3.MeasurementsofaslottedALOHAchannelwithaninfinitenumberofusersshowthat10percentoftheslotsareidle.
(a)Whatisthechannelload,G?
(b)Whatisthethroughput?
(c)Isthechannelunderloadedoroverloaded?
答:
(a)从泊松定律得到p0=e^-G,因此G=-lnp0=-ln0.1=2.3
(b)由题知S=G*e-G,G=2.3,e^-G=0.1
S=2.3×0.1=0.23
(c)因为每当G>1时,信道总是过载的,因此在这里信道是过载的。
4.Whatisthebaudrateofthestandard10MbpsEthernet?
答:
以太网使用曼彻斯特编码,意味着发送每一位都有两个信号周期,标准以太网的数据率为10MB/S,一次波特率是数据率的两倍,为20MBaud。
5.A1-km-long,10-MbpsCSMA/CDLAN(not802.3)hasapropagationspeedof/?
sec.Repeatersarenotallowedinthissystem.Dataframesare256bitslong,including32bitsofheader,checksum,andotheroverhead.ThefirstbitslotafterasuccessfultransmissionisreservedforthereceivertocapturethechannelinordertoSenda32-bitacknowledgementframe.Whatistheeffectivedatarate,excludingoverhead,assumingthattherearenocollisions?
答:
依题意知道的铜电缆中单程的传播时间为1、200000=5usec,往返的时间为2t=10usec,我们知道,一次完整的传输分为六步,发送者侦听铜电缆的时间为10usec,若线路可用发送数据帧传输时间为256bits、10MPS=25.6usec,数据帧最后一位到达时传播的延迟为5.0usec,接听者侦听铜电缆的时间为10usec,若线路可用接听者发送确认帧所用的时间为3.2usec,确认帧最后一位到达时的传播延迟为5.0usec,总共58.8sec,在这期间发送了224bits的数据,所以数据率为3.8MPS。
6.TwoCSMA/CDstationsareeachtryingtotransmitlong(multiframe)files.Aftereachframeissent,theycontendforthechannel,usingthebinary
exponentialbackoffalgorithm.Whatistheprobabilitythatthecontentionendsonroundk,andwhatisthemeannumberofroundspercontentionperiod?
答:
把获得通道的尝试从1开始编号。
第i次尝试分布在2i-1个时隙中。
因此,i次尝试碰撞的概率是2-(i-1),开头k-1次尝试失败,紧接着第k次尝试成功的概率是:
Pk=(1-2^-(k-1))[2^-0*2*-1*······*2^-(k-2)]=(1-2^-(k-1))2^-(k-1)(k-2)/2所以每个竞争周期的平均竞争次数是Σkpk(k=1,2,3······∞)
8.AnIPpackettobetransmittedbyEthernetis60byteslong,includingallitsheaders.IfLLCisnotinuse,ispaddingneededintheEthernetframe,and
ifso,howmanybytes?
答:
最小的以太帧是64bytes,包括了以太帧头部的二者地址、类型/长度域、校验和。
因为头部域占用18bytes报文是60bytes,总的帧长度是78bytes,已经超过了64-byte的最小限制。
因此,不需要填补。
1.Describedistancevector(DV)algorithm.DiscussthefeatureoftheDVroutingalgorithm.
Solution:
(1)ThebasicideaofDValgorithm
EachnodexbeginswithDx(y),anestimateofthecostoftheleast-costpathfromitselftonodey,forallnodesinN.LetDx=[Dx(y):
yinN]benodex’sdistancevector,whichisthevectorofcostestimatesfromxtoallothernodes,y,inN.WiththeDValgorithm,eachnodexmaintainsthefollowingroutinginformation:
•Foreachneighborv,thecostc(x,v)fromxtodirectlyattachedneighborv
•Nodex’sdistancevector,thatis,Dx=[Dx(y):
yinN],containingx’sestimateofitscosttoalldestinations,y,inN
•Thedistancevectorsofeachofitsneighbors,thatis,Dv=[Dv(y):
yinN]foreachneighborvofx
Inthedistributed,asynchronousalgorithm,fromtimetotime,eachnodesendsacopyofitsdistancevectortoeachofitsneighbors.Whenanodexreceivesanewdistancevectorfromanyofitsneighborsv,itsavesv’sdistancevector,andthenusestheBellman-Fordequationtoupdateitsowndistancevectorasfollows:
Dx(y)_minv{c(x,v)+Dv(y)}foreachnodeyinN
Ifnodex’sdistancevectorhaschangedasaresultofthisupdatestep,nodexwillthensenditsupdateddistancevectortoeachofitsneighbors,whichcaninturnupdatetheirowndistancevectors.Miraculouslyenough,aslongasallthenodescontinuetoexchangetheirdistancevectorsinanasynchronousfashion,eachcostestimateDx(y)convergestodx(y),theactualcostoftheleast-costpathfromnodextonodey
(2)ThefeatureoftheDVroutingalgorithm
Thedistancevector(DV)algorithmisiterative,asynchronous,anddistributed.
Itisdistributedinthateachnodereceivessomeinformationfromoneormoreofitsdirectlyattachedneighbors,performsacalculation,andthendistributestheresultsofitscalculationbacktoitsneighbors.
Itisiterativeinthatthisprocesscontinuesonuntilnomoreinformationisexchangedbetweenneighbors.(Interestingly,thealgorithmisalsoself-terminating—thereisnosignalthatthecomputationshouldstop;itjuststops.)
Thealgorithmisasynchronousinthatitdoesnotrequireallofthenodestooperateinlockstepwitheachother.
2.ConsideraconfigurationinwhichpacketsaresentfromcomputersonaLANtosystemsonothernetworks.AllofthesepacketsmustpassthrougharouterthatconnectstheLANtoawideareanetworkandhencetotheoutsideworld.
LetuslookatthetrafficfromtheLANthroughtherouter.Packetsarrivewithameanarrivalrateof5persecond.Theaveragepacketlengthis144bytes,anditisassumedthatpacketlengthisexponentiallydistributed.Linespeedfromtheroutertothewide-areanetworkis9600bps.Thefollowingquestionsareasked:
(a)Whatistheutilizationofthelinkoftherouter?
(b)Whatisthemeanresidencetimeintherouter?
(c)Howmanypacketsareintherouter,includingthosewaitingfortransmissionandtheonecurrentlybeingtransmitted(ifany),ontheaverage?
Solution:
(a)Meanarrivalrate(throughput):
X=5packets/sec
Averageservicetime:
S=((144bytes/packet)*(8bits/byte))/9600bps=0.12sec/packet
Utilization(timetherouterisbusy):
U=X*S=(5packets/sec)*(0.12sec/packet)=0.6
(b)ThemeanresidencetimeisT=S/(1-U)=(0.12sec/packet)/(1-0.6)=0.3sec/packet
(c)NumberofpacketsintherouterisE[n]=U/(1-U)=1.5packets
2.Considerthearrivaltrafficcharacterizedbyatokenbucketwithparametersρ(averagerate)=1Mbps,M(maximumoutputrate)=2Mbps,andC(tokencapacity)=200Kb.Whatistheminimumraterthatneedstobeallocatedbyarouterinordertoguaranteeadelaynolargerthan50ms?
Solution:
Webuildtheequationaccordingtotherule:
thebitsflowedintherouterareequaltothebitsflowedouttherouter.LetSbeburstlength,themaximumaccumulativeamountofarrivaltraffictotherouterisC+ρS=MS.WegetS=C/(M-ρ).Whentherouterdealthearrivaltrafficattheminimumraterwithadelaynolargerthan50ms,letD=50msandtheequationisMS=r*(S+D).So,
3.Describethebordergatewayprotocol(BGP)anddiscusshowapacketwouldbetransmittedamongdifferentautonomoussystem(AS).
Solution:
BorderGatewayProtocolversion4(BGP4)
WejustlearnedhowISPsuseRIPandOSPFtodetermineoptimalpathsforsourcedestinationpairsthatareinternaltothesameAS.Let’snowexaminehowpathsaredeterminedforsource-destinationpairsthatspanmultipleASs.
BGPprovideseachASameansto
1.ObtainsubnetreachabilityinformationfromneighboringASs.
2.PropagatethereachabilityinformationtoallroutersinternaltotheAS.
3.Determine“good”routestosubnetsbasedonthereachabilityinformationandonASpolicy.
4.Supposethatframesare1250byteslongincluding25bytesofhead.A