link‐state roung fileswitching fabric • deliver packet inside the router – from incoming...
TRANSCRIPT
Link‐StateRou.ngReading:Sec.ons4.2and4.3.4
COS461:ComputerNetworksSpring2010(MW3:00‐4:20inCOS105)
MichaelFreedmanhJp://www.cs.princeton.edu/courses/archive/spring10/cos461/
1
GoalsofToday’sLecture
• Insidearouter– Controlplane:rou.ngprotocols– Dataplane:packetforwarding
• Pathselec.on– Minimum‐hopandshortest‐pathrou.ng– Dijkstra’salgorithm
• Topologychange– Usingbeaconstodetecttopologychanges– Propaga.ngtopologyinforma.on
• Rou.ngprotocol:OpenShortestPathFirst2
WhatisRou.ng?
• Afamousquota.onfromRFC791“Anameindicateswhatweseek.Anaddressindicateswhereitis.Arouteindicateshowwegetthere.”‐‐JonPostel
3
Rou.ngvs.Forwarding
• Rou.ng:controlplane– Compu.ngpathsthepacketswillfollow
– Routerstalkingamongstthemselves
– Individualroutercrea,ngaforwardingtable• Forwarding:dataplane
– Direc.ngadatapackettoanoutgoinglink– Individualrouterusingaforwardingtable
4
DataandControlPlanes
5
Switching Fabric
Processor
Line card
Line card
Line card
Line card
Line card
Line card
data plane
control plane
RouterPhysicalLayout
6
Juniper T series
Cisco 12000
Switch
Linecards
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
SwitchingFabric
• Deliverpacketinsidetherouter– Fromincominginterfacetooutgoinginterface
– Asmallnetworkinandofitself
• Mustoperateveryquickly– Mul.plepacketsgoingtosameoutgoinginterface– Switchschedulingtomatchinputstooutputs
• Implementa.ontechniques– Bus,crossbar,interconnec.onnetwork,…– Runningatafasterspeed(e.g.,2X)thanlinks– Dividingvariable‐lengthpacketsintofixed‐sizecells
8
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”
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
WheredoForwardingTablesComeFrom?
• Routershaveforwardingtables– MapIPprefixtooutgoinglink(s)
• Entriescanbesta.callyconfigured– E.g.,“map12.34.158.0/24toSerial0/0.1”
• But,thisdoesn’tadapt– Tofailures– Tonewequipment– Totheneedtobalanceload
• Thatiswhererou.ngprotocolscomein
11
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
Compu.ngtheShortestPaths
assumingyoualreadyknowthetopology
13
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
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)
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
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
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
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
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)
LearningtheTopology
bytherouterstalkamongstthemselves
21
Link‐StateRou.ng
• Eachrouterkeepstrackofitsincidentlinks– Whetherthelinkisupordown– Thecostonthelink
• Eachrouterbroadcaststhelinkstate– Togiveeveryrouteracompleteviewofthegraph
• EachrouterrunsDijkstra’salgorithm– Tocomputetheshortestpaths– …andconstructtheforwardingtable
• Exampleprotocols– OpenShortestPathFirst(OSPF)– IntermediateSystem–IntermediateSystem(IS‐IS)
22
Detec.ngTopologyChanges
• Beaconing– Periodic“hello”messagesinbothdirec.ons
– Detectafailureaierafewmissed“hellos”
• Performancetrade‐offs– Detec.onspeed– OverheadonlinkbandwidthandCPU– Likelihoodoffalsedetec.on
23
“hello”
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)
Broadcas.ngtheLinkState
• Reliableflooding– Ensureallnodesreceivelink‐stateinforma.on
– …andthattheyusethelatestversion• Challenges
– Packetloss– Out‐of‐orderarrival
• Solu.ons– Acknowledgmentsandretransmissions– Sequencenumbers– Time‐to‐liveforeachpacket
25
WhentoIni.ateFlooding
• Topologychange– Linkornodefailure– Linkornoderecovery
• Configura.onchange– Linkcostchange
• Periodically– Refreshthelink‐stateinforma.on– Typically(say)30minutes– Correctsforpossiblecorrup.onofthedata
26
WhentheRoutersDisagree
(duringtransientperiods)
27
Convergence
• Genngconsistentrou.nginforma.ontoallnodes– E.g.,allnodeshavingthesamelink‐statedatabase
• Consistentforwardingaierconvergence– Allnodeshavethesamelink‐statedatabase
– Allnodesforwardpacketsonshortestpaths– Thenextrouteronthepathforwardstothenexthop
28
3 2
2
1
1 4
1
4
5
3
TransientDisrup.ons
• Detec.ondelay– Anodedoesnotdetectafailedlinkimmediately
– …andforwardsdatapacketsintoa“blackhole”– Dependson.meoutfordetec.nglosthellos
29
3 2
2
1
1 4
1
4
5
3
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
ConvergenceDelay
• Sourcesofconvergencedelay– Detec.onlatency– Floodingoflink‐stateinforma.on– Shortest‐pathcomputa.on– Crea.ngtheforwardingtable
• Performanceduringconvergenceperiod– LostpacketsduetoblackholesandTTLexpiry– Loopingpacketsconsumingresources– Out‐of‐orderpacketsreachingthedes.na.on
• VerybadforVoIP,onlinegaming,andvideo31
ReducingConvergenceDelay• Fasterdetec.on
– Smallerhello.mers– Link‐layertechnologiesthatcandetectfailures
• Fasterflooding– Floodingimmediately– Sendinglink‐statepacketswithhigh‐priority
• Fastercomputa.on– Fasterprocessorsontherouters– IncrementalDijkstra’salgorithm
• Fasterforwarding‐tableupdate– Datastructuressuppor.ngincrementalupdates
32
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
Conclusions
• Rou.ngisadistributedalgorithm– Reacttochangesinthetopology– Computethepathsthroughthenetwork
• Shortest‐pathlinkstaterou.ng– Floodlinkweightsthroughoutthenetwork– Computeshortestpathsasasumoflinkweights
– Forwardpacketsonnexthopintheshortestpath• Convergenceprocess
– Changingfromonetopologytoanother– Transientperiodsofinconsistencyacrossrouters
34