Transcript

ComputerNetworks:ArchitectureandProtocols

CS4450

Lecture12Intra-domainRou3ng:DeepDive

RachitAgarwal

Announcements

• ProblemSet3willbereleasedtoday

• Prelim:28thMarch,In-class

• Nobodyshouldbeinconflict• Letmeknowimmediatelyifthereisaconflict

• Project1willbeoutnextweek• Sameidea:dowhenyougettime(nodeadline)

• Wewillprovideallthehelp

• Weareatastagewhereyouhaveastrongfoundationinnetworks

• Sharingnetworks,architecturalprinciples,designgoals• And,youdon’trealizeit,butyouunderstandmanynewtradeoffs

2

GoalsforToday’sLecture

• LearningaboutRoutingProtocols

• LinkState(Globalview,Localcomputation)

• DistanceVector(Localview,Localcomputation)

• Maintainsanity:itsoneofthe“harder”lectures

• I’lltrytomakeit-less-hard,but…

• Payattention• Reviewagaintomorrow

• Workoutafewexamples

3

Recapfromlastfewlectures

• UsedinswitchedEthernettoavoidbroadcaststorm

• CanbeusedforroutingontheInternet(via“flooding”onspanningtree)

• Threefundamentalissues:

• Unnecessaryprocessingatendhosts(thatarenotthedestination)• Higherlatency• Loweravailablebandwidth

Recap:SpanningTreeProtocol…

• Routingtable:• Eachswitch:thenexthopforeachdestinationinthenetwork

• Routingstate:collectionofroutingtablesacrossallnodes

• Twoquestions:• Howcanweverifygivenroutingstateisvalid?• Howcanweproducevalidroutingstate?

• Globalroutingstatevalidifandonlyif:• Therearenodeadends(otherthandestination)• Thereareno“persistent”loops

Recap:RoutingTables

• Routingtablesarenothingbut….• Acollectionof(directed)spanningtree• Oneforeachdestination

• RoutingProtocols• Mechanismstoproducingvalidroutingtables

• Whatwewillsee:

• “n”spanningtreeprotocolsrunninginparallel

Recap:TherightwaytothinkaboutRoutingTables

• CreateTree,routeontree• E.g.,Spanningtreeprotocol(switchedEthernet)• Good:easy,no(persistent)loops,nodeadends• Not-so-good:unnecessaryprocessing,highlatency,lowbandwidth

• Obtainaglobalview:• E.g.,Linkstate(lastlecture)

• Distributedroutecomputation:

• E.g.,Distancevector• E.g.,BorderGatewayProtocol

Recap:Threeflavorsofprotocolsforproducingvalidroutingstate

• Easytoavoiddeadends

• Avoidingloopsishard

• Thekeydifferencebetweenroutingprotocolsishowtheyavoidloops!

Recap:ProducingValidRoutingState

Recap:GlobalView

• Questions:• Wheretocreateglobalview

• Howtocreateglobalview• Whentorunroutecomputation

Recap:Wheretocreateglobalview?

• Oneoption:Centralserver• Collectsaglobalview• Computestheroutingtableforeachnode

• “Installs”routingtablesateachnode• Software-definedNetworks:laterincourse

• Secondoption:Ateachrouter• Eachroutercollectsaglobalview• ComputesitsownroutingtableusingLink-stateprotocol

• Link-stateroutingprotocol• OSPFisaspecificimplementationoflink-stateprotocol

• IETFRFC2328(IPv4)or5340(IPv6)

Recap:OverviewofLink-StateRouting

• Everyrouterknowsitslocal“linkstate”• Knowsstateoflinkstoneighbors• Up/down,andassociatedcost

• Arouterfloodsitslinkstatetoallotherrouters• Usesaspecialpacket—LinkStateAnnouncements(LSA)

• Announcementisdeliveredtoallnodes(nextslide)

• Hence,everyrouterlearnstheentirenetworkgraph

• Runsroutecomputationlocally

• Computingleastcostpathsfromthemtoallothernodes

• E.g.,usingDijkstra’salgorithm

Recap:Link-StateRouting

S1

S2

S3

S7S5

S6

S4

