Distance Vector Routing - Moodle 2017-2018 · PDF fileDistance Vector Routing ... (e.g....

62
1 Distance Vector Routing Jean‐Yves Le Boudec 2014 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

Transcript of Distance Vector Routing - Moodle 2017-2018 · PDF fileDistance Vector Routing ... (e.g....

1

Distance Vector Routing

Jean‐YvesLeBoudec2014

ÉCOLE POLYTECHNIQUEFÉDÉRALE DE LAUSANNE

2

Contents1. RoutinginGeneral2. Distancevector:theory3. Distancevector:practice(RIP)

TextbookSection5.1.1,Thecontrolplane

1. IntroductionWhy were routing protocols invented

IPassumesroutingtablesaremaintainedathostsandroutersusedbyPacketForwardingRouting=controlmethod

maintainroutingtablesautomaticallyinrouters

PacketForwardingforeverypacketdone inrealtime

Routingcomputationofroutingtablesordatastructuresforunicastandmulticastnormallyonlybetweenroutersnon‐realtime:latencyupto2minutesusesdedicatedprotocols(RIP,OSPF,EIGRP(Cisco)forunicastandDVMRP,M‐OSPF,PIM)Routingtablesinhostsarenormallyderivedfromconfigurationinfo

3

4

What  a routing protocol does

findreachabledestinationsfindbestpathstowardsdestinations

best=distancetodestinationisminimalDistance=computedusingsomemetricStatic metric ‐ does notdepend onthenetworkstate;forexample:

number ofhopslinkcapacityandstaticdelayAdministrativecost

Dynamic metric‐ depend onthenetworkstatelinkloadcurrentdelayseeendofsection

How routing protocols workTherearemanydifferentways,whichcanbeclassifiedasDistanceVector:

Everyrouterknowsonly:itsneighbours +distancestoalldestination(usedinsidedomains– interiorrouting)– thismoduleandlab4

LinkState:Everyrouterhasadetailedmapofentirenetwork(usedinsidedomains– interiorrouting)– module“linkstate”

PathvectorEveryrouterknowsonly:itsneighbours +pathstoalldestination(usedbetweendomains– exteriorrouting)‐‐ moduleBGPandlab6

SourceroutingAsanalternativetorouting protocols it is also possibletoconfigurerouting tablesusing manual configuration(see lab1)oroutofbandmanagementsoftware(e.g.OpenFlow)

5

Source Routing

sourcewritesrouteintopacketheader(IPheaderextension)routerreadsnexthopfrompacketheader,movespointerroutediscoveredbythesource,floodingwithIP,thisiscalled“strictsourcerouting”:notusedintheInternetbutusedinsomead‐hocnetworks

6

A B 2.2.4IS

BISIS

IS

A

SA DA RI data

12

3

1 2

1 3

1

3

43

224

A B 2.2.4A B 2.2.4

7

2. Distance Vector: Theory

What itdoes:itcomputesshortestpathstoalldestinations

Costofapath=sumofthecostofnetworklinksalongthepathCostofalinkissetupbyconfigurationShortestpath=pathwhosecostisminimalDistancefromnodeAtonodeB=costofashortestpathfromAtoB

How itworksusesthe“DistributedBellman‐Ford”algorithmFullydistributedUsingasonlyinformationthedistancesfromselftoalldestinations

8

2.1 The Centralized Bellman‐Ford Algorithm

Algorithm BF‐Cinput: a directed graph with links costs  ( , ); assume  ( ,  )>0 and  when nodes i and j are not connected.output: vector  s.t. ( )= cost of best path from node  to node 1

for 

for dofor 

untilreturn( )

Example: shortest paths to node 1: run BF‐C for 

9

1 0∞

1BC

DE

1

51

1

6

2 2

k=0

0∞∞

∞ ∞

1BC

DE

1

51

1

6

2 2

k=1

01∞

∞ 5

1BC

DE

1

51

1

6

2 2

k=2

1BC

DE

1

51

1

6

2 2

k=3

1BC

DE

1

51

1

6

2 2

k=4

1BC

DE

1

51

1

6

2 2

k=5

1BF‐C

Message Passing Interpretation of Bellman‐Ford

WithBF‐Citisasif:atiteration ,node receivesfromneighbors theirpreviouscosts andupdatesowncostbypickingthebestBF‐Ccanbeinterpretedasasynchronousmessagepassingalgorithm

synchronous=nodeswaituntiliteration 1 isfinishedbeforestartingiteration

10

1BC

DE

1

51

1

6

2 2

k=1

01∞

∞ 5

1BC

DE

1

51

1

6

2 2

k=2

0

∞1

3   5

Example: shortest paths to node 1: run BF‐C, 

11

1 0∞

1BC

DE

1

51

1

6

2 2

k=0

0∞∞

∞ ∞

1BC

DE

1

51

1

6

2 2

k=1

01∞

∞ 5

1BC

DE

1

51

1

6

2 2

k=2

017  

3 3

1BC

DE

1

51

1

6

2 2

k=3

1BC

DE

1

51

1

6

2 2

k=4

1BC

DE

1

51

1

6

2 2

k=5

1BF‐C

At which  does the algorithm stop ?(i.e. what is the smallest  such that  ?)

1. k=12. k=23. k=34. k=45. k=56. k 67. Idon’t

know

12

k = 1

k = 2

k = 3

k = 4

k = 5 

I don’t know

0% 0%

6%2%

8%

60%

24%

Solution: algorithm stops at

13

0 0∞

1BC

DE

1

51

1

6

2 2

k=0

0∞∞

∞ ∞

1BC

DE

1

51

1

6

2 2

k=1

01∞

∞ 5

1BC

DE

1

51

1

6

2 2

k=2

017

3 3

1BC

DE

1

51

1

6

2 2

k=3

014

3 3

1BC

DE

1

51

1

6

2 2

k=4

014

3 3

1BC

DE

1

51

1

6

2 2

p(A)=0p(B)=1p(C)=4

p(E)=3 p(E)=3

Correctness of BF‐C

Theorem11. Ifthenetworkisfullyconnected,BF‐Cstopsatthelatestat

(where numberofnodes)andoutputsthedistancealongshortestpathfrom to1,forall

isthedistancefrom to1inatmost hops3. Thenexthopalongashortestpathfrom to1isfoundbynextHop(i) Argminji

14

15

Computation of shortest path tree

Whenalgorithmhasconverged,thenexthopofnodeCisobtainedbylookingfor thatminimizes

1BC

DE

1

51

1

6

2 2

k=4

014

3 3

2.2 Assume we start fromother initial conditions. What will happen ?

1. Thealgorithm convergestothecorrectdistances

2. Thealgorithm does notconverge3. Thealgorithm convergesbutnotto

thecorrectdistances4. Idon’t know

16

1BC

DE

1

51

1

6

2 2

k=0

0101

1 1

replaced by values on graph →

The algorithm

 converges to

The algorithm

 does n

ot co

.The algorithm

 converges b

I don’t know

19%

2%

64%

15%

Run BF‐C with bizarre initial conditions

the value of  is…

1. 12. 23. 34. 45. 5

7. Idon’tknow

17

0 010

1BC

DE

1

51

1

6

2 2

k=0

0101

1 1

1BC

DE

1

51

1

6

2 2

k=1

?

1 2 3 4 5

I don’t know

38%

30%

4%2%

21%

0%

4%

Solution:Run BF‐C with bizarre initial 

conditions

18

Onthisexample,algorithmBF‐Cconvergesto

thecorrectvaluesinspiteofabnormalinitialconditions

0 010

1BC

DE

1

51

1

6

2 2

k=0

0101

1 1

1BC

DE

1

51

1

6

2 2

k=1

012

2 2

1BC

DE

1

51

1

6

2 2

k=2

013

3 3

1BC

DE

1

51

1

6

2 2

k=3

014

3 3

1BC

DE

1

51

1

6

2 2

k=4

014

3 3

1BF‐C

Assume we break some links and start from these initial 

conditions. What will happen ?

1. Thealgorithm convergestothecorrectdistances

2. Thealgorithm does notconverge3. Thealgorithm convergesbutnotto

thecorrectdistances4. Idon’t know

19

replaced by values on graph →

1BC

DE

1

51

1

6

2 2

014

3 3

∞∞∞

The a

lgorit

hm co

nverge

s to..

The a

lgorit

hm doe

s not co

...

The a

lgorit

hm co

nverge

s b.

I don

’t kn

ow

35%

2%

27%

35%

Run BF‐C with disconnected network

the value of  is…

1. 12. 23. 34. 45. 5

7. Idon’tknow

20

0 010

1BC

DE

1

51 2

k=0

014

3 3

1BC

DE

1

51 2

k=1

?

1 2 3 4 5

I don’t know

8%

4%2%

12%

45%

10%

20%

Solution:BF‐C with disconnected 

network

21

Onthisexample,algorithmBF‐Cconvergesto

thecorrectvaluesat BandDandcountsto∞ atCandE

1BC

DE

1

51 2

k=0

014

3 3

1BC

DE

1

51 2

k=1

014

5 3

1BC

DE

1

51 2

k=2

016

5 3

1BC

DE

1

51 2

k=3

016

7 3

1BC

DE

1

51 2

k=4

018

7 3

BF‐C

Correctness of BF‐C

with arbitrary initial 

condition and arbitrary network

Theorem21. Ifthereisapathfrom to1,thenfor largeenough

∀ where isthedistancefrom to1.Itfollowsthatifthenetworkisfullyconnected,BF‐Cwitharbitraryinitialconditionsterminatesandeventuallycomputesthecorrectdistances.However,ingeneral,when issmall isnot thedistancefrom to1in hops.

2. Ifthereisnopathfrom to1then lim→

∞.Itfollowsthatifthenetworkisnotfullyconnected,BF‐Cdoesnotterminate(“counttoinfinity”).

22

any nonnegative value

23

ProofWe dotheproofassuming allnodes areconnected.1. Letpk bethevectorpk[i],i=2,….LetBbethemappingthattransformsanarrayx[i]i=2…into

thearrayBx definedfori 1 byBx[i]=minj i,j 1[A(i,j)+x(j)]

Letbbethearraydefinedfori 1 byb[i]=A(i,1)

Thealgorithmcanberewritteninvectorformas(1)pk =Bpk‐1 bwhere isthepointwise minimum

2. Eq (1)isamin‐pluslinearequationandtheoperatorBsatisfiesB(xy)=Bx By.Thus,Eq(1) canbesolvedusingmin‐plusalgebrainto(2)pk =Bkp0 Bk‐1b… Bb b

3. Definethearrayefori 1bye[i]=.Letp0=e.Eq (2)becomes(3)pk =Bk‐1b… Bb b.NowwehavetheBellmanFordalgorithmwithclassicalinitialconditions,thus,byTheorem1:(4)fork n‐1:Bk‐1b… Bb b=qwhereq[i]isthedistancefromi to1.

4. WecanrewriteEq(2)fork n‐1as(5)pk =Bkp0 q

5. Bkp0[i]canbewrittenasA[i,i1]+A[i1,i2]+…+A[ik‐1,ik]+p[ik]thus(6)Bkp0[i] ka,whereaistheminimumofallA[i,j].ThusBkp0[i]tendstowhenkgrows.Thusforklargeenough,Bkp0islargerthanqandcanbeignoredinEq(5).Inotherwords,forklargeenough:(6)pk =q

24

2.3 Distributed Bellman Ford

BF‐Ccanbeusedtocomputep(i)i.e.findtheshortestpath.However,thisisnotitsmaininterest,becausethereisabetteralgorithm(Dijkstra)thatcanbeusedinacentralizedway.But:itcanbedistributed asfollows.

Thisisasynchronousmessagepassing,i.e.nodesdonotwaitforcompleteroundsofiterationtobeperformed.

DistributedBellman‐FordAlgorithm,BF‐prelimnode maintainsanestimate ofthetruedistance tonode1;node alsokeepsarecordoflatestvalues forallneighborsinitialconditionsarearbitrarybut 1 0 atallsteps;

fromtimetotime,i sendsitsvalue toallneighbours

when receivesanupdatedvalue fromneighbor ,noderecomputes :eq (1) ← min

A i, j q j

nextHop(i) issettoavalueofj thatachievestheminineq(1)

25

Correctness of BF‐prelim

Theorem:Assumeatleastonemessageisreliablysenttoallneighborsbyeverynodeevery timeunitsandthenetworkisfullyconnected.BF‐prelimconvergestothesameresultasthecentralizedversionBF‐C(i.e.tothecorrectdistances)in timeunits,where isthenumberofstepsperformedbyBF‐Cwithsameinitialconditions.

DistributedBellman‐FordAlgorithm,BF‐prelimnode maintainsanestimate ofthetruedistance tonode1;node alsokeepsarecordoflatestvalues forallneighborsinitialconditionsarearbitrarybut 1 0 atallsteps;

fromtimetotime,i sendsitsvalue toallneighbours

when receivesanupdatedvalue fromneighbor ,noderecomputes :eq (1) ← min

A i, j q j

nextHop(i) issettoavalueofj thatachievestheminineq(1)

26

Distributed Bellman‐Ford BF‐prelim

Apossiblerun ofalgorithm BF‐prelim.Thetableshowsthesuccessivevaluesof

q(i)     1    B    C   D   E0  0    1 0    1     3 0    1    7 3 0    1    7  3    80    1    7  3    40    1    7    3    4 

1 ‐> BB ‐> DB ‐> CC ‐> ED ‐> E1 ‐> DB ‐> E

473∞

1BC

DE

1

5

1

1

6

2 2

017

3

Converged !

0    1    7    3    3E ‐> BE ‐> C

0    1    7    3    30    1    4 3    3                    

27

Super‐Duper Bellman‐Ford

BF‐prelimrequiresanodetorememberallpreviouslyreceivedestimatesq(j) forallneighbors,eveniftheyarenotthebestones;canwedobetter?Apossiblemodificationwouldbetoreplaceeq(1)by

Super‐DuperBellman‐Ford:

Nodei nowneedstostoreonlyitsownestimate

Q. doesthiswork?

← min , ,

when receives an updated value from neighbor , node recomputes :eq (1s) ← min

, ,

Is Super‐Duper Bellman‐Ford correct ?

1. Yes,regardless ofinitialcondition

2. Only ifinitialconditionsareand

at time03. Itmay fail,even with initial

conditionsasin2.4. Idon’t know

28

← min , ,

when receives an updated value from neighbor , node recomputes :eq (1s) ← min

, ,

Yes, 

rega

rdles

s of in

itial c

o...

Only 

if init

ial co

nditio

ns ar

...

It may

 fail, 

even

 with

 initia

l...

I don

’t kno

w

54%

7%15%

24%

Solution

Super‐Dupercanonlydecrease .Soifwestartfrominitialconditionsasinexample« ImpactofInitialConditions »,thealgorithmwillnotconvergetotherightvalue.Itgets« stuck »withalowvalue.Itispossibletoshowthatitworksifallinitialconditionsareabovethefinalvalues,forexample andinitially.Buteventhen,itwillnotworkifthereisatopologychange,sincethisisequivalenttostartingfromdifferentinitialconditions.Indeed,requiringthatinitialconditionsarecorrectmeansthatweareabletoresettheentirenetworkwheneverthereisatopologychange(whichisnotfeasibleinpractice).

29

30

Distributed Bellman‐Ford, the true version

Requiresonlytorememberdistancefromselftodestination+thebestneighbor(nextHop( ))andworksforallinitialconditions

DistributedBellman‐FordAlgorithm,BF‐Dnode maintainsanestimate ofthedistance tonode1;node remembersthebestneighbornextHop(i)

initialconditionsarearbitrarybut 1 0 atallsteps;

fromtimetotime,i sendsitsvalue toallneighbors

when receivesanupdatedvalue from ,node recomputes :eq (2) if nextHop

then ← ,else ← min , ,

ifeq(2)causes tobemodified,nextHop ←

1BC

DE

1

5

1

1

6

2 2

017

3

31

Distributed Bellman‐Ford BF‐D

Apossiblerun ofalgorithm BF‐D.Thetableshowsthesuccessivevaluesof

1   B   C   D  E   0    10  1 6 10    1 1 6 10    1    1 3 10    1  1 3 10    1    1    3    10    1    1    3    1

1 ‐> BB ‐> DB ‐> CB ‐> ED ‐> EC ‐> E

1nextHop

0    1    1    3    2

1BC

DE

1

5

1

1

6

2 2

017

3

32

Distributed Bellman‐Ford BF‐D, cont’d

Apossiblerun ofalgorithm BF‐D.Thetableshowsthesuccessivevaluesof

1   B   C   D  E   0    10  1 6 10    1 1 6 10    1    1 3 10    1  1 3 10    1    1    3    10    1    1    3    1

1 ‐> BB ‐> DB ‐> CB ‐> ED ‐> EC ‐> EE ‐> CC ‐> EE ‐> CC ‐> EE ‐> CB ‐> E

4nextHop

0    1    1    3    20    1    2 3    2  0    1    1    3    30    1    3 3    30    1    3    3    40    1    4 3    40    1    4    3    3

33

Correctness of BF‐D

Theorem:Assumeatleastonemessageisreliablysenttoallneighborsbyeverynodeevery timeunitsandthenetworkisfullyconnected.BF‐DconvergestothesameresultasthecentralizedversionBF‐C(i.e.tothecorrectdistances)intimeunits,where isthenumberofstepsperformedbyBF‐Cwithsameinitialconditions.Comment:ThemaindifferencewithBF‐prelimisthateq(2)replaceseq(1).AssumeweuseBF‐D,andwestartfromaconditionsuchthatq(i)isindeedequaltotheminimumgivenbyeq (1)(whichiswhat,intuitively,istruemostofthetime).

WhenjisnotequaltonextHop(i),botheq(1)andeq(2)havethesameeffect:thenewvalueofq(i)isthesameinbothcases.Incontrast,ifj==nextHop(i),theneq (2)setsq(i)tothenewvalueA(i,j)+q(j),whereaseq(1)setsittominj neighbor (A(i,j)+q(j)).Eq(2)providesanupperboundoneq(1),inthiscase.Itturnsoutthatthealgorithmstillworks,bythesamemechanismthatmakesthealgorithmworkevenwhentheinitialconditionsarearbitrary.Indeed,nodeiwillsenditsnewvaluetoallremainingneighbors,whowillinturndoanupdateandeventually,nodei willreceivevaluesofq(j)thatwillcorrecttheproblem.Inotherwords,ifthenewvalueofq(i)istoohigh(comparedtowhatwouldbeobtainedwitheq (1)),thisisrepairedinoneroundofexchangeswiththeneighbors.

Take‐Home Message

Bellman‐Ford,Distributed(BF‐D),allowsanodetocomputedistancestoonedestinationStoredinformationis:

NexthoptodestinationDistancetodestination

BF‐Dworksbymessagepassing:everynodeinformsitsneighborsofitscurrentdistance

BF‐Dworksevenwheninitialconditionsarenotasexpected(whichoccursduetotopologychanges)

Ifdestinationisunreachable(distance )thenthealgorithmscountstoinfinity.

34

3. Distance Vector routing in practice

Distancevectorrouting=basedonBF‐DBF‐DisruninallroutersforallpossibledestinationprefixesRouteri computesshortestpathandnexthopforallnetworkprefixesn thatitheardof.Initially:D(i,n) =1ifi directlyconnectedton andimplicitlyD(i,n) =+ foranyn thatwasneverheardof.Nodei receivesfromneighbour k latestvaluesofD(k,n) foralln(thisisthedistancevector).Nodei computesthebestestimatesaccordingtoalgorithmBF‐D

35

c(i,m)

c(i,1) D(1,n)

c(i,k) D(k,n)

D(m,n)

i n

1

k

m

Periodic Updates

Updatesaresentperiodically(e.g.every30sec)Ifneighbour k isnolongerpresent,nodeiwillnolongerreceivehellomessages,andafteratimeout,thishasthesameeffectasifnodeiwouldreceivethemessagefromk: foralln.ThenalgorithmBF‐Disrun:Itfollowsthatif was thenext hopto ,then declaresunreachable.

36

c(i,m)

c(i,1) D(1,n)

c(i,k) D(k,n)

D(m,n)

i n

1

k

m

37

Example 1

n1A B

n3D C

n2n4

net dist nxt

n1 1 n1,An4 1 n4,A

net dist nxt

n1 1 n1,Bn2 1 n2,B

net dist nxt

n3 1 n3,Dn4 1 n4,Dm3 1 m3,D

net dist nxt

n2 1 n2,Cn3 1 n3,Cm1 1 m1,Cm2 1 m2,C

A B

CDm1

m2

m3

All link costs = 1

38

Example 1

n1A B

n3D C

n2n4

net dist nxt

n1 1 n1,An4 1 n4,A

net dist nxt

n1 1 n1,Bn2 1 n2,Bn4 2 n1,A

net dist nxt

n3 1 n3,Dn4 1 n4,Dm3 1 m3,D

net dist nxtn2 1 n2,Cn3 1 n3,Cm1 1 m1,Cm2 1 m2,Cn4 2 n3,Dm3 2 n3,D

from An1 1 n4 1

A B

CDm1

m2

m3

from Dn3 0 n4 0m3 0

All link costs = 1

39

Example 1

n1A B

n3D C

n2n4

net dist nxt

n1 1 n1,An4 1 n4,A

net dist nxt

n3 1 n3,Dn4 1 n4,Dm3 1 m3,D

net dist nxtn2 1 n2,Cn3 1 n3,Cm1 1 m1,Cm2 1 m2,Cn4 2 n3,Dm3 2 n3,D

A

CDm1

m2

m3

from Cn2 1 n3 1m1 1m2 1 n4 2m3 2

net dist nxt

n1 1 n1,Bn2 1 n2,Bn3 2 n2,Cn4 2 n1,Am1 2 n2,Cm2 2 n2,Cm3 3 n2,C

B

All link costs = 1

40

Example 1 ‐ Final   

n1A B

n3D C

n2n4

net dist nxt

n1 1 n1,An2 2 n1,Bn3 2 n4,Dn4 1 n4,Am1 3 n4,Dm2 3 n4,Dm3 2 n4,D

net dist nxt

n1 2 n4,An2 2 n3,Cn3 1 n3,Dn4 2 n4,Dm1 2 n3,Cm2 2 n3,Cm3 1 m3,D

A

C

D

m1

m2

m3

net dist nxt

n1 2 n2,Bn2 1 n2,Cn3 1 n3,Cm1 1 m1,Cm2 1 m2,Cn4 2 n3,Dm3 2 n3,D

net dist nxt

n1 1 n1,Bn2 1 n2,Bn3 2 n2,Cn4 2 n1,Am1 2 n2,Cm2 2 n2,Cm3 3 n2,C

B

41

Example 1 ‐ Failure 

n1A B

n3D C

n2n4

m1

m2

m3

net dist nxt

n1 2 An2 2 Cn3 1 Dn4 1 Dm1 2 Cm2 2 Cm3 1 D

D

C

net dist nxt

n1 2 Bn2 1 Cn3 1 Cm1 1 Cm2 1 Cn4 2 Dm3 2 D

net dist nxt

n1 1 Bn2 1 Bn3 2 Cn4 2 Am1 2 Cm2 2 Cm3 3 C

B

We show only the router in the next hop field

All link costs = 1

42

Example 1 ‐ Failure 

n1A B

n3D C

n2n4

m1

m2

m3

timeout

net dist nxt

n1 1 Bn2 1 Bn3 2 Cn4 2 Am1 2 Cm2 2 Cm3 3 C

B

C

net dist nxt

n1 2 Bn2 1 Cn3 1 Cm1 1 Cm2 1 Cn4 2 Dm3 2 D

net dist nxt

n1 2 An2 2 Cn3 1 Dn4 1 Dm1 2 Cm2 2 Cm3 1 D

Dtimeout

All link costs = 1

43

Example 1 ‐ Failure 

n1A B

n3D C

n2n4

m1

m2

m3

net dist nxt

n1 1 Bn2 1 Bn3 2 C

m1 2 Cm2 2 Cm3 3 C

B

C

net dist nxt

n1 2 Bn2 1 Cn3 1 Cm1 1 Cm2 1 Cn4 2 Dm3 2 D

net dist nxt

n2 2 Cn3 1 Dn4 1 Dm1 2 Cm2 2 Cm3 1 D

D

From C:n1 2n2 1n3 1m1 1m2 1n4 2m3 2

All link costs = 1

n1 3 C

44

Example 1 ‐ After Failure 

n1A B

n3D C

n2n4

m1

m2

m3

net dist nxt

n1 1 Bn2 1 Bn3 2 Cn4 3 Cm1 2 Cm2 2 Cm3 3 C

B

C

net dist nxt

n1 2 Bn2 1 Cn3 1 Cm1 1 Cm2 1 Cn4 2 Dm3 2 D

net dist nxt

n2 2 Cn3 1 Dn4 1 Dm1 2 Cm2 2 Cm3 1 D

D

All link costs = 1

n1 3 C

Example 1: Conclusion

Example1illustrateshowBellmanFordismappedtothenetworkconceptshowtopologychangesaretakenintoaccount

mostrecentannouncementreplacespreviousonesnonrefreshedannouncementsbecomeobsolete

howdistancevectorcarriesreachabilityinformation

45

Example 2Assumealgorithmhasconverged

46

A B

dest link cost

a local 1b l1 2c l1 3d l3 2e l3 3

A B

D E

l4l3 C l5

l2

dest link cost

a l1 2b local 1c l2 2d l4 3e l4 2

dest link cost

a l2 3b l2 2c local 1 d l5 3e l5 2

C

dest link cost

a l3 2b l3 3c l6 3d local 1e l6 2

D

dest link cost

a l6 3b l4 2c l5 2d l6 2e local 1

E

All link costs = 1

Example 2Linksl1andl6failsimultaneously,Ddetectsfailure

47

A B

dest link cost

a local 1b l1 2c l1 3d l3 2e l3 3

A B

D E

l4l3 C l5

l2

dest link cost

a l1 2b local 1c l2 2d l4 3e l4 2

dest link cost

a l2 3b l2 2c local 1 d l5 3e l5 2

C

dest link cost

a l3 2b l3 3c NR ∞d local 1e NR ∞

D

dest link cost

a l6 3b l4 2c l5 2d l6 2e local 1

E

All link costs = 1

Example 2 : Zoom on A and B

48

dest link cost

a local 1b l1 2c l1 3d l3 2e l3 3

A

A

D

l3

dest link cost

a l3 2b l3 3c l3 4d local 1e l3 4

D

from A:dest costa 1b,d 2c,e 3

dest link cost

a local 1b NR ∞c NR ∞d l3 2e l3 3

A

A

D

l3

dest link cost

a l3 2b l3 3c l3 4d local 1e l3 4

D

A detects failure of dest link cost

a local 1b l3 c l3 d l3 2e l3 5

A

A

D

l3

dest link cost

a l3 2b l3 3c l3 d local 1e l3

D

from D:dest costd 1a 2b 3c,e 4

All link costs = 1

After processing this update, what is the distance at D to e ? 

1. 12. 23. 34. 45. 56. 67. Idon’t know

49

dest link cost

a local 1b l3 c l3 d l3 2e l3 5

A

A

D

l3

dest link cost

a l3 2b l3 3c l3 d local 1e l3

D

from A:dest costa 1d 2b 4c,e 5

All link costs = 1

1 2 3 4 5 6I d

on’t k

now

3% 3% 3%

51%

30%

8%

3%

Solution

AtD:DistributedBellman‐Ford(BF‐D)updateisreceivedfromnexthoptoethereforenewdistanceisacceptedDsetsdistancetoeto

50

dest link cost

a local 1b l3 c l3 d l3 2e l3 5

A

A

D

l3

dest link cost

a l3 2b l3 3c l3 d local 1e l3

D

from A:dest costa 1d 2b 4c,e 5

Count to Infinity

51

dest link cost

a local 1b l3 c l3 d l3 2e l3 5

A

A

D

l3

dest link cost

a l3 2b l3 5c l3 6d local 1e l3 6

D

from A:dest costa 1d 2b 4c,e 5

dest link cost

a local 1b l3 6c l3 7d l3 2e l3 7

A

A

D

l3

dest link cost

a l3 2b l3 5c l3 6d local 1e l3 6

D

from D:dest costa 1d 2b 4c,e 5

dest link cost

a local 1b l3 6c l3 7d l3 2e l3 7

A

A

D

l3

dest link cost

a l3 2b l3 7c l3 8d local 1e l3 8

D

from A:dest costa 1d 2b 6c,e 7

All link costs = 1

Conclusion from Example 2

Thecoststob,c,e growunbounded“CounttoInfinity”thetruecostsareinfiniteThisistheexpectedbehaviour ofBellman‐Ford

Inpractice,weenforceconvergencebysettinglargenumber

e.g.RIP:∞ 16

Butwecandobetter…

52

Route poisoning and Split Horizon

TwopracticalheuristicsinordertoPreventcounttoinfinityPreventping‐pong loops

Routepoisoning:ifAdetectsthatroutetoxisnotreachable,Asends«distancetox= »toneighbours

Further,when adistance= isreceivedforx,anyfurtherupdateaboutxisignoredforsometime(holddown timer)

SplitHorizon:ifAroutespacketstoxviaB,AdoesnotannouncethisroutetoB

53

Example 2with Route Poisoning and Split Horizon

A B

dest link cost

a local 1b l1 2c l1 3d l3 2e l3 3

A B

D E

l4l3 C l5

l2

dest link cost

a l1 2b local 1c l2 2d l4 3e l4 2

dest link cost

a l2 3b l2 2c local 1 d l5 3e l5 2

C

dest link cost

a l3 2b l3 3c NR ∞d local 1e NR ∞

D

dest link cost

a l6 3b l4 2c l5 2d l6 2e local 1

E

D detects failureD immediately sends update to A with poisoned routes (∞ distances)Routes to a and b are not advertized (split horizon) 

from B:d 1c, e: ∞

All link costs = 1

After processing this update, what are the distances at A to c and  e ? 

5. Noneoftheabove6. Idon’t know

55

dest link cost

a local 1b l1 2c l1 3d l3 2e l3 3

A

A

D

l3

dest link cost

a l3 2b l3 3c NR ∞d local 1e NR ∞

D

from B:d 1c, e: ∞

All link costs = 1

$$ $$ =3, $$ $$ =

None of the abov

I don’t know

12%

7%10%

0%

44%

27%

Solution

AappliesBF‐D:

Disnotthenexthoptoc,thereforeAcomputes

distanceis3,nochange

Disthenexthoptoe,thereforeAcomputes

distanceis ,i.e.eisunreachable

56

dest link cost

a local 1b l1 2c l1 3d l3 2e NR ∞

A

A

D

l3

dest link cost

a l3 2b l3 3c NR ∞d local 1e NR ∞

D

from B:d 1c, e: ∞

Example 2 with Route poisoning and Split Horizon

NocounttoinfinityAfter sometime,thedistancesareremoved bytimeout

57

A detects failuredest link cost

a local 1b NR ∞c NR ∞d l3 2e NR ∞

A

A

D

l3

dest link cost

a l3 2b NR ∞c NR ∞d local 1e NR ∞

D

from A:a 1b,c,e ∞

dest link cost

a local 1b l1 2c l1 3d l3 2e NR ∞

A

A

D

l3

dest link cost

a l3 2b l3 3c NR ∞d local 1e NR ∞

D

from B:d 1c, e: ∞

All link costs = 1

58

RIP (Routing Information Protocol)ImplementsBF‐DCostofonelinkis1bydefaultCostsareunidirectional,itispossibletohave , ,∞ 16;thereforenetworkspanlimitedto15SplithorizonandroutepoisoningUDPport520andmulticastaddress224.0.0.9/ff02::9Sendsdistancevectorupdateevery30seconds(bydefault)orwhenchangeisdetected(“triggeredupdate”)

Routenotannouncedduring3minutesbecomesinvalidRIPkeepsadatabaseofallbestpaths,called“RoutingInformationBase”(RIB),whichisdifferent(supersetof)routingtable

unlikeslidesinpart“theory”AuthenticationinRIPv2byMD5(sharedsecret)RIPforIPv4,RIPng forIPv6

59

EIGRP (Enhanced Interior Gateway Routing Protocol)

ProprietaryprotocolbyCISCOMetricthatestimatestheglobaldelayMaintainsseveralroutesofsimilarcost

loadsharingNolimitof15

numberofroutersincludedinmessagesBroadcastevery90sec

TypicallyoneprocessforIPv4andoneprocessforIPv6

60

Metric example

MetricTrans=10000000/Bandwidth(timetosend10Kb)delay=(sumofDelay)/10m=[K1*Trans+(K2*Trans)/(256‐load)+K3*delay]default:K1=1,K2=0,K3=1,K4=0,K5=0ifK5 0,m=m*[K5/(Reliability+K4)]

BandwidthinKb/s,DelayinsAtVenus:Routefor172.17/16:Metric=10000000/784+(20000+1000)/10=14855AtSaturn:Routefor12./8:Metric=10000000/224+(20000+1000)/10=46742

In a fully connected network, say what is true :

1. BF‐Cconvergestothecorrectdistanceswhatevertheinitialconditions

2. BF‐Dconvergestothecorrectdistanceswhatevertheinitialconditions

3. 1and24. None5. Idon’tknow

61

BF‐C

 conv

erge

s to the c

orre

..

BF‐D

 conv

erge

s to the c

orre..

1 and

 2 

None

 I d

on’t kn

ow

0% 0%0%0%0%

62

Conclusion

DistancevectorissmartFullydistributed,littleinformationstored

SimpleBut:relativelyslow

NotsuitedforlargeandcomplexnetworksLinkStateprotocolsshouldbeusedinstead