lecture09-switched-ethernet -network-layer › courses › cs4450 › 2019sp ›...

62
Computer Networks: Architecture and Protocols CS4450 Lecture 9 Spanning Tree Protocol Why Network Layer? Rachit Agarwal

Upload: others

Post on 06-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

ComputerNetworks:ArchitectureandProtocols

CS4450

Lecture9SpanningTreeProtocolWhyNetworkLayer?

RachitAgarwal

Page 2: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

GoalsforToday’sLecture

• FinishSpanningTreeProtocol

• Whydoweneednetworklayer?

• WhynotjustuseswitchedEthernetacrosstheInternet?

2

Page 3: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

RecapofLinkLayersofar

3

Page 4: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• TraditionalLinkLayer:BroadcastEthernet• CSMA/CD

• Randomaccessonabroadcastchannel

• ExponentialBackoff• WhyFrames?

• Toincorporatesentinelbitsforidentifyingframestart/end

• Toincorporatelinklayersourceanddestinationnames

• ToincorporateCRCforcheckingcorrectnessofreceivedframes

• ModernLinkLayer:SwitchedEthernet

• Why?

• ScalabilitylimitsoftraditionalEthernet

• Why?

• Detectingcollisionsonabroadcastchannel

Recap:Linklayer

4

Page 5: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Recap:SwitchedEthernet

• Enablesconcurrentcommunication

• HostAcantalktoC,whileBtalkstoD• Nocollisions->noneedforCSMA,CD

• Noconstraintsonlinklengthsorframesize

5

Page 6: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Recap:Broadcaststorm

6

Page 7: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Recap:AvoidingBroadcastStormProblem

7

Gettingridofloops

using

SpanningTreeProtocol

Page 8: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Recap:SpanningTreedefinition

• Subgraphthatincludesallverticesbutcontainsnocycles• Linksnotinthespanningtreearenotusedinforwardingframes

8

Page 9: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Questions?

Page 10: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

AlgorithmhasTwoAspects…

• Pickaroot:• Picktheonewiththesmallestidentifier(MACname/address)

• Computetheshortestpathstotheroot

• Onlykeepthelinksontheshortestpath• Breaktiesinsomeway

• soweonlykeeponeshortestpathfromeachnode

• Oneapproach:Choosethepathvianeighborswitchwiththesmallestidentifier

• Ethernet’sspanningtreeconstructiondoesbothwithasinglealgorithm

10

Page 11: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

StepsinSpanningTreeProtocol(assumingalldelays=1)• Messages(Y,d,X)

• ProposingrootY;fromnodeX;advertisingadistancedtoY

• Initiallyeachswitchproposesitselfastheroot• thatis,switchXannounces(X,0,X)toitsneighbors

• Switchesupdatetheirview;eachswitchZ:• Uponreceivingmessage(Y,d,X)fromX,checkY’sid

• IfY’sid<currentroot:setroot=Y• Setnext-hop=X

• Switchescomputetheirdistancefromtheroot;eachswitchZ:

• Shortestdistancetoroot=d+distancefromX=d+1

• IfrootchangedORshortestdistancetotherootchanged:• SwitchZsendsneighborsupdatedmessage(Y,d+1,Z)

11

Page 12: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

LetsruntheSpanningTreeProtocolonthisexample

(assumealllinkshave“distance”1)

Page 13: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Round1

Receive Send Next-hop

1 (1,0,1) 1

2 (2,0,2) 2

3 (3,0,3) 3

4 (4,0,4) 4

5 (5,0,5) 5

6 (6,0,6) 6

7 (7,0,7) 7

Page 14: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Round2Receive Send

Nexthop

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

2(2,0,2)(3,0,3),(4,0,4),(6,0,6),(7,0,7)

2

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

4(4,0,4) (2,0,2),(7,0,7) (2,1,4) 2

5(5,0,5) (1,0,1),(6,0,6) (1,1,5) 1

6(6,0,6) (2,0,2),(5,0,5) (2,1,6) 2

7(7,0,7) (2,0,2),(4,0,4) (2,1,7) 2

Page 15: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Round3Receive Send Nexthop

1 (1,1,3),(1,1,5) 1

2(1,1,3),(2,1,4),(2,1,6),(2,1,7)

(1,2,2) 3

3(1,1,3) 1

4(2,1,4) (2,1,7) 2

5(1,1,5) (2,1,6) 1

6(2,1,6) (1,1,5) (1,2,5) 5

7(2,1,7) (2,1,4) 2

Page 16: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Round4Receive Send Nexthop

1 1

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

3 (1,2,2) 1

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

5 (1,2,6) 1

