Computer Networking A Top Down Approach ,Chapter3_5thppt课件_第1页
Computer Networking A Top Down Approach ,Chapter3_5thppt课件_第2页
Computer Networking A Top Down Approach ,Chapter3_5thppt课件_第3页
Computer Networking A Top Down Approach ,Chapter3_5thppt课件_第4页
Computer Networking A Top Down Approach ,Chapter3_5thppt课件_第5页
已阅读5页,还剩103页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

.,3-1,Chapter3TransportLayer,ComputerNetworking:ATopDownApproach5thedition.JimKurose,KeithRossAddison-Wesley,April2009.,Anoteontheuseofthesepptslides:Weremakingtheseslidesfreelyavailabletoall(faculty,students,readers).TheyreinPowerPointformsoyoucanadd,modify,anddeleteslides(includingthisone)andslidecontenttosuityourneeds.Theyobviouslyrepresentalotofworkonourpart.Inreturnforuse,weonlyaskthefollowing:Ifyouusetheseslides(e.g.,inaclass)insubstantiallyunalteredform,thatyoumentiontheirsource(afterall,wedlikepeopletouseourbook!)Ifyoupostanyslidesinsubstantiallyunalteredformonawwwsite,thatyounotethattheyareadaptedfrom(orperhapsidenticalto)ourslides,andnoteourcopyrightofthismaterial.Thanksandenjoy!JFK/KWRAllmaterialcopyright1996-2009J.FKuroseandK.W.Ross,AllRightsReserved,.,3-2,Chapter3:TransportLayer,Ourgoals:understandprinciplesbehindtransportlayerservices:multiplexing/demultiplexingreliabledatatransferflowcontrolcongestioncontrol,learnabouttransportlayerprotocolsintheInternet:UDP:connectionlesstransportTCP:connection-orientedtransportTCPcongestioncontrol,.,3-3,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-4,Transportservicesandprotocols,providelogicalcommunicationbetweenappprocessesrunningondifferenthoststransportprotocolsruninendsystemssendside:breaksappmessagesintosegments,passestonetworklayerrcvside:reassemblessegmentsintomessages,passestoapplayermorethanonetransportprotocolavailabletoappsInternet:TCPandUDP,.,3-5,Tworklayer,networklayer:logicalcommunicationbetweenhoststransportlayer:logicalcommunicationbetweenprocessesrelieson,enhances,networklayerservices,Householdanalogy:12kidssendinglettersto12kidsprocesses=kidsappmessages=lettersinenvelopeshosts=housestransportprotocol=AnnandBillnetwork-layerprotocol=postalservice,.,3-6,Internettransport-layerprotocols,reliable,in-orderdelivery(TCP)congestioncontrolflowcontrolconnectionsetupunreliable,unordereddelivery:UDPno-frillsextensionof“best-effort”IPservicesnotavailable:delayguaranteesbandwidthguarantees,.,3-7,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-8,Multiplexing/demultiplexing,application,transport,network,link,physical,P1,application,transport,network,link,physical,application,transport,network,link,physical,P2,P3,P4,P1,host1,host2,host3,=process,=socket,deliveringreceivedsegmentstocorrectsocket,gatheringdatafrommultiplesockets,envelopingdatawithheader(laterusedfordemultiplexing),.,3-9,Howdemultiplexingworks,hostreceivesIPdatagramseachdatagramhassourceIPaddress,destinationIPaddresseachdatagramcarries1transport-layersegmenteachsegmenthassource,destinationportnumberhostusesIPaddressesDatagramSocketmySocket2=newDatagramSocket(12535);UDPsocketidentifiedbytwo-tuple:(destIPaddress,destportnumber),WhenhostreceivesUDPsegment:checksdestinationportnumberinsegmentdirectsUDPsegmenttosocketwiththatportnumberIPdatagramswithdifferentsourceIPaddressesand/orsourceportnumbersdirectedtosamesocket,.,3-11,Connectionlessdemux(cont),DatagramSocketserverSocket=newDatagramSocket(6428);,SPprovides“returnaddress”,.,3-12,Connection-orienteddemux,TCPsocketidentifiedby4-tuple:sourceIPaddresssourceportnumberdestIPaddressdestportnumberrecvhostusesallfourvaluestodirectsegmenttoappropriatesocket,ServerhostmaysupportmanysimultaneousTCPsockets:eachsocketidentifiedbyitsown4-tupleWebservershavedifferentsocketsforeachconnectingclientnon-persistentHTTPwillhavedifferentsocketforeachrequest,.,3-13,Connection-orienteddemux(cont),ClientIP:B,serverIP:C,SP:9157,DP:80,D-IP:C,S-IP:A,D-IP:C,S-IP:B,D-IP:C,S-IP:B,.,3-14,Connection-orienteddemux:ThreadedWebServer,ClientIP:B,serverIP:C,SP:9157,DP:80,P4,D-IP:C,S-IP:A,D-IP:C,S-IP:B,D-IP:C,S-IP:B,.,3-15,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-16,UDP:UserDatagramProtocolRFC768,“nofrills,”“barebones”Internettransportprotocol“besteffort”service,UDPsegmentsmaybe:lostdeliveredoutofordertoappconnectionless:nohandshakingbetweenUDPsender,receivereachUDPsegmenthandledindependentlyofothers,WhyisthereaUDP?noconnectionestablishment(whichcanadddelay)simple:noconnectionstateatsender,receiversmallsegmentheadernocongestioncontrol:UDPcanblastawayasfastasdesired,.,3-17,UDP:more,oftenusedforstreamingmultimediaappslosstolerantratesensitiveotherUDPusesDNSSNMPreliabletransferoverUDP:addreliabilityatapplicationlayerapplication-specificerrorrecovery!,sourceport#,destport#,32bits,Applicationdata(message),UDPsegmentformat,length,checksum,Length,inbytesofUDPsegment,includingheader,.,3-18,UDPchecksum,Sender:treatsegmentcontentsassequenceof16-bitintegerschecksum:addition(1scomplementsum)ofsegmentcontentssenderputschecksumvalueintoUDPchecksumfield,Receiver:computechecksumofreceivedsegmentcheckifcomputedchecksumequalschecksumfieldvalue:NO-errordetectedYES-noerrordetected.Butmaybeerrorsnonetheless?Morelater.,Goal:detect“errors”(e.g.,flippedbits)intransmittedsegment,.,3-19,InternetChecksumExample,NoteWhenaddingnumbers,acarryoutfromthemostsignificantbitneedstobeaddedtotheresultExample:addtwo16-bitintegers,1111001100110011011101010101010101110111011101110111101110111011110010100010001000011,wraparound,sum,checksum,.,3-20,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-21,PrinciplesofReliabledatatransfer,importantinapp.,transport,linklayerstop-10listofimportantnetworkingtopics!,characteristicsofunreliablechannelwilldeterminecomplexityofreliabledatatransferprotocol(rdt),.,3-22,PrinciplesofReliabledatatransfer,importantinapp.,transport,linklayerstop-10listofimportantnetworkingtopics!,characteristicsofunreliablechannelwilldeterminecomplexityofreliabledatatransferprotocol(rdt),.,3-23,PrinciplesofReliabledatatransfer,importantinapp.,transport,linklayerstop-10listofimportantnetworkingtopics!,characteristicsofunreliablechannelwilldeterminecomplexityofreliabledatatransferprotocol(rdt),.,3-24,Reliabledatatransfer:gettingstarted,sendside,receiveside,.,3-25,Reliabledatatransfer:gettingstarted,Well:incrementallydevelopsender,receiversidesofreliabledatatransferprotocol(rdt)consideronlyunidirectionaldatatransferbutcontrolinfowillflowonbothdirections!usefinitestatemachines(FSM)tospecifysender,receiver,eventcausingstatetransition,actionstakenonstatetransition,state:wheninthis“state”nextstateuniquelydeterminedbynextevent,.,3-26,Rdt1.0:reliabletransferoverareliablechannel,underlyingchannelperfectlyreliablenobiterrorsnolossofpacketsseparateFSMsforsender,receiver:sendersendsdataintounderlyingchannelreceiverreaddatafromunderlyingchannel,Waitforcallfromabove,packet=make_pkt(data)udt_send(packet),rdt_send(data),extract(packet,data)deliver_data(data),Waitforcallfrombelow,rdt_rcv(packet),sender,receiver,.,3-27,Rdt2.0:channelwithbiterrors,underlyingchannelmayflipbitsinpacketchecksumtodetectbiterrorsthequestion:howtorecoverfromerrors:acknowledgements(ACKs):receiverexplicitlytellssenderthatpktreceivedOKnegativeacknowledgements(NAKs):receiverexplicitlytellssenderthatpkthaderrorssenderretransmitspktonreceiptofNAKnewmechanismsinrdt2.0(beyondrdt1.0):errordetectionreceiverfeedback:controlmsgs(ACK,NAK)rcvr-sender,.,3-28,rdt2.0:FSMspecification,Waitforcallfromabove,snkpkt=make_pkt(data,checksum)udt_send(sndpkt),extract(rcvpkt,data)deliver_data(data)udt_send(ACK),rdt_rcv(rcvpkt)y=73,sothercvrwants73+;ySendBase,sothatnewdataisacked,.,3-68,TCP:retransmissionscenarios,HostA,Seq=100,20bytesdata,ACK=100,prematuretimeout,HostB,Seq=92,8bytesdata,ACK=120,Seq=92,8bytesdata,ACK=120,Seq=92timeout,SendBase=100,SendBase=120,SendBase=120,Sendbase=100,.,3-69,TCPretransmissionscenarios(more),SendBase=120,.,3-70,TCPACKgenerationRFC1122,RFC2581,EventatReceiverArrivalofin-ordersegmentwithexpectedseq#.Alldatauptoexpectedseq#alreadyACKedArrivalofin-ordersegmentwithexpectedseq#.OneothersegmenthasACKpendingArrivalofout-of-ordersegmenthigher-than-expectseq.#.GapdetectedArrivalofsegmentthatpartiallyorcompletelyfillsgap,TCPReceiveractionDelayedACK.Waitupto500msfornextsegment.Ifnonextsegment,sendACKImmediatelysendsinglecumulativeACK,ACKingbothin-ordersegmentsImmediatelysendduplicateACK,indicatingseq.#ofnextexpectedbyteImmediatesendACK,providedthatsegmentstartsatlowerendofgap,.,3-71,FastRetransmit,Time-outperiodoftenrelativelylong:longdelaybeforeresendinglostpacketDetectlostsegmentsviaduplicateACKs.Senderoftensendsmanysegmentsback-to-backIfsegmentislost,therewilllikelybemanyduplicateACKs.,Ifsenderreceives3ACKsforthesamedata,itsupposesthatsegmentafterACKeddatawaslost:fastretransmit:resendsegmentbeforetimerexpires,.,3-72,Figure3.37ResendingasegmentaftertripleduplicateACK,.,3-73,event:ACKreceived,withACKfieldvalueofyif(ySendBase)SendBase=yif(therearecurrentlynot-yet-acknowledgedsegments)starttimerelseincrementcountofdupACKsreceivedforyif(countofdupACKsreceivedfory=3)resendsegmentwithsequencenumbery,Fastretransmitalgorithm:,aduplicateACKforalreadyACKedsegment,fastretransmit,.,3-74,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-75,TCPFlowControl,receivesideofTCPconnectionhasareceivebuffer:,speed-matchingservice:matchingthesendratetothereceivingappsdrainrate,appprocessmaybeslowatreadingfrombuffer,.,3-76,TCPFlowcontrol:howitworks,(SupposeTCPreceiverdiscardsout-of-ordersegments)spareroominbuffer=RcvWindow=RcvBuffer-LastByteRcvd-LastByteRead,RcvradvertisesspareroombyincludingvalueofRcvWindowinsegmentsSenderlimitsunACKeddatatoRcvWindowguaranteesreceivebufferdoesntoverflow,.,3-77,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-78,TCPConnectionManagement,Recall:TCPsender,receiverestablish“connection”beforeexchangingdatasegmentsinitializeTCPvariables:seq.#sbuffers,flowcontrolinfo(e.g.RcvWindow)client:connectioninitiatorSocketclientSocket=newSocket(hostname,portnumber);server:contactedbyclientSocketconnectionSocket=welcomeSocket.accept();,Threewayhandshake:Step1:clienthostsendsTCPSYNsegmenttoserverspecifiesinitialseq#nodataStep2:serverhostreceivesSYN,replieswithSYNACKsegmentserverallocatesbuffersspecifiesserverinitialseq.#Step3:clientreceivesSYNACK,replieswithACKsegment,whichmaycontaindata,.,3-79,TCPConnectionManagement,Connectionestablishment,.,3-80,TCPConnectionManagement(cont.),Closingaconnection:clientclosessocket:clientSocket.close();Step1:clientendsystemsendsTCPFINcontrolsegmenttoserverStep2:serverreceivesFIN,replieswithACK.Closesconnection,sendsFIN.,Wait_1,Wait_2,Step1,Step2,Close_wait,.,3-81,TCPConnectionManagement(cont.),Step3:clientreceivesFIN,replieswithACK.Enters“timedwait”-willrespondwithACKtoreceivedFINsStep4:server,receivesACK.Connectionclosed.Note:withsmallmodification,canhandlesimultaneousFINs.,client,FIN,server,ACK,ACK,FIN,closing,closing,closed,timedwait,closed,Wait_1,Wait_2,Step3,Step4,Close_wait,.,3-82,TCPConnectionManagement(cont),TCPclientlifecycle,TCPserverlifecycle,.,3-83,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-84,PrinciplesofCongestionControl,Congestion:informally:“toomanysourcessendingtoomuchdatatoofastfornetworktohandle”differentfromflowcontrol!manifestations:lostpackets(bufferoverflowatrouters)longdelays(queueinginrouterbuffers)atop-10problem!,.,3-85,Causes/costsofcongestion:scenario1,twosenders,tworeceiversonerouter,infinitebuffersnoretransmission,largedelayswhencongestedmaximumachievablethroughput,.,3-86,Causes/costsofcongestion:scenario2,onerouter,finitebufferssenderretransmissionoflostpacket,finitesharedoutputlinkbuffers,HostA,lin:originaldata,HostB,lout,lin:originaldata,plusretransmitteddata,.,3-87,Causes/costsofcongestion:scenario2,always:(goodput)“perfect”retransmissiononlywhenloss:retransmissionofdelayed(notlost)packetmakeslarger(thanperfectcase)forsame,“costs”ofcongestion:morework(retrans)forgiven“goodput”unneededretransmissions:linkcarriesmultiplecopiesofpkt,.,3-88,Causes/costsofcongestion:scenario3,foursendersmultihoppathstimeout/retransmit,Q:whathappensasandincrease?,finitesharedoutputlinkbuffers,lin:originaldata,lout,lin:originaldata,plusretransmitteddata,.,3-89,Causes/costsofcongestion:scenario3,Another“cost”ofcongestion:whenpacketdropped,any“upstreamtransmissioncapacityusedforthatpacketwaswasted!,lout,.,3-90,Approachestowardscongestioncontrol,End-endcongestioncontrol:noexplicitfeedbackfromnetworkcongestioninferredfromend-systemobservedloss,delayapproachtakenbyTCP,Network-assistedcongestioncontrol:routersprovidefeedbacktoendsystemssinglebitindicatingcongestion(SNA,DECbit,TCP/IPECN,ATM)explicitratesendershouldsendat,Twobroadapproachestowardscongestioncontrol:,.,3-91,Casestudy:ATMABRcongestioncontrol,ABR:availablebitrate:“elasticservice”ifsenderspath“underloaded”:sendershoulduseavailablebandwidthifsenderspathcongested:senderthrottledtominimumguaranteedrate,RM(resourcemanagement)cells:sentbysender,interspersedwithdatacellsbitsinRMcellsetbyswitches(“network-assisted”)NIbit:noincreaseinrate(mildcongestion)CIbit:congestionindicationRMcellsreturnedtosenderbyreceiver,withbitsintact,.,3-92,Casestudy:ATMABRcongestioncontrol,two-byteER(explicitrate)fieldinRMcellcongestedswitchmaylowerERvalueincellsendersendratethusmaximumsupportablerateonpathEFCIbitindatacells:setto1incongestedswitchifdatacellprecedingRMcellhasEFCIset,destinationsetsCIbitinreturnedRMcell,.,3-93,Chapter3outline,3.1Transport-layerservices3.2Multiplexinganddemultiplexing3.3Connectionlesstransport:UDP3.4Principlesofreliabledatatransfer,3.5Connection-orientedtransport:TCPsegmentstructurereliabledatatransferflowcontrolconnectionmanagement3.6Principlesofcongestioncontrol3.7TCPcongestioncontrol,.,3-94,TCPcongestioncontrol:additiveincrease,multiplicativedecrease,Approach:increasetransmissionrate(windowsize),probingforusablebandwidth,untillossoccursadditiveincrease:increaseCongWinby1MSSeveryRTTuntillossdetectedmultiplicativedecrease:cutCongWininhalfafterloss,time,congestionwindowsize,Sawtoothbehavior:probingforbandwidth,.,3-95,TCPCongestionControl:details,senderlimitstransmission:LastByteSent-LastByteAckedCongWinRoughly,CongWinisdynamic,functionofperceivednetworkcongestion,Howdoessenderperceivecongestion?lossevent=timeoutor3duplicateacksTCPsenderreducesrate(CongWin)afterlosseventthreemechanisms:AIMDslowstartconservativeaftertimeoutevents,.,3-96,TCPSlowStart,Whenconnectionbegins,CongWin=1MSSExample:MSS=500byteswindowthengrowsexponentiallytoathreshold,thengrowslinearly,3dupACKsindicatesnetworkcapableofdeliveringsomesegmentstimeoutindicatesa“morealarming”congestionscenario,Philosophy:,.,3-99,Refinement,Q:Whenshouldtheexponentialincreaseswitchtolinear?A:WhenCongWingetsto1/2ofitsvaluebeforetimeout.,Implementation:VariableThresholdAtlossevent,Thresholdissetto1/2ofCongWinjustbeforelossevent,TripleduplicatedACK,.,3-100,FastRecovery,Fastrecovery(rfc2581)isrecommendedbutnotrequiredFastrecoverystateisenteredwhenduplicate_count=3,threshold=CongWin/2,CongWin=threshold+3MSS3MSSisaddedtocompensateforthe3TCPsegmentsthathavealreadybeenbufferedbythereceiverEvents/actionsinfastrecoverystate:DuplicatedACKreceived:CongWin=CongWin+1MSS1MSSisaddedtocompensatefortheTCPsegmentthathasalreadybeenbufferedbythereceiverACKreceivedforthemissingsegment:CongWin=threshold,duplicate_count=0,entercongestionavoidancestateTimeout:threshold=CongWin/2,CongWin=1MSS,duplicate_count=0,enterslowstartstate,.,3-101,Summary:TCPCongestionControl,WhenCongWinisbelowThreshold,senderinslow-startphase,windowgrowsex

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论