link‐state roung fileswitching fabric • deliver packet inside the router – from incoming...

34
Link‐State Rou.ng Reading: Sec.ons 4.2 and 4.3.4 COS 461: Computer Networks Spring 2010 (MW 3:00‐4:20 in COS 105) Michael Freedman hJp://www.cs.princeton.edu/courses/archive/spring10/cos461/ 1

Upload: lamthu

Post on 02-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A

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

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

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

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

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

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

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

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

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

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

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

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

Compu.ngtheShortestPaths

assumingyoualreadyknowthetopology

13

Page 14: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A

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

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

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

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

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

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

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

LearningtheTopology

bytherouterstalkamongstthemselves

21

Page 22: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A

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

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

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

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

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

WhentheRoutersDisagree

(duringtransientperiods)

27

Page 28: Link‐State Roung fileSwitching Fabric • Deliver packet inside the router – From incoming interface to outgoing interface – A

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

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

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

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

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

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

Conclusions

•  Rou.ngisadistributedalgorithm– Reacttochangesinthetopology– Computethepathsthroughthenetwork

•  Shortest‐pathlinkstaterou.ng– Floodlinkweightsthroughoutthenetwork– Computeshortestpathsasasumoflinkweights

– Forwardpacketsonnexthopintheshortestpath•  Convergenceprocess

– Changingfromonetopologytoanother– Transientperiodsofinconsistencyacrossrouters

34