第三章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