1 / 55

Understanding Transport Layer: Protocols & Services

Explore the functions, protocols, and services of the transport layer in the OSI model. Learn about connection-oriented and connectionless services, TCP vs. UDP, header formats, and more. Compiled By: Ashish Kr. Jha.

danielg
Download Presentation

Understanding Transport Layer: Protocols & Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter6 & 7 TransportLayer Compiled By: Ashish Kr. Jha

  2. 2 • Introduction • FourthlayerofOSIReferenceModel. • Thebasicfunctionofthetransportlayeristoacceptdatafromabove,splititupintosmallerunitsifneedbe,passthesetothenetworklayer,andensurethatthepiecesallarrivecorrectlyattheotherend. • Furthermore,allthismustbedoneefficientlyandinawaythatisolatestheupperlayersfromtheinevitablechangesinthehardwaretechnology. Compiled By: Ashish Kr. Jha

  3. 3 • ElementsofTransportLayerProtocols • Endtoendconnection • Processesareaddressed/Addressing • Transportationissuebetweenthehost • Reliabledatatransferbetweenthehost • Establishconnectionbetweenthehost • FlowcontrolandBuffering • Errordetectionandrecovery/Crashrecovery • Multiplexing • ProtocolDataUnit(PDU):Segment Compiled By: Ashish Kr. Jha

  4. 4 TransportLayer Compiled By: Ashish Kr. Jha

  5. 5 • NeedofTransportLayer • Allowsdifferentprocessesorapplicationstorun • simultaneouslyinsamehost. • ▫ ಯPortNumberರisaddedtoidentifydifferentprocessesand • applicationsrunninginthesinglehost(i.e.OnlyoneIP). • UsershavenocontrolovertheNetworkServices.So,ifsomethinggoeswrong,ausercandonothing. • Thetransportserviceiswhatuserscanaddtoimprovethe • reliabilityoftheserviceprovidedbythenetwork. • TransportLayerServices: • ▫ ServicesProvidedtotheUpperLayers • ▫ TransportServicePrimitives • ▫ BerkeleySockets Compiled By: Ashish Kr. Jha

  6. 6 ServicesProvidedtotheUpperLayers • Thenetwork,transport,andapplicationlayers. Compiled By: Ashish Kr. Jha

  7. 7 • TransportServicePrimitives • Theprimitivesforasimpletransportservice Compiled By: Ashish Kr. Jha

  8. 8 DataEncapsulationatdifferentlayers • ThenestingofTPDUs,packets,andframes. Compiled By: Ashish Kr. Jha

  9. 9 • BerkeleySockets • ThesocketprimitivesforTCP. Compiled By: Ashish Kr. Jha

  10. 10 • TransportLayerProtocolServices • Connectionorientedserviceand • ConnectionlessService Compiled By: Ashish Kr. Jha

  11. 11 • ConnectionOrientedServices • Connection-Orientedmeansthatwhendevicescommunicate,theyperformhandshakingtosetupanend-to-endconnection. • ThehandshakingprocessmaybeassimpleassynchronizationsuchasinthetransportlayerprotocolTCP,orascomplexasnegotiatingcommunicationsparametersaswithamodem. • Connection-Orientedsystemscanonlyworkinbi-directionalcommunicationsenvironments.Tonegotiateaconnection,bothsidesmustbeabletocommunicatewitheachother.Thiswillnotworkinaunidirectionalenvironment. • Sinceaconnectionneedstobeestablished,theservicealsobecomesreliableone. • ExampleofonesuchconnectionorientedserviceisTCP. Compiled By: Ashish Kr. Jha

  12. 12 • ConnectionLessServices • Aconnectionlesstransportservice does notrequire • connectionestablishmentand • sincethereisnoestablishment,thereshouldbeno • terminationalso. • Thishappenstobeaunreliableservicebutmuchmorefasterthanconnectionoriented. • ExampleofonesuchconnectionlessserviceisUDP Compiled By: Ashish Kr. Jha

  13. 13 • TransportLayerProtocols • TCP(TransmissionControlProtocol) • ▫ Reliable,connectionorientedbyte-streamprotocol • ▫ In-sequencesegmentdelivery • ▫ Flowcontrol(withseq.andACKwithslidingwindow) • ▫ Errordetectionwithchecksum • ▫ Veryreliable,usuallyusedforfiletransfers. • UDP(UserDatagramProtocol) ▫ Usuallyusedforrealtimetrafficslikelivevideostreaming,videoorvoicechattingetc. Compiled By: Ashish Kr. Jha

  14. 14 ConnectionestablishmentinTCP Compiled By: Ashish Kr. Jha

  15. 15 AcknowledgementinTCP Compiled By: Ashish Kr. Jha

  16. 16 ConnectionTearDowninTCP Compiled By: Ashish Kr. Jha

  17. 17 TCPVS.UDP Compiled By: Ashish Kr. Jha

  18. 18 TCPHeaderFormat Compiled By: Ashish Kr. Jha

  19. 19 • TCPHeaderFormat • SourceandDestinationportareofeach16bit. • Numberofportnumber=216=65535 • 0-1023arewellknownportnumbers,which isusedby • systemtorepresentdifferentservices.e.g.port25forSMTP, • port80forhttp,443forhttps,21forftp,23fortelnetetc. • TheSourceportandDestinationportfieldsidentifythelocalendpointsoftheconnection. • The32bitSequencenumberand32bitAcknowledgementnumberfieldsareusedforreliabledatatransferbetweenhosts. Compiled By: Ashish Kr. Jha

  20. 20 • TCPHeaderFormat • TheTCPheaderlengthtellshowmany32-bitwordsarecontainedintheTCPheader.ThisinformationisneededbecausetheOptionsfieldisofvariablelength. • MinimumHLENis20bytes. • Nextcomesa6-bitfieldthatisnotused. • Sixbitflagsi.e.URG,ACK,PSH,RST,FINandSYN • TheACKbitissetto1toindicatethattheAcknowledgement • numberisvalid. • SYN,FINandRSTisusedforconnectionestablishmentandteardown. Compiled By: Ashish Kr. Jha

  21. 21 • TCPHeaderFormat • SendercanuseaPUSHflagtoinstructTCPnottobufferthe • send. • SendercanuseURGENTflagtohaveTCPsenddataimmediatelyandhavethereceiverTCPsignalthereceiverapplicationthatthereisdatatoberead. • FlowcontrolinTCPishandledusingavariable-sizedslidingwindow.TheWindowsizefieldtellshowmanybytesmaybesentstartingatthebyteacknowledged. • AChecksumisalsoprovidedforextrareliability. • Urgentpointer:byteoffsetofurgentdata • Options:Extrafacilitiese.g.SpecifymaximumTCPLoad. Compiled By: Ashish Kr. Jha

  22. 22 • TCPReliability • ErrorDetection • ReceiverFeedback • Retransmission Compiled By: Ashish Kr. Jha

  23. 23 UserDatagramProtocol(UDP) Compiled By: Ashish Kr. Jha

  24. 24 • UDPHeaderFormat • FixedLengthHeaderformat. • Thesourceportisprimarilyneededwhenareplymustbesentbacktothesource. • TheUDPlengthfieldincludesthe8-byteheaderandthedata. • TheUDPchecksumisoptionalandstoredas0ifnotcomputed Compiled By: Ashish Kr. Jha

  25. 25 ApplicationLayerProtocols Compiled By: Ashish Kr. Jha

  26. 26 Addressing TSAPs(TransportServiceAccessPoint),NSAPs(NetworkSAP) Compiled By: Ashish Kr. Jha

  27. 27 • Multiplexing • Multiplexingheremeansmultiplexingmultipletransportconnectionsonasinglenetworklayerconnection,whichisgenerallyrequirediftheavailablebandwidthismorethanor equaltotheintegrationofindividualrequirementofeach the • connection,thusmaking • availablebandwidth. • Increasesthethroughput. aneffectiveutilizationof Appl.xAppl.yAppl.z Appl.zAppl.yAppl.x PortPortPort PortPort TransportProtocol Port TransportProtocol Entity Entity IPAddress IPAddress NetworkServiceProvider Host Host Compiled By: Ashish Kr. Jha

  28. 28 • PortandSocket • Port • ▫ Anapplication-specificorprocess-specificsoftwareconstructtoidentifydifferentprocessesofsamehost • ▫ Analogoustotelephoneextensioninsideanorganization • ▫ Whenyouopenyahoo.comandhotmail.comonsamePCatsame • time,theywillhavedifferentportnumbers. • ▫ Whyportno.aswealreadyhaveprocessID? • Processidisdifferentforeachnewprocesseventhoughtheyrequiresameservice • VerydifficulttotrackProcessIDofeachprocessofahost Compiled By: Ashish Kr. Jha

  29. 29 • PortandSocket • TypesofPortNumber • ▫ Well-KnownPorts • Portnumbers0 to 1023 • Usedformostcommonnetworkapplications • Eg.http-80,ftpdata-20,ftpcontrol-21,DHCPClient-68,DHCP • Server-67,DNS -53,SMTP–25,POP3–110etc • ▫ Registered Ports • PortNumbers1024to49151 • Assignedby IANAforspecificserviceseg.VLC –1234,Skype- • 23399 • Inmost systems, theseportscanalsobe usedbyordinaryusers • ▫ Dynamic/PrivatePorts • PortNumbers49152to65535 • Cannotbe registeredwithIANA • Usedfortemporarypurposes Compiled By: Ashish Kr. Jha

  30. 30 PortandSocket Application1 Application2 Application1 Application2 Portno. Portno. Portno. Portno. TransportProtocolEntity TransportProtocolEntity IPaddress IPaddress IPServiceProvider Compiled By: Ashish Kr. Jha

  31. 31 • PortandSocket • Socket ▫ Endpoint ofaninter-processcommunicationflowacrossa computernetwork. ▫ SocketaddressisacombinationofIPandPortno.accordingto whichitdeliversdatatoappropriateapplicationorprocess ▫ Integratedintotheoperatingsystem ▫ Explicitlycreated,used,releasedbyapplications Compiled By: Ashish Kr. Jha

  32. 32 ConnectionEstablishment • 3-wayhandshake: client server • ▫ Step1: • ClientendsystemsendsTCPSYN • controlsegmenttoserver • ▫ Step2: • ServerendsystemreceivesSYN, replieswithSYN-ACK • Allocatesbuffers • ACKs receivedSYN open listen established • ▫ Step3: • ClientreceivesSYN-ACK • connectionisnowsetup • clientstartsthe“realwork” established Compiled By: Ashish Kr. Jha

  33. 33 • ConnectionRelease • Releasecanbeasymmetric(onesided, wheredatamayloss) orsymmetric (bothsideagreed) • StepsforsymmetricRelease: • Step1: ClientendsystemsendsTCP • FINcontrolsegmenttoserver Abruptdisconnectionwithlossofdata. client server • Step2:ServerreceivesFIN,replies withACK.Closesconnection,sends FIN. • Step 3: ClientreceivesFIN,replies withACK. close close timedwait ▫ Enters “timedwait”-will respond withACKtoreceived FINs closed • Step 4: server,receivesACK. Connectionclosed. closed SymmetricRelease Compiled By: Ashish Kr. Jha

  34. 34 • ConnectionRelease(Problem) • Thetwo-armyproblem • Forbluearmy to win, bothtroops(1&2)mustattackwhitearmy atsame • time • Forsync.,#1sendsmsg. to #2andwaitsforACK.Even though#1 receivesACK,attackisnotpossibleas#2 doesn’tknowwhether#1 has receiveditsACKornot • Even,3-wayhandshaking(#1againsendingACK) willnotguarantee • successfulattackasnow#1isnotsureif#2hasreceiveditsACK • Itcanbe provedthatno protocolexiststhatworks,butlittleriskcanbe takenwhilereleasingconnection. • Although,3-wayhandshakingisnotinfallible,itisusuallyadequate Compiled By: Ashish Kr. Jha

  35. 35 ConnectionRelease Fourprotocolscenariosfor releasingaconnection. Normalcaseofathree-wayhandshake. finalACKlost. Responselost. ResponselostandsubsequentDRs(DisconnectionRequests)lost. Compiled By: Ashish Kr. Jha

  36. 36 FlowControlandBuffering • FlowControl,similartodatalinklayer(slidingwindow),exceptthattransportlayerhastodealwithlargenumberofconnections. • Flowcontrolatthislayerisperformedend-to-endratherthanacrossasinglelink. • Allocatingdedicatedbuffersperconnectionatsenderandreceivermaynotbepractical. • Differentapproachesforbufferorganization • ▫ Chainedfixed-sizebuffers • ▫ Chainedvariable-sizedbuffers • ▫ Onelargecircularbufferperconnection • Typeoftrafficcarriedbyaconnectionalsoinfluencesbufferingstrategy. • Asconnectionscomeandgo,andtraffictypeschanges,needto • abletoadjustbufferallocationsdynamically • ▫ Usingvariable-sizedslidingwindows • ▫ Decouplewindowmanagementfromacknowledgements Compiled By: Ashish Kr. Jha

  37. 37 • FlowControlandBuffering • ReceiveWindowfieldisusetocontroltheflowbetweentwo • hosts. • Slidingwindowprotocolisusedforflowcontrolmechanism. Compiled By: Ashish Kr. Jha

  38. 38 FlowControlandBuffering Compiled By: Ashish Kr. Jha

  39. 39 FlowControlandBuffering (a)Chainedfixed-sizebuffers.(b)Chainedvariable-sizedbuffers. (c)Onelargecircularbufferperconnection. Compiled By: Ashish Kr. Jha

  40. 40 • FlowControlandBuffering • Evenifthereceiverhasagreedtodothebuffering,therestill • remainsthequestionofthebuffersize. • IfmostTPDUsarenearlythesamesize,itisnaturaltoorganizethebuffersasapoolofidentically-sizedbuffers,withoneTPDUperbuffer,asinFig.A.However,ifthereiswidevariationinTPDUsize,fromafewcharacterstypedataterminaltothousandsofcharactersfromfiletransfers,apooloffixed-sizedbufferspresentsproblems. • IfthebuffersizeischosenequaltothelargestpossibleTPDU,spacewillbewastedwheneverashortTPDUarrives. • IfthebuffersizeischosenlessthanthemaximumTPDUsize,multiplebufferswillbeneededforlongTPDUs,withtheattendantcomplexity. Compiled By: Ashish Kr. Jha

  41. 41 • FlowControlandBuffering • Anotherapproachtothebuffersizeproblemistouse • variable-sizedbuffers,asinFig.B. • Theadvantagehereisbettermemoryutilization,attheprice • ofmorecomplicatedbuffermanagement. • Athirdpossibilityistodedicateasinglelargecircularbufferperconnection,asinFig.C. • Thissystemalsomakesgooduseofmemory,providedthatallconnectionsareheavilyloaded,butispoorifsomeconnectionsarelightlyloaded. Compiled By: Ashish Kr. Jha

  42. 42 • Congestion • Whentoomanypacketsarepresentin(apartof)thesubnet, • performancedegrades.Thissituationiscalledcongestion. • Overloadingofrouterswithpackets. • Routersreceivingpacketsfasterthantheycanforward. • FactorsCausingCongestion • ▫ Packetarrivalrateexceedstheoutgoinglinkcapacity. • ▫ Insufficientmemorytostorearrivingpackets • ▫ Burstytraffic • ▫ Slowprocessor Compiled By: Ashish Kr. Jha

  43. 43 Congestion Whentoomuchtrafficisoffered,congestionsetsinand performancedegradessharply. Compiled By: Ashish Kr. Jha

  44. 44 • CongestionCausedbySeveralFactors • Ifallofasudden,streamsofpacketsbeginarrivingonthreeorfourinputlinesandallneedthesameoutputline,aqueuewillbuildup.Ifthereisinsufficientmemorytoholdallofthem,packetswillbelost. • Routershaveaninfiniteamountofmemory,congestiongetsworse,notbetter,becausebythetimepacketsgettothefrontofthequeue,theyhavealreadytimedout(repeatedly)andduplicateshavebeensent. • Slowprocessorscanalsocausecongestion.Thisproblemwillpersistuntilallthecomponentsareinbalance. • Ifrouterhasnofreebuffers,itmustdiscardnewlyarrivingpacket.Sendermaytimeoutandretransmitsagainandagainincreasingtraffic. Compiled By: Ashish Kr. Jha

  45. 45 • CongestionControlandFlowControl • Congestioncontrolhastodowithmakingsurethesubnetis • abletocarrytheofferedtraffic. • Itisaglobalissue,involvingthebehaviourofallthehosts,alltherouters,thestore-and-forwardingprocessingwithintherouters,andalltheotherfactorsthattendtodiminishthecarryingcapacityofthesubnet. • Flowcontrol,incontrast,relatestothepoint-to-pointtraffic • betweenagivensenderandagivenreceiver. • Itsjobistomakesurethatafastsendercannotcontinuallytransmitdatafasterthanthereceiverisabletoabsorbit. • Flowcontrolfrequentlyinvolvessomedirectfeedbackfromthereceivertothesendertotellthesenderhowthingsaredoingattheotherend. Compiled By: Ashish Kr. Jha

  46. 46 • GeneralPrinciplesofCongestionControl • Twoapproach: • ▫ Openloop:trytopreventcongestionoccurringbygooddesign • ▫ Closed-loop:monitorthesystemtodetectcongestion,passthisinformationtowhereactioncanbetaken,andadjustsystemoperationtocorrecttheproblem(detect,feedbackandcorrect) • MoreTechniques: • ▫ Warningbit– SpecialBitinPacketHeadertonotifysender • aboutthecongestion,piggy-backedwithACK • ▫ Chokepackets– ControlPacketsentbycongestednode. • Sourcesthatgetchokepacketmustreducetransmissionrate • ▫ Loadshedding–bufferfull=>simplydiscardpackets. • ▫ Randomearlydiscard–discardpacketsbeforebufferisfull • ▫ Trafficshaping-controlstherateatwhichpacketsaresent Compiled By: Ashish Kr. Jha

  47. 47 • TrafficShaping • Trafficshapingisaboutregulatingtheaveragerate(and • burstiness)ofdatatransmission. • Incontrast,theslidingwindowprotocolswestudiedearlierlimittheamountofdataintransitatonce,nottherateatwhichitissent. • TwoWays: • ▫ LeakyBucket • ▫ TokenBucket Compiled By: Ashish Kr. Jha

  48. 48 LeakyBucket Compiled By: Ashish Kr. Jha

  49. 49 • LeakyBucket • Imagineabucketwithasmallholeinthebottom. • Nomattertherateatwhichwaterentersthebucket,theoutflowisataconstantrate,whenthereisanywaterinthebucketandzerowhenthebucketisempty. • Also,oncethebucketisfull,anyadditionalwaterenteringitspills • overthesidesandislost. • Thesameideacanbeappliedtopackets,asshowninFig.(b). • Conceptually,eachhostisconnectedtothenetworkbyaninterfacecontainingaleakybucket,thatis,afiniteinternalqueue. • Ifapacketarrivesatthequeuewhenitisfull,thepacketisdiscarded. • Inotherwords,ifoneormoreprocesseswithinthehosttrytosendapacketwhenthemaximumnumberisalreadyqueued,thenewpacketisunceremoniouslydiscarded. Compiled By: Ashish Kr. Jha

  50. 50 • LeakyBucket • Thisarrangementcanbebuiltintothehardwareinterfaceor • simulatedbythehostoperatingsystem. • ItwasfirstproposedbyTurner(1986)andiscalledtheleaky • bucketalgorithm. • Theleakybucketconsistsofafinitequeue.Whenapacketarrives,ifthereisroomonthequeueitisappendedtothequeue;otherwise,itisdiscarded. • Ateveryclocktick,onepacketistransmitted(unlessthe • queueisempty). • Theleakybucketalgorithmenforcesarigidoutputpatternat • theaveragerate,nomatterhowburstythetrafficis. Compiled By: Ashish Kr. Jha

More Related