Sei sulla pagina 1di 18

MIT6.

02DRAFTLectureNotes
Lastupdate:November3,2012
CHAPTER18
Network Routing - II
Routing Around Failures
This chapter describes the mechanisms used by distributed routing protocols to handle
linkandnodefailures,packetlosses(whichmaycauseadvertisementstobelost),changes
in link costs, and (as in the previous chapter) new nodes and links being added to the
network. Wewillusethetermchurntorefertoanychangesinthenetworktopology. Our
goalistondthebestpathsinthefaceofchurn.Ofparticularinterestwillbetheabilityto
routearoundfailures, ndingtheminimum-costworkingpathsbetweenanytwonodes
fromamongthesetofavailablepaths.
Westartbydiscussingwhatitmeansforaroutingprotocoltobecorrect,anddeneour
correctnessgoalinthefaceofchurn. Therststeptosolvingtheproblemistodiscover
failures. Inroutingprotocols, eachnodeisresponsiblefordiscoveringwhichofitslinks
and corresponding nodes are still working; most routing protocols use a simple HELLO
protocolforthistask.Then,tohandlefailures,eachnoderunstheadvertisementandintegra-
tionstepsperiodically. Theideaisforeachnodetorepeatedlypropagatewhatitknows
aboutthenetworktopologytoitsneighborssothatanychangesarepropagatedtoallthe
nodesinthenetwork. Theseperiodicmessagesarethekeymechanismusedbyrouting
protocolstocopewithchangesinthenetwork. Ofcourse,theroutingprotocolhastobe
robusttopacketlossesthatcausevariousmessagestobelost;forexample,onecantuse
theabsenceofasinglemessagetoassumethatalinkornodehasfailed,forpacketlosses
areusuallyfarmorecommonthanactualfailures.
We will see that the distributed computation done in the distance-vector protocol in-
teractsadverselywiththeperiodicadvertisementsandcausestheroutingprotocoltonot
producecorrectroutingtablesinthefaceofcertainkindsoffailures. Wewillpresentand
analyzeafewdifferentsolutionsthatovercometheseadverseinteractions,whichextend
ourdistance-vectorprotocol. Wealsodiscusssomecircumstancesunderwhichlink-state
protocolsdontworkcorrectly.Weconcludethischapterbycomparinglink-stateanddis-
tancevectorprotocols.
287
CHAPTER 18. NETWORK ROUTING - II
288 ROUTING AROUND FAILURES
18.1 Correctness and Convergence
Inanideal,correctlyworkingroutingprotocol,twopropertieshold:
1. For any node, if the node has a route to a given destination, then there will be a
usablepathinthenetworktopologyfromthenodetothedestinationthattraverses
thelinknamedintheroute.Wecallthispropertyroutevalidity.
2. In addition, each node will have a route to each destination for which there is a
usablepathinthenetworktopology,andanypacketforwardedalongthesequence
of these routes will reach the destination (note that a route is the outgoing link at
eachswitch;thesequenceofroutescorrespondstoapath).Wecallthispropertypath
visibilitybecauseitisastatementofhowvisibletheusablepathsaretotheswitches
inthenetwork.
Ifthesetwopropertiesholdinanetwork,thenthenetworksroutingprotocolissaidto
haveconverged.Itisimpossibletoguaranteethatthesepropertiesholdatalltimesbecause
ittakesanon-zeroamountoftimeforanychangetopropagatethroughthenetworktoall
nodes,andforallthenodestocometosomeconsensusonthestateofthenetwork.Hence,
wewillsettleforalessambitiousthoughstillchallenginggoal,eventualconvergence.
Wedeneeventualconvergenceasfollows:Givenanarbitraryinitialstateofthenetwork
andtheroutingtablesattimet = 0,supposesomesequenceoffailureandrecoveryevents
andotherchangestothetopologyoccuroversomedurationoftime,. Aftert= ,sup-
posethatnochangesoccurtothenetworktopology,alsothatnorouteadvertisementsor
HELLO messages are lost. Then, if the routing protocol ensures that route validity and path
visibilityholdinthenetworkaftersomeniteamountoftimefollowingt = ,thentheprotocolis
saidtoeventuallyconverge.
In practice, it is quite possible, and indeed likely, that there will be no time after
whichtherearenochangesorpacketlosses,buteveninthesecases,eventualconvergence
isavaluablepropertyofaroutingprotocolbecauseitshowsthattheprotocolisworking
towardensuringthattheroutingtablesareallcorrect. Thetimetakenfortheprotocolto
convergeafterasequenceofchangeshaveoccurred(orfromsomeinitialstate)iscalled
the convergence time. Thus, even though churn in real networks is possible at any time,
eventualconvergenceisstillavaluablegoal.
During the time it takes for the protocol to converge, a number of things could go
wrong:routingloopsandreducedpathvisibilityaretwosignicantproblems.
18.1.1 Routing Loops
Suppose the nodes in a network each want a route to some destination D. If the routes
theyhaveforDtakethemonapathwithasequenceofnodesthatformacycle,thenthe
networkhasaroutingloop. Thatis,ifthepathresultingfromtheroutesateachsuccessive
node forms a sequence of two or more nodes n
1
, n
2
, . . . , n
k
in which n
i
= n
j
for some
i = j,thenwehavearoutingloop. Aroutingloopviolatestheroutevaliditycorrectness
condition. If a routing loop occurs, packets sent along this path to D will be stuck in
the network forever, unless other mechanisms are put in place (while packets are being
forwarded)toushsuchpacketsfromthenetwork(seeSection18.2).
289 SECTION 18.2. ALLEVIATING ROUTING LOOPS: HOP LIMITS ON PACKETS
18.1.2 Reduced Path Visibility
Thisproblemusuallyariseswhenafailedlinkornoderecoversafterafailureandapre-
viously unreachable part of the network now becomes reachable via that link or node.
Because it takes time for the protocol to converge, it takes time for this information to
propagatethroughthenetworkandforallthenodestocorrectlycomputepathstonodes
ontheothersideofthenetwork. Duringthattime,theroutingtableshavenotyetcon-
verged, so as far as data packets are concerned, the previously unreachable part of the
networkstillremainsthatway.
18.2 Alleviating Routing Loops: Hop Limits on Packets
Ifapacketissentalongasequenceofroutersthatarepartofaroutingloop, thepacket
willremaininthenetworkuntiltheroutingloopiseliminated.Thetypicaltimescalesover
whichroutingprotocolsconvergecouldbemanysecondsorevenafewminutes,during
whichthesepacketsmayconsumesignicantamountsofnetworkbandwidthandreduce
thecapacityavailabletootherpacketsthatcanbesentsuccessfullytootherdestinations.
Tomitigatethis(hopefullytransient)problem,itiscustomaryforthepacketheaderto
includeahoplimit. Thesourcesetsthehoplimiteldinthepacketsheadertosome
valuelargerthanthenumberofhopsitbelievesisneededtogettothedestination. Each
switch,beforeforwardingthepacket,decrementsthehoplimiteldby1.Ifthiseldreaches
0,thenitdoesnotforwardthepacket,butdropsitinstead(optionally,theswitchmaysend
adiagnosticpackettowardthesourcetellingitthattheswitchdroppedthepacketbecause
thehoplimitwasexceeded).
The forwarding process needs to make sure that if a checksum covers the hop limit
eld, then the checksum needs to be adjusted to reect the decrement done to the hop-
limiteld.
1
Combiningthisinformationwiththerestoftheforwardingstepsdiscussedinthepre-
vious chapter, we can summarize the basic steps done while forwarding a packet in a
best-effortnetworkasfollows:
1. Checkthehop-limiteld. Ifitis0,discardthepacket. Optionally,sendadiagnos-
ticpackettowardthepacketssourcesayinghoplimitexceeded;inresponse,the
source may decide to stop sending packets to that destination for some period of
time.
2. Ifthehop-limitislargerthan0,thenperformaroutingtablelookupusingthedes-
tinationaddresstodeterminetherouteforthepacket. Ifnolinkisreturnedbythe
lookup or if the link is considered not working by the switch, then discard the
packet. Otherwise,ifthedestinationisthepresentnode,thendeliverthepacketto
theappropriateprotocolorapplicationrunningonthenode. Otherwise,proceedto
thenextstep.
3. Decrementthehop-limitby1.Adjustthechecksum(typicallytheheaderchecksum)
if necessary. Enqueue the packet in the queue corresponding to the outgoing link
1
IPversion4hassuchaheaderchecksum,butIPversion6dispenseswithit,becausehigher-layerprotocols
usedtoprovidereliabledeliveryhaveachecksumthatcoversportionsoftheIPheader.
CHAPTER 18. NETWORK ROUTING - II
290 ROUTING AROUND FAILURES
returnedbytheroutelookupprocedure. Whenthispacketreachestheheadofthe
queue,theswitchwillsendthepacketonthelink.
18.3 Neighbor Liveness: HELLO Protocol
As mentioned in the previous chapter, determining which of a nodes neighbors is cur-
rently alive and working is the rst step in any routing protocol. We now address this
question: howdoesanodedetermineitscurrentsetofneighbors? TheHELLOprotocol
solvesthisproblem.
The HELLO protocol is simple and is named for the kind of message it uses. Each
nodesendsaHELLOpacketalongallitslinksperiodically. ThepurposeoftheHELLOis
toletthenodesattheotherendofthelinksknowthatthesendingnodeisstillalive. As
long as the link is working, these packets will reach. As long as a node hears anothers
HELLO, it presumes that the sending node is still operating correctly. The messages are
periodic because failures could occur at any time, so we need to monitor our neighbors
continuously.
Whenshouldanoderemoveanodeattheotherendofalinkfromitslistofneighbors?
IfweknewhowoftentheHELLOmessageswerebeingsent,thenwecouldwaitforacer-
tainamountoftime,andremovethenodeifwedonthearevenoneHELLOpacketfromit
inthattime. Ofcourse,becausepacketlossescouldpreventaHELLOpacketfromreach-
ing,theabsenceofjustone(orevenasmallnumber)ofHELLOpacketsmaynotbeasign
thatthelinkornodehasfailed. Hence,itisbesttowaitforenoughtimebeforedeciding
thatanodewhoseHELLOpacketswehaventheardshouldnolongerbeaneighbor.
Forthisapproachtowork,HELLOpacketsmustbesentatsomeregularity,suchthat
the expected number of HELLO packets within the chosen timeout is more or less the
same.WecallthemeantimebetweenHELLOpackettransmissionstheHELLO INTERVAL.
Inpractice,theactualtimebetweenthesetransmissionshassmallvariance; forinstance,
onemightpickatimedrawnrandomlyfrom[HELLO INTERVAL- ,HELLO INTERVAL+
],where < HELLO INTERVAL.
WhenanodedoesnthearaHELLOpacketfromanodeattheotherendofadirectlink
for some duration, k HELLO INTERVAL, it removes that node from its list of neighbors
andconsidersthatlinkfailed(thenodecouldhavefailed,orthelinkcouldjustbeexpe-
riencedhighpacketloss,butweassumethatitisunusableuntilwestarthearingHELLO
packetsoncemore).
Thechoiceofk isatrade-offbetweenthetimeittakestodetermineafailedlinkandthe
oddsoffalselyaggingaworkinglinkasfailedbyconfusingpacketlossforafailure(of
course,persistentpacketlossesthatlastalongperiodoftimeshouldindeedbeconsidered
alinkfailure,buttheriskhereinpickingasmallk isthatifthatmanysuccessiveHELLO
packets are lost, we will consider the link to have failed). In practice, designers pick k
byevaluatingthelatencybeforedetectingafailure(kHELLO INTERVAL)withtheprob-
abilityoffalselyaggingalinkasfailed. Thisprobabilityisg
k
,whereg isthepacketloss
probability on the link, assumingand this is a big assumption in some networksthat
packetlossesareindependentandidenticallydistributed.
291 SECTION 18.4. PERIODIC ADVERTISEMENTS
18.4 Periodic Advertisements
Thekeyideathatallowsroutingprotocolstoadapttodynamicnetworkconditionsispe-
riodicroutingadvertisementsandtheintegrationstepthatfollowseachsuchadvertise-
ment. This method applies to both distance-vector and link-state protocols. Each node
sendsanadvertisementeveryADVERT INTERVALsecondstoitsneighbors. Inresponse,
in a distance-vector protocol, each receiving node runs the integration step; in the link-
stateprotocoleachreceivingnoderebroadcaststheadvertisementtoitsneighborsifithas
notdonesoalreadyforthisadvertisement. Then,everyADVERT INTERVALseconds,off-
setfromthetimeofitsownadvertisementbyADVERT INTERVAL/2seconds,eachnode
in the link-state protocol runs its integration step. That is, if a node sends its advertise-
mentsattimest
1
, t
2
, t
3
, . . ., wherethemeanvalueoft
i+1
t
i
=ADVERT INTERVAL,then
the integration step runs at times (t
1
+t
2
)/2, (t
2
+t
3
)/2, . . .. Note that one could imple-
ment a distance-vector protocol by running the integration step at such offsets, but we
dontneedtobecausetheintegrationinthatprotocoliseasytorunincrementallyassoon
asanadvertisementarrives.
It is important to note that in practice the advertisements at the different nodes are
unsynchronized. Thatis,eachnodehasitsownsequenceoftimesatwhichitwillsendits
advertisements. In a link-state protocol, this means that in general the time at which a
noderebroadcastsanadvertisementithearsfromaneighbor(whichoriginatedateither
theneighbororsomeothernode)isnotthesameasthetimeatwhichitoriginatesitsown
advertisement. Similarly,inadistance-vectorprotocol,eachnodesendsitsadvertisement
asynchronouslyrelativetoeveryothernode,andintegratesadvertisementscomingfrom
neighborsasynchronouslyaswell.
18.5 Link-State Protocol Under Failure and Churn
Wenowarguethatalink-stateprotocolwilleventuallyconverge(withhighprobability)
givenanarbitraryinitialstateatt= 0 andasequenceofchangestothetopologythatall
occurwithintime(0, ),assumingthateachworkinglinkhasahighenoughprobability
ofdeliveringapacket.Toseewhy,observethat:
1. There exists some nite time t
1
> at which each node will correctly know, with
highprobability,whichofitslinksandcorrespondingneighboringnodesareupand
whichhavefailed. Becausewehaveassumedthattherearenochangesafter and
thatallpacketsaredeliveredwithhigh-enoughprobability,theHELLOprotocolrun-
ningateachnodewillcorrectlyenabletheneighborstoinferitsliveness.Thearrival
oftherstHELLOpacketfromaneighborwillprovideevidenceforliveness,andif
thedeliveryprobabilityishighenoughthatthechancesofk successiveHELLOpack-
etstobelostbeforethecorrectlinkstatepropagatestoallthenodesinthenetwork
issmall,thensuchatimet
1
exists.
2. Thereexistssomenitetimet
2
> t
1
atwhichallthenodeshavereceived,withhigh
probability, at least one copy of every other nodes link-state advertisement. Once
anodehasitsowncorrectlinkstate,ittakesatimeproportionaltothediameterof
thenetwork(thenumberofhopsinthelongestshortest-pathinthenetwork)forthat
CHAPTER 18. NETWORK ROUTING - II
292 ROUTING AROUND FAILURES
A
Figure 18-1: Distance-vector protocol showing the count-to-innity problem (see Section 18.6 for the
explanation).
advertisementtopropagatetoalltheothernodes,assumingnopacketloss. Ifthere
arelosses,thennoticethateachnodereceivesasmanycopiesoftheadvertisement
as there are neighbors, because each neighbor sends the advertisement once along
eachofitslinks.Thisoodingmechanismprovidesabuilt-inreliabilityatthecostof
increasedbandwidthconsumption.EvenifanodedoesnotgetanothernodesLSA,
itwilleventuallygetsomeLSAfromthatnodegivenenoughtime,becausethelinks
haveahigh-enoughpacketdeliveryprobability.
3. At a time roughly ADVERT INTERVAL/2 after receiving every other nodes correct
link-state,anodewillcomputethecorrectroutingtable.
Thus,onecanseethatundergoodpacketdeliveryconditions,alink-stateprotocolcan
converge to the correct routing state as soon as each node has advertised its own link-
stateadvertisement,andeachadvertisementisreceivedatleastoncebyeveryothernode.
Thus, startingfromsomeinitialstate, becauseeachnodesendsanadvertisementwithin
timeADVERT INTERVALonaverage, theconvergencetimeisexpectedtobeatleastthis
amount.WeshouldalsoaddatimeofroughlyADVERT INTERVAL/2secondstothisquan-
titytoaccountforthedelaybeforethenodeactuallycomputestheroutingtable.Thistime
couldbehigher, iftheroutesarerecomputedlessoftenonaverage, orlower, iftheyare
recomputedmoreoften.
Ignoringwhenanoderecomputesitsroutes,wecansaythatifeachnodegetsatleast
one copy of each link-state advertisement, then the expected convergence time of the
protocolisoneadvertisementintervalplustheamountoftimeittakesforanLSAmessage
totraversethediameterofthenetwork.Becausetheadvertisementintervalismanyorders
ofmagnitudelargerthanthemessagepropagationtime,thersttermisdominant.
Link-state protocols are not free from routing loops, however, because packet losses
couldcauseproblems.Forexample,ifanodeAdiscoversthatoneofitslinkshasfailed,it
mayrecomputearoutetoadestinationviasomeotherneighboringnode,B. If Bdoesnot
receiveacopyofAsLSA,andifBwereusingthelinktoAasitsroutetothedestination,
thenaroutingloopwouldensue,atleastuntilthepointwhenB learnedaboutthefailed
link.
Ingeneral,link-stateprotocolsareagoodwaytoachievefastconvergence.
18.6 Distance-Vector Protocol Under Failure and Churn
Unlikeinthelink-stateprotocolwheretheoodingwasdistributedbuttheroutecomputa-
tionwascentralizedateachnode,thedistance-vectorprotocoldistributesthecomputation
too.Asaresult,itsconvergencepropertiesarefarmoresubtle.
293 SECTION 18.6. DISTANCE-VECTOR PROTOCOL UNDER FAILURE AND CHURN
Considerforinstanceasimplechaintopologywiththreenodes,A,B,anddestination
D (Figure18-1). Supposethattheroutingtablesareallcorrectatt = 0 andthenthatlink
betweenB andD failsatsometimet < .Afterthisevent,therearenofurtherchangesto
thetopology.
Ideally, one would like the protocol to do the following. First, Bs HELLO protocol
discoversthefailure,andinitsnextroutingadvertisement,sendsacostofINFINITY(i.e.,
unreachable)toA.Inresponse,AwouldconcludethatB nolongerhadaroutetoD,and
removeitsownroutetoD fromitsroutingtable. Theprotocolwillthenhaveconverged,
andthetimetakenforconvergencenotthatdifferentfromthelink-statecase(proportional
tothediameterofthenetworkingeneral).
Unfortunately,thingsarentsoclearcutbecauseeachnodeinthedistance-vectorpro-
tocoladvertisesinformationaboutalldestinations,notjustthosedirectlyconnectedtoit.
WhatcouldeasilyhavehappenedwasthatbeforeB sentitsadvertismenttellingA that
the cost to D had become INFINITY, As advertisement could have reached B telling B
thatthecosttoD is2. Inresponse,B integratesthisrouteintoitsroutingtablebecause2
issmallerthanBsowncost,whichisINFINITY.YoucannowseetheproblemB hasa
wrongroutebecauseitthinksA hasawayofreachingD withcost2,butitdoesntreally
knowthatAsrouteisbasedonwhatB hadpreviouslytoldhim! So,nowA thinksithas
aroutewithcost2ofreachingD andB thinksithasaroutewithcost2 + 1 = 3. Thenext
advertisement from B will cause A to increase its own cost to 3 + 1 = 4. Subsequently,
aftergettingAsadvertisement,B willincreaseitscostto5,andsoon. Infact,thismess
willcontinue, withbothnodesbelievingthatthereissomewaytogettothedestination
D,eventhoughthereisnopathinthenetwork(i.e.,theroutevaliditypropertydoesnot
holdhere).
Thereisacolorfulnameforthisbehavior: countingtoinnity. Theonlywayinwhich
each node will realize that D is unreachable is for the cost to reach INFINITY. Thus, for
thisdistance-vectorprotocoltoconvergeinreasonabletime,thevalueofINFINITYmust
bequitesmall!And,ofcourse,INFINITYmustbeatleastaslargeasthecostofthelongest
usablepathinthenetwork,forotherwisethatroutescorrespondingtothatpathwillnot
befoundatall.
Wehaveaproblem.Thedistance-vectorprotocolwasattractivebecauseitconsumedfar
lessbandwidththanthelink-stateprotocol,andsowethoughtitwouldbemoreappopri-
ateforlargenetworks,butnowwendthatINFINITY(andhencethesizeofnetworksfor
whichtheprotocolisagoodmatch)mustbequitesmall!Isthereawayoutofthismess?
First,letsconsideraawedsolution.InsteadofB waitingforitsnormaladvertisment
time(everyADVERT INTERVALsecondsonaverage),whatifB sentnewsofanyunreach-
abledestination(s)assoonasitsintegrationstepconcludesthatalinkhasfailedandsome
destination(s)hascostINFINITY?Ifeachnodepropagatedthisbadnewsfastinitsad-
vertisement,thenperhapstheproblemwilldisappear.
Unfortunately,thisapproachdoesnotworkbecauseadvertisementpacketscouldeasily
belost. Inoursimpleexample,evenifB sentanadvertisementimmediatelyafterdiscov-
eringthefailureofitslinktoD,thatmessagecouldeasilygetdroppedandnotreachA.
Inthiscase,werebacktosquareone,withB gettingAsadvertisementwithcost2,and
soon. Clearly,weneedamorerobustsolution. Weconsidertwo,inturn,eachwithfancy
names: split horizon routing and path vector routing. Both generalize the distance-vector


