




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1End-to-EndProtocolOutline
SimpleDemultiplexer(UDP)ReliableByte-Stream(TCP)ConnectionEstablishment/TerminationSlidingWindowRevisitedFlowControl1End-to-EndProtocolOutline2TheLayeredNetworkStackPhysicalLayerApplicationLayerTransportLayer(TCP/UDP)NetworkLayer(IP)DataLinkLayerInternetStackPhysicalLayerSessionLayerTransportLayerNetworkLayerDataLinkLayerOSIStackPresentationLayerApplicationLayer2TheLayeredNetworkStackPhys3End-to-EndProtocolsUnderlyingbest-effortnetworkdropmessagesre-ordersmessagesdeliversduplicatecopiesofagivenmessagelimitsmessagestosomefinitesizedeliversmessagesafteranarbitrarilylongdelayCommonend-to-endservicesguaranteemessagedeliverydelivermessagesinthesameordertheyaresentdeliveratmostonecopyofeachmessagesupportarbitrarilylargemessagessupportsynchronizationallowthereceivertoflowcontrolthesendersupportmultipleapplicationprocessesoneachhost3End-to-EndProtocolsUnderlyin4Transportlayerusesthenetworklayer,tosendandreceivedata.TransportProtocolDataUnit(TPDU)EachlayeraddsitspartTCPsegment,IPpacket,DatalinkframeOverviewofTransportLayer
4Transportlayerusesthenetw5OverviewofTransportLayer
(cont.)5OverviewofTransportLayer
(6Twotypesoftransportservicesconnection-orientedconnectionlessEnd-to-EndProtocols6Twotypesoftransportservic7SimpleDemultiplexor(UDP)TransportprotocolaboveIPsimplypassesIPthroughtotheupper(application)layersUnreliableandunordereddatagramserviceAddsmultiplexingNoflowcontrolEndpointsidentifiedbyportsservershavewell-knownportsFTP-21,Telnet-23,http-80,pop-110,DNS-537SimpleDemultiplexor(UDP)Tra8UDP“Features”Givesapp’stheoptiontosendpacketsunreliablyUsefulformulticastapp’sLowdelaytransmissionforinteractivetext/audio/videoMinimalconnectionstate:“connectionless”MinimalconnectionsetuptimeNocongestioncontrol–blastawayBuildownapplication-levelprotocolontopofUDP8UDP“Features”Givesapp’sthe9UDPUDPHeader:Only8bytes!(vs.IP20bytesheader)SourceportforUDPsendingprocessDestportforUDPreceivingprocessLengthinbytesofUDPheader+payloadChecksumoverUDPheader+payloadSourcePort#Dest.Port#UDPlengthChecksum1632UDPpayloaddataUDPpayloadIPhdrUDPhdrErrorDetection9UDPUDPHeader:SourcePort#De10ErrorDetectionWhyisthereerrordetectioninthetransportlayergiventhatthesamefunctionisprovidedbythedatalinklayerReliabletransmissionalongeachlinkisstillnoguaranteeoferror-freetransmissionbetweenthesourceandthedestination.10ErrorDetectionWhyisthere11ErrorDetection(cont.)11ErrorDetection(cont.)12TCPOverviewConnection-orientedTCPprovides:Reliabledeliveryofpackets,Streamorin-orderdeliveryApplicationprocessWritebytesTCPSendbufferSegmentSegmentSegmentTransmitsegmentsApplicationprocessReadbytesTCPReceivebuffer………Fullduplex Flowcontrol:keepsenderfromoverrunningreceiverCongestioncontrol:keepsenderfromoverrunningnetwork12TCPOverviewConnection-orien13TransportControlProtocolProvidesareliableend-to-endbytestreamoveranunreliablenetworksuchasIP.Providesconnectionorienteduser-to-userserviceconnectionmanagementNointermediatenodesareinvolvedinconnectionestablishment.TCPserviceisobtainedbyhavingboththesenderandreceivercreateendpointscalledsockets.Eachsocketisassociated(bound)withIPaddressofthehost16-bitnumberlocaltothehostcalledaport13TransportControlProtocolPr14TransportControlProtocol
(cont.)14TransportControlProtocol
(15DataLinkVersusTransportPotentiallyconnectsmanydifferenthostsneedexplicitconnectionestablishmentandterminationPotentiallydifferentRTTneedadaptivetimeoutmechanismPotentiallylongdelayinnetworkneedtobepreparedforarrivalofveryoldpacketsPotentiallydifferentcapacityatdestinationneedtoaccommodatedifferentnodecapacityPotentiallydifferentnetworkcapacityneedtobepreparedfornetworkcongestion15DataLinkVersusTransportPo16TCPSegmentAsegmentconsistsofafixed20-byteheader(plusanoptionalpart)followedbyzeroormoredatabytes16TCPSegmentAsegmentconsist17TCPSegment(cont.)Sourceport(16bits)–Specifiestheapplicationsendingthesegment.17TCPSegment(cont.)Sourcepo18TCPSegment(cont.)Destinationport(16bits)–Identifiestheapplicationtowhichthesegmentissent.18TCPSegment(cont.)Destinati19TCPSegment(cont.)Sequencenumber(32bits)–Containsthesequencenumberofthefirstbyteofdata.19TCPSegment(cont.)Sequence20TCPSegment(cont.)Acknowledgmentnumber(32bits)–ContainsthebytesequencenumberwhichthereceivingTCPentityexpectstoreceivenext.20TCPSegment(cont.)Acknowled21TCPSegment(cont.)Headerlength(4bits):thesizeoftheTCPheader.21TCPSegment(cont.)Headerle22TCPSegment(cont.)Flags(6bits)–Controlfunctionsforestablishingandremovingconnectionsetc.IncludeURG,ACK,PSH,RST,SYN,FIN.22TCPSegment(cont.)Flags(623TCPSegment(cont.)Window(16bits)–TellsthereceivingTCPentityhowmanydatabytesthesendingTCPentitycanaccept.23TCPSegment(cont.)Window(124TCPSegment(cont.)Checksum(16bits)–Usedfortransportlayererrordetection.–
pseudoheader(12Bytes)+TCPheader+data24TCPSegment(cont.)Checksum25TCPSegment(cont.)Urgentpointer(16bits)–Signalthereceivertodeliverthedatatothehigherlayerasquicklyaspossible.25TCPSegment(cont.)Urgentpo26TCPSegment(cont.)Options/padding-maximumsegmentsize26TCPSegment(cont.)Options/p27SegmentFormat(cont)Eachconnectionidentifiedwith4-tuple:(SrcPort,SrcIPAddr,DsrPort,DstIPAddr)Slidingwindow+flowcontrolacknowledgment,SequenceNum,AdvertisedWinowSenderData(SequenceNum)Acknowledgment+AdvertisedWindowReceiver27SegmentFormat(cont)Eachco28ConnectionEstablishmentActiveparticipant(client)Passiveparticipant(server)SYN,SequenceNum=xSYN+ACK,SequenceNum=
y,ACK,Acknowledgment=y
+1Acknowledgment=x
+1SequenceNum=x+1
28ConnectionEstablishmentActi29ConnectionTermination29ConnectionTermination30StateTransitionDiagramCLOSEDLISTENSYN_RCVDSYN_SENTESTABLISHEDCLOSE_WAITLAST_ACKCLOSINGTIME_WAITFIN_WAIT_2FIN_WAIT_1PassiveopenCloseSend/SYNSYN/SYN+ACKSYN+ACK/ACKSYN/SYN+ACKACKClose/FINFIN/ACKClose/FINFIN/ACKACK+FIN/ACKTimeoutaftertwosegmentlifetimesFIN/ACKACKACKACKClose/FINCloseCLOSEDActiveopen/SYN30StateTransitionDiagramCLOS31SlidingWindowRevisitedSendingsideLastByteAcked<=LastByteSentLastByteSent<=LastByteWrittenbufferbytesbetweenLastByteAckedandLastByteWrittenSendingapplicationLastByteWrittenTCPLastByteSentLastByteAckedReceivingapplicationLastByteReadTCPLastByteRcvdNextByteExpectedReceivingsideLastByteRead<NextByteExpectedNextByteExpected<=LastByteRcvd+1bufferbytesbetweenNextByteReadandLastByteRcvd31SlidingWindowRevisitedSend32FlowControlSendbuffersize:MaxSendBufferReceivebuffersize:MaxRcvBufferReceivingsideLastByteRcvd-LastByteRead<=MaxRcvBufferAdvertisedWindow=MaxRcvBuffer–((NextByteExpected-1)-NextByteRead)SendingsideLastByteSent-LastByteAcked<=AdvertisedWindowEffectiveWindow=AdvertisedWindow-(LastByteSent-LastByteAcked)LastByteWritten-LastByteAcked<=MaxSendBufferblocksenderif(LastByteWritten-LastByteAcked)+y>MaxSenderBufferAlwayssendACKinresponsetoarrivingdatasegmentPersistwhenAdvertisedWindow
=032FlowControlSendbuffersize33FlowControlTransportprotocolsresemblethedatalinkprotocolsFlowcontrol,errorcontrol,sequencingAslidingwindowisusedforflowcontrolDifferencesArouterusuallyhasonlyafewlinkstoothers,whileatransportentitymayhavenumerousconnections.Thisdifferencemakesitimpracticaltoimplementadatalinkbufferingstrategyinthetransportlayer.Thereceivermaynotdedicatespecificbufferstospecificconnections.33FlowControlTransportprotoc34FlowControlDynamicbuffermanagement-creditmechanismInitially,thesenderrequestsacertainnumberofbuffers(credit),basedonitsperceivedneeds.Thereceivergrantsasmanyoftheseasitcanafford.EverytimethesendertransmitsaTPDU,itdecreasesitsallocation(credit),stoppingwhentheallocation(credit)reacheszero.Thereceiverreturnsbothacknowledgmentsandbufferallocations(credit).34FlowControlDynamicbufferm35MoveforwardbyACK1002003004005006007008009001012013014015016017018011SenderwindowDatathatcanbesent不可發(fā)送pointerSenderwantstosend900bytes–9segments(100byteseachsegment).
Thesenderwindowis500bytes.SendercanmovethewindowforwardbytheACKfromthereceiver.Inaddition,thesendermaintainapointertoidentifythedatawhichhavebeensent.Datathatcannotbesent35MoveforwardbyACK100200300361002003004005006007008009001012013014015016017018011可發(fā)送不可發(fā)送pointer1002003004005006007008009001012013014015016017018011發(fā)送窗口可發(fā)送不可發(fā)送SendwindowmovesforwardThesenderhavesend400bytes.AndthesenderonlyreceivetheACKofthetop200bytes.Thewindowis500.Sothesendercanstillsend300bytes.
Sent&acked已發(fā)送但未被確認SenderwindowDatathatcanbesentMoveforwardbyACK500600700800900501601701801不可發(fā)送DatathatcannotbesentpointerSent&NotackedDatathatcanbesentDatathatcannotbesent361002003004005006007008009001371002003004005006007008009001012013014015016017018011Sent&acked可發(fā)送pointerSendwindowreduceThesenderreceivetheACKofthefollowing200bytes.Thewindowischangedto400.Sothesendercansend400bytes.1002003004005006007008009001012013014015016017018011可發(fā)送不可發(fā)送pointerSendwindowmovesforwardSent&acked已發(fā)送但未被確認Sent&Notack
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 湖北省騰云聯(lián)盟2023-2024學年高三上學期12月月考地理試題(解析版)
- 2025年砼空心砌塊(承重型)項目合作計劃書
- 供水設(shè)施智能化改造項目實施進度安排
- 2025至2030年中國快速硅膠模數(shù)據(jù)監(jiān)測研究報告
- 商品房購銷合同簽署完就必須辦銀行貸款
- 二零二五年度公司免責的跨境電商合作協(xié)議
- 2025至2030年中國干荷電摩托車蓄電池數(shù)據(jù)監(jiān)測研究報告
- 集體合同2025年度生效時間規(guī)定及員工勞動爭議調(diào)解機制
- 2025年度獨家區(qū)域招商代理服務(wù)合同
- 二零二五年度公司股權(quán)轉(zhuǎn)讓與市場推廣合同
- 礦山開采與環(huán)境保護
- 企業(yè)事業(yè)部制的管理與監(jiān)督機制
- 兒童體液平衡及液體療法課件
- 勞動防護用品培訓試卷帶答案
- ORACLE執(zhí)行計劃和SQL調(diào)優(yōu)
- 2024年鐘山職業(yè)技術(shù)學院高職單招(英語/數(shù)學/語文)筆試歷年參考題庫含答案解析
- 2024年湖南交通職業(yè)技術(shù)學院高職單招(英語/數(shù)學/語文)筆試歷年參考題庫含答案解析
- 研究生導師談心談話記錄內(nèi)容范文
- 小學機器人課題報告
- 《字體設(shè)計》課程標準
- 圖像生成中的風格遷移方法研究
評論
0/150
提交評論