lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture •...
Transcript of lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture •...
![Page 1: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/1.jpg)
ComputerNetworks:ArchitectureandProtocols
CS4450
Lecture11Rou+ng:DeepDive
Spring2018RachitAgarwal
![Page 2: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/2.jpg)
GoalsforToday’sLecture
• LearningaboutRoutingProtocols
• LinkState(Globalview)
• DistanceVector(Localview)
• Maintainsanity:itsoneofthe“harder”lectures
• I’lltrytomakeit-less-hard,but…
• Payattention• Reviewagaintomorrow
• Workoutafewexamples
2
![Page 3: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/3.jpg)
Recap:SpanningTreeProtocol(failuresonlaterslides)
3
• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY
• InitiallyeachswitchXannounces(X,0,X)toitsneighbors
• Switchesupdatetheirview• Uponreceivingmessage(Y,d,Y)fromZ,checkY’sid
• IfY’sid<currentroot:setroot=Y
• Switchescomputetheirdistancefromtheroot
• Add1totheshortestdistancereceivedfromaneighbor
• IfrootchangedORshortestdistancetotherootchanged,sendallneighborsupdatedmessage(Y,d+1,X)
![Page 4: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/4.jpg)
• Easytodesignroutingalgorithmsfortrees
• Nodescan“flood”packettoallothernodes
• Amazingproperties:
• Noroutingtablesneeded!• Nopacketswilleverloop.• Atleast(andexactly)onepacketmustreachthedestination
• Assumingnofailures
• Threefundamentalissues:
• Unnecessaryprocessingatendhosts(thatarenotthedestination)• Higherlatency• Loweravailablebandwidth
Recap:RoutingviaFloodingonSpanningTree…
![Page 5: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/5.jpg)
Each Switch stores a table indicating the next hop for corresponding destination of a packet (called a routing table)
• SupposepacketfollowsPath1:Cornell-S#1-S#3-MIT
Recap:RoutingviaRoutingTables
Cornell
Harvard
MIT
Switch#1
Switch#2
Switch#3L1
L2 L3
L4
L5 L6
DESTINATION NEXT HOPCORNELL L1
MIT L3HARVARD L4
DESTINATION NEXT HOPCORNELL L2
MIT L5HARVARD L5
DESTINATION NEXT HOPCORNELL L5
MIT L6HARVARD L3
![Page 6: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/6.jpg)
• Routingstate:collectionofroutingtablesacrossallnodes
• Twoquestions:• Howcanweverifygivenroutingstateisvalid?• Howcanweproducevalidroutingstate?
• Lastlecture:globalroutingstatevalidifandonlyif:• Therearenodeadends(otherthandestination)• Therearenoloops
• Today:Howtoproducevalidroutingstate?
Recap:RoutingTables
![Page 7: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/7.jpg)
Questions?
![Page 8: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/8.jpg)
• Easytoavoiddeadends
• Avoidingloopsishard
• Thekeydifferencebetweenroutingprotocolsishowtheyavoidloops!
ProducingValidRoutingState
![Page 9: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/9.jpg)
• CreateTree,routeontree• E.g.,Spanningtreeprotocol(switchedEthernet)• Good:easy,no(persistent)loops,nodeadends• Not-so-good:unnecessaryprocessing,highlatency,lowbandwidth
• Obtainaglobalview:• E.g.,Linkstate(today)
• Distributedroutecomputation:
• E.g.,Distancevector• E.g.,BorderGatewayProtocol
• WewilltrytofinishLinkstateandDistancevectortoday
Fourflavorsofprotocols
![Page 10: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/10.jpg)
RoutingMetrics
• Routinggoals:computepathswithminimumX
• X=numberof“hops”(nodesinthemiddle)
• X=latency• X=weight• X=failureprobability• …
• Generallyassumeeverylinkhas“cost”associatedwithit
• Wewanttominimizethecostoftheentirepath
• WewillfocusonasubsetofpropertiesX,where:
• Costofapath=sumofcostsofindividuallinks/nodesonthepath• E.g.,numberofhopsandlatency
![Page 11: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/11.jpg)
Globalview
![Page 12: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/12.jpg)
TwoAspectsofGlobalViewMethod
• Protocol:Whatwefocusontoday
• Wheretocreateglobalview
• Howtocreateglobalview• Disseminatingroutecomputation(ifnecessary)
• Whentorunroutecomputation
• Algorithm:computingloop-freepathsongraph
• Straightforwardtocomputelowestcostpaths
• UsingDijkstra’salgorithm(pleasestudy;algorithmscourse)
• Wewon’tspendtimeonthis
![Page 13: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/13.jpg)
Wheretocreateglobalview?
• Oneoption:Centralserver• Collectsaglobalview• Computestheroutingtableforeachnode
• “Installs”routingtablesateachnode• Software-definedNetworks:laterincourse
• Secondoption:Ateachrouter• Eachroutercollectsaglobalview• ComputesitsownroutingtableusingLink-stateprotocol
• Link-stateroutingprotocol• OSPFisaspecificimplementationoflink-stateprotocol
• IETFRFC2328(IPv4)or5340(IPv6)
![Page 14: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/14.jpg)
OverviewofLink-StateRouting
• Everyrouterknowsitslocal“linkstate”• Knowsstateoflinkstoneighbors• Up/down,andassociatedcost
• Arouterfloodsitslinkstatetoallotherrouters• Usesaspecialpacket—LinkStateAnnouncements(LSA)
• Announcementisdeliveredtoallnodes(nextslide)
• Hence,everyrouterlearnstheentirenetworkgraph
• Runsroutecomputationlocally
• Computingleastcostpathsfromthemtoallothernodes
• E.g.,usingDijkstra’salgorithm
![Page 15: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/15.jpg)
HowdoesFloodingWork?
• “Linkstateannouncement”(LSA)arrivesonalinkatarouter
• Thatrouter:• Remembersthepacket
• Forwardsthepacketoutallotherlinks• Doesnotsenditouttheincominglink
• Why?
• Ifapreviouslyreceivedannouncementarrivesagain…
• Routerdropsit(noneedtoforwardagain)
![Page 16: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/16.jpg)
Link-StateRouting
S1
S2
S3
S7S5
S6
S4
Host A
Host B
Host C
Host DHost E
![Page 17: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/17.jpg)
EachNodeThenhasaGlobalView
S1
S2
S3
S7S5
S6
S4
Host A
Host B
Host C
Host DHost E
![Page 18: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/18.jpg)
WhentoInitiateFloodingofannouncements?
• Topologychange• Linkfailures• Linkrecovery
• Configurationchange• Linkcostchange(whywouldonechangelinkcost?)
• Periodically• Refreshthelink-stateinformation
• Typically(say)30minutes
• Correctsforpossiblecorruptionofdata
![Page 19: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/19.jpg)
MakingFloodsReliable
• ReliableFlooding• Ensureallnodesreceivesamelinkstateannouncements
• Noannouncementsdropped
• Ensureallnodesusethelatestversion
• Supposewecanimplementreliableflooding.Howcanitstillfail?
• Canyoueverhaveloopswithlink-staterouting?
• Again:Canyoueverhaveloopswithlink-staterouting?
![Page 20: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/20.jpg)
AreLoopsStillPossible?
55
5 35
51
1
A
D E
F
CB
55
5 35
5
1
A
D E
F
CB
A and D think this is the path to C
E-C link fails, but D doesn’t know yet
E thinks that this the path to C
E reaches C via D, D reaches C via E Loop!
![Page 21: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/21.jpg)
TransientDisruptions
55
5 35
5
1
A
D E
F
CB
55
5 35
5
1
A
D E
F
CB
• Inconsistentlink-stateviews• Someroutersknowaboutfailurebeforeothers
• Theshortestpathsarenolongerconsistent• Cancausetransientforwardingloops
• Transientloopsarestillaproblem!
![Page 22: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/22.jpg)
Convergence
• Allroutershaveconsistentroutinginformation
• E.g.,allnodeshavingthesamelink-statedatabase
• Forwardingisconsistentafterconvergence• Allnodeshavethesamelink-statedatabase
• Allnodesforwardpacketsonsamepaths
• Butwhilestillconverging,badthingscanhappen
![Page 23: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/23.jpg)
TimetoReachConvergence
• Sourcesofconvergencedelay?• Timetodetectfailure
• Timetofloodlink-stateinformation(~longestRTT)
• Timetorecomputeforwardingtables
• Performanceproblemsduringconvergenceperiod?
• Deadends• Loopingpackets• Andsomemorewe’llseelater….
![Page 24: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/24.jpg)
LinkStateisConceptuallySimple
• Everyonefloodslinksinformation
• Everyonethenknowsgraphofthenetwork
• Everyoneindependentlycomputespathsonthegraph
• Allthecomplexityisinthedetails
![Page 25: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/25.jpg)
DistributedRouteComputation
![Page 26: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/26.jpg)
• Eachnodecomputingtheoutgoinglinksbasedon:
• Locallinkcosts• Informationadvertisedbyneighbors
• Algorithmsdifferinwhattheseexchangescontain
• Distance-vector:justthedistance(andnexthop)toeachdestination• Pathvector:theentirepathtoeachdestination
• Wewillfocusondistance-vectorfornow
DistributedComputationofRoutes
![Page 27: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/27.jpg)
Recall:RoutingTables=CollectionofSpanningTrees
27
• Canweusethespanningtreeprotocol(withmodifications)?
• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY
• InitiallyeachswitchXannounces(X,0,X)toitsneighbors
• FordestinationX:eachswitchZannounces(X,d_x,Z)toitsneighbors
• Switchesupdatetheirview• Uponreceivingmessage(Y,d,Y)fromZ,checkY’sid
• IfY’sid<currentroot:setrootdestination=Y
• Switchescomputetheirshortestdistancefromtherootdestination
• Addlinkcostctotheshortestdistancereceivedfromaneighbor
• IfrootchangedORshortestdistancetotherootdestinationchanged,sendallneighborsupdatedmessage(Y,d+c,X)
![Page 28: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/28.jpg)
Letsfocusononedestination=Zfirst
28
• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY
• InitiallyeachswitchZannounces(Z,0,Z)toitsneighbors
• Switchesupdatetheirview• Uponreceivingmessage(Z,d,Y)fromY,checkY’sid
• IfY’sid<currentroot:setrootdestination=Z
• Switchescomputetheirshortestdistancefromtherootdestination
• Addlinkcostctotheshortestdistancereceivedfromaneighbor
• IfrootchangedORshortestdistancetotherootdestinationchanged,sendallneighborsupdatedmessage(Z,d+c,X)
![Page 29: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/29.jpg)
GroupExercise:
LetsruntheProtocolonthisexample
(destination=1)
![Page 30: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/30.jpg)
Round1
Receive Send
1 (1,0,1)
2
3
4
5
6
7
![Page 31: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/31.jpg)
Round2Receive Send
1(1,0,1)
2
3 (1,0,1) (1,1,3)
4
5 (1,0,1) (1,1,5)
6 (1,0,1) (1,1,6)
7
![Page 32: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/32.jpg)
Round3Receive Send
1(1,0,1)(1,1,3),(1,1,5),
(1,1,6)
2 (1,1,3),(1,1,6) (1,2,2)
3(1,1,3)
4
5(1,1,5) (1,1,6)
6(1,1,6) (1,1,5)
7
![Page 33: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/33.jpg)
Round4Receive Send
1(1,0,1)
2(1,2,2)
3(1,1,3) (1,2,2)
4 (1,2,2) (1,3,4)
5(1,1,5)
6(1,1,6) (1,2,2)
7 (1,2,2) (1,3,7)
![Page 34: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/34.jpg)
Round5Receive Send
1(1,0,1)
2(1,2,2) (1,3,4),(1,3,7)
3(1,1,3)
4(1,3,4) (1,3,7)
5(1,1,5)
6(1,1,6)
7(1,3,7) (1,3,4)
![Page 35: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/35.jpg)
GroupExercise:
LetsruntheProtocolonthisexample
(destination=2)
![Page 36: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/36.jpg)
• Thesamealgorithmappliestoalldestinations
• Eachnodeannouncesdistancetoeachdest• Iam4hopsawayfromnodeA
• Iam6hopsawayfromnodeB
• Iam3hopsawayfromnodeC
• …
• Nodesareexchangingavectorofdistances
WhynotSpanningTreeProtocol?WhyDistance“Vector”?
![Page 37: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/37.jpg)
Letssee…
37
• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY
• InitiallyeachswitchXannounces(X,0,X)toitsneighbors
• FordestinationX:eachswitchZannounces(X,d_x,Z)toitsneighbors
• Switchesupdatetheirview• Uponreceivingmessage(Y,d,Y)fromZ,checkY’sid
• IfY’sid<currentroot:setrootdestination=Y
• Switchescomputetheirshortestdistancefromtherootdestination
• Addlinkcostctotheshortestdistancereceivedfromaneighbor
• IfrootchangedORshortestdistancetotherootdestinationchanged,sendallneighborsupdatedmessage(Y,d+c,X)
![Page 38: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/38.jpg)
• Protocol:• Exchangingthatroutinginformationwithneighbors
• Whatandwhenforexchanges
• RIPisaprotocolthatimplementsDV(IETFRFC2080)
• Algorithm:
• Howtousetheinformationfromyourneighborstoupdateyour
ownroutingtables?
TwoAspectstoThisApproach
![Page 39: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/39.jpg)
• Assumelinkbetweennodesx,yhascostc(x,y)
• Nodeufindsminimalcostpathsusingthefollowing
1.Neighborstellmetheirdistancetoallnodesv
• Eachneighborwgivesmea“distancevector”d(w,v)forallv
• “Distance”meanstotalcostoverpath
2.Nodeu’scosttoagivendestinationvisthen:• d(u,v)=Min_{nbrsw}[c(u,w)+d(w,v)]
3.Nodeutellsneighborsaboutd(u,v)…andprocessrepeats
GeneralApproachtoAlgorithm
![Page 40: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/40.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zx 0 2 7y 2 0 1z 7 1 0
min { d(x,z) = cost (x,z),cost (x,y) + d(y,z)}
from
to
![Page 41: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/41.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zx 0 2 3y 2 0 1z 7 1 0
min { d(x,z) = cost (x,z),cost (x,y) + d(y,z)}
from
to
![Page 42: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/42.jpg)
MoreGenerally
x
y
u
2
7
min { d(x,z) = cost (x,y) + d(y,z),cost (x,u) + d(u,z),
}
z
w1
cost (x,w) + d(w,z)Bellman Ford equation
![Page 43: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/43.jpg)
• Algorithm:
• NodesuseBellman-Fordtocomputedistances
• Protocol• Nodesexchangedistancevectors• Updatetheirownroutingtables• Andexchangeagain…• Details:whentoexchange,whattoexchange,etc….
FromAlgorithmtoProtocol
![Page 44: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/44.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zx - - -y 2 0 1z - - -
x y zx 0 2 7y - - -z - - -
x y zx - - -y - - -z 7 1 0
This is y’s “distance vector”
from
to
![Page 45: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/45.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zxy 2 0 1z
x y zx 0 2 7yz
x y zxyz 7 1 0
This is y’s “distance vector” 2 0 1
7 1 0
0 2 72 0 1
0 2 7
7 1 0
from
to
![Page 46: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/46.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zxy 2 0 1z
x y zx 0 2 3y 2 0 1z 7 1 0
x y zxyz 7 1 0
This is y’s “distance vector”
0 2 72 0 1
0 2 7
7 1 0
from
to
![Page 47: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/47.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y zxy 2 0 1z
x y zx 0 2 3y 2 0 1z 3 1 0
x y zxyz 3 1 0
This is y’s “distance vector”
0 2 32 0 1
0 2 3
3 1 0
from
to
![Page 48: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/48.jpg)
• Thethreenodenetwork:• Everyonewasneighborswitheveryoneelse
• Whathappensinalargernetwork?
• Iwillshowyouagraph• Workoutfirstfewstepsyourself
• Thenwecangooverthemtogether
AMoreComplicatedCase
![Page 49: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/49.jpg)
FourNodeNetwork
x
y
v
1 1
2
x y v zxy 1 0 3z
z3
x y v zyvz 3 1 0
x y v zxv 2 0 1z
x y v zx 0 1 2yv
![Page 50: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/50.jpg)
AfterFirstExchange
x
y
v
1 1
2
x y v zx 0 1 2y 1 0 3z 3 1 0
z3
x y v zy 1 0 3v 2 0 1z 3 1 0
x y v zx 0 1 2v 2 0 1z 3 1 0
x y v zx 0 1 2y 1 0 3v 2 0 1
![Page 51: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/51.jpg)
RecomputingTables
x
y
v
1 1
2
x y v zx 0 1 2y 1 0 3z 3 1 0
z3
x y v zy 1 0 3v 2 0 1z 3 1 0
x y v zx 0 1 2v 2 0 1z 3 1 0
x y v zx 0 1 2y 1 0 3v 2 0 1
3
33
3
3
3
33
33
3
3
![Page 52: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/52.jpg)
DoThisOneYourself
x
y
v
7 1
2
x y v zxy 7 0 3z
z3
x y v zyvz 3 1 0
x y v zxv 2 0 1z
x y v zx 0 7 2yv
![Page 53: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/53.jpg)
Answers
x
y
v
7 1
2
x y v zx 0 6 2 3y 6 0 4 3z 3 3 1 0
z3
x y v zy 6 0 4 3v 2 4 0 1z 3 3 1 0
x y v zx 0 6 2 3v 2 4 0 1z 3 3 1 0
x y v zx 0 6 2 3y 6 0 4 3v 2 4 0 1
![Page 54: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/54.jpg)
• Whendoyousendmessages?
• Whenanyofyourdistancesd(u,v)change
• Whataboutwhenc(u,v)changes
• Periodically,toensureconsistencybetweenneighbors
• Whatinformationdoyousend?
• Couldsendentirevector• Orjustupdatedentries
• Doyousendeveryonethesameinformation
• Considerthefollowingslides
OtherAspectsofProtocol
![Page 55: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/55.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y z
y
z
x y z
y
z
2 0 1
3 1 0
3 1 0
2 0 1
What happens now?
4
routing loop!
4
![Page 56: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/56.jpg)
ThreeNodeNetwork
x
y
z
1
7
x y z
y
z
x y z
y
z
0 1
3 1 0
3 1 0
0 14
routing loop!
4
5
5
6
6
7
7
8
8
“Count to infinity scenario if c(x,z) was infinite
![Page 57: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/57.jpg)
• Whywouldyouadvertiseapathbacktothepersonwhohasadviseditto
you?
• Tellingthemaboutyourentrygoingthroughthem
• Doesn’ttellthemanythingnew
• Perhapsmisleadsthemthatyouhaveanindependentpath
• Solution:ifyouareusinganext-hop’spath,then:• Tellthemnottouseyourpath(bytellingthemcostof\inf)
• Called“poisonedreverse”
• Anditiseasytogetthemconfused
HowCanYouFixThis?
![Page 58: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/58.jpg)
ThreeNodeNetwork
x
y
z
2 1
7
x y z
y
z
x y z
y
z
2 0 1
1 0
3 1 0
2 0 1
∞Poisoned reverse ∞
∞7
7
8
Poisoned reverse
![Page 59: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/59.jpg)
• Distancevectorprotocolscanconvergeslowly• Whilethesecornercasesarerare
• Theresultingconvergencedelayscanbesignificant
Convergence
![Page 60: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/60.jpg)
• Senddistancevectorsbasedontimers:
• EverysooftensendcompleteDVtoyourneighbors
• Follow“splithorizon”rule:• Ifuseneighborforpathtox,don’tsendaroutingentryforxtotheneighbor
• WhenanyvaluesinyourDVchange,sendupdates
• Onlysendelementsthatchanged
• Specialcases:• Poisoningtheroute:send∞ when no longer have path• Poisonreverse:send∞ to neighbor you go through for path
MoreCompleteVersionofProtocol
![Page 61: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/61.jpg)
ThreeNodeNetwork
x
y
z
1
7
x y z
y
z 1 0
0 1
∞Poisoned reverse∞Poisoning route
![Page 62: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/62.jpg)
• Poisoningandsplithorizonhavesimilargoals
• Buttheyareusedindifferentcontexts
• Anditiseasytogetthemconfused
Poisoning,SplitHorizon,etc.
![Page 63: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/63.jpg)
• Splithorizononlyworkswhensendingfullupdates
• Silenceaboutrouteisinterpretedaslackofroute• Whichonlymakessensewhensendingfullupdate
• Ifalwayssendfullupdates,noneedforpoison
• Lackofroutetodestinationhasclearmeaning
• Don’tsendthosepacketstome!
• CouldbebecauseIhavenoroute,orbecauseOhavearoutethroughyou
SplitHorizon:WhenandWhy
![Page 64: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/64.jpg)
• Poisonnecessarywhensendingpartialupdates
• Silencewithpartialupdatesmeansnochange
• Itdoesnotmean“noroute”
• Mustexplicitlytellneighborsnottouseroute
• Poisoningaroute:tellingthetruthaboutabsenceofpath• Poisonreverse:haveapath,butlieaboutitsinceitgetsthroughthatneighbor
• Butonlyhavetopoisonifyouhaveeveradvertisedthatroute!
Poison:WhatandWhy
![Page 65: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/65.jpg)
• Whynotalwayspoisoning?
• Nopossibleconfusion• Veryclearimplementation
• ConsiderthecaseofBerkeley’sedgerouter• Doesitwanttoadvertiseallroutesintheuniversetothenext-hopexternalrouter
• Allofthesepaths(exceptBerkeleydestinations)alwaysgothroughthatrouter
• Easierandmoreefficienttojustbesilentaboutthem
• Youneveradvertisetheseroutes,soyouneverhavetopoison
WhyUseSplitHorizonAtAll?
![Page 66: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/66.jpg)
• IfIpostanewlectureschedule,anditcontainsnomidterm,youknow
thatthereisnomidterm
• IfIpostasmallchangetothelectureschedule,thefactthatIdonot
mentionamidtermdoesnotimplythatthereisnomidterm
• Wouldhavetoexplicitlysaythemidtermwascancelled
• ButifI’venevermentionedmidtermsinmyfullschedule,youcanassume
thatthereisstillnomidtermifImakeaminorchangetomyschedule
ExampleinRealLife
![Page 67: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/67.jpg)
• Whenadvertisetoneighbors,sendthemyourpaths
• Whythismightbehelpful?
• Thispreventsloops,evenwhennotminimizingmetric
• Looppreventionisnowseparatefromroutinggoal
• Whatfoalsmightthisaccommodate?
• Policychoices
PathVector
![Page 68: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/68.jpg)
• Everyroutercanmakeitsowndecisionsabout:
• Whichofitsneighborspathstouse(ifany)
• Whichofitspathstotelleachneighbor(ifany)
• Whatcouldgowrongwithsuchanalgorithm?
• Gotalktoyourfriendsforafewminutes
• ThenI’llaskforvolunteers
WhatMightGoWrongWithPV?
![Page 69: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/69.jpg)
• Lackofconnectivity• IfBerkeleyrefusestouseroutesfromStanford,mightnotbeableto
reachsomeplacesintheInternet
• Lackofconvergence:• Theroutingalgorithmisnotguaranteedtoconverge
• Willdiscussthiswhenwegettointerdomainrouting
PossibleIssues
![Page 70: lecture11-routing-link-state-distance-vector · 2018-03-06 · Goals for Today’s Lecture • Learning about Routing Protocols • Link State (Global view) • Distance Vector (Local](https://reader034.fdocuments.us/reader034/viewer/2022042204/5ea549c56768553c49490992/html5/thumbnails/70.jpg)
• Link-State:• Globalflood:eachrouter’slink-state(#ports)• Senditonceperlinkevent,orperiodically
• DistanceVector:• Sendlongervector(#dest)justtoneighbors
• Butmightenduptriggeringtheirupdates
• SenditeverytimeDVchanges(whichcanbeoften)
• Tradeoff:• LS:Senditeverywhereandbedoneinpredictabletime
• DV:Sendlocally,andperhapsiterateuntilconvergence
ComparisonofScalability