CHAPTER 18. NETWORK ROUTING - II
294 ROUTING AROUND FAILURES
A

Figure18-2: Splithorizon(withorwithoutpoisonreverse)doesntpreventroutingloopsofthreeormore
hops.ThedashedarrowsshowtheroutingadvertisementsfordestinationD.IflinkBDfails,asexplained
inthetext,itispossibleforacount-to-innityroutingloopinvolvingA,B,andCtoensue.
protocolinelegantways.
18.7 Distance Vector with Split Horizon Routing
Theideainthesplithorizonextensiontodistance-vectorroutingissimple:
IfanodeAlearnsaboutthebestroutetoadestinationDfromneighborB,thenAwill
notadvertiseitsrouteforDbacktoB.
Infact,onecanfurtherensurethatBwillnotusetherouteadvertisedbyAbyhaving
AadvertisearoutetoDwithacostofINFINITY.Thismodicationiscalledapoisonreverse,
becausethenode(A)ispoisoningitsrouteforDinitsadvertisementtoB.
Itiseasytoseethatthetwo-noderoutingloopthatshowedupearlierdisappearswith
thesplithorizontechnique.
Unfortunately,thismethoddoesnotsolvetheproblemmoregenerally; loopsofthree
or more hops can persist. To see why, look at the topology in Figure 18-2. Here, B is
connectedtodestinationD, andtwoothernodesAandC areconnectedtoB aswellas
toeachother. Eachnodehasthefollowingcorrectroutingstateatt= 0: AthinksDisat
cost2(andviaB),B thinksD isatcost1viathedirectlink,andC thinksD isatcostS
(andviaB). Eachnodeusesthedistance-vectorprotocolwiththesplithorizontechnique
(itdoesntmatterwhethertheyusepoisonreverseornot),soAandC advertisetoBthat
theirroutetoDhascostINFINITY.Ofcourse,theyalsoadvertisetoeachotherthatthere
is a route to D with cost 2; this advertisement is useful if link AB (or BC) were to fail,
becauseAcouldthenusetherouteviaCtogettoD(orCcouldusetherouteviaA).
Now, supposethelinkBDfailsatsometimet < . Ideally, ifB discoversthefailure
andsendsacostofINFINITYtoAandC initsnextupdate, allthenodeswillhavethe
correct cost to D, and there is no routing loop. Because of the split horizon scheme, B
does nothave to send itsadvertisement immediately upon detecting the failed link, but
thesooneritdoes,thebetter,forthatwillenableAandCtoconvergesooner.



