lecture11-routing-link-state-distance-vector · 2018-03-06 · goals for today’s lecture •...

70
Computer Networks: Architecture and Protocols CS4450 Lecture 11 Rou+ng: Deep Dive Spring 2018 Rachit Agarwal

Upload: others

Post on 24-Apr-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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

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

• 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

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

• 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

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

• 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

• 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

• 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

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

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

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

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

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

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

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

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

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

• 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

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

• 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

• 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

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

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

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

• 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

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

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

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

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

• 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

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

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

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

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

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

• 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

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

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

• 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

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

• 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

• 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

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

• 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

• 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

• 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

• 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

• 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

• 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

• 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

• 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

• Link-State:• Globalflood:eachrouter’slink-state(#ports)• Senditonceperlinkevent,orperiodically

• DistanceVector:• Sendlongervector(#dest)justtoneighbors

• Butmightenduptriggeringtheirupdates

• SenditeverytimeDVchanges(whichcanbeoften)

• Tradeoff:• LS:Senditeverywhereandbedoneinpredictabletime

• DV:Sendlocally,andperhapsiterateuntilconvergence

ComparisonofScalability