網(wǎng)絡(luò)實驗計算機網(wǎng)絡(luò)l13tcp i v_第1頁
網(wǎng)絡(luò)實驗計算機網(wǎng)絡(luò)l13tcp i v_第2頁
網(wǎng)絡(luò)實驗計算機網(wǎng)絡(luò)l13tcp i v_第3頁
網(wǎng)絡(luò)實驗計算機網(wǎng)絡(luò)l13tcp i v_第4頁
網(wǎng)絡(luò)實驗計算機網(wǎng)絡(luò)l13tcp i v_第5頁
已閱讀5頁,還剩58頁未讀 繼續(xù)免費閱讀

付費下載

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

ComputerNetworks

Lecture13JingXu(徐晶)Dept.ofElectronicsandInformationEng.HuazhongUniversityofScienceandTechnologyDec.2011-2-Review:RequirementAnalysisWhatweexpectfromanetwork?Requirement1:connectivityAnestedInterconnectionofnodesandlinksRequirement2:cost-effectiveconnectivitySharingthishardwarebasethroughtheuseofstatisticalmultiplexingThisresultsinapacket-switchednetworkRequirement3:process-to-processcommunicationservices-3-Problem:GettingProcessestoComm.NetworkLayerTransportLayerApplicationLayerLinkLayerConnectivityamongHostsConnectivityatLinklayerleveldirectlinkorswitchednetworksConnectivityatnetworklayerlevel–internetworkinghost-to-hostprotocolsheterogeneityandscalabilityconcernswithinternetworkingIPservicemodelandprotocols?CommonServices?ProbleminChapter5:GettingProcessestoCommunicate-4--5-Lecture13Chapter5End-to-EndProtocolsProblem:GettingProcessestoCommunicate5.1SimpleDemultiplexer(UDP)5.2ReliableByteStream(TCP)5.3RemoteProcedureCall5.4Real-timetransportprotocol(RTP)5.5Performance5.6Summary-6-TransportLayer:AboveNetworkLayerTransportLayerApplicationLayerLinkLayerWhatapplication-levelprocessesaboveexpect?guaranteesmessagedeliverydeliversmessagesinthesameordertheyaresentdeliversatmostonecopyofeachmessagesupportsarbitrarilylargemessagessupportssynchronizationbetweenthesenderandthereceiverallowsthereceivertoapplyflowcontroltothesendersupportsmultipleapplicationprocessesoneachhost-7-TransportLayer:BelowNetworkLayerTransportLayerApplicationLayerLinkLayerWhatthenetworkbelowmayprovideunreliablepacketdeliverylossreorderingduplicatearbitrarilyvariabledelayfinitesizeofpacketWhatapplication-levelprocessesaboveexpect?guaranteesmessagedeliverydeliversmessagesinthesameordertheyaresentdeliversatmostonecopyofeachmessagesupportsarbitrarilylargemessages......-8-TransportLayer:ChallengesNetworkLayerTransportLayerApplicationLayerLinkLayerWhatthenetworkbelowmayprovideunreliablepacketdelivery:loss,reordering,duplicatearbitrarilyvariabledelayfinitesizeofpacketWhatapplication-levelprocessesaboveexpectmultipleapplicationprocessesreliablemessagedeliveryflowcontrolmessagelengthEnd-to-endprotocolsChallengesturndeficientaspectsofunderlyingnetworksintothehigh-levelserviceexpectedbyapplicationprocesses-9-TransportLayerProtocolsThischapterlooksfourrepresentativeservicesasimpleasynchronousdemultiplexingserviceUDP(UserDatagramProtocol)areliablebyte-streamserviceTCP(TransmissionControlProtocol)arequest/replyserviceRemoteProcedureCall(RPC)SunRPCandDCE-RPCareal-timetransmissionserviceRTP-10-Lecture13Chapter5End-to-EndProtocolsProblem:GettingProcessestoCommunicate5.1SimpleDemultiplexer(UDP)5.2ReliableByteStream(TCP)5.3RemoteProcedureCall5.4Real-timetransportprotocol(RTP)5.5Performance5.6SummaryUserDatagramProtocol(UDP)OneoftwotransportlayerprotocolsinTCP/IPprotocolstackUDP:developedin1980FirstTCPin1974,IPv4in1981FeaturesuponIP,justaddsalevelofdemultiplexingmessage-orientedconnectionlessnoguaranteetoreliablemessagedeliverynoflowcontrol-11-TwoBasicTransportFeaturesDemultiplexing:portnumbersErrordetection:checksums12Webserver(port80)ClienthostServerhostEchoserver(port7)Servicerequestto:80OSClientIPpayloaddetectcorruptionRequestfrom:3456Demuxtable(“5tuple”)Socket<*,*,,80,TCP>5<,3456,,80,TCP>6UDPDemultiplexing-14-UDPHeaderFieldsSrcPortandDstPort:identifyapplicationprocessesChecksum:optional,computedonthepayloadandpseudoheader-15-Port:PublicserviceHowaprocesslearnstheporttowhichitwantstosendamessage?Commonapproachisfortheservertoacceptmessagesatawell-knownportDNS,port53SNMP,port25PortMapperTheclientandserverusethewell-knownporttoagreeonsomeotherportthattheywilluseforsubsequentcommunication,leavingthewell-knownportfreeforotherclientsAdvantagesofUDPControloverwhatdataissentandwhenAssoonasanapplicationprocesswritesintothesocket…UDPwillpackagethedataandsendthepacketNodelayforconnectionestablishmentUDPjustsendsmessageswithoutcontactingthehostfirstPaysoffwhenhostisexpectingmessagesanywayStatelessconnectionNoallocationofbuffers,parameters,sequence#s,etc.…makingiteasiertohandlemanyactiveclientsatonce(thinkofservers)SmallpacketheaderoverheadUDPheaderisonlyeight-byteslong16DisadvantagesofUDP“Besteffort”networkingNoguaranteedeliveryofmessagestodestinationhost,noordereddeliveryNocongestioncontrolNoadaptationtothecongestionconditionsofthenetworkSuppressesTCPflowsIncaseofcongestionTCPflowswillbackoffwhileUDPwillstayonthesamerateCanbeusedasanattackmethod(UDPfloodingattack)17ApplicationsUtilizingUDPSimplequeryprotocolslikeDomainNameSystem(DNS)DelayforconnectionestablishmentistoolargeQueriesaresmallandUDPaddsasmalloverhead(header)EasiertohaveapplicationretransmitifneededUsuallymayfitwithinaUDPpacketsonoout-of-orderdangerMultimediaApplicationsRetransmittinglost/corruptedpacketsisnotworthwhileBythetimethepacketisretransmitted,it’stoolateE.g.,telephonecalls,videoconferencing,gamingCertainlossisacceptablesinceVoice,picture,etcarestilldiscernable18-19-Lecture13Chapter5End-to-EndProtocolsProblem:GettingProcessestoCommunicate5.1SimpleDemultiplexer(UDP)5.2ReliableByteStream(TCP)5.3RemoteProcedureCall5.4Real-timetransportprotocol(RTP)5.5Performance5.6Summary-20-TransmissionControlProtocol(TCP)OneoftwotransportlayerprotocolsinTCP/IPprotocolstackEarlyTCPTCP/IPFirstTCPin1974,IPv4in1981MostofapplicationsuseTCPProvidesRELIABLEbytestreamservicestoapplicationprocessesByteStreamingbyTCPTCPdoesnotdistinguishboundariesamongthemessageswrittenbyapplicationprocesses,buttransmitsdataintheformofsegmentApplicationprocessWritebytesTCPSendbufferSegmentSegmentSegmentTransmitsegmentsApplicationprocessReadbytesTCPReceivebuffer■■■TCPServiceModelConnectionorientedendhostsneedtoestablishaconnectionbeforedataexchangefull-duplex:datacanbeexchangedalongbothdirectionsReliabilityguaranteeddatadeliverydataisdeliveredinthecorrectorderFlowcontroltokeepthesenderfromoverloadingthereceiverflowcontrolalsoappearsinlinklayerCongestioncontroltokeepthesenderfromoverloadingthenetworkcongestioncontrolinnetworkandtransportlayer-22-Flowvs.CongestionControlReceiverbufferoverflowRouterbufferoverflowLecture135.2ReliableByteStream(TCP)5.2.1End-to-EndIssues5.2.2SegmentFormat5.2.3ConnectionEstablishmentandTermination5.2.4SlidingWindowRevisited5.2.5TriggeringTransmission5.2.6AdaptiveRetransmission5.2.7RecordBoundaries5.2.8TCPExtensions5.2.9AlternativeDesignChoices-24--25-Reviewofreliablecommunication:

