3.-第三章课后习题及答案

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

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

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

资源描述

第三章1.(Q1)Supposethenetworklayerprovidesthefollowingservice.Thenetworklayerinthesourcehostacceptsasegmentofmaximumsize1,200bytesandadestinationhostaddressfromthetransportlayer.Thenetworklayerthenguaranteestodeliverthesegmenttothetransportlayeratthedestinationhost.Supposemanynetworkapplicationprocessescanberunningatthedestinationhost.a.Designthesimplestpossibletransport-layerprotocolthatwillgetapplicationdatatothedesiredprocessatthedestinationhost.Assumetheoperatingsysteminthedestinationhosthasassigneda4-byteportnumbertoeachrunningapplicationprocess.b.Modifythisprotocolsothatitprovidesa“returnaddress”tothedestinationprocess.c.Inyourprotocols,doesthetransportlayer“havetodoanything”inthecoreofthecomputernetwork.Answer:a.CallthisprotocolSimpleTransportProtocol(STP).Atthesenderside,STPacceptsfromthesendingprocessachunkofdatanotexceeding1196bytes,adestinationhostaddress,andadestinationportnumber.STPaddsafour-byteheadertoeachchunkandputstheportnumberofthedestinationprocessinthisheader.STPthengivesthedestinationhostaddressandtheresultingsegmenttothenetworklayer.ThenetworklayerdeliversthesegmenttoSTPatthedestinationhost.STPthenexaminestheportnumberinthesegment,extractsthedatafromthesegment,andpassesthedatatotheprocessidentifiedbytheportnumber.b.Thesegmentnowhastwoheaderfields:asourceportfieldanddestinationportfield.Atthesenderside,STPacceptsachunkofdatanotexceeding1192bytes,adestinationhostaddress,asourceportnumber,andadestinationportnumber.STPcreatesasegmentwhichcontainstheapplicationdata,sourceportnumber,anddestinationportnumber.Itthengivesthesegmentandthedestinationhostaddresstothenetworklayer.Afterreceivingthesegment,STPatthereceivinghostgivestheapplicationprocesstheapplicationdataandthesourceportnumber.c.No,thetransportlayerdoesnothavetodoanythinginthecore;thetransportlayer“lives”intheendsystems.2.(Q2)Consideraplanetwhereeveryonebelongstoafamilyofsix,everyfamilylivesinitsownhouse,eachhousehasauniqueaddress,andeachpersoninagivenhousehasauniquename.Supposethisplanethasamailservicethatdeliverslettersformsourcehousetodestinationhouse.Themailservicerequiresthat(i)theletterbeinanenvelopeandthat(ii)theaddressofthedestinationhouse(andnothingmore)beclearlywrittenontheenvelope.Supposeeachfamilyhasadelegatefamilymemberwhocollectsanddistributeslettersfortheotherfamilymembers.Thelettersdonotnecessarilyprovideanyindicationoftherecipientsoftheletters.a.UsingthesolutiontoProblemQ1aboveasinspiration,describeaprotocolthatthedelegatescanusetodeliverlettersfromasendingfamilymembertoareceivingfamilymember.b.Inyourprotocol,doesthemailserviceeverhavetoopentheenvelopeandexaminetheletterinordertoprovideitsservice.Answer:a.Forsendingaletter,thefamilymemberisrequiredtogivethedelegatetheletteritself,theaddressofthedestinationhouse,andthenameoftherecipient.Thedelegateclearlywritestherecipient’snameonthetopoftheletter.Thedelegatethenputstheletterinanenvelopeandwritestheaddressofthedestinationhouseontheenvelope.Thedelegatethengivesthelettertotheplanet’smailservice.Atthereceivingside,thedelegatereceivestheletterfromthemailservice,takestheletteroutoftheenvelope,andtakesnoteoftherecipientnamewrittenatthetopoftheletter.Thedelegatethangivesthelettertothefamilymemberwiththisname.b.No,themailservicedoesnothavetoopentheenvelope;itonlyexaminestheaddressontheenvelope.3.(Q3)DescribewhyanapplicationdevelopermightchoosetorunanapplicationoverUDPratherthanTCP.Answer:AnapplicationdevelopermaynotwantitsapplicationtouseTCP’scongestioncontrol,whichcanthrottletheapplication’ssendingrateattimesofcongestion.Often,designersofIPtelephonyandIPvideoconferenceapplicationschoosetoruntheirapplicationsoverUDPbecausetheywanttoavoidTCP’scongestioncontrol.Also,someapplicationsdonotneedthereliabledatatransferprovidedbyTCP.4.(P1)SupposeClientAinitiatesaTelnetsessionwithServerS.Ataboutthesametime,ClientBalsoinitiatesaTelnetsessionwithServerS.Providepossiblesourceanddestinationportnumbersfora.ThesegmentsentfromAtoB.b.ThesegmentsentfromBtoS.c.ThesegmentsentfromStoA.d.ThesegmentsentfromStoB.e.IfAandBaredifferenthosts,isitpossiblethatthesourceportnumberinthesegmentfromAtoSisthesameasthatfromBtoS?f.Howaboutiftheyarethesamehost?Answer:sourceportnumbersdestinationportnumbersaA→S46723bB→S51323cS→A23467dS→B23513eYes.fNo.5.(P2)ConsiderFigure3.5Whatarethesourceanddestinationportvaluesinthesegmentsflowingformtheserverbacktotheclients’processes?WhataretheIPaddressesinthenetwork-layerdatagramscarryingthetransport-layersegments?Answer:SupposetheIPaddressesofthehostsA,B,andCarea,b,c,respectively.(Notethata,b,caredistinct.)TohostA:Sourceport=80,sourceIPaddress=b,destport=26145,destIPaddress=aTohostC,leftprocess:Sourceport=80,sourceIPaddress=b,destport=7532,destIPaddress=cTohostC,rightprocess:Sourceport=80,sourceIPaddress=b,destport=26145,destIPaddress=c6.(P3)UDPandTCPuse1scomplementfortheirchecksums.Supposeyouhavethefollowingthree8-bitbytes:01101010,01001111,01110011.Whatisthe1scomplementofthesumofthese8-bitbytes?(NotethatalthoughUDPandTCPuse16-bitwordsincomputingthechecksum,forthisproblemyouar

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

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

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

×
保存成功