计算机网络:Internet中的传输协议_第1页
计算机网络:Internet中的传输协议_第2页
计算机网络:Internet中的传输协议_第3页
计算机网络:Internet中的传输协议_第4页
计算机网络:Internet中的传输协议_第5页
已阅读5页,还剩40页未读 继续免费阅读

下载本文档

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

文档简介

1TransportProtocolsInInternetConceptsTCPUDP2OrientationWemoveonelayerupandlookatthetransportlayer.3OrientationTransportlayerprotocolsareend-to-endprotocolsTheyareonlyimplementedatthehosts4TransportProtocolsintheInternetUDP-UserDatagramProtocoldatagramorientedunreliable,connectionlesssimpleunicastandmulticastusefulonlyforfewapplications,e.g.,multimediaapplicationsusedalotforservicesnetworkmanagement(SNMP),routing(RIP),naming(DNS),etc.TCP-TransmissionControlProtocolstreamorientedreliable,connection-orientedcomplexonlyunicastusedformostInternetapplications:web(http),email(smtp),filetransfer(ftp),terminal(telnet),etc.

TheInternetsupports2transportprotocols5UDP-UserDatagramProtocolUDPissupportsunreliabletransmissionsofdatagramsUDPmerelyextendsthehost-to-to-hostdeliveryserviceofIPdatagramtoanapplication-to-applicationserviceTheonlythingthatUDPaddsismultiplexinganddemultiplexing6UDPFormat

Portnumbersidentifysendingandreceivingapplications(processes).Maximumportnumberis216-1=65,535

MessageLengthisatleast8bytes(I.e.,Datafieldcanbeempty)andatmost65,535

Checksumisforheader(ofUDPandsomeoftheIPheaderfields)7PortNumbersUDP(andTCP)useportnumberstoidentifyapplicationsAgloballyuniqueaddressatthetransportlayer(forbothUDPandTCP)isatuple

<IPaddress,portnumber>Thereare65,535UDPportsperhost.8TCPOverviewTCP=TransmissionControlProtocolConnection-orientedprotocolProvidesareliableunicastend-to-endbytestreamoveranunreliableinternetwork.9Connection-OrientedBeforeanydatatransfer,TCPestablishesaconnection:OneTCPentityiswaitingforaconnection(“server”)TheotherTCPentity(“client”)contactstheserverTheactualprocedureforsettingupconnectionsismorecomplex.Eachconnectionis

fullduplex10Connection-Oriented11TCPFormat

TCPsegmentshavea20byteheaderwith>=0bytesofdata.12TCPheaderfieldsPortNumber:Aportnumberidentifiestheendpointofaconnection.Apair<IPaddress,portnumber>identifiesoneendpointofaconnection.Twopairs<clientIPaddress,serverportnumber>and<serverIPaddress,serverportnumber>identifyaTCPconnection.13TCPheaderfieldsSequenceNumber(SeqNo):Sequencenumberis32bitslong.SotherangeofSeqNois0<=SeqNo<=232-1

4.3Gbyte EachsequencenumberidentifiesabyteinthebytestreamInitialSequenceNumber(ISN)ofaconnectionissetduringconnectionestablishment14TCPheaderfieldsAcknowledgementNumber(AckNo):Acknowledgementsarepiggybacked,I.e asegmentfromA->BcancontainanacknowledgementforadatasentintheB->AdirectionAhostsusestheAckNofieldtosendacknowledgements.(IfahostsendsanAckNoinasegmentitsetsthe“ACKflag”)TheAckNocontainsthenextSeqNothatahostswantstoreceive

Example:

Theacknowledgementforasegmentwithsequencenumbers0-1500isAckNo=150115TCPheaderfieldsAcknowledgeNumber(cont’d)TCPusestheslidingwindowflowprotocoltoregulatetheflowoftrafficfromsendertoreceiverTCPusesthefollowingvariationofslidingwindow:noNACKs(NegativeACKnowledgement)onlycumulativeACKs16TCPheaderfieldsExample:

Assume:Sendersendstwosegmentswith“1..1500”and“1501..3000”,butreceiveronlygetsthesecondsegment.Inthiscase,thereceivercannotacknowledgethesecondpacket.ItcanonlysendAckNo=117TCPheaderfieldsHeaderLength(4bits):Lengthofheaderin32-bitwordsNotethatTCPheaderhasvariablelength(withminimum20bytes)18TCPheaderfieldsFlagbits:URG: UrgentpointerisvalidIfthebitisset,thefollowingbytescontainanurgentmessageintherange:SeqNo<=urgentmessage<=SeqNo+urgentpointer