OriginalStop-and-waitAlgorithmTimeouttriggerTimeouttriggerTwofundamentalmethodstoprovidereliablecommunication:(1)ACK(acknowledgement)(2)Timeout-26-Reviewofreliablecommunication:

OriginalSlidingWindowAlgorithmTimeouttriggerTimeouttriggerACKSenderWindowReceiverWindowSeqNum012Morecomponentsrequiredinslidingwindowalgorithm(3)SenderWindow/ReceiverWindow(4)DesignedSeqNumReliabletransmissionservicesBasicsolutionofReliabletransmissionservicesACK(acknowledgement)TimeoutLinklayerARQ,SlidingWindowAlgorithmTransportlayerWhatarethedifferences?DoesTCPDuplicateLowerLayerServices?-27--28-ChallengesofTCPReliabletrans.TimeouttriggerTimeouttriggerACKSenderWindowReceiverWindowSeqNum012Challenge1:HowtosetuptheConnection,Negotiationonstart/endBackgroundbelow:IPprovideconnection-less,un-reliableservices,runningacrossheterogenicnetworks,connectingdiversehosts-29-ChallengesofTCP-1Problem:ConnectionNotrequiredinasinglephysicallinkthatalwaysconnectsthesametwocomputersTCPshouldsupportlogicalconnectionsbetweenprocessesthatarerunningonanytwocomputersintheInternet.MotivationTCPneedsanexplicitconnectionstablishmentphaseTCPalsohasanexplicitconnectionteardownphase-30-ChallengesofTCPReliabletrans.TimeouttriggerTimeouttriggerACKSenderWindowReceiverWindowSeqNum012Backgroundbelow:IPprovideconnection-less,un-reliableservices,runningacrossheterogenicnetworks,connectingdiversehostsChallenge2:Timeoutproblem,Whentoretrans?EstimationonVariableRTT-31-ChallengesofTCP-2Problem:TimeoutasinglephysicallinkthatalwaysconnectsthesametwocomputershasafixedRTTTCPconnectionsarelikelytohavewidelydifferentround-triptimesDifferentdistance:SanFranciscotoBoston,RTT100ms,twohostsinthesameroom,RTT1msVariationsintheRTT:SanFranciscotoBoston,RTT100msat3a.m.,RTT500msat3p.m.Motiviationthetimeoutmechanisminslidingwindowalgorithmthattriggersretransmissionsmustbeadaptive.-32-ChallengesofTCPReliabletrans.TimeouttriggerTimeouttriggerACKSenderWindowReceiverWindowSeqNum012Challenge3:ReorderingPacketslossanddelayBackgroundbelow:IPprovideconnection-less,un-reliableservices,runningacrossheterogenicnetworks,connectingdiversehostsChallengesofTCP-3Problem:ReorderingReorderingisnotpossibleonapoint-to-pointlinkReorderinginrealmultiplehopInternetIPthrowspacketsawayaftertheirTTLexpiresMotivationTCPassumesthateachpackethasamaximumlifetime,maximumsegmentlifetime(MSL),currentrecommendedsettingis120secondsTCPhastobepreparedforveryoldpacketstosuddenlyshowupatthereceiver,potentiallyconfusingtheslidingwindowalgorithm-33--34-ChallengesofTCPReliabletrans.TimeouttriggerTimeouttriggerACKSenderWindowReceiverWindowSeqNum012Backgroundbelow:IPprovideconnection-less,un-reliableservices,runningacrossheterogenicnetworks,connectingdiversehostsChallenge4:FlowcontrolDiversedelay*bandwidth,bufferChallengesofTCP-4Problem:FlowcontrolBufferinslidingwindowcanbedesignedinpoint-to-pointlinkBufferdesignisdifficultintransmissionoverInterentdelay×bandwidthproductisunknownbuffermaybesharedamonghundredsofTCPconnectionsMotivationTCPmustincludeamechanismthateachsideusesto“l(fā)earn”whatresources(e.g.,howmuchbufferspace)theothersideisabletoapplytotheconnection.==>flow-controlissue.-35-ChallengesofTCPReliabletrans.-36-Cancongestionbesolvedlocally?ToomanyTCPconnectionsbringtoomuchtraffictotheintermediaterouterChallengesofTCP-5Problem:CongestioncontrolCongestionisnottheprobleminpoint-to-pointlinkCongestionwilloccurinInterentsendingsideofaTCPconnectionhasnoideawhatlinkswillbetraversedtoreachthedestinationdatabeinggeneratedbymanydifferentsourcesmightbetryingtotraversethissameslowlinkMotivationTCPhastorealisethecongestioncontrolalgorithmforthenetwork-37--38-SummaryofthechallegesChallengesofTCPcomparingwiththeReliabletransmissioninlinklayerConnectionTimeoutReorderingFlowcontrolCongestioncontrolCanwesolveitbyhop-to-hopsolution?Bytheendhost??Bytheintermediaterouter??-39-hop-to-hopvs.end-to-endX.25networksrunningonvirtualcircuitswitchingnetworktheunderlyingnetworkisassumedtobesomehowreliablemessagesaredeliveredreliablyandinorderbetweeneachpairofnodesalongthepathusetheslidingwindowprotocolonahop-by-hopbasisTCPrunningondatagramswitchingnetworktheunderlyingIPnetworkisassumedtobeunreliableandtodelivermessagesoutoforderTCPusestheslidingwindowalgorithmonanend-to-endbasistoprovidereliable/ordereddelivery-40-hop-to-hopvs.end-to-endAsequenceofhop-by-hopguaranteesdoesnotnecessarilyadduptoanend-to-endguaranteeEnd-to-endargumentAfunctionshouldnotbeprovidedinthelowerlevelsofthesystemunlessitcanbecompletelyandcorrectlyimplementedatthatlevelItisstillnecessarytoprovidetrueend-to-endcheckstoguaranteereliable/orderedservice,eventhoughthelowerlevelsofthesystemalsoimplementthatfunctionality.1981Lecture135.2ReliableByteStream(TCP)5.2.1End-to-EndIssues5.2.2SegmentFormat5.2.3ConnectionEstablishmentandTermination5.2.4SlidingWindowRevisited5.2.5TriggeringTransmission5.2.6AdaptiveRetransmission5.2.7RecordBoundaries5.2.8TCPExtensions5.2.9AlternativeDesignChoices-41--42-TCPSegmentsTCPsendsasegmentwhentheamountofdatareachesthemaximumsegmentsize(MSS)triggeredbytheapplication,e.g.pushoperationperiodictimerexpiresChoiceofMSSmakesresultedIPpacketnotbefragmentedMSS=MTU–IPheadersize–TCPheadersize-43-TCPPortsSimilartoUDP,TCPusesportnumberstoidentifytheclientandserverapplicationsWellknownportsareusedtoidentifyserverapplicationsexamples:HTTP(80),FTP(21)wellknownportnumbersarebetween1and1023Clientchoosesadifferentportnumberforeachapplicationprocesstheseportsareknownephemeralports(shortlived)usuallybetween1024and5000EachTCPconnectionisuniquelyidentifiedbya4-tuple<SrcIP,SrcPort,DstPort,DstIP>-44-TCPHeaderusedbysliding-windowbasedflowcontrolFlagsSYN,FIN–establishing/terminatingaTCPconnectionACK–setwhenAcknowledgementfieldisvalidURG–urgentdataPUSH–don’twaittofillsegmentRESET–abortconnectionLecture135.2ReliableByteStream(TCP)5.2.1End-to-EndIssues5.2.2SegmentFormat5.2.3ConnectionEstablishmentandTermination5.2.4SlidingWindowRevisited5.2.5TriggeringTransmission5.2.6AdaptiveRetransmission5.2.7RecordBoundaries5.2.8TCPExtensions5.2.9AlternativeDesignChoices-46-ConnectionEstablishmentDonebeforedatatransferBasedon3-wayhandshaketheexchangeofthreemessagesbetweentwoTCPpeerstoagreeontheinitialsequencenumbersoftwoTCPpeersTheinitialsequencenumberisrandomlygeneratedtheAcknowledgmentisalwaysonelargerthanthepeersent-47--48-3-WayHandshakeActiveparticipant(client)(server)SYN,SequenceNum=xACK,Acknowledgment=y+1Acknowledgment=x+1SYN+ACK,SequenceNum=y,Three-wayhandshaketoestablishconnectionHostAsendsaSYN(open)tothehostBHostBreturnsaSYNacknowledgment(SYNACK)HostAsendsanACKtoacknowledgetheSYNACK-49-ConnectionTerminationTwoindependenthandshakesterminatingunidirectionalhalfoftheconnectionClosingtheconnectionFinish(FIN)tocloseandreceiveremainingbytesAndotherhostsendsaFINACKtoacknowledgeReset(RST)tocloseandnotreceiveremainingbytesTCPStateTransition(State,Event/Action)Lecture135.2ReliableByteStream(TCP)5.2.1End-to-EndIssues5.2.2SegmentFormat5.2.3ConnectionEstablishmentandTermination5.2.4SlidingWindowRevisited5.2.5TriggeringTransmission5.2.6AdaptiveRetransmission5.2.7RecordBoundaries5.2.8TCPExtensions5.2.9AlternativeDesignChoices-51--52-TCPSlidingWindowAlgorithmTCP’svariantofslidingwindowalgorithmcanperformreliabledeliveryofdatain-orderdeliveryofdataflowcontrol(basedonvariedAdvertisedWindowfield)Slidingwindowalgorithmwithvariedreceivingwindowsizethereceiveradvertisesareceivingwindowsizetothesender,whichisvariedovertimeratherthanfixedthereceivingwindowsizeisinformedusingtheAdvertisedWindowfieldintheTCPheader53acknowledgedsenttobesentoutsidewindowSourcePortDest.PortSequenceNumberAcknowledgmentHL/FlagsAdvertisedWinD.ChecksumUrgentPointerOptions..SourcePortDest.PortSequenceNumberAcknowledgmentHL/FlagsAdvertisedWinD.ChecksumUrgentPointerOptions..PacketSentPacketReceivedAppwriteWindowFlowControl:SendSide-54-TCPSlidingWindowAlgorithm1.Reliableandin-orderdeliveryofdataLastByteAcked≤LastByteSentLastByteSent≤LastByteWrittenLastByteRead≤NextByteExpectedNextByteExpected≤LastByteRcvd+1-55-TCPSlidingWindowAlgorithm2.FlowcontrolFlowcontrol:asendersendsdataasmuchaspossiblebutwithoutoverloadingthereceiverAdjustthesender’swindowbyreceiver’srequirementratherthanwaitingfortheACKmsgs.AdvertisedWindowfieldinthereceiver'sview:LastByteReadReceiver’sviewLastByteRcvdNextByteExpectedLastByteRcvd-LastByteRead≤MaxRcvBufferAdvertisedWindow=MaxRcvBuffer–((NextByteExpected-1)-LastByteRead)-56-TCPSlidingWindowAlgorithm2.Flowcontrol(cont.)AdvertisedWindowfieldinthesender'sview:LastByteSent-LastByteAcked≤AdvertisedWindowEffectiveWindow=AdvertiseWindow–(LastByteSent–LastByteAcked)LastByteWrittenLastByteSentLastByteAckedSender’sviewLastByteWritten–LastByteAcked≤MaxSendBuffer-57-TCPSlidingWindowAlgorithm

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論