Host A

Host B

Host C

Host DHost E

Recap:EachNodeThenhasaGlobalView

S1

S2

S3

S7S5

S6

S4

Host A

Host B

Host C

Host DHost E

Recap:WhentoInitiateFloodingofannouncements?

• Topologychange• Linkfailures• Linkrecovery

• Configurationchange• Linkcostchange(whywouldonechangelinkcost?)

• Periodically• Refreshthelink-stateinformation

• Typically(say)30minutes

• Correctsforpossiblecorruptionofdata

Recap: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!

Recap: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!

Questions?

ConvergenceinLink-StateRouting

• Eventually,allroutershaveconsistentroutinginformation

• E.g.,allnodeshavingthesamelink-statedatabase

• Here,eventuallymeans“ifnothingchangesafterawhile”

• Forwardingisconsistentafterconvergence• Allnodeshavethesamelink-statedatabase

• Allnodesforwardpacketsonsamepaths

• Butwhilestillconverging,badthingscanhappen

TimetoReachConvergence

• Sourcesofconvergencedelay?• Timetodetectfailure

• Timetofloodlink-stateinformation(~longestRTT)

• Timetorecomputeforwardingtables

• Performanceproblemsduringconvergenceperiod?

• Deadends• Loopingpackets• Andsomemorewe’llseelater….

Finalwords:LinkStateisConceptuallySimple

• Everyonefloodslinksinformation

• Everyonethenknowsgraphofthenetwork

• Everyoneindependentlycomputespathsonthegraph

• Allthecomplexityisinthedetails

DistributedRouteComputation

• Eachnodecomputestheoutgoinglinks(foreachdestination)basedon:

• Locallinkcosts• Informationadvertisedbyneighbors

• Algorithmsdifferinwhattheseexchangescontain

• Distance-vector:justthedistance(andnexthop)toeachdestination• Pathvector:theentirepathtoeachdestination

• Wewillfocusondistance-vectorfornow

DistributedComputationofRoutes

Recall:RoutingTables=CollectionofSpanningTrees

24

• Canweusethespanningtreeprotocol(withmodifications)?

• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY

• InitiallyeachswitchXannounces(X,0,X)toitsneighbors

Distancevector:acollectionof“n”STPinparallel

LetsruntheProtocolonthisexample

(destination=1)

Round1

Receive Send

1 (1,0,1)

2

3

4

5

6

7

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

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

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)

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)

• Thesameprotocol/algorithmappliestoalldestinations

• Eachnodeannouncesdistancetoeachdest• Iam4hopsawayfromnodeA

• Iam6hopsawayfromnodeB

• Iam3hopsawayfromnodeC

• …

• Nodesareexchangingavectorofdistances

WhynotSpanningTreeProtocol?WhyDistance“Vector”?

TowardsDistanceVectorProtocol(withnofailures)

32

• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY

• InitiallyeachswitchXannounces(X,0,X)toitsneighbors

• Switchesupdatetheirview• Uponreceivingmessage(Y,d,Z)fromZ,checkY’sid

• IfY’sid<currentroot:setrootdestination=Y

• Switchescomputetheirshortestdistancefromtherootdestination

• Ifcurrent_distance_to_Y>d+costoflinktoZ:• updatecurrent_distance_to_Y=d+costoflinktoZ

• IfrootchangedORshortestdistancetotherootdestinationchanged,sendallneighborsupdatedmessage(Y,d+c,X)

GroupExercise:

LetsruntheProtocolonthisexample

2

1

3

2 1

7

Round1

Receive Send

1 (1,0,1)

2 (2,0,2)

3 (3,0,3)

2

1

3

2 1

7

Round2

Receive Send

1(1,0,1)

(2,0,2),(3,0,3)

(2,2,1),(3,1,1)

2(2,0,2)

(1,0,1),(3,0,3)

(1,2,2),(3,7,2)

3(3,0,3)

(1,0,1),(2,0,2)

(1,1,3),(2,7,3)

2

1

3

2 1

7

Round3

Receive Send

1(1,0,1)(2,2,1),(3,1,1)

(1,2,2),(3,7,2),(1,1,3),(2,7,3)