6(1,2,6) (1,2,2) 5

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

Page 17: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Round5Receive Send

Nexthop

1 1

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

3 1

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

5 1

6 1

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

Page 18: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

AfterRound5:WehaveourSpanningTree

• 3-1• 5-1• 6-1• 2-3• 4-2• 7-2

18

Page 19: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Questions?

Page 20: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

SpanningTreeProtocol(++Incorporatingdistances)• Messages(Y,d,X)

• ProposingrootY;fromnodeX;advertisingadistancedtoY

• Initiallyeachswitchproposesitselfastheroot• thatis,switchXannounces(X,0,X)toitsneighbors

• Switchesupdatetheirview;eachswitchZ:• Uponreceivingmessage(Y,d,X)fromX,checkY’sid

• IfY’sid<currentroot:setroot=Y• Setnext-hop=X

• Switchescomputetheirdistancefromtheroot;eachswitchZ:

• Shortestdistancetoroot=d+distanceTo(X)

• IfrootchangedORshortestdistancetotherootchanged:• switchZsendsneighborsupdatedmessage(Y,d+distanceTo(X),Z)

20

Page 21: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Protocolmustreacttofailures

• Failureoftherootnode• Failureofswitchesandlinks

• Rootnodesendsperiodicannouncementmessages

• Fewpossibleimplementations,butthisissimpletounderstand

• Otherswitchescontinueforwardingmessages

• Detectingfailuresthroughtimeout(softstate)

• Ifnowordfromroot,timeoutandsenda(Y,0,Y)messagetoallneighbors(inthegraph)!

• Ifmultiplemessageswithanewrootreceived,sendmessage(Y,d,X)totheneighborsendingthemessage

21

SpanningTreeProtocol++(incorporatingfailures)

Page 22: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example:Supposelink2-4fails

• 4willsend(4,0,4)toallitsneighbors• 4willstopreceivingannouncementmessagesfromtheroot

• Why?

• Atsomepoint,7willrespondwith(1,3,7)

• 4willnowupdateto(1,4,4)andsendupdatemessage

• Newspanningtree!

22

Page 23: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Questions?

Page 24: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

24

TheendofLinkLayer….

Andthebeginningofnetworklayer:-D

Builtontopofreliabledelivery

Builtontopofbest-effortforwarding

Builtontopofbest-effortrouting

Builtontopofphysicalbittransfer

Page 25: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Whynotjustusespanningtreesacrosstheentirenetwork?

• Easytodesignroutingalgorithmsfor(spanning)trees

• Nodescan“flood”packettoallothernodes

Whydoweneedanetworklayer?

Page 26: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Sendspackettoeverynodeinthenetwork

• Step1:IgnorethelinksnotbelongingtotheSpanningTree

• Step2:Originatingnodesends“flood”packetouteverylink(onspanningtree)

• Step3:Sendincomingpacketouttoalllinksotherthantheonethatsentthepacket

FloodingonaSpanningTree

Page 27: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

FloodingExample

Source

Deshnahon

1

3

2

7

6

5

4

Page 28: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

FloodingExample

Source

Destination

1

3

2

7

6

5

4

Eventuallyallnodesarecovered

Onecopyofpacketdeliveredtodesdnadon

1

2

4

7

5

6

Page 29: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• There’sonlyonepathfromsourcetodestination

• Howdoyoufindthatpath?Ideas?

• Easytodesignroutingalgorithmsfortrees

• Nodescan“flood”packettoallothernodes

• Amazingproperties:

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

• Assumingnofailures

RoutingviaFloodingonSpanningTree…

Page 30: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Threefundamentalissues!

Source

Destination

1

3

2

7

6

5

4

1

2

4

7

5

6

Issue1:Eachhosthastodounnecessarypacketprocessing!(todecidewhetherthepacketisdesdnedtothehost)

Page 31: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Source

Destination

1

3

2

7

6

5

4

Threefundamentalissues!

Issue2:Higherlatency!(Thepacketsunnecessarilytraversemuchlongerpaths)

Page 32: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Source

Destination

1

3

2

7

6

5

4

Threefundamentalissues!

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

Page 33: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Questions?

Page 34: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Networklayerperforms“routing”ofpacketstoalleviatetheseissues

• Usesroutingtables

• Letsunderstandroutingtablesfirst

Whydoweneedanetworklayer?

Page 35: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

WhatpathwillapackettakefromCornelltoMIT?

• Routingtablesallowfindingpathfromsourcetodestination

RoutingPacketsviaRoutingTables

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3

Page 36: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Findingpathforapacketfromsourcetodestination

RoutingPacketsviaRoutingTables

Cornell

Harvard

MIT