295 SECTION 18.8. PATH-VECTOR ROUTING
A
B
C
D
E
l1
l2
l1
l2
l1
l2
l1
l2
l1 l3
l2
l3
E: 'Self'
.To reach E, come this way"
path = [E]
.To reach E, come this way"
path = [E]
[CE]
E: l2; cost=2; path=[DE]
E: l1; cost=2; path=[CE]
E: l2; cost=1; path=[E]
E: l1; cost=1; path=[E]
[DE]
[CE]
[CE]
[DE]
[ACE]
[BDE]
[ACE]
[BDE]
[DE]
Figure18-3:Pathvectorprotocolexample.
However,supposeBsroutingadvertisementwiththeupdatedcosttoD (ofINFINITY)
reachesA,butislostanddoesntshowupatC.Anowknowsthatthereisnorouteofnite
costtoD,butC doesnt. Now,initsnextadvertisement,C willadvertisearoutetoDof
cost2toA(andacostofINFINITYtoB becauseofpoisonreverse). Inresponse,Awill
assumethatC hasfoundabetterroutethanwhatA has(whichisanullroutewithcost
INFINITY),andintegratethatintoitstable. Initsnextadvertisement,Awilladvertiseto
Bthatithasarouteofcost3todestinationD,andBwillincorporatethatrouteatcost4!
ItiseasytoseenowthatwhenB advertisesthisroutetoC,itwillcauseC toincreaseits
costto5,andsoon.Thecount-to-innityproblemhasshownupagain!
Pathvectorroutingisagoodsolutiontothisproblem.
18.8 Path-Vector Routing
Theinsightbehindthepathvectorprotocolisthatanodeneedstoknowwhenitissafe
andcorrecttointegrateanygivenadvertisementintoitsroutingtable. Thesplithorizon
technique was an attempt that worked in only a limited way because it didnt prevent
loopslongerthantwohops.Thepathvectortechniqueextendsthedistancevectoradver-
tisementtoincludenotonlythecost,butalsothenodesalongthebestpathfromthenodetothe
destination.Itlookslikethis:
[dest1cost1path1dest2cost2path2dest3cost3path3...]
Here,eachpathistheconcatenationoftheidentiersofthenodealongthepath,with
thedestinationshowingupattheend(theoppositeconventionisequivalent, aslongas
allnodestreatthepathconsistently).Figure18-3showsanexample.
Theintegrationstepatnodenshouldnowbeextendedtoonlyconsideranadvertise-
mentaslongasndoesnotalreadyappearontheadvertisedpath. Withthatstep,therest
oftheintegrationstepofthedistancevectorprotocolcanbeusedunchanged.
Given an initial state at t= 0 and a set of changes in (0, ), and assuming that each
link has a high-enough packet delivery probability, this path vector protocol eventually
converges(withhighprobability)tothecorrectstatewithoutcountingtoinnity. The
CHAPTER 18. NETWORK ROUTING - II
296 ROUTING AROUND FAILURES
timeittakestoconvergewheneachnodeisinterestedinndingtheminimum-costpath
isproportionaltothelengthofthelongestminimum-costpathmultipliedbytheadver-
tisementinterval. Thereasonisasfollows. Initially,eachnodeknowsnothingaboutthe
network.Afteroneadvertisementinterval,itlearnsaboutitsneighborsroutingtables,but
at this stage those tables have nothing other than the nodes themselves. Then, after the
next advertisement, each node learns about all nodes two hops away and how to reach
them.Eventually,afterkadvertisements,eachnodelearnsabouthowtoreachallnodesk
hopsaway,assumingofcoursethatnopacketlossesoccur.Hence,ittakesdadvertisement
intervalsbeforeanodediscoversroutestoalltheothernodes,wheredisthelengthofthe
longestminimum-costpathfromthenode.
Comparedtothedistancevectorprotocol,thepathvectorprotocolconsumesmorenet-
workbandwidthbecausenoweachnodeneedstosendnotjustthecosttothedestination,
butalsotheaddresses(oridentiers)ofthenodesalongthebestpath. Inmostlargereal-
worldnetworks,thenumberoflinksislargecomparedtothenumberofnodes,andthe
lengthoftheminimum-costpathsgrowsslowlywiththenumberofnodes(typicallylog-
arithmically).Thus,forlargenetwork,apathvectorprotocolisareasonablechoice.
Wearenowinapositiontocomparethelink-stateprotocolwiththetwovectorproto-
cols(distance-vectorandpath-vector).
18.9 Summary: Comparing Link-State and Vector Protocols
Thereisnothingeithergoodorbad,butthinkingmakesitso.
Hamlet,ActII(sceneii)
Bandwidth consumption. The total number of bytes sent in each link-state advertise-
mentisquadraticinthenumberoflinks,whileitislinearinthenumberoflinksforthe
distance-vectorprotocol.
The advertisement step in the simple distance-vector protocol consumes less band-
widththaninthesimplelink-stateprotocol. Supposethattherearennodesandmlinks
inthenetwork,andthateach[nodepathcost]or[neighborlinkcost]tupleinanadvertise-
menttakesupkbytes(kmightbe6inpractice).Eachadvertisementalsocontainsasource
address,which(forsimplicity)wewillignore.
Then, for distance-vector, each nodes advertisement has size kn. Each such adver-
tisementshowsuponeverylinktwice,becauseeachnodeadvertisesitsbestpathcostto
every destination on each of its link. Hence, the total bandwidth consumed is roughly
2knm/ADVERT INTERVALbytes/second.
The calculation for link-state is a bit more involved. The easy part is to observe that
theres a origin address and sequence number of each LSA to improve the efciency
of the ooding process, which isnt needed in distance-vector. If the sequence number
is g bytes in size, then because each node broadcasts every other nodes LSA once, the
numberofbytessentisgn. However,thisisasecond-ordereffect;mostofthebandwidth
isconsumedbytherestoftheLSA.TherestoftheLSAconsistsofkbytesofinformationper
neighbor.Acrosstheentirenetwork,thisquantityaccountsfork(2m)bytesofinformation,
becausethesumofthenumberofneighborsofeachnodeinthenetworkis2m.Moreover,
eachLSAisre-broadcastoncebyeachnode,whichmeansthateachLSAshowsuptwice
297 SECTION 18.9. SUMMARY: COMPARING LINK-STATE AND VECTOR PROTOCOLS
oneverylink. Therefore, thetotalnumberofbytesconsumedinoodingtheLSAsover
thenetworktoallthenodesisk(2m)(2m) = 4km
2
.Puttingittogetherwiththebandwidth
consumed by the sequence number eld, we nd that the total bandwidth consumed is
(4km
2
+2gmn)/ADVERT INTERVALbytes/second.
Itiseasytoseethatthereisnoconnectednetworkinwhichthebandwidthconsumed
by the simple link-state protocol is lower than the simple distance-vector protocol; the
important point is that the former is quadratic in the number of links, while the latter
dependsontheproductofthenumberofnodesandnumberoflinks.
Convergencetime. Theconvergencetimeofourdistancevectorandpathvectorproto-
colscanbeaslargeasthelengthofthelongestminimum-costpathinthenetworkmul-
tipliedbytheadvertisementinterval. Theconvergencetimeofourlink-stateprotocolis
roughlyoneadvertisementinterval.
Robustnesstomisconguration. Inavectorprotocol,eachnodeadvertisescostsand/or
pathstoalldestinations.Assuch,anerrorormiscongurationcancauseanodetowrongly
advertiseagoodroutetoadestinationthatthenodedoesnotactuallyhaveagoodroute
for.Intheworstcase,itcancauseallthetrafcbeingsenttothatdestinationtobehijacked
andpossiblyblackholed(i.e.,notreachtheintendeddestination).Thiskindofproblem
has been observed on the Internet from time to time. In contrast, the link-state protocol
onlyadvertiseseachnodesimmediatelinks. Ofcourse,eachnodealsore-broadcaststhe
advertisements,butitisharderforanygivenerroneousnodetowreakthesamekindof
havocthatasmallerrorormiscongurationinavectorprotocolcan.
Inpractice, link-stateprotocolsareusedinsmallernetworkstypicallywithinasingle
company (enterprise) network. The routing between different autonomously operating
networksintheInternetusesapathvectorprotocol. Variantsofdistancevectorprotocols
that guarantee loop-freedom are used in some small networks, including some wireless
meshnetworksbuiltoutofshort-range(WiFi)radios.
Acknowledgments
ThankstoSariCanelakeandAnirudhSivaramanforseveralusefulcommentsandtoKerry
Xingforspottingeditingerrors.
CHAPTER 18. NETWORK ROUTING - II
298 ROUTING AROUND FAILURES
Problems and Questions
1. Whydoesthelink-stateadvertisementincludeasequencenumber?
2. What is the purpose of the hop limit eld in packet headers? Is that eld used in
routingorinforwarding?
3. Describeclearlywhytheconvergencetimeofourdistancevectorprotocolcanbeas
largeasthelengthofthelongestminimum-costpathinthenetwork.
4. Supposealinkconnectingtwonodesinanetworkdropspacketsindependentlywith
probability10%. Ifwewanttodetectalinkfailurewithaprobabilityoffalselyre-
portingafailureof0.1%,andtheHELLOmessagesaresentonceevery10seconds,
thenhowmuchtimedoesittaketodeterminethatalinkhasfailed?
5. Youve set up a 6-node connected network topology in your home, with nodes
named A, B, . . . , F. Inspecting As routing table, you nd that some entries have
been mysteriously erased (shown with ? below), but you nd the following en-
tries:
Destination Cost Next-hop
B 3 C
C 2 ?
D 4 E
E 2 ?
F 1 ?
Each link has a cost of either 1 or 2 and link costs are symmetric (the cost from X
toY isthesameasthecostfromY toX). Theroutingtableentriescorrespondto
minimum-costroutes.
(a) Drawanetworktopologywiththesmallestnumberoflinksthatisconsistentwith
theroutingtableentriesshownaboveandthecostinformationprovided.Label
eachnodeandshoweachlinkcostclearly.
(b) Youknowthattherecouldbeotherlinksinthetopology. Tondout,younow
goandinspectDsroutingtable,butitismysteriouslyempty.Whatisthesmall-
est possible value for the cost of the path from D to F in your home network
topology? (Assume that any two nodes may possibly be directly connected to
answerthisquestion.)
6. AnetworkwithN nodesandN bi-directionallinksisconnectedinaringasshown
in Figure 18-4, where N is an even number. The network runs a distance-vector
protocol in which the advertisement step at each node runs when the local time is
T
T isecondsandtheintegrationsteprunswhenthelocaltimeisT i + seconds,
2
(i= 1, 2, . . .). Eachadvertisementtakestimetoreachaneighbor. Eachnodehasa
separateclockandtimeisnotsynchronizedbetweenthedifferentnodes.
Supposethatatsometimetaftertheroutinghasconverged,nodeN+ 1 isinserted
intothering,asshowninthegureabove. Assumethattherearenootherchanges
299 SECTION 18.9. SUMMARY: COMPARING LINK-STATE AND VECTOR PROTOCOLS
1
2
3
4
N
N-1
N-2
N-3
N+1
X
Removed
Link
Added
Node
Figure18-4:TheringnetworkwithN nodes(N iseven).
in the network topology and no packet losses. Also assume that nodes 1 and N
update their routing tables at time t to include node N + 1, and then rely on their
nextscheduledadvertisementstopropagatethisnewinformation.
(a) Whatistheminimumtimebeforeeverynodeinthenetworkhasaroutetonode
N+1?
(b) What is the maximum time before every node in the network has a route to
nodeN+1?
7. AlyssaP.HackermanagesMITsinternalnetworkthatrunslink-staterouting. She
wants to experiment with a few possible routing strategies. Listed below are the
namesoffourstrategiesandabriefdescriptionofwhateachonedoes.
(a) MinCost:Everynodepicksthepaththathasthesmallestsumoflinkcostsalong
thepath.(Thisistheminimumcostroutingyouimplementedinthelab).
(b) MinHop:Everynodepicksthepathwiththesmallestnumberofhops(irrespec-
tiveofwhatthecostonthelinksis).
(c) SecondMinCost: Everynodepicksthepathwiththesecondlowestsumoflink
costs.Thatis,everynodepicksthesecondbestpathwithrespecttopathcosts.
(d) MinCostSquared: Every node picks the path that has the smallest sum of
squaresoflinkcostsalongthepath.
Assumethatsufcientinformationisexchangedinthelinkstateadvertisements,so
thateverynodehascompleteinformationabouttheentirenetworkandcancorrectly
implementthestrategiesabove. Youcanalsoassumethatalinkspropertiesdont
change,e.g.,itdoesntfail.
(a) HelpAlyssagureoutwhichofthesestrategieswillworkcorrectly,andwhich
will result in routing with loops. In case of strategies that do result in rout-
ingloops,comeupwithanexamplenetworktopologywitharoutingloopto
convinceAlyssa.
CHAPTER 18. NETWORK ROUTING - II
300 ROUTING AROUND FAILURES
(b) How would you implement MinCostSquared in a distance-vector protocol?
Specifywhattheadvertisementsshouldcontainandwhattheintegrationstep
mustdo.
8. AlyssaP.Hackerimplementsthe6.02distance-vectorprotocolonthenetworkshown
below. Eachnodehasitsownlocalclock,whichmaynotbesynchronizedwithany
other nodes clock. Each node sends its distance-vector advertisement every 100
seconds. Whenanodereceivesanadvertisement,itimmediatelyintegratesit. The
timetosendamessageonalinkandtointegrateadvertisementsisnegligible. No
advertisementsarelost.ThereisnoHELLOprotocolinthisnetwork.
A
2
B C
D S
2 6
2 7
1
(a) At time 0, all the nodes except D are up and running. At time 10 seconds,
nodeD turnsonandimmediatelysendsarouteadvertisementforitselftoall
itsneighbors. Whatistheminimumtimeatwhicheachoftheothernodesisguar-
anteedtohaveacorrectroutingtableentrycorrespondingtoaminimum-cost
pathtoreachD?Justifyyouranswers.
(b) IfeverynodesendspacketstodestinationD,andtonootherdestination,which
linkwouldcarrythemosttrafc?
Alyssaisunhappythatoneofthelinksinthenetworkcarriesalargeamount
oftrafcwhenallthenodesaresendingpacketstoD.Shedecidestoovercome
thislimitationwithAlyssasVectorProtocol(AVP).InAVP,S lies, advertising
a path cost for destination D that is different from the sum of the link costs
along the path used to reach D. All the other nodes implement the standard
distance-vectorprotocol,notAVP.
(c) Whatisthe smallestnumericalvalueofthe costthatS shouldadvertiseforD
alongeachofitslinks,toguaranteethatonlyitsowntrafcforDusesitsdirect
linktoD? Assumethatalladvertisedcostsareintegers; iftwopathcostsare
equal,onecantbesurewhichpathwillbetaken.
9. Help Ben Bitdiddle answer these questions about the distance-vector protocol he
runsonthenetworkshowninFigure18-5. Thelinkcostsareshownneareachlink.
Benisinterestedinminimum-costroutestodestinationnodeD.
Each node sends a distance-vector advertisement to all its neighbors at times
0, T, 2T, . . .. Each node integrates advertisements at times T/2, 3T/2, 5T/2, . . .. You
mayassumethatallclocksaresynchronized.Thetimetotransmitanadvertisement
overalinkisnegligible.Therearenofailuresorpacketlosses.
Ateachnode,aroutefordestinationDisvalidifpacketsusingthatroutewilleven-
tuallyreachD.



