Beruflich Dokumente
Kultur Dokumente
6thlecture
ChairofCommunicationSystems
DepartmentofAppliedSciences
UniversityofFreiburg
2005
1|48
InternetWorking
Lastlectureandpracticalcourse
ARP(addressresolutionprotocol),IPhelperprotocolfor
broadcastnetworks
Mapping48bitMACaddressestoIPaddresses
ARPinsecureprotocol
MACaddressesassignedgloballyuniquebyvendor
IPaddressesdependsonsubnetwhereendsystemislocated
AnotherhelperprotocolIPmessaginganderrorreporting
ICMP,partofIP
Sendnetworkerrorandinformationalmessages
2|48
InternetWorking
Lastlecture
DynamicIPaddressassignment
Byclientitself
Bycentrallymanagedserver
DHCP,UDPbased,applicationlayerprotocolfordynamic
assignmentofIPaddressesinbroadcastnetworks(layer2:
ethernet,TokenRing,...)
3|48
InternetWorking
planforthislecture
PacketroutinginIPnetworks
Discussedaddressadaptationinbroadcastnetsforlocal
delivery
Talkedofroutingprinciples(matchingdestinationaddresses
againstnetworkaddressofaninterface)
Mostlyinvolvesstaticrouting(addresses,netmasks,...)
assignedbyadministratordirectlyorviaDHCP
HowdoesroutingLANwideorgloballywork?
4|48
InternetWorking
definitionofrouters
SomehowmagicallyanIPpackettravelslongdistancesandfinds
itswaybetweentwoendsystems(fromsourcemachineto
destination)
Aswetalkedinintroduction:
IPisapacketswitchednetworksooneveryintermediate
systemaroutingdecisionistobemade
TheseintermediatesystemsnormallyhavemorethanoneIP
interfaces(eachinterfacewithitsownIPnumbermatchingtothe
netthemachineismemberof)
Formally:eachmachinewithinterfacesintwodifferentIPsubnets
(andtheabilitytoforwardpacketsfromoneinterfacetothe
other)iscalledarouter
5|48
InternetWorking
definitionofrouterscont.
Everyroutermaintainsaroutingtable
Inthesimplestcasetherouterhasthreeentriesinthattable
Routetolocalsubnet#1
Routetolocalsubnet#2
Defaultroutewiththerouterinoneofthesubnets
Theroutingtablegrowswiththenumberofinterfacesandnets
connectedtoeach
6|48
InternetWorking
routingexample
7|48
InternetWorking
routingexample
Theroutingtablesofthetworouters#1,#2arelongerthen
routingtableofendsystem
Foreachinterfacearoutingentryispresent
Wefindadefaultrouteonbothofthem(mostroutershave
defaultentry,wewillseewhylater)
Maintainingthisroutinginformationmanuallyisthestandard
mechanismusedforrelativelystaticandverysmallLAN
environments
Routingtablesonalargerscalearenotasfixedaslocalones
RememberthenetworkingstructuregraphsofBelWue,DFNand
Geant,manynetworknodesareconnectedonemorethanone
pathwitheachothers
8|48
InternetWorking
routingcont.
ReasonsformultilinkIPconnections
EveryISPmusthavemorethanoneuplinkconnectiontoget
thepermissiontooperate(foxholeprinciple)
Linksareofdifferingbandwidth,quality,latencyandprice
Thesevariablesmaydifferovertimeperiods(differentratesfor
dailyornightuse,failinglines,congestedpaths,...)
Youwillneedmechanismstoconsidertheseinformationand
computeanoptimalwaytoeverydestinationnetwork
RoutingtechniquesandprotocolsworkingoverIParetobe
introduced...
9|48
InternetWorking
routingprotocols
Ingeneral:routingprotocolsarenotIPspecific
Routingprotocolsmaybeneededondifferentnetworklayers
Itdependsonthetypeofunderlyingnetworkinginfrastructureand
conceptofconnection
Wecanmakesomegeneralassumptionsonroutingalgorithms
independentlyofthetypeofnetwork
WithinconnectionorientatednetworkslikeATMinfrastructurewe
findvirtualchannelswitching
ATMpacketsfollowapreviousinstalledroute
Routeisactiveduringthewholesession
10|48
InternetWorking
routingprotocols
IPpacketorientatednetwork
Routingdecisionisrenewedforeverypacket(introductionto
staticIProutinglastlecture)
Nostateofpreviousroutingdecisionsiskept(!)
Staticrouting(manualsetup)isacceptableinsmallnetworks
RoutingsetupforendsystemsoftenbyDHCP(lastlecture)
Thesemechanismsnotsuitableforroutingonlargerscale,e.g.
CampuswideinterLANrouting
DFNwide,interproviderrouting,...
11|48
InternetWorking
routingprotocols
Routingtablesgrowrelativelyfast,e.g.simplesubnettingin
universityLANofroughly256classCsubnetsin132.230.X.YIP
domainproduceslongtablesincorerouters
IPsubnetaggregationisoftenimpossible
Routersmayhaveseverallinks
Networkshouldhaveredundantlinks...
Routingcouldbedefined:Algorithmstoestablishroutingtableto
makewidelydistributedendpointsappeartobedirectly
connected
Somechanismsforautomatedsetupofroutertablesdesired
Differentroutingprotocolsrunonroutersimplementseveral
routingalgorithms
12|48
InternetWorking
routingprotocolsgeneralconsiderations
Ingeneral:forwardingislocalmadedecision,requiringonlynext
hopinformation
But:computationofbestrouterequiresglobalinformation
Thisinformationischallenging:
Hardtocollect,oftenoutdated,hugeamountsofdata
Nosinglenetworkowner
Generalneedsforrouting
Computeoptimalpathsforeachdestination(weneeda
definitionoftermoptimal)
Minimizecontrolmessageexchanges
Minimizeroutingtablespace
13|48
InternetWorking
routingprotocolspitfalls
Whileconsideringautomaticsetupofroutingtablessomerisks
mayshowup
Loops:shouldlocalforwardinginformationbeinconsistent
withglobaltopologyitcanformloops(blackholesinwhich
packetsdisappearyoumayhaveobservedthis
phenomenonwithtraceroutewhenarouteoscillatedbetween
tworouters...)
Oscillations:dynamicallyadaptingtoloadcanshiftload,lead
tocongestionandrepeat(oftenwithpathsofsmallbandwidth
considertwoISDNlineswithheavyload...)
Normallythesescenariosunusualundernormaloperation,often
duetomisconfiguration
14|48
InternetWorking
routingprotocolstheory
Routingitself(discussedwithIPaddressing)ispartofthenetwork
layerandresponsiblefordecidingwhichoutputlineanincoming
packetshouldtake
Routingalgorithmsoftenimplementedinapplicationsrunon
topoftheunderlyingIPnetwork
Forroutingdecisionshenceeveryroutingalgorithmcertain
propertiesaredesirable:
Correctnessofroutes
Simplicityofprotocol
Robustness
Stability
Fairnessandoptimality
15|48
InternetWorking
routingprotocolstheory
Correctnessandsimplicityareobviousrequirements
Robustness
Onceamajornetworkissetupsystemwidefailuresand
outagesarenotdesired
Shouldcatchupwithtopologychanges
Copewithhardwarefailures
Routechanges(becauseofpricingchanges,new
infrastructure,expandingofthenetwork,...)
...thatmeans,notallconnectedhostsshouldn'tbeaffected
16|48
InternetWorking
routingtheorycont.
Stability
Routingalgorithmsshouldconvergetowardsequilibriumina
certainamountoftime
Fairnessandoptimality
Obviousbutoftencontradictorygoals
Seethefollowingpicture,ifthesixhosts1,1';2,2';3,3'
communicatewitheachotherandsaturatethelinkthe
communicationofX,X'shouldbeshutoffcompletely...
17|48
InternetWorking
routingtheorycont.
ConflictbetweenFairnessandoptimality(dependsofcourseon
underlyingnetworktopology)
18|48
InternetWorking
routingprotocolstheory
Beforedecisionontradeoffbetweenthedescribedproblemcould
bedoneweshouldseewhatweseektooptimize:
Maximumtotalnetworkthroughputcouldbeoneparameter
Minimummeanpacketdelayisanother
Thesetwogoalsinconflicttoo:sinceoperatinganyqueuingsystem
nearlimitimplieslongdelays
Manynetworkstrytocompromisewithminimizingthenumberof
hops(passingaroutingengine)totakefromsourcetodestination
Suchthedelayisreducedandtheamountofbandwidthconsumed
minimized
19|48
InternetWorking
routingprotocolsinpacketnetworks
Internetdoesn'thaveverypredictabletrafficflow,mayhave
unreliablelinks
Routersareassumedtoknow
Addressofeachneighbor
Costofreachingeachneighbor
ChoicesforInternetrouting
Centralizedvs.distributedrouting
Sourcebasedvs.hopbyhop
Singleormultipath
Dynamicvs.static
20|48
InternetWorking
routingstrategies(non)adaptiverouting
Routingalgorithmsaregroupedintotwomajorclasses
NonadaptiveRAdonotbasetheirroutingdecisionson
(continuous)measurementsorestimatesofcurrentbandwidth
usageandtopology
Noneedforspecificmeasurementserviceruncontinuouslyor
scheduled
Theroutestousearecomputedinadvance,offlineand
downloadedtorouterswhennetworkiscomingup
Thatisthetypicalscenariofornetworkedendsystemsnormally
thesystemadministratorprovidestheroutesduringmachinesetup
OrtheroutinginformationistransferredviaDHCP(centralized
setupofnetworkingresources)
21|48
InternetWorking
adaptiverouting
Routingdonethatwayoftennamedstatic(typeofrouting
discussedyetfallsintothatcategory)
Adaptivealgorithmschangetheirroutingdecisionstoreflect
changesintraffic/bandwidthusageandtopology
Algorithmsdifferinwheretheygettheirinformation...
Locallyfromownmeasurementsorfromadjacentrouters
Or(globally)fromallrouters
...andwhenchangesareexecuted
EveryTsecondswhennetworkloadchanges
Orchangesintopologyoccur
Oreventdriven...
22|48
InternetWorking
adaptiveroutingcont.
Measure/functionneededtorepresentcertainvalues
Metriccanbeseenasavalueformeasuringroutingcosts
Thesecostscouldbe
Physicaldistancebetweentworouters
Numberofhopspacketstravelfromsourcetodestination
Estimatedtransittime
Monetarycosts(cheapsatellitelinkvs.expensiveseacable
forcontinentalcrossingorviceversa)
Differentroutingalgorithms(RA)usedifferentmetricsfortheir
routingdecisions
Differentmetricshavedifferentcostsofcomputingthem
23|48
InternetWorking
routingoptimalityprinciple
BeforediscussingspecificRAonecanstateingeneralthereisa
optimalroutewithoutregardingnetworktopology
Theoptimalityprinciplestates:IfrouterBisoptimalpathfrom
routerAtorouterC,thenroutefromBtoCfallstothesamepath
(measuredinhops)
24|48
InternetWorking
routingoptimalityprinciplecont.
ProvingthatnamethepartfromAtoBr1andtherestoftheroute
r2:Ifthereisabetterrouter2(e.g.thedottedline)itwouldbe
concatenatedtor1toimprovethewholeroute,contradictingthat
r1r2isoptimal
Consequence:Setofoptimalroutesfromallsourcestogiven
destinationformatreerootedatdestination
25|48
InternetWorking
routingoptimalityprinciplecont.
Exampleofasinktreewithhopcountmetric
Notnecessarilyuniquerouter12mayconnectedover3with
samehopcount
26|48
InternetWorking
ICMPfurthermessages
GoalofallRAistodiscoversuchtreesforallroutersofagiven
subnet
Sincesinktreeisatreeitdoesnotcontainanyloops,sopackets
shouldbedeliveredwithinafiniteandboundednumberofhops
Inpracticeoperationofnetworksisnotaseasy:
Linksmaygodownandrecoverafterawhile
Differentroutersmayhavedifferentideasabouttopology
Itwasnotstatedhowroutersacquireinformationfortree
computing(itself,predefined,centrally,...)
27|48
InternetWorking
routingalgorithmsflooding
Arelativespecificroutingalgorithmisflooding
Everyincomingpacketissentoutoneveryoutgoinglineexcept
theonethepacketwasreceivedfrom
Floodingobviouslygeneratesavastnumberofpackets,so
measuresshouldbetakentodamptheprocess
Installahopcounter,soifpackethopcounterreacheszero
thepacketisdiscarded
Keeptrackofwhichpacketshavebeenflooded,use
sequencenumberanddiscardduplicatepackets
Eachrouterhastokeepalistwhichpacketshavebeenseen
fromwhichsource
28|48
InternetWorking
floodingcont.
Topreventofgrowinglistsoutofbounduseacounterk,
meaningthatallpacketsuptokhavebeenseen
Whenpacketcomesinitiseasytocheckifithasalreadybe
seen
Listbelowkisnotneeded,becauseitsummarizesallpackets
uptothatnumber
Floodingisnotpracticalinmostapplications,becauseorthevery
suboptimalutilizationofbandwidthandnetworkcapacity
Butitfindsthemosteffectiverouteineverycase,becauseevery
routeischecked(andthefastestpacketarrivesfirst)
29|48
InternetWorking
routingalgorithmsflooding
Mechanismcouldbefounde.g.inunswitchedethernetswithhubs
connectingsegments
verycheapandsimpleprinciplenocomplicatedlogichasto
bebuildintocomponentshubsinethernetssimply
regenerateandamplifypassingsignals
Thatprinciplerendersunswitchedethernetsunusablewith
morethanafewendsystemsadded(generatingcertain
amountoftraffic)
Anotheradvantageno/verysimpleroutingtableshavetobe
kept
FloodingcanbeusefulinspecialIProutingscenarioswewillsee
later
30|48
InternetWorking
routingalgorithmsroutingmechanisms
Distancevector&linkstaterouting
Distributedalgorithms
Distancevector
Tellneighborsaboutdistancestoeachdestination
Eachnodescomputationdependsonitsneighbors
Linkstate
Tellallroutersdistancetoeachneighbor
Eachroutercomputesitsbestpaths
Distancevectorusesshortestpath
Singleadaptivecostofalink
31|48
InternetWorking
shortestpathrouting
Routingtechniquewidelyused,becauseitissimpleandeasyto
understand
Idea:Buildagraphofthesubnetwitheachnoderepresentinga
routerandeacharcrepresentingalink
Tochoosearoutebetweenagivenpairofnodesthealgorithm
justfindstheshortestpathonthegraph
Youhavetoexplainthemetricusedforshortestpathmeasuring:
Hopcount,physicaldistance,bandwidth,latency,
communicationcosts,meanqueuelength,...
32|48
InternetWorking
shortestpathrouting
Hopcountmetrichassamelengthforpath125and123
(nodesarefatnumbers,costssmallernumbersbetweennodes)
Geographicdistanceisfor123muchlongerthenfor125
(assumingthegraphisdrawninscale)
Forothermetricstheweightingfunctionmaybecomputed
throughhourlytestpacketssentandcomputed
Criteriaforcomputationofmetricmaycombined
33|48
InternetWorking
shortestpathroutingcont.
OnealgorithmforcomputingtheshortestpathisDijkstras
Eachnodeislabeledwithitsdistancefromsourcenodealongthe
bestknownpath
Initiallynopathsareknown(andlabeledaccordingly)
Asalgorithmproceedsandpathsarediscoveredlabelsmay
changereflectingbetterpaths
34|48
InternetWorking
shortestpathroutingcont.
Theshortestpath(sp)from1to4issearchedfor
Weareusingthegeographicdistanceforcomputingthesp
Startedfrom1markingitpermanent(bigdot),thenexaminedthe
adjacentnodesto1(node2and7)
Wheneveranodeis(re)labeledthesourcenodewecomefromis
filledin(distance,sourcenode)
35|48
InternetWorking
shortestpathroutingcont.
Whenadjacentroutesareexaminedthesmallestdistanceis
labeledpermanent(node2)
Inthenextsteptheprocessisrestartedfromnode2
Wehavetotakethesumsoftherouteuptohereintoaccount
andwegetnode5(lastpicture)
Note:Innextstepnode7hastoberelabeled{(6,1)>(5,5)}
36|48
InternetWorking
shortestpathroutingcont.
Pathwith3hopsto7haslessercoststhandirectwith1hop
Nextstepshowsthatfromnode7themetricto8ishigherthan
fromnode5over6to8
Node8hastoberelabeledthen(seenextslide)
37|48
InternetWorking
shortestpathroutingcont.
Stepshowsthatfromnode7themetricto8ishigherthanfrom
node5over6to8(node8hastoberelabeled)
Thereisamoreoptimalroutetonode8
12578(4hopswithcostof9)
12568(4hopswithcostof8)
38|48
InternetWorking
shortestpathroutingcont.
Forgettingthepathwestartfromthedestinationandgetthe
predecessorfromthelabels
Intheendwegetaroute125684
Remember:routeoptimalincostsnotinhops
Simplehopcountroutingwouldprefer1234(costof
12)or1784(samecost)2pointshigherthanroute
namedabove
39|48
InternetWorking
distancevectorrouting
Fordistancevectorroutingeachroutermaintainsatable(called
avectorforagivendestinationcomputedwithshortestpath)
deliveringthebestknowndistancetoeachdestination
Thistablesareupdatedbyregularlyexchanginginformationwith
neighbors
OthernameofthisalgorithmisdistributedBellmannFordor
FordFulkerson
Indistancevectorroutingeachroutermaintainsaroutingtable
containingthepairofeachrouterofthe(sub)netandthe
destinationtoit
Entrycontainsinformationonoutgoinglineandtheestimateof
time,distancetodestination
40|48
InternetWorking
distancevectorroutingcont.
Themetricmightbeoneofthetypeswenamedearlier
Everyroutershouldknowthedistancetoitsneighbors,withhop
count(typicallyusedwithRIPexplainednextlectureingreater
detail)itisjustonehop
Queuelengthasmetricmightbecomputedthroughsimply
checkingeachoutgoingline
FordelaytheroutermightpingeachneighborwithspecialECHO
packetsandcomputetheroundtriptime
Forsettingupofthetableseachroutersendsapacketwiththe
listofdistancestoeachrouterinthe(sub)net
Everyrouterreceivessuchpacketsandusesthemforcomputing
ofanupdatedtable
41|48
InternetWorking
distancevectorroutingcont.
Eachdestinationmightbereachableondifferentpaths,butthe
routertakestheshortestdistancefromallpacketsandremoves
theotherinformationtothesamedestination
Suchtheroutercomputesinformationonwhichlinewhichrouter
isreachable
Thismechanismworksquitewellintheory,buthassome
drawbackstoo...
42|48
InternetWorking
counttoinfinityproblem
Althoughdistantvectorconvergestothecorrectansweritmay
doingitveryslowly
Itreactsfasttopositivenewsbutleisurelytobadones
Toseehowfastgoodnewspropagatesseethenextsimple
example(fiveroutersonalinearsubnet,hopsto1shown)
43|48
InternetWorking
counttoinfinityproblem
With1downinitiallynorouterknowsapathtoit(inroutingterms:
infiniteroute)
With1comingupatthefirstexchange(forsimplicity:allrouting
informationisexchangedatexactthesamemoment)2getsthe
goodnewsthat1hasarouteof0to1
2addsthisinformationtoitstable
Inthenextroundofexchange2tells3thatitknowsaroutewith
hopcount1to1,3learnsthatandaddsthemetric2forthe
routeto1
Nextsstepsareaccordinglyprocessendsafterthe4thround
44|48
InternetWorking
counttoinfinityproblem
Nowcomputetheroutesfortheoppositescenario(router1is
goingdownforsomereason)
45|48
InternetWorking
counttoinfinityproblem
Alllineswhereinitiallyup,but1failed
Thefirstroundofpacketexchange2hearsnothingfrom1,but3
saysnoworry,Iknowarouteto1
Hence2updatesitstabletothehopcountof3forpathto1
2doesnotknowthat3srouterunsthroughitself
Withsecondexchangerouter3hastwoentriesfor1withthe
samemetricof3,thereforepicksoneatrandomandupdatesits
tabletoahopcountof4
Problem:Noonerouterhasahopcountgreaterthanthe
minimumofallneighbors,graduallytheywalkuptoinifinty
46|48
InternetWorking
counttoinfinityproblem
Whenrouter1issetunreachabledependsonthevaluefor
infinity
Thereforthevalueforinfinityshouldsettothemaximumdiameter
ofthenetworkplus1
Buteveninmoderatesizednetworkstheexchangesneededfor
settingarouterunreachablemayregardedastomuch
Ifthemetricisatimedelaythentheupperboundoftheinifinity
valueshouldbesetreasonablehigh,elsesimpleproblemswithin
thenetwork(congestionsofashortmoment,delaysinqueues,...)
couldbringroutersoutofrange
Oneofmanysuggestedsolutions(noonesolvedtheproblem)is
theSplitHorizonHack(introducednextlecture!)
47|48
InternetWorking
routing:literaturelist
RoutingTheory
Tanenbaum:ComputerNetworks,4thedition:Section5.2RoutingAlgorithms,Section
5.2.1TheOptimalityPrinciple
Flooding::
Tanenbaum:ComputerNetworks,4thedition:Section5.2.3Flooding
ShortestPathRouting
Tanenbaum:ComputerNetworks,4thedition:Section5.2.2ShorestPathRouting
DistanceVectorRouting
Tanenbaum:ComputerNetworks,4thedition:Section5.2.4DistanceVectorRouting
CounttoInfinityProblem
Tanenbaum:ComputerNetworks,4thedition:Section5.2.4DistanceVectorRouting,The
CounttoInfinityProblem
RoutingAlgorithms
Kurose&Ross:ComputerNetworking,3rdedition:Section4.5RoutingAlgorithms 48|48