lecture10-SPT-routing-fundamentals - Cornell University · Fundamentals of Rou4ng Rachit Agarwal....

Post on 22-Aug-2020

1 views 0 download

Transcript of lecture10-SPT-routing-fundamentals - Cornell University · Fundamentals of Rou4ng Rachit Agarwal....

ComputerNetworks:ArchitectureandProtocols

CS4450

Lecture10FundamentalsofRou4ng

RachitAgarwal

2

GoalsforToday’sLecture

• Recap:WhyNetworkLayer?

• Recap:TherightwaytothinkaboutRoutingTables…

• Correctnessdefinitionforroutingtables

• OurfirstNetworkLayerProtocol:LinkState

3

Recapfromlastlecture

• Whynotjustusespanningtreesacrosstheentirenetwork?

• Easytodesignroutingalgorithmsfor(spanning)trees

• Step1:Sourcenode“floods”itspacketonitsspanningtreelinks

• Step2:Wheneveranodereceivesapacket:

• Forwardsincomingpacketouttoalllinksotherthantheonethatsentthepacket

Recap:Whydoweneednetworklayer?

Recap:FloodingExample

Source

DesMnaMon

1

3

2

7

6

5

4

Eventuallyallnodesarecovered

Onecopyofpacketdeliveredtodes4na4on

1

2

4

7

5

6

• Whynotjustusespanningtreesacrosstheentirenetwork?

• Easytodesignroutingalgorithmsfor(spanning)trees

• Step1:Sourcenode“floods”itspacketonitsspanningtreelinks

• Step2:Wheneveranodereceivesapacket:

• Forwardsincomingpacketouttoalllinksotherthantheonethatsentthepacket

• Amazingproperties:

• Noroutingtablesneeded!• Nopacketswilleverloop.• Atleast(andexactly)onepacketmustreachthedestination

• Assumingnofailures

Recap:Whydoweneednetworklayer?

Recap:Threefundamentalissues!

Source

DesMnaMon

1

3

2

7

6

5

4

1

2

4

7

5

6

Issue1:Eachhosthastodounnecessarypacketprocessing!(todecidewhetherthepacketisdes4nedtothehost)

Source

DesMnaMon

1

3

2

7

6

5

4

Recap:Threefundamentalissues!

Issue2:Higherlatency!(Thepacketsunnecessarilytraversemuchlongerpaths)

Source

DesMnaMon

1

3

2

7

6

5

4

Recap:Threefundamentalissues!

Issue3:Wastedbandwidth!(2-6and3-1packetsunnecessarilyhavetosharebandwidth)

Questions?

• Networklayerperforms“routing”ofpacketstoalleviatetheseissues

• Usesroutingtables

• Letsunderstandroutingtablesfirst

Whydoweneedanetworklayer?

WhatpathwillapackettakefromCornelltoMIT?

• Routingtablesallowfindingpathfromsourcetodestination

RoutingPacketsviaRoutingTables

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3

• Findingpathforapacketfromsourcetodestination

RoutingPacketsviaRoutingTables

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3

HowtospecifywhetherthepacketshouldtakePath1orPath2?

EachSwitchstoresatableindica4ngthenexthopforcorrespondingdes4na4onofapacket(calledarou4ngtable)

• SupposepacketfollowsPath1:Cornell-S#1-S#3-MIT

RoutingTable

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3L1

L2 L3

L4

L5 L6

DESTINATION NEXTHOP

CORNELL L1

MIT L3

HARVARD L4

DESTINATION NEXTHOP

CORNELL L2

MIT L5

HARVARD L5

DESTINATION NEXTHOP

CORNELL L5

MIT L6

HARVARD L3

Seesomethinginteres4ng?

• Letsfocusononedestination-MIT

RoutingTable:Therightwaytothinkaboutthem

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3L1

L2 L3

L4

L5 L6

DESTINATION NEXTHOP

CORNELL L1

MIT L3

HARVARD L4

DESTINATION NEXTHOP

CORNELL L2

MIT L5

HARVARD L5

DESTINATION NEXTHOP

CORNELL L5

MIT L6

HARVARD L3

Rou4ngtableentriesforapar4culardes4na4onforma(directed)spanningtreewiththatdes4na4onastheroot!!!!