2(1,2,2),(2,0,2),(3,7,2)

(2,2,1),(3,1,1),(1,1,3),(2,7,3)

(3,3,2)

3(1,1,3),(2,7,3),(3,0,3)

(2,2,1),(3,1,1),(1,2,2),(3,7,2)

(2,3,3)

2

1

3

2 1

7

Round4

Receive Send

1(1,0,1)(2,2,1),(3,1,1)

(3,3,2),(2,3,3)

2(1,2,2),(2,0,2),(3,3,2)

(2,3,3)

3(1,1,3),(2,3,3),(3,0,3)

(3,3,2)

2

1

3

2 1

7

TowardsDistance-vectorprotocolwithnext-hops(nofailures)

38

• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY

• InitiallyeachswitchXannounces(X,0,X)toitsneighbors

• Switchesupdatetheirview• Uponreceivingmessage(Y,d,Z)fromZ,checkY’sid

• IfY’sid<currentroot:setrootdestination=Y

• Switchescomputetheirshortestdistancefromtherootdestination

• Ifcurrent_distance_to_Y>d+costoflinktoX:• updatecurrent_distance_to_Y=d• updatenext_hop_to_destination=X

• IfrootchangedORshortestdistancetotherootdestinationchanged,sendallneighborsupdatedmessage(Y,d+c,X)

GroupExercise:

LetsruntheProtocolonthisexample

(thistimewithnext-hops)

2

1

3

2 1

7

Round1

Receive Send Next-hops

1 (1,0,1) [-]

2 (2,0,2) [-]

3 (3,0,3) [-]

2

1

3

2 1

7

Round2

Receive Send Next-hops

1(1,0,1)

(2,0,2),(3,0,3)

(2,2,1),(3,1,1)

[-,2,3]

2(2,0,2)

(1,0,1),(3,0,3)

(1,2,2),(3,7,2)

[1,-,3]

3(3,0,3)

(1,0,1),(2,0,2)

(1,1,3),(2,7,3)

[1,2,-]

2

1

3

2 1

7

Round3

Receive Send Next-hops

1(1,0,1)(2,2,1),(3,1,1)

(1,2,2),(3,7,2),(1,1,3),(2,7,3)

[-,2,3]

2(1,2,2),(2,0,2),(3,7,2)

(2,2,1),(3,1,1),(1,1,3),(2,7,3)

(3,3,2)[1,-,1]

3(1,1,3),(2,7,3),(3,0,3)

(2,2,1),(3,1,1),(1,2,2),(3,7,2)

(2,3,3)[1,1,-]

2

1

3

2 1

7

Round4

Receive Send Next-hops

1(1,0,1)(2,2,1),(3,1,1)

(3,3,2),(2,3,3)

[-,2,3]

2(1,2,2),(2,0,2),(3,3,2)

(2,3,3)[1,-,1]

3(1,1,3),(2,3,3),(3,0,3)

(3,3,2)[1,1,-]

2

1

3

2 1

7

• Thesamealgorithmappliestoalldestinations

• Eachnodeannouncesdistancetoeachdest• Iamdistanced_AawayfromnodeA

• Iamdistanced_BawayfromnodeB

• Iamdistanced_CawayfromnodeC

• …

• Nodesareexchangingavectorofdistances

WhynotSpanningTreeProtocol?WhyDistance“Vector”?

DistanceVectorProtocol

45

• Messages(Y,d,X):ForrootY;FromnodeX;advertisingadistancedtoY

• InitiallyeachswitchXinitializesitsroutingtableto(X,0,-)anddistanceinfinitytoallotherdestinations

• Switchesannouncetheirentiredistancevectors(routingtablew/0nexthops)

• Uponreceivingaroutingtablefromanode(sayX),eachnodedoes:

• ForeachdestinationYintheannouncement(distance(X,Y)=d):

• Ifcurrent_distance_to_Y>d+costoflinktoX:• updatecurrent_distance_to_Y=d• updatenext_hop_to_destination=X

• Ifshortestdistancetoanydestinationchanged,sendallneighborsyourdistancevectors

