lecture08-queueing-delay-switched-ethernet · lecture08-queueing-delay-switched-ethernet.key...

41
Computer Networks: Architecture and Protocols CS4450 Lecture 8 Switched Ethernet Spanning Tree Protocol Rachit Agarwal

Upload: others

Post on 25-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

ComputerNetworks:ArchitectureandProtocols

CS4450

Lecture8

SwitchedEthernet

SpanningTreeProtocol

RachitAgarwal

Page 2: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

GoalsforToday’sLecture

• Experience(thebeautyof)SpanningTreeProtocol

• Whydoweneednetworklayer?

• WhynotjustuseswitchedEthernetacrosstheInternet?

2

Page 3: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Recap:LinkLayer

• Originallyabroadcastchannel• MACaddresses(really,names)

• CSMA/CD

• Remember:Exponentialback-off(moreinproblemset2)

• WhydoesEthernetuseframes?

• HowLinkLayerbuildsontopofPhysicalLayer(thatusesbits)• Boundsonnetworklengthand/orminimumframesize

• Duetopropagationdelays

• Morerecently:switchedEthernet

• Broadcaststorm!

3

Page 4: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Recap:Ethernet“Frames”

• Preamble:

• 7bytesforclocksynchronization• 1bytetoindicatestartoftheframe

• Names:6+6bytes(MACnames/addresses)

• Protocoltype:2bytes,indicatinghigherlayerprotocol(e.g.,IP)

• Datapayload:max1500bytes,minimum46bytes

• CRC:4bytesforerrordetection

• +Trailer:1bytetoindicateendoftheframe(rightbeforeCRC)

4

Page 5: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Recap:SwitchedEthernet

• Enablesconcurrentcommunication

• HostAcantalktoC,whileBtalkstoD• Nocollisions->noneedforCSMA,CD

• Noconstraintsonlinklengthsorframesize

5

Page 6: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Recap:Broadcaststorm

6

Page 7: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

HowtoavoidtheBroadcastStormProblem?

7

Getridoftheloops!

Page 8: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Letsgetbacktothegraphrepresentation!

8

Page 9: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

EasiestWaytoAvoidLoops

• Useanetworktopology(graph)whereloopisimpossible!

• Takearbitrarytopology(graph)

• Buildspanningtree• Subgraphthatincludesallverticesbutcontainsnocycles• Linksnotinthespanningtreearenotusedinforwardingframes

• Onlyonepathtodestinationsonspanningtrees• Sodon'thavetoworryaboutloops!

9

Page 10: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

ConsiderGraph

10

Page 11: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

MultipleSpanningTrees

11

Page 12: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Questions?

Page 13: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

SpanningTreeApproach

• Takearbitrarytopology

• Picksubsetoflinksthatformaspanningtree

• Onlyforwardpacketsonthespanningtree• =>Noloops• =>Nobroadcaststorm

13

Page 14: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

SpanningTreeProtocol

• Protocolbywhichbridgesconstructaspanningtree

• Niceproperties• Zeroconfiguration(byoperatorsorusers)• Selfhealing

• Stillusedtoday

• Constraintsforbackwardscompatibility

• Nochangestoend-hosts• Maintainplug-n-playaspect

• EarlierEthernetachievedplug-n-playbyleveragingabroadcastmedium

• Canwedothesameforaswitchedtopology?

14

Page 15: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

AlgorithmhasTwoAspects…

• Pickaroot:• Destinationtowhichtheshortestpathsgo• Picktheonewiththesmallestidentifier(MACname/address)

• Computetheshortestpathstotheroot

• Noshortestpathcanhaveacycle• Onlykeepthelinksontheshortestpath• Breaktiesinsomeway

• soweonlykeeponeshortestpathfromeachnode

• Ethernet’sspanningtreeconstructiondoesbothwithasinglealgorithm

15

Page 16: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

BreakingTies

• Whentherearemultipleshortestpathstotheroot:

• Choosethepathvianeighborswitchwiththesmallestidentifier

• Onecoulduseanytiebreakingsystem

• Thisisjustaneasyonetorememberandimplement

16

Page 17: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

ConstructingaSpanningTree

• Messages(Y,d,X)

• ProposingYastheroot• FromnodeX

• AndadvertisingadistancedbetweenXandY

• Switcheselectthenodewithsmallestidentifier(MACaddress)asroot

• Yinmessages

• Eachswitchdeterminesifalinkisonitsshortestpathtotheroot

• Ifnot,excludesitfromthetree

• dtoYinthemessageisusedtodeterminethis

17

Page 18: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