• Letsfocusononedestination-MIT

RoutingTable:Therightwaytothinkaboutthem

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3L1

L2 L3

L4

L5 L6

DESTINATION NEXTHOP

CORNELL L1

MIT L3

HARVARD L4

DESTINATION NEXTHOP

CORNELL L2

MIT L5

HARVARD L5

DESTINATION NEXTHOP

CORNELL L5

MIT L6

HARVARD L3

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

• RoutingProtocols• “n”spanningtreeprotocolsrunninginparallel

RoutingTable:Therightwaytothinkaboutthem

• Globalroutingstateisvalidif:• italwaysresultsindeliverpacketstotheirdestinations

• GoalofRoutingProtocols• Computeavalidstate

• Buthowtotellifaroutingstateisvalid?…• Thinkaboutit,whatcouldmakeroutingincorrect?

“ValidRoutingTables”(routingstate)

• Globalroutingstatevalidifandonlyif:• Therearenodeadends(otherthandestination)• Therearenoloops

• Adeadendiswhenthereisnooutgoinglink• Apacketarrives,but..

• theroutingtabledoesnothaveanoutgoinglink• Andthatnodeisnotthedestination

• Aloopiswhenapacketcyclesaroundthesamesetofnodesforever

ValidityofaRoutingState

• SupposepacketwantstogofromCornelltoMITusinggivenstate:

Example:RoutingwithDeadEnds

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3L1

L2 L3

L4

L5L6

DESTINATION NEXTHOP

CORNELL L1

MIT L2

HARVARD L4

DESTINATION NEXTHOP

CORNELL L2

HARVARD L5

DESTINATION NEXTHOP

CORNELL L5

MIT L6

HARVARD L3

NoforwardingdecisionforMIT!

DeadEnd!PacketneverreachesMIT

Example:RoutingwithLoops

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3L1

L2 L3

L4

L5L6

DESTINATION NEXTHOP

CORNELL L1

MIT L3

HARVARD L4

DESTINATION NEXTHOP

CORNELL L2

MIT L2

HARVARD L5

DESTINATION NEXTHOP

CORNELL L5

MIT L5

HARVARD L3

• SupposepacketwantstogofromCornelltoMITusinggivenstate:

Loop!PacketneverreachesMIT

• Howcanweverifygivenroutingstateisvalid?

• Howcanweproducevalidroutingstate?

TwoQuestions

• Checkvalidityofroutingstateforonedestinationatatime…

• Foreachnode:• Marktheoutgoinglinkwitharrowfortherequireddestination

• Therecanonlybeoneateachnode

• Eliminatealllinkswithnoarrows

• Lookwhat’sleft.Stateisvalidifandonlyif• Remaininggraphisaspanningtreewithdestinationassink

• Whyisthistrue?

• Tree->Noloops• Spanning(tree)->Nodeadends

CheckingValidityofaRoutingState

Example1

Example1:PickDestination

Example1:PutArrowsonOutgoingPorts

Example1:RemoveunusedLinks

LeavesSpanningTree:Valid

Example2:

Example2:

Isthisvalid?

Example3:

Example3:

Isthisvalid?

• Simpletocheckvalidityofroutingstateforaparticulardestination

• Deadends:nodeswithoutarrows

• Loops:obvious,disconnectedfromdestinationandrestofthegraph

CheckingValidityofaRoutingState

• Howcanweverifygivenroutingstateisvalid?

• Howcanweproducevalidroutingstate?

TwoQuestions

• Easytoavoiddeadends

• Avoidingloopsishard

• Thekeydifferencebetweenroutingprotocolsishowtheyavoidloops!

• Trytothinkaloopavoidancedesignforfiveminutes

CreatingValidRoutingState

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

• Obtainaglobalview:• E.g.,Linkstate

• Distributedroutecomputation:

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

Fourflavorsofprotocols

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

#1:CreateaTree

• Removeenoughlinkstocreateatreecontainingallnodes

• Soundsfamiliar?Spanningtrees!

• Ifthetopologyhasnoloops,thenjustmakesurenotsendingpacketsbackfromwheretheycame

• Thatcausesanimmediateloop

