Distance‐VectorandPath‐VectorRou3ng
Sec3ons4.2.2.,4.3.2,4.3.3
COS461:ComputerNetworksSpring2011
MikeFreedmanhHp://www.cs.princeton.edu/courses/archive/spring11/cos461/
1
GoalsofToday’sLectures• Distance‐vectorrou3ng
– Pro:Lessinforma3onthanlinkstate– Con:Slowerconvergence
• Path‐vectorrou3ng– Fasterconvergencethandistancevector– Moreflexibilityinselec3ngpaths
• Differentgoals/metricsifinter‐orintra‐domain
2
DistanceVector:S3llShortest‐PathRou3ng
• Path‐selec3onmodel– Des3na3on‐based– Load‐insensi3ve(e.g.,sta3clinkweights)– Minimumhopcountorsumoflinkweights
3
3 2
2
1
1 4
1
4
5
3
• Compute:pathcoststoallnodes– Fromagivensourceutoallothernodes
– Costofthepaththrougheachoutgoinglink– Nexthopalongtheleast‐costpathtos
Shortest‐PathProblem4
u
s 6
3 2
2
1
1 4
1
4
5
3
v (u,v) w (u,w) x (u,w) y (u,v) z (u,v)
link
s (u,w) t (u,w)
Ex)Forwardingtableatu
ComparisonofProtocolsLinkState
• Knowledgeofeveryrouter’slinks(en3regraph)
• EveryrouterhasO(#edges)
• Trustapeer’sinfo,dorou3ngcomputa3onyourself
• UseDijkstra’salgorithm
• Sendupdatesonanylink‐statechanges
• Ex:OSPF,IS‐IS• Adv:Fasttoreacttochanges
DistanceVector• Knowledgeofneighbors’
distancetodes3na3ons
• EveryrouterhasO(#neighbors*#nodes)
• Trustapeer’srou3ngcomputa3on
• UseBellman‐Fordalgorithm
• Sendupdatesperiodicallyorrou3ngdecisionchange
• Ex:RIP,IGRP• Adv:Lessinfo&lower
computa3onaloverhead
5
Bellman‐FordAlgorithm
• Definedistancesateachnodex– dx(y)=costofleast‐costpathfromxtoy
• Updatedistancesbasedonneighbors– dx(y)=min{c(x,v)+dv(y)}overallneighborsv
6
3 2
2
1
1 4
1
4
5
3
u
v
w
x
y
z
s
t du(z)=min{c(u,v) +dv(z), c(u,w)+dw(z)}
DistanceVectorAlgorithm• Nodexmaintainsstate:
– c(x,v)=costfordirectlinkfromxtoneighborv– DistancevectorDx(y)(es3mateofleastcostxtoy)forallnodesy
– DistancevectorDv(y)foreachneighborv,forally
• NodexperiodicallysendsDxtoitsneighborsv– Neighborsupdatetheirowndistancevectors:Dv(y)←minx{c(v,x)+Dx(y)}foreachnodey∊N
• Over3me,thedistancevectorDxconverges
7
DistanceVectorAlgorithm8
Itera3ve,asynchronous:Eachlocalitera3onby
• Locallinkcostchange• Distancevectorupdate
messagefromneighbor
Distributed:
• Eachnodeno3fiesneighborsonlywhenitsDVchanges
• Neighborsthenno3fytheirneighborsifnecessary
wait for (change in local link cost or msg from neighbor)
recompute estimates
if distance to any destination has changed, notify neighbors
Eachnode:
DistanceVectorExample:Step19
Table for A Dst Cst Hop A 0 A B 4 B C ∞ – D ∞ – E 2 E F 6 F
Table for B Dst Cst Hop A 4 A B 0 B C ∞ – D 3 D E ∞ – F 1 F
Table for C Dst Cst Hop A ∞ – B ∞ – C 0 C D 1 D E ∞ – F 1 F
Table for D Dst Cst Hop A ∞ – B 3 B C 1 C D 0 D E ∞ – F ∞ –
Table for E Dst Cst Hop A 2 A B ∞ – C ∞ – D ∞ – E 0 E F 3 F
Table for F Dst Cst Hop A 6 A B 1 B C 1 C D ∞ – E 3 E F 0 F
Optimum 1-hop paths
A
E
F
C
D
B
2
3
6
41
1
1
3
DistanceVectorExample:Step210
Table for A Dst Cst Hop A 0 A B 4 B C 7 F D 7 B E 2 E F 5 E
Table for B Dst Cst Hop A 4 A B 0 B C 2 F D 3 D E 4 F F 1 F
Table for C Dst Cst Hop A 7 F B 2 F C 0 C D 1 D E 4 F F 1 F
Table for D Dst Cst Hop A 7 B B 3 B C 1 C D 0 D E ∞ – F 2 C
Table for E Dst Cst Hop A 2 A B 4 F C 4 F D ∞ – E 0 E F 3 F
Table for F Dst Cst Hop A 5 B B 1 B C 1 C D 2 C E 3 E F 0 F
Optimum 2-hop paths
A
E
F
C
D
B
2
3
6
41
1
1
3
DistanceVectorExample:Step311
Table for A Dst Cst Hop A 0 A B 4 B C 6 E D 7 B E 2 E F 5 E
Table for B Dst Cst Hop A 4 A B 0 B C 2 F D 3 D E 4 F F 1 F
Table for C Dst Cst Hop A 6 F B 2 F C 0 C D 1 D E 4 F F 1 F
Table for D Dst Cst Hop A 7 B B 3 B C 1 C D 0 D E 5 C F 2 C
Table for E Dst Cst Hop A 2 A B 4 F C 4 F D 5 F E 0 E F 3 F
Table for F Dst Cst Hop A 5 B B 1 B C 1 C D 2 C E 3 E F 0 F
Optimum 3-hop paths
A
E
F
C
D
B
2
3
6
41
1
1
3
DistanceVector:LinkCostChanges12
Linkcostchanges:• Nodedetectslocallinkcostchange• Updatesthedistancetable• Ifcostchangeinleastcostpath,no3fyneighbors
X Z 1 4
50
Y 1
algorithmterminates
“Goodnewstravelsfast”
ViewofX(aboutneighboryandz’srou3ngtables)
Circledentryisleastcost
DistanceVector:LinkCostChanges13
Linkcostchanges:
• Goodnewstravelsfast• Badnewstravelsslow‐“counttoinfinity”problem!
X Z 1 4
50
Y 60
algorithmcon3nues
on!
ViewofX(aboutneighboryandz’srou3ngtables)
DistanceVector:PoisonReverse14
IfZroutesthroughYtogettoX:• ZtellsYits(Z’s)distancetoXisinfinite(soYwon’troutetoXviaZ)
• S3ll,canhaveproblemswhenmorethan2routersareinvolved
X Z 1 4
50
Y 60
algorithmterminates
ViewofX(aboutneighboryandz’srou3ngtables)
Rou3ngInforma3onProtocol(RIP)
• Distancevectorprotocol– Nodessenddistancevectorsevery30seconds– …or,whenanupdatecausesachangeinrou3ng
• LinkcostsinRIP– Alllinkshavecost1– Validdistancesof1through15– …with16represen3nginfinity– Small“infinity”smaller“coun3ngtoinfinity”problem
• RIPislimitedtofairlysmallnetworks– E.g.,usedinthePrincetoncampusnetwork
15
ComparisonofLSandDVRou3ng
Messagecomplexity• LS:withnnodes,Elinks,
O(nE)messagessent
• DV:exchangebetweenneighborsonly
SpeedofConvergence• LS:rela3velyfast• DV:convergence3mevaries
– Mayberou3ngloops– Count‐to‐infinityproblem
Robustness:whathappensifroutermalfunc3ons?
LS:– Nodecanadver3seincorrectlinkcost
– Eachnodecomputesonlyitsowntable
DV:– DVnodecanadver3seincorrectpathcost
– Eachnode’stableusedbyothers(errorpropagates)
16
Similari3esofLSandDVRou3ng
• Shortest‐pathrou3ng– Metric‐based,usinglinkweights– Routersshareacommonviewofhowgoodapathis
• Assuch,commonlyusedinsideanorganiza3on– RIPandOSPFaremostlyusedasintra‐domainprotocols– E.g.,PrincetonusesRIP,andAT&TusesOSPF
• ButtheInternetisa“networkofnetworks”– Howtos3tchthemanynetworkstogether?– Whennetworksmaynothavecommongoals– …andmaynotwanttoshareinforma3on
17
Path‐VectorRou3ng
18
Shortest‐PathRou3ngisRestric3ve• Alltrafficmusttravelonshortestpaths
• Allnodesneedcommonno3onoflinkcosts
• Incompa3blewithcommercialrela3onships
19
Regional ISP1
Regional ISP2
Regional ISP3
Cust1 Cust3 Cust2
National ISP1
National ISP2
YES
NO
Link‐StateRou3ngisProblema3c• Topologyinforma3onisflooded
– Highbandwidthandstorageoverhead– Forcesnodestodivulgesensi3veinforma3on
• En3repathcomputedlocallypernode– Highprocessingoverheadinalargenetwork
• Minimizessomeno3onoftotaldistance– Worksonlyifpolicyissharedanduniform
• TypicallyusedonlyinsideanAS– E.g.,OSPFandIS‐IS
20
DistanceVectorisontheRightTrack
• Advantages– Hidesdetailsofthenetworktopology– Nodesdetermineonly“nexthop”towardthedest
• Disadvantages– Minimizessomeno3onoftotaldistance,whichisdifficultinaninterdomainsevng
– Slowconvergenceduetothecoun3ng‐to‐infinityproblem(“badnewstravelsslowly”)
• Idea:extendtheno3onofadistancevector– Tomakeiteasiertodetectloops
21
Path‐VectorRou3ng• Extensionofdistance‐vectorrou3ng
– Supportflexiblerou3ngpolicies– Avoidcount‐to‐infinityproblem
• Keyidea:adver3setheen3repath– Distancevector:senddistancemetricperdestd– Pathvector:sendtheen4repathforeachdestd
22
d
“d: path (2,1)” “d: path (1)”
data traffic data traffic 2 13
FasterLoopDetec3on• Nodecaneasilydetectaloop
– Lookforitsownnodeiden3fierinthepath– E.g.,node1seesitselfinthepath“3,2,1”
• Nodecansimplydiscardpathswithloops– E.g.,node1simplydiscardstheadver3sement
23
2 1
“d: path (2,1)” “d: path (1)”
“d: path (3,2,1)”
3
FlexiblePolicies• Eachnodecanapplylocalpolicies
– Pathselec3on:Whichpathtouse?
– Pathexport:Whichpathstoadver3se?
• Examples– Node2maypreferthepath“2,3,1”over“2,1”
– Node1maynotletnode3hearthepath“1,2”
24
2 3
1
2 3
1
Conclusions• Distance‐vectorrou3ng
– Pro:Lessinforma3onandcomputa3onthanlinkstate– Con:Slowerconvergence(e.g.,counttoinfinity)
• Path‐vectorrou3ng– Shareen3repath,notdistance:fasterconvergence– Moreflexibilityinselec3ngpaths
• Differentgoals/metricsifinter‐orintra‐domain
• Nextweek:BPG(path‐vectorprotocolb/wASes)
25
Top Related