StepsinSpanningTreeProtocol

• Messages(Y,d,X)

• ProposingrootY;fromnodeX;advertisingadistancedtoY

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

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

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

• Switchescomputetheirdistancefromtheroot

• Add1totheshortestdistancereceivedfromaneighbor

• IfrootchangedORshortestdistancetotherootchanged:• sendneighborsupdatedmessage(Y,d+1,X)

18

Page 19: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

GroupExercise:

LetsruntheSpanningTreeProtocolonthisexample

(assumealllinkshave“distance”1)

Page 20: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

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 21: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Round2

Receive SendNexthop

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

(6,0,6)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)(1,0,1),(2,0,2),

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

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

Page 22: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Round3

Receive Send Nexthop

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

(1,1,6)1

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

(1,2,2)3

(or6)

3(1,1,3) 1

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

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

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

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

Page 23: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Round4

Receive Send Nexthop

1(1,0,1) 1

2(1,2,2) 3

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

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

5(1,1,5) 1

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

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

Page 24: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Round5

Receive SendNexthop

1(1,0,1) 1

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

3(1,1,3) 1

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

5(1,1,5) 1

6(1,1,6) 1

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

Page 25: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

AfterRound5:WehaveourSpanningTree

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

25

Page 26: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Questions?

Page 27: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

• Protocolmustreacttofailures

• Failureoftherootnode• Failureofswitchesandlinks

• Rootnodesendsperiodicannouncementmessages

• Fewpossibleimplementations,butthisissimpletounderstand

• Otherswitchescontinueforwardingmessages

• Detectingfailuresthroughtimeout(softstate)

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

• Ifmultiplemessageswithanewrootreceived,sendmessage(Y,d,X)

totheneighborsendingthemessage

27

SpanningTreeProtocol++(incorporatingfailures)

Page 28: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Supposelink2-4fails

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

• Why?

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

• 4willnowupdateto(1,4,4)andsendupdatemessage

• Newspanningtree!

28

Page 29: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Questions?

Page 30: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

30

TheendofLinkLayer….

Andthebeginningofnetworklayer:-D

Builtontopof

reliabledelivery

Builtontopofbest-

effortforwarding

Builtontopof

best-effortrouting

Builtontopof

physicalbittransfer

Page 31: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

• There’sonlyonepathfromsourcetodestination

• Howdoyoufindthatpath?Ideas?

• Easytodesignroutingalgorithmsfortrees

• Nodescan“flood”packettoallothernodes

Whydoweneedanetworklayer?

Page 32: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

• Sendspackettoeverynodeinthenetwork

• Step1:IgnorethelinksnotbelongingtotheSpanningTree

• Step2:Originatingnodesends“flood”packetouteverylink(onspanningtree)

• Step3:Sendincomingpacketouttoalllinksotherthantheonethatsentthepacket

FloodingonaSpanningTree

Page 33: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

FloodingExample

Source

Destination

1

3

2

7

6

5

4

Page 34: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

FloodingExample

Source

Destination

1

3

2

7

6

5

4

Eventuallyallnodesarecovered

Onecopyofpacketdeliveredtodesenaeon

1

2

4

7

5

6

Page 35: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

• There’sonlyonepathfromsourcetodestination

• Howdoyoufindthatpath?Ideas?

• Easytodesignroutingalgorithmsfortrees

• Nodescan“flood”packettoallothernodes

• Amazingproperties:

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

• Assumingnofailures

RoutingviaFloodingonSpanningTree…

Page 36: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Threefundamentalissues!

Source

Destination

1

3

2

7

6

5

4

1

2

4

7

5

6

Issue1:Eachhosthastodounnecessarypacketprocessing!

(todecidewhetherthepacketisdesenedtothehost)

Page 37: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Source

Destination

1

3

2

7

6

5

4

Threefundamentalissues!

Issue2:Higherlatency!

(Thepacketsunnecessarilytraversemuchlongerpaths)

Page 38: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Source

Destination

1

3

2

7

6

5

4

Threefundamentalissues!

Issue3:Lowerbandwidthavailability!

(2-6and3-1packetsunnecessarilyhavetosharebandwidth)

Page 39: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

Questions?

Page 40: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM

• Networklayerperforms“routing”ofpacketstoalleviatetheseissues

• Usesroutingtables

• Letsunderstandroutingtablesfirst• Wewillseeroutingtablesarenothingbut…

Whydoweneedanetworklayer?

Page 41: lecture08-queueing-delay-switched-Ethernet · lecture08-queueing-delay-switched-Ethernet.key Created Date: 3/3/2020 1:40:35 PM