Switch#1

Switch#2

Switch#3

HowtospecifywhetherthepacketshouldtakePath1orPath2?

Page 37: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

EachSwitchstoresatableindicadngthenexthopforcorrespondingdesdnadonofapacket(calledaroudngtable)

• 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

Page 38: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Seesomethinginteresdng?

• 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

Page 39: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Roudngtableentriesforapardculardesdnadonforma(directed)spanningtreewiththatdesdnadonastheroot!!!!

• 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

Page 40: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

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

• RoutingProtocols• “n”spanningtreeprotocolsrunninginparallel

RoutingTable:Therightwaytothinkaboutthem

Page 41: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Globalroutingstateisvalidif:• italwaysresultsindeliverpacketstotheirdestinations

• GoalofRoutingProtocols• Computeavalidstate

• Buthowtotellifaroutingstateisvalid?…• Thinkaboutit,whatcouldmakeroutingincorrect?

“ValidRoutingTables”(routingstate)

Page 42: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Globalroutingstatevalidifandonlyif:• Therearenodeadends(otherthandestination)• Therearenoloops

• Adeadendiswhenthereisnooutgoinglink• Apacketarrives,but..

• theroutingtabledoesnothaveanoutgoinglink• Andthatnodeisnotthedestination

• Aloopiswhenapacketcyclesaroundthesamesetofnodesforever

ValidityofaRoutingState

Page 43: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• 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

Page 44: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

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

Page 45: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Howcanweverifygivenroutingstateisvalid?

• Howcanweproducevalidroutingstate?

TwoQuestions

Page 46: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Checkvalidityofroutingstateforonedestinationatatime…

• Foreachnode:• Marktheoutgoinglinkwitharrowfortherequireddestination

• Therecanonlybeoneateachnode

• Eliminatealllinkswithnoarrows

• Lookwhat’sleft.Stateisvalidifandonlyif• Remaininggraphisaspanningtreewithdestinationassink

• Whyisthistrue?

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

CheckingValidityofaRoutingState

Page 47: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example1

Page 48: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example1:PickDestination

Page 49: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example1:PutArrowsonOutgoingPorts

Page 50: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example1:RemoveunusedLinks

LeavesSpanningTree:Valid

Page 51: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example2:

Page 52: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example2:

Isthisvalid?

Page 53: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example3:

Page 54: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Example3:

Isthisvalid?

Page 55: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Simpletocheckvalidityofroutingstateforaparticulardestination

• Deadends:nodeswithoutarrows

• Loops:obvious,disconnectedfromdestinationandrestofthegraph

CheckingValidityofaRoutingState

Page 56: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Howcanweverifygivenroutingstateisvalid?

• Howcanweproducevalidroutingstate?

TwoQuestions

Page 57: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Easytoavoiddeadends

• Avoidingloopsishard

• Thekeydifferencebetweenroutingprotocolsishowtheyavoidloops!

• Trytothinkaloopavoidancedesignforfiveminutes

CreatingValidRoutingState

Page 58: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Removeenoughlinkstocreateatreecontainingallnodes

• Soundsfamiliar?Spanningtrees!

• Ifthetopologyhasnoloops,thenjustmakesurenotsendingpacketsbackfromwheretheycame

• Thatcausesanimmediateloop

• Therefore,ifnoloopsintopologyandnoformationofimmediateloopsensuresvalidrouting

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

#1:CreateTreeOutofTopology

Page 59: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Aglobalviewofthenetworkmakescomputingpathswithoutloopseasy

• Manygraphalgorithmsforcomputingloop-freepaths

• Fore.g.,Dijkstra’sAlgorithm

• Gettingtheglobalviewofnetworkischallenging!

#2:ObtainaGlobalView

Page 60: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

• Oftengettingaglobalviewofthenetworkisinfeasible• Distributedalgorithmstocomputefeasibleroute

• ApproachA:Findingoptimalrouteformaximizing/minimizingametric

• ApproachB:Findingfeasiblerouteviaexchangingpathsamongswitches

#3:DistributedRouteComputation

Page 61: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

WelcometotheNetworkLayer!

• THEfunctionality:deliveringthedata

• THEprotocol:InternetProtocol(IP)• Toachieveitsfunctionality(deliveringthedata),IPprotocolhasthreeresponsibilities

• Addressing(nextlecture)• Encapsulatingdataintopackets(nextlecture)• Routing(usingavarietyofprotocols;severallectures)

Page 62: lecture09-switched-Ethernet -network-layer › courses › cs4450 › 2019sp › lecture09...Spanning Tree Protocol ++ (incorporating failures) Example: Suppose link 2-4 fails •

Nextlecture!