• Protocol:• Exchangingthatroutinginformationwithneighbors

• Whatandwhenforexchanges

• RIPisaprotocolthatimplementsDV(IETFRFC2080)

• Algorithm:

• Howtousetheinformationfromyourneighborstoupdateyour

ownroutingtables?

TwoAspectstoThisApproach

GroupExercise:

LetsruntheProtocolagainonthisexample

(thistimewithdistancevectors)

2

1

3

2 1

7

Round1

2

1

3

2 1

7

distance next-hop1 0 -2 infinity3 infinity

distance next-hop1 infinity2 0 -3 infinity

distance next-hop1 infinity2 infinity3 0 -

Round2

2

1

3

2 1

7

distance next-hop1 0 -2 2 23 1 3

distance next-hop1 2 12 0 -3 7 3

distance next-hop1 1 12 7 23 0 -

Round3

2

1

3

2 1

7

distance next-hop1 0 -2 2 23 1 3

distance next-hop1 2 12 0 -3 3 1

distance next-hop1 1 12 3 13 0 -

Round4

2

1

3

2 1

7

distance next-hop1 0 -2 2 23 1 3

distance next-hop1 2 12 0 -3 3 1

distance next-hop1 1 12 3 13 0 -

• Algorithm:

• NodesuseBellman-Fordtocomputedistances

• Protocol• Nodesexchangedistancevectors• Updatetheirownroutingtables• Andexchangeagain…• Details:whentoexchange,whattoexchange,etc….

FromAlgorithmtoProtocol

• Whendoyousendmessages?

• Whenanyofyourdistancesd(u,v)change

• Whataboutwhenc(u,v)changes?

• Periodically,toensureconsistencybetweenneighbors

• Whatinformationdoyousend?

• Couldsendentirevector• Orjustupdatedentries

• Doyousendeveryonethesameinformation

• Considerthefollowingslides

OtherAspectsofProtocol

Threenodenetwork

2

1

3

2 1

7

distance next-hop1 0 -2 2 23 1 3

distance next-hop1 1 12 3 13 0 -

Threenodenetwork

2

1

3

2 1

7

distance next-hop1 0 -2 infinity3 1 3

distance next-hop1 1 12 3 13 0 -

Round1

2

1

3

2 1

7

distance next-hop1 0 -2 4 33 1 3

distance next-hop1 1 12 3 13 0 -

Round2

2

1

3

2 1

7

distance next-hop1 0 -2 4 33 1 3

distance next-hop1 1 12 5 13 0 -

Round3

2

1

3

2 1

7

distance next-hop1 0 -2 6 33 1 3

distance next-hop1 1 12 5 13 0 -

Round4

2

1

3

2 1

7

distance next-hop1 0 -2 6 33 1 3

distance next-hop1 1 12 7 13 0 -

COUNT-TO-INFINITYproblem!!!!

Count-to-infinityproblem

2

1

3

2 1

7

distance next-hop1 0 -2 6 33 1 3

distance next-hop1 1 12 7 13 0 -

Notjustduetofailures:Canhappenwithchangesincost!

• Donotadvertiseapathbacktothenodethatisthenexthoponthepath• Called“splithorizon”• Tellingthemaboutyourentrygoingthroughthem

• Doesn’ttellthemanythingnew

• Perhapsmisleadsthemthatyouhaveanindependentpath

• Anothersolution:ifyouareusinganext-hop’spath,then:• Tellthemnottouseyourpath(bytellingthemcostofinfinity)

• Called“poisonedreverse”

HowCanYouFixThis?

• Distancevectorprotocolscanconvergeslowly• Whilethesecornercasesarerare

• Theresultingconvergencedelayscanbesignificant

Convergence

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

• DistanceVector:• Sendlongervector(#dest)justtoneighbors

• Butmightenduptriggeringtheirupdates

• SenditeverytimeDVchanges(whichcanbeoften)

• Tradeoff:• LS:Senditeverywhereandbedoneinpredictabletime

• DV:Sendlocally,andperhapsiterateuntilconvergence

ComparisonofScalability

EndofDistance-vectorRouting

NowyouknowjustasmuchasmyPhDstudents:-)