ACK:AcknowledgementNumberisvalidPSH:PUSHFlagNotificationfromsendertothereceiverthatthereceivershouldpassalldatathatithastotheapplication.Normallysetbysenderwhenthesender’sbufferisempty19TCPheaderfieldsFlagbits:RST:ResettheconnectionTheflagcausesthereceivertoresettheconnectionReceiverofaRSTterminatestheconnectionandindicateshigherlayerapplicationabouttheresetSYN:SynchronizesequencenumbersSentinthefirstpacketwheninitiatingaconnectionFIN:SenderisfinishedwithsendingUsedforclosingaconnectionBothsidesofaconnectionmustsendaFIN20TCPheaderfieldsWindowSize:EachsideoftheconnectionadvertisesthewindowsizeWindowsizeisthemaximumnumberofbytesthatareceivercanaccept.Maximumwindowsizeis216-1=65535bytesTCPChecksum:TCPchecksumcoversoverbothTCPheaderandTCPdata(alsocoverssomepartsoftheIPheader)UrgentPointer:OnlyvalidifURGflagisset21TCPheaderfieldsOptions:22TCPheaderfieldsOptions:NOPisusedtopadTCPheadertomultiplesof4bytesMaximumSegmentSizeWindowScaleOptions

IncreasestheTCPwindowfrom16to32bits,I.e.,thewindowsizeisinterpreteddifferentlyThisoptioncanonlybeusedintheSYNsegment(firstsegment)duringconnectionestablishmenttimeTimestampOptionCanbeusedforroundtripmeasurements23ConnectionManagementinTCPOpeningaTCPConnectionClosingaTCPConnectionSpecialScenariosStateDiagram24TCPConnectionEstablishmentTCPusesathree-wayhandshaketoopenaconnection:

(1)ACTIVEOPEN:ClientsendsasegmentwithSYNbitset*portnumberofclientinitialsequencenumber(ISN)ofclient

(2)PASSIVEOPEN:ServerrespondswithasegmentwithSYNbitset*initialsequencenumberofserverACKforISNofclient(3)Clientacknowledgesbysendingasegmentwith:ACKISNofserver(*countsasonebyte)25Three-WayHandshake26Three-WayHandshake27TCPConnectionTerminationEachendofthedataflowmustbeshutdownindependently(“half-close”)IfoneendisdoneitsendsaFINsegment.ThismeansthatnomoredatawillbesentFourstepsinvolved: (1)XsendsaFINtoY(activeclose) (2)YACKstheFIN, (atthistime:YcanstillsenddatatoX) (3)andYsendsaFINtoX(passiveclose)

(4)XACKstheFIN.28TCPStates29TCP-PartIIDatatransmissionFlowcontrolErrorcontrolCongestioncontrol30InteractiveandbulkdatatransferTCPapplicationscanbeputintothefollowingcategoriesbulkdatatransfer -ftp,mail,httpinteractivedatatransfer -telnet,rloginTCPhasheuristicstodealtheseapplicationtypes.Forinteractivedatatransfer:Trytoreducethenumberofpackets31

FlowControl

CongestionControl

ErrorControlTCP:32TCPFlowControl33TCPFlowControl

TCPimplementsslidingwindowflowcontrol Sendingacknowledgementsisseparatedfromsettingthewindowsizeatsender.AcknowledgementsdonotautomaticallyincreasethewindowsizeAcknowledgementsarecumulative34SlidingWindowFlowControl

SlidingWindowProtocolisperformedatthebytelevel:Here:Sendercantransmitsequencenumbers6,7,8.35SlidingWindow:“WindowCloses”

Transmissionofasinglebyte(withSeqNo=6)andacknowledgementisreceived(AckNo=5,Win=4):36SlidingWindow:“WindowOpens”

Acknowledgementisreceivedthatenlargesthewindowtotheright(AckNo=5,Win=6):

AreceiveropensawindowwhenTCPbufferempties(meaningthatdataisdeliveredtotheapplication).37SlidingWindow:“WindowShrinks”

Acknowledgementisreceivedthatreducesthewindowfromtheright(AckNo=5,Win=3):

Shrinkingawindowshouldnotbeused38WindowManagementinTCPThereceiverisreturningtwoparameterstothesenderTheinterpretationis:Iamreadytoreceivenewdatawith SeqNo=AckNo,AckNo+1,….,AckNo+Win-1ReceivercanacknowledgedatawithoutopeningthewindowReceivercanchangethewindowsizewithoutacknowledgingdata39TCPCongestionControl40TCPCongestionControlTCPhasamechanismforcongestioncontrol.ThemechanismisimplementedatthesenderThesenderhastwoparameters:CongestionWindow(cwnd)Slow-startthreshholdValue(ssthresh) InitialvalueistheadvertisedwindowsizeCongestioncontrolworksintwomodes:slowstart(cwnd<ssthresh)congestionavoidance(cwnd>=ssthresh41SlowStartInitialvalue: Setcwnd=1

Note:Unitisasegmentsize.TCPactuallyisbasedonbytesandincrementsby1MSS(maximumsegmentsize)Thereceiversendsanacknowledgement(ACK)foreachpacketNote:Generally,aTCPreceiversendsanACKforeveryothersegment.42SlowStartEachtimeanACKisreceivedbythesender,thecongestionwindowisincreasedby1segment:

cwnd=cwnd+1IfanACKacknowledgestwosegments,cwndisstillincreasedbyonly1segment.EvenifACKacknowledgesasegmentthatissmallerthanMSSbyteslong,cwndisincreasedby1.DoesSlowStartincrementslowly?Notreally.

Infact,theincreaseofcwndisexponential43SlowStartExa

温馨提示

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

评论

0/150

提交评论