301 SECTION 18.9. SUMMARY: COMPARING LINK-STATE AND VECTOR PROTOCOLS
A
G
2
1

7
1
7 7
2

Figure18-5:Timetoconverge=?
At each node, a route for destination D is correct if packets using that route will
eventuallyreachDalongsomeminimum-costpath.
(a) AtwhattimewillallnodeshaveintegratedavalidroutetoDintotheirrouting
tables? WhatnodeisthelastonetointegrateavalidroutetoD?Answerboth
questions.
(b) Atwhattimewillallnodeshaveintegratedacorrect(minimum-cost)routeto
Dintotheirroutingtables?Whatnodeisthelastonetointegrateacorrectroute
toD?Answerbothquestions.
10.GoAhead,MakeMyRoute: JackRipperusesaminimum-costdistance-vectorrouting
protocolinthenetworkshowninFigure18-6.Eachlinkcost(notshown)isapositive
integerandisthesameineachdirectionofthelink. Jacksetsinnityto32inthe
protocol.Afterallrouteshaveconverged(breakingtiesarbitrarily),Fsroutingtable
isasfollows:
A
B
C
D
E F
Figure18-6:DistancevectortopologyinJackRippersnetwork.
Usingtheinformationprovided,answerthesequestions:
(a) Fillinthetwomissingblanksinthetableabove.
CHAPTER 18. NETWORK ROUTING - II
302 ROUTING AROUND FAILURES
Destination Cost Route
A 6 link(FC)
B 4 link(FC)
C
D
3
5 link(FD)
E 1
(b) Foreachlinkinthepicture,writethelinkscostintheboxnearthelink. Each
cost is either a positive integer or an expression of the form < c, c, c, or
> c,forsomeintegerc.
(c) Suppose link (FE) fails, but there are no other changes. When the protocol
converges,whatwillFsroute(notpath)toEbe? (Ifthereisnoroute,sayno
route.)
(d) Nowsupposelinks(BC)and(BF)alsofailsoonafterlink(FE)fails. There
are no packet losses. In the worst case, C and F enter a count-to-innity
phase. Howmanydistinctrouteadvertisements(withdifferentcosts)mustC
hearfromF,beforeC determinesthatitdoesnothaveanyvalidroutetonode
A?
11. AlyssaP.Hackerrunsthelink-stateroutingprotocolinthenetworkshownbelow.
Each node runs Dijkstras algorithm to compute minimum-cost routes to all other
destinations,breakingtiesarbitrarily.
B
C
A
D E
5
1
1
2
6
6
7
6
Figure18-7:NetworkinAlyssaslink-stateprotocol.
ThelinksinAlyssasnetworkareunreliable;oneachlink,anypacketsentoverthe
linkisdeliveredwithsomeprobability,p,totheotherendofthelink,independent
ofallotherevents(0< p < 1).Supposelinks(CE)and(BD)fail.
Answerthefollowingquestions.
303 SECTION 18.9. SUMMARY: COMPARING LINK-STATE AND VECTOR PROTOCOLS
(a) HowdoCandEdiscoverthatthelinkhasfailed?Howdoesthemethodwork?
(b) Overthisunreliablenetwork,linkstateadvertisements(LSAs)arelostaccord-
ingtotheprobabilitiesmentionedabove.Owingtoabuginitssoftware,Edoes
notoriginateanyLSAofitsownoroodthem,butallothernodes(exceptE)
workcorrectly. CalculatetheprobabilitythatAlearnsthatlink(CE)hasfailed
fromtherstLSAthatoriginatesfromC afterC discoversthatlink(CE)has
failed.Notethatlink(BD)hasalsofailed.
(c) Supposeonlylink(CE)hadfailed,butnot(BD),whichliketheothersurviv-
inglinkscandeliverypacketssuccessfullywithprobabilityp. Now,wouldthe
answertopart(b)aboveincrease, decrease, or remainthesame? Why? (No
mathnecessary.)
MIT OpenCourseWare
http://ocw.mit.edu
6.02 Introduction to EECS II: Digital Communication Systems
Fall 2012
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Potrebbero piacerti anche