• Therefore,ifnoloopsintopologyandnoformationofimmediateloopsensuresvalidrouting

• However…threechallenges• Unnecessaryhostresourcesusedtoprocesspackets• Highlatency• Lowbandwidth(utilization)

#1:CreateaTreeOutofTopology

Globalview

TwoAspectsofGlobalViewMethod

• Protocol:Whatwefocusontoday

• Wheretocreateglobalview

• Howtocreateglobalview• Disseminatingroutecomputation(ifnecessary)

• Whentorunroutecomputation

• Algorithm:computingloop-freepathsongraph

• Straightforwardtocomputelowestcostpaths

• UsingDijkstra’salgorithm(pleasestudy;algorithmscourse)

• Wewon’tspendtimeonthis

Wheretocreateglobalview?

• Oneoption:Centralserver• Collectsaglobalview• Computestheroutingtableforeachnode

• “Installs”routingtablesateachnode• Software-definedNetworks:laterincourse

• Secondoption:Ateachrouter• Eachroutercollectsaglobalview• ComputesitsownroutingtableusingLink-stateprotocol

• Link-stateroutingprotocol• OSPFisaspecificimplementationoflink-stateprotocol

• IETFRFC2328(IPv4)or5340(IPv6)

OverviewofLink-StateRouting

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

• Arouterfloodsitslinkstatetoallotherrouters• Usesaspecialpacket—LinkStateAnnouncements(LSA)

• Announcementisdeliveredtoallnodes(nextslide)

• Hence,everyrouterlearnstheentirenetworkgraph

• Runsroutecomputationlocally

• Computingleastcostpathsfromthemtoallothernodes

• E.g.,usingDijkstra’salgorithm

HowdoesFloodingWork?

• “Linkstateannouncement”(LSA)arrivesonalinkatarouter

• Thatrouter:• Remembersthepacket

• Forwardsthepacketoutallotherlinks• Doesnotsenditouttheincominglink

• Why?

• Ifapreviouslyreceivedannouncementarrivesagain…

• Routerdropsit(noneedtoforwardagain)

Link-StateRouting

S1

S2

S3

S7S5

S6

S4

Host A

Host B

Host C

Host DHost E

EachNodeThenhasaGlobalView

S1

S2

S3

S7S5

S6

S4

Host A

Host B

Host C

Host DHost E

WhentoInitiateFloodingofannouncements?

• Topologychange• Linkfailures• Linkrecovery

• Configurationchange• Linkcostchange(whywouldonechangelinkcost?)

• Periodically• Refreshthelink-stateinformation

• Typically(say)30minutes

• Correctsforpossiblecorruptionofdata

MakingFloodsReliable

• ReliableFlooding• Ensureallnodesreceivesamelinkstateannouncements

• Noannouncementsdropped

• Ensureallnodesusethelatestversion

• Supposewecanimplementreliableflooding.Howcanitstillfail?

• Canyoueverhaveloopswithlink-staterouting?

• Again:Canyoueverhaveloopswithlink-staterouting?

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!

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!

Convergence

• Allroutershaveconsistentroutinginformation

• E.g.,allnodeshavingthesamelink-statedatabase

• Forwardingisconsistentafterconvergence• Allnodeshavethesamelink-statedatabase

• Allnodesforwardpacketsonsamepaths

• Butwhilestillconverging,badthingscanhappen

TimetoReachConvergence

• Sourcesofconvergencedelay?• Timetodetectfailure

• Timetofloodlink-stateinformation(~longestRTT)

• Timetorecomputeforwardingtables

• Performanceproblemsduringconvergenceperiod?

• Deadends• Loopingpackets• Andsomemorewe’llseelater….

LinkStateisConceptuallySimple

• Everyonefloodslinksinformation

• Everyonethenknowsgraphofthenetwork

• Everyoneindependentlycomputespathsonthegraph

• Allthecomplexityisinthedetails

• Oftengettingaglobalviewofthenetworkisinfeasible• Distributedalgorithmstocomputefeasibleroute

• ApproachA:Findingoptimalrouteformaximizing/minimizingametric

• ApproachB:Findingfeasiblerouteviaexchangingpathsamongswitches

#3:DistributedRouteComputation

Nextlecture!HappyFebruaryBreak!!