cs4450 - cornell university › courses › cs4450 › 2019sp › lecture04...• urls are based on...
TRANSCRIPT
ComputerNetworks:ArchitectureandProtocols
CS4450
Lecture4-PacketDelays
-HowtheInternetworks-ThreeArchitecturalPrinciples
RachitAgarwal
ContextforandGoalsofToday’sLecture
• Context:• Today’slectureisgoingtobeoneofthehardestlectures• Ifyouunderstandeverything
• Thereissomethingwrong!
• Goals:• HowdoestheInternetwork?
• Anend-to-endview
• ThreePrinciples
But,asusual,letsstartwith:
whatwelearntlastlecture
• Handlingfailures• Resourceunderutilization• Blockedconnections• Connectionsetupoverheads• Per-connectionstateinswitches(scalabilityproblem)
Recap:ChallengeswithCircuitswitching(reservation)
• Breakdataintosmallerpieces
• Packets!
• Transmitthepacketswithoutanyreservations
• And,hopeforthebest
Recap:Solution:Packetswitching
• Goods:• Easiertohandlefailures• Noresourceunderutilization
• Asourcecansendmoreifothersdon’tuseresources
• Noblockedconnectionproblem
• Noper-connectionstate• Noset-upcost
• Not-so-goods:• Unpredictableperformance
• Highlatency• Packetheaderoverhead
Recap:Packetswitchingsummary
• Consistsofsixcomponents
• Linkproperties:• Transmissiondelay
• Propagationdelay
• OSinternals:• Processingdelay• Queueingdelay
• Trafficmatrixandswitchinternals:
• Processingdelay• Queueingdelay
• First,considertransmission,propagationdelays
• Queueingdelayandprocessingdelayslaterinthecourse
Recap:Deepdiveintoonelink:packetdelay/latency
• Transmissiondelay:
• Timetakentopushallthebitsofapacketintoalink
• =Packetsize/Linkbandwidth
• Propagationdelay:• Timetakentomoveonebitfromoneendofthelinktoother
• =Linklength/Speedoflight
Recap:Transmissionandpropagationdelay
Questions?
Today’slecture
1. Diveintoend-to-end:fromsourcetodestination
2. Firstlookintoswitches:routing,queueing,forwarding
3. Firstlookintonetworkstack:sockets,ports,“thestack”
4. Secondlookintothestack:layers
5. Whylayering?
Firstlookintoend-to-end
Source
Destination
Source
Destination
End-to-end:whatmechanismsdoweneed?
• Locatingthedestination:Naming,addressing
• Findingapathtothedestination:Routing
• Sendingdatatothedestination:Forwarding
• Reliability:Failurehandling
Fourfundamentalproblems!
Naming,Routing,Forwarding,Reliability
• Eachismotivatedbyaclearneed
• Thesolutionsarenotalwayscleanordeep
• Butifyoukeepinmindwhattheproblemis
• You’llbeabletounderstandthesolutions• Whentherighttimecomes:-)
Fourfundamentalproblems!
• NetworkAddress:wherehostislocated• Requiresanaddressforthedestinationhost
• canbemultipleheaders
• NetworkName:whichhostitis
• why?
• Whenyoumoveservertonewbuilding
• Namedoesn’tchange
• Addressdoeschange
• Samethingwithyourownnameandaddress!
• Remembertheanalogy:humannames,addresses,postoffice,letters
Fundamentalproblem#1:HostNamesandAddresses
• Considerwhenyouaccessawebpage• InsertURLintobrowser(eg,www.cornell.edu)• Packetssenttowebsite(reliably)• Packetreachapplicationondestinationhost
• Howdoyougettothewebsite?• URLisuser-levelname(eg,www.cornell.edu)
• Networkneedsaddress(eg,whereiswww.cornell.edu)?
• Mustmapnamestoaddresses
• Justlikeweuseanaddressbooktomaphumannamestoaddresses
Namesversusaddresses
• OntheInternet,weonlynamehosts(sortof)
• URLsarebasedonthenameofthehostcontainingthecontent(thatis,www.cornell.edunamesahost)
• Beforeyoucansendpacketstowww.cornell.edu,youmustresolvenamesintothehost’saddress
• DonebytheDomainNameSystem(DNS)
MappingNamestoAddresses
Thesourceknowsthename;
MapsthatnametoanaddressusingDNS!
Questions?
Routingtodestination
• Givendestinationaddress,howdoeseachswitch/routerknowwheretosendthepacketsothatthepacketreachesitsdestination
• Whenapacketarrivesatarouter
• aroutingtabledetermineswhichoutgoinglinkthepacketissenton
Fundamentalproblem#2
• Distributedalgorithmthatrunsbetweenrouters
• Distributedmeansnosinglerouterhas“full”viewofthenetwork
• Exchangeofmessagestogather“enough”information…
• …aboutthenetworktopology
• Computepathsthroughthattopology
• Storeforwardinginformationineachrouter
• IfpacketisdestinedforX,sendoutlinkl1• IfpacketisdestinedforY,sendoutlinkl2• Canpacketsgoingtodifferentdestinationssentouttosameport?
• Wecallthisaroutingtable
Routingprotocols(conceptually)
Questions?
QueueingandForwardingofpacketsatswitches/routers
• Queueing:Whenapacketarrives,storeitin“inputqueues”
• Eachincomingqueuedividedintomultiplevirtualoutputqueues
• Onevirtualoutputqueueperoutgoinglink• Whenapacketarrives:
• Lookupitsdestination’saddress(how?)• Findthelinkonwhichthepacketwillbeforwarded(how?)• Storethepacketincorrespondingvirtualoutputqueue
• Forwarding:Whentheoutgoinglinkfree
• Pickapacketfromthecorrespondingvirtualoutputqueue
• forwardthepacket!
Fundamentalproblem#3
• Packetsmustdescribewhereitshouldbesent
• Requiresanaddressforthedestination
• Packetsmustdescribewhereitscomingfrom
• Forhandlingfailures,etc.• Requiresanaddressforthesource
• Packetsmustcarrydata
• canbebitsinafile,image,whatever
Whatmustpacketscarrytoenableforwarding?
Header Data
Whatdoesaswitch/routerlooklike
Inputqueue
Virtualoutputqueue
Outputqueue
• Eachinputqueuecouldsendpacketstoeachoutputqueueatfullrate• Thatis,aswitcharchitectureisheavilyparallelized• Canalwaysfocusonasingleoutgoingqueuefordesign/analysis
Queueingandprocessingdelay:CaseI(lowload)
2packets/time
1packet/time
Queueingandprocessingdelay:CaseII(balancedload)
2packets/time
1packet/time
Queueingandprocessingdelay:CaseII(highload)
2packets/time
1packet/time
• Processingdelay• Easy;eachswitch/routerneedstodecidewheretoputpacket• Requirescheckingheader,etc.
• Queueingdelay• Dependsonnetworkload• Asloadincreases,queueingdelayincreases
• Inanextremecase,increaseinnetworkload
• resultsinpacketdrops
Queueingandprocessingdelay
Questions?
Howdoyoudeliverpacketsreliable?
• Packetscanbedroppedalongtheway• Buffersinroutercanoverflow• Routerscancrashwhilebufferingpackets• Linkscangarblepackets
• Howdoyoumakesurepacketsarrivesafelyonanunreliablenetwork?
• Or,atleast,knowiftheyaredelivered?• Wantnofalsepositives,andhighchangeofsuccess
Fundamentalproblem#4
• Whoisresponsibleforthis?(architecture)
• Network?• Host?
• Howisitimplemented?(engineering)
• Wewillconsiderbothperspectives
Twoquestionsaboutreliability
Questions?
• Wenowhavetheaddressofthewebsite
• And,aroute/pathtothedestination• And,mechanismsinplacetoforwardthepacketsateachswitch/router
• Inareliablemanner
• So,wecansendpacketsfromsourcetodestination
• Arewedone?
• Whenapacketarrivesatahost,whatdoesthehostdowithit?
• Towhichprocess(application)shouldthepacketbesent?
• Ifthepacketheaderonlyhasthedestinationaddress,howdoesthehostknowwheretodeliverpacket?
• Theremaybemultipleapplicationsonthatdestination
Finishingourstory
• Whoputsthesourceaddress,sourceport,destinationaddress,
destinationportinthepacketheader?
Andwhilewearefinishingourstory….
Thefinalpieceinthegame:End-hoststack
OfSocketsandPorts
• Whenaprocesswantsaccesstothenetwork,itopensasocket,whichisassociatedwithaport
• Socket:anOSmechanismthatconnectsprocessestothenetworkingstack
• Port:numberthatidentifiesthatparticularsocket
• TheportnumberisusedbytheOStodirectincomingpackets
• PacketHeadermustinclude:
• Destinationaddress(usedbynetwork)• Destinationport(usedbynetworkstack)• And?• Sourceaddress(usedbynetwork)• Sourceport(usedbynetworkstack)
• Whenapacketarrivesatthedestinationhost,packetisdeliveredtothesocketassociatedwiththedestinationport
• Moredetailslater
ImplicationsforPacketHeader
• Network:Deliverpacketsfromhosttohost(basedonaddress)
• Networkstack(OS):Deliverpacketstoappropriatesocket(basedonport)
• Applications:• Sendandreceivepackets• Understandcontentofpacketbodies
Separationofconcerns
SecretoftheInternet’ssuccessisgetting
theseandotherabstractionsright
• Whyisseparationofconcernsimportant?
• Separationofconcerns~Modularity
• Ifeachcomponent’staskwell-defined,onecanfocusdesignonthattask
• Andreplaceitwithanyotherimplementationthatdoesthattask
• Withoutchanginganythingelse
Whocares?
• Modularityisnothingmorethandecomposingprograms/systemsintosmallerunits.• Aclean“separationofconcerns”
• Playsacrucialroleincomputerscience…
• …andnetworking
WhatisModularity
“Modularitybasedonabstractionisthewaytogetthingsdone”--BarbaraLiskov
ModularityinComputerScience
• Partitionsystemintomodules
• Eachmodulehaswelldefinedinterface
• Interfacesgiveflexibilityinimplementation
• Changeshavelimitedscope
• Examples• Librariesencapsulatingsetoffunctionalities• ProgramminglanguageabstractsawayCPU
• Thetrickistofindtherightmodularity
• Theinterfacesshouldbelong-lasting• Ifinterfacesarechangingoften,modularityiswrong
ComputerSystemModularity
• Theneedformodularitystillapplies
• Andisevenmoreimportant!(why?)
• Networkimplementationsnotjustdistributedacrossmanylinesofcode
• Normalmodularity“organizes”thatcode
• Networkingisdistributedacrossmanymachines• Hosts• Routers
NetworkSystemModularity
• Howtobreaksystemintomodules?
• Classicdecompositionintotasks
• Wherearemodulesimplemented?
• Hosts?• Routers?• Both?
• Whereisstatestored?
• Hosts?• Routers?• Both?
NetworkModularityDecisions
• Howtobreaksystemintomodules
• Layering
• Wherearemodulesimplemented
• End-to-EndPrinciple
• Whereisstatestored?• Fate-Sharing
Leadstothreedesignprinciples
Layering
• Bitsonwire
• Packetsonwire
• Deliverpacketstohostsacrosslocalnetwork
• Deliverpacketstohostacrossnetworks
• Deliverpacketsreliably,tocorrectprocess
• Dosomethingwiththedata
Breakdownintotasks
• Bitsonwire(Physical)
• Packetsonwire
• Deliverpacketstohostsacrosslocalnetwork(Datalink)
• Deliverpacketstohostacrossnetworks(Network)
• Deliverpacketsreliably,tocorrectprocess(Transport)
• Dosomethingwiththedata(Application)
ResultingModules(Layers)
• Application:Providingnetworksupportforapps
• Transport(L4):(Reliable)end-to-enddelivery
• Network(L3):Globalbest-effortdelivery
• Datalink(L2):Localbest-effortdelivery
• Physical:Bitsonwire
FiveLayers(Top-Down)
• Akindofmodularity
• Functionalityseparatedintolayers• Layerninterfaceswithonlylayern-1
• Hidescomplexityofsurroundinglayers
• Evolutionof“modules”
• (IP)Connectivitybecomesacommodity
Layering
• Eachlayer:• Dependsonthelayerbelow• Supportslayerabove• Independentofothers
• Multipleversionsinlayer
• Interfacesdiffersomewhat
• Componentspickwhichlower-
levelprotocoltouse
• ButonlyoneIPlayer• Unifyingprotocol
ThreeObservations
Layering“modularized”theInternetarchitecturewithflexibleopeninterfaces
whichhelpedspurinnovagon
LayeringandInnovation
• Innovationatmostlevels:
• Applications(lots)• Transport(few)• Datalink(few)• Physical(lots)
• Innovationproceededlargelyinparallel
• Payoffofmodularity!
• Pursuedbyverydifferentcommunities
• Likesystemsandchipdesigners
LayeringcrucialtoInternet’ssuccess
Questions?
• Howtobreaksystemintomodules?
• Layering
• Wherearemodulesimplemented?
• End-to-EndPrinciple
• Whereisstatestored?
• Fate-Sharing
ThreeInternetDesignPrinciples
• Layersaresimpleifonlyonasimplemachine
• Juststackofmodulesinteractingwiththoseabove/below
• Butweneedtoimplementlayersacrossmachines
• Hosts• Routers(Switches)
• Whatgetsimplementedwhere?
DistributingLayersacrossNetwork
• Bitsarriveonwire,mustmakeituptoapplication
• Therefore,alllayersmustexistathost!
WhatgetsimplementedonHost?
• Bitsarriveonwire• Physicallayernecessary
• Packetsmustbedeliveredtonexthop
• Datalinklayernecessary
• Routersparticipateinglobaldelivery• Networklayernecessary
• Routersdonotsupportreliabledelivery• Transportlayer(andabove)notsupported
WhatgetsimplementedonRouter?
• Lowerthreelayersimplementedeverywhere
• Toptwolayersonlyimplementedathosts
SimpleDiagram
• Layeringdoesn'ttellyouwhatserviceseachlayershouldprovide
• Whatisaneffectivedivisionofresponsibilitybetweenvariouslayers?
Butwhyimplementedthisway?
If a function can completely and correctly be implemented only with the knowledge and help of the application standing at the endpoints of the communication system,
then providing that function as a feature of the communication system itself is not possible.
Sometimes providing an incomplete version of that function as a feature of the communication system itself may be useful as a performance enhancement.
End-to-endPrinciple
Supposethelinklayerisreliable.Doesthatensurereliabledatatransfer?
Supposethenetworklayerisreliable.Doesthatensurereliabledata
transfer?
machine machine
Example: file transfer
Suppose the link layer is reliable. Does that ensure reliable file transfer?
Suppose the network layer is reliable. Does that ensure reliable file transfer?
disk disk
file transferapplication
file transferapplication
network
flow of data
End-to-endPrinciple:anexample
Assumethecondigon(IF)holds.Then,
• End-to-endimplementation• Correct• Generalized,andsimplifieslowerlayers
• In-networkimplementation• Insufficient• Mayhelp—orhurt—performance
Examples?Contradicfons?
End-to-endPrinciple(Interpretation)
Whatdoestheendmean?
End-to-endPrinciple(Interpretation)
• Failureavoidance?
• Failurereaction?
• Routing?
• Topologydiscovery?
• PathSelection?
• Security?
• Networkmanagement?
• Resourcemanagement?
GroupExercise4
Whereshallweimplementthefollowing?
• Wheretoimplementfunctionalityiscomplicated
• Norightorwronganswer
• Buteveryoneagreesthatreliabilitydoesnotbelonginthenetwork
• Multicastisagoodtestcase
Summary
Questions?
• Howtobreaksystemintomodules?
• Layering
• Wherearemodulesimplemented?
• End-to-EndPrinciple
• Whereisthestatestored?
• Fate-sharing
ThreeInternetDesignPrinciples
• NotethatE2Eprinciplereliedon“fate-sharing”• Invariantsonlybreakwhenendpointsthemselvesbreak
• Minimizethedependenceonothernetworkelements
• Thisshoulddictateplacementofstorage
Fate-Sharing
• Whenstoringstateinadistributedsystem,colocateitwithentitiesthat
relyonthatstate
• Onlywayfailurecancauselossofthecriticalstateisiftheentitythatcaresaboutitalsofails…
• …inwhichcaseitdoesn’tmatter
• Oftenarguesforkeepingnetworkstateatendhostsratherthaninsiderouters
• E.g.,packet-switchingratherthancircuit-switching
GeneralPrinciple:Fate-Sharing
• Howtobreaksystemintomodules
• Dictatedbylayering
• Wheremodulesareimplemented
• DictatedbyEnd-to-EndPrinciple
• Wherestateisstored
• DictatedbyFateSharing
DecisionsandtheirPrinciples
• TheInternetisahuge,complicatedsystem
• Onecanstudythepartsinisolation• Routing• Ports,sockets• Networkstack• …
• Butthepiecesallfittogetherinaparticularway
• Todaywasquickoverviewofhowpiecesfit…• Don’tworryifyoudidn’tunderstandmuchofit
• Youprobablyabsorbedmorethanyourealize
Today’slecture