Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming...
Transcript of Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming...
![Page 1: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/1.jpg)
Link‐StateRou.ngReading:Sec.ons4.2and4.3.4
COS461:ComputerNetworksSpring2010(MW3:00‐4:20inCOS105)
MichaelFreedmanhJp://www.cs.princeton.edu/courses/archive/spring10/cos461/
1
![Page 2: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/2.jpg)
GoalsofToday’sLecture
• Insidearouter– Controlplane:rou.ngprotocols– Dataplane:packetforwarding
• Pathselec.on– Minimum‐hopandshortest‐pathrou.ng– Dijkstra’salgorithm
• Topologychange– Usingbeaconstodetecttopologychanges– Propaga.ngtopologyinforma.on
• Rou.ngprotocol:OpenShortestPathFirst2
![Page 3: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/3.jpg)
WhatisRou.ng?
• Afamousquota.onfromRFC791“Anameindicateswhatweseek.Anaddressindicateswhereitis.Arouteindicateshowwegetthere.”‐‐JonPostel
3
![Page 4: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/4.jpg)
Rou.ngvs.Forwarding
• Rou.ng:controlplane– Compu.ngpathsthepacketswillfollow
– Routerstalkingamongstthemselves
– Individualroutercrea,ngaforwardingtable• Forwarding:dataplane
– Direc.ngadatapackettoanoutgoinglink– Individualrouterusingaforwardingtable
4
![Page 5: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/5.jpg)
DataandControlPlanes
5
Switching Fabric
Processor
Line card
Line card
Line card
Line card
Line card
Line card
data plane
control plane
![Page 6: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/6.jpg)
RouterPhysicalLayout
6
Juniper T series
Cisco 12000
Switch
Linecards
![Page 7: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/7.jpg)
LineCards(InterfaceCards,Adaptors)
• Interfacing– Physicallink– Switchingfabric
• Packethandling– Packetforwarding– Decrement.me‐to‐live– Buffermanagement– Linkscheduling– Packetfiltering– Ratelimi.ng– Packetmarking– Measurement
7
to/from link
to/from switch
lookup
Rec
eive
Transmit
![Page 8: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/8.jpg)
SwitchingFabric
• Deliverpacketinsidetherouter– Fromincominginterfacetooutgoinginterface
– Asmallnetworkinandofitself
• Mustoperateveryquickly– Mul.plepacketsgoingtosameoutgoinginterface– Switchschedulingtomatchinputstooutputs
• Implementa.ontechniques– Bus,crossbar,interconnec.onnetwork,…– Runningatafasterspeed(e.g.,2X)thanlinks– Dividingvariable‐lengthpacketsintofixed‐sizecells
8
![Page 9: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/9.jpg)
PacketSwitching
9
R1 Link 1
Link 2
Link 3
Link 4
Link 1, ingress Link 1, egress
Link 2, ingress Link 2, egress
Link 3, ingress Link 3, egress
Link 4, ingress Link 4, egress
Choose Egress
Choose Egress
Choose Egress
Choose Egress
“4”
“4”
![Page 10: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/10.jpg)
RouterProcessor
• So‐called“Loopback”interface– IPaddressoftheCPUontherouter
• Interfacetonetworkadministrators– Command‐lineinterfaceforconfigura.on– Transmissionofmeasurementsta.s.cs
• Handlingofspecialdatapackets– PacketswithIPop.onsenabled– PacketswithexpiredTime‐To‐Livefield
• Control‐planesoiware– Implementa.onoftherou.ngprotocols– Crea.onofforwardingtableforthelinecards
10
![Page 11: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/11.jpg)
WheredoForwardingTablesComeFrom?
• Routershaveforwardingtables– MapIPprefixtooutgoinglink(s)
• Entriescanbesta.callyconfigured– E.g.,“map12.34.158.0/24toSerial0/0.1”
• But,thisdoesn’tadapt– Tofailures– Tonewequipment– Totheneedtobalanceload
• Thatiswhererou.ngprotocolscomein
11
![Page 12: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/12.jpg)
Compu.ngPathsBetweenRouters
• Routersneedtoknowtwothings– Whichroutertousetoreachades.na.onprefix– Whichoutgoinginterfacetousetoreachthatrouter
• Today’sclass:justhowroutersreacheachother– Howuknowshowtoforwardpacketstowardz
12
12.34.158.0/24
Interface along the path to z
u z
Router z that can reach destination
![Page 13: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/13.jpg)
Compu.ngtheShortestPaths
assumingyoualreadyknowthetopology
13
![Page 14: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/14.jpg)
Shortest‐PathRou.ng
• Path‐selec.onmodel– Des.na.on‐based– Load‐insensi.ve(e.g.,sta.clinkweights)– Minimumhopcountorsumoflinkweights
14
3 2
2
1
1 4
1
4
5
3
![Page 15: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/15.jpg)
Shortest‐PathProblem• Given:networktopologywithlinkcosts
– c(x,y):linkcostfromnodextonodey
– Infinityifxandyarenotdirectneighbors• Compute:least‐costpathstoallnodes
– Fromagivensourceutoallothernodes– p(v):predecessornodealongpathfromsourcetov
15
3 2
2
1
1 4
1
4
5
3
u
v
p(v)
![Page 16: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/16.jpg)
Dijkstra’sShortest‐PathAlgorithm
• Itera.vealgorithm– Aierkitera.ons,knowleast‐costpathtoknodes
• S:nodeswhoseleast‐costpathdefini.velyknown– Ini.ally,S={u}whereuisthesourcenode– AddonenodetoSineachitera.on
• D(v):currentcostofpathfromsourcetonodev– Ini.ally,D(v)=c(u,v)forallnodesvadjacenttou– …andD(v)=∞forallothernodesv
– Con.nuallyupdateD(v)asshorterpathsarelearned
16
![Page 17: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/17.jpg)
Dijsktra’sAlgorithm
17
1 Initialization: 2 S = {u} 3 for all nodes v 4 if (v is adjacent to u) 5 D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in S with the smallest D(w) 10 add w to S 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min{D(v), D(w) + c(w,v)} 13 until all nodes in S
![Page 18: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/18.jpg)
Dijkstra’sAlgorithmExample
18
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
![Page 19: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/19.jpg)
Dijkstra’sAlgorithmExample
19
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4
5
3
![Page 20: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/20.jpg)
Shortest‐PathTree
• Shortest‐pathtreefromu • Forwardingtableatu
20
3 2
2
1
1 4
1
4
5
3
u
v
w
x
y
z
s
t
v (u,v) w (u,w) x (u,w) y (u,v) z (u,v)
link
s (u,w) t (u,w)
![Page 21: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/21.jpg)
LearningtheTopology
bytherouterstalkamongstthemselves
21
![Page 22: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/22.jpg)
Link‐StateRou.ng
• Eachrouterkeepstrackofitsincidentlinks– Whetherthelinkisupordown– Thecostonthelink
• Eachrouterbroadcaststhelinkstate– Togiveeveryrouteracompleteviewofthegraph
• EachrouterrunsDijkstra’salgorithm– Tocomputetheshortestpaths– …andconstructtheforwardingtable
• Exampleprotocols– OpenShortestPathFirst(OSPF)– IntermediateSystem–IntermediateSystem(IS‐IS)
22
![Page 23: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/23.jpg)
Detec.ngTopologyChanges
• Beaconing– Periodic“hello”messagesinbothdirec.ons
– Detectafailureaierafewmissed“hellos”
• Performancetrade‐offs– Detec.onspeed– OverheadonlinkbandwidthandCPU– Likelihoodoffalsedetec.on
23
“hello”
![Page 24: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/24.jpg)
Broadcas.ngtheLinkState
• Flooding– Nodesendslink‐stateinforma.onoutitslinks
– Andthenthenextnodesendsoutallofitslinks– …excepttheonewheretheinforma.onarrived
24
X A
C B D (a)
X A
C B D (b)
X A
C B D (c)
X A
C B D (d)
![Page 25: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/25.jpg)
Broadcas.ngtheLinkState
• Reliableflooding– Ensureallnodesreceivelink‐stateinforma.on
– …andthattheyusethelatestversion• Challenges
– Packetloss– Out‐of‐orderarrival
• Solu.ons– Acknowledgmentsandretransmissions– Sequencenumbers– Time‐to‐liveforeachpacket
25
![Page 26: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/26.jpg)
WhentoIni.ateFlooding
• Topologychange– Linkornodefailure– Linkornoderecovery
• Configura.onchange– Linkcostchange
• Periodically– Refreshthelink‐stateinforma.on– Typically(say)30minutes– Correctsforpossiblecorrup.onofthedata
26
![Page 27: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/27.jpg)
WhentheRoutersDisagree
(duringtransientperiods)
27
![Page 28: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/28.jpg)
Convergence
• Genngconsistentrou.nginforma.ontoallnodes– E.g.,allnodeshavingthesamelink‐statedatabase
• Consistentforwardingaierconvergence– Allnodeshavethesamelink‐statedatabase
– Allnodesforwardpacketsonshortestpaths– Thenextrouteronthepathforwardstothenexthop
28
3 2
2
1
1 4
1
4
5
3
![Page 29: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/29.jpg)
TransientDisrup.ons
• Detec.ondelay– Anodedoesnotdetectafailedlinkimmediately
– …andforwardsdatapacketsintoa“blackhole”– Dependson.meoutfordetec.nglosthellos
29
3 2
2
1
1 4
1
4
5
3
![Page 30: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/30.jpg)
TransientDisrup.ons
• Inconsistentlink‐statedatabase– Someroutersknowaboutfailurebeforeothers
– Theshortestpathsarenolongerconsistent– Cancausetransientforwardingloops
30
3 2
2
1
1 4
1
4
5
3
3 2
2
1
1 4
1
4 3
![Page 31: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/31.jpg)
ConvergenceDelay
• Sourcesofconvergencedelay– Detec.onlatency– Floodingoflink‐stateinforma.on– Shortest‐pathcomputa.on– Crea.ngtheforwardingtable
• Performanceduringconvergenceperiod– LostpacketsduetoblackholesandTTLexpiry– Loopingpacketsconsumingresources– Out‐of‐orderpacketsreachingthedes.na.on
• VerybadforVoIP,onlinegaming,andvideo31
![Page 32: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/32.jpg)
ReducingConvergenceDelay• Fasterdetec.on
– Smallerhello.mers– Link‐layertechnologiesthatcandetectfailures
• Fasterflooding– Floodingimmediately– Sendinglink‐statepacketswithhigh‐priority
• Fastercomputa.on– Fasterprocessorsontherouters– IncrementalDijkstra’salgorithm
• Fasterforwarding‐tableupdate– Datastructuressuppor.ngincrementalupdates
32
![Page 33: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/33.jpg)
ScalingLink‐StateRou.ng
• Overheadoflink‐staterou.ng– Floodinglink‐statepacketsthroughoutthenetwork– RunningDijkstra’sshortest‐pathalgorithm
• Introducinghierarchythrough“areas”
33
Area 0
Area 1 Area 2
Area 3 Area 4
area border router
![Page 34: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A](https://reader031.fdocuments.net/reader031/viewer/2022020411/5ac14e237f8b9a357e8c8215/html5/thumbnails/34.jpg)
Conclusions
• Rou.ngisadistributedalgorithm– Reacttochangesinthetopology– Computethepathsthroughthenetwork
• Shortest‐pathlinkstaterou.ng– Floodlinkweightsthroughoutthenetwork– Computeshortestpathsasasumoflinkweights
– Forwardpacketsonnexthopintheshortestpath• Convergenceprocess
– Changingfromonetopologytoanother– Transientperiodsofinconsistencyacrossrouters
34