62
Link State & OSPF Brad Smith

Link State & OSPF - University of California, Santa Cruz to the schedule… Spring 2017 CE 151 - Advanced Networks 4 Week Date Lecture Exercise Quiz Lab Projects 1 Tuesday 4/4 Intro

Embed Size (px)

Citation preview

LinkState&OSPF

BradSmith

Changestotheschedule…

Spring2017 CE151-AdvancedNetworks 4

Week Date Lecture Exercise Quiz Lab Projects

1Tuesday 4/4 IntroThursday 4/6 IPv4 Address Prefixes

2

Sunday 4/9 Single Segment Network

Tuesday 4/11 Link Layer

Thursday 4/13 Switched & Routed Pings IPv4

Sunday 4/16 Static Routing IPv4

3Tuesday 4/18 IPv6Thursday 4/20 IPv6 Link Layer

4

Sunday 4/23 LAN SwitchingMonday 4/24 VLAN (extra cred)Tuesday 4/25 Link-State RoutingThursday 4/27 Link-State Routing IPv6

5

Sunday 4/30 Static Routing IPv6

Tuesday 5/2 Distance-Vector PROPOSALS DUE

Thursday 5/4 Distance-Vector Intra-Domain Routing

6Sunday 5/7 OSPFTuesday 5/9 STPThursday 5/11 STP STP

7

Sunday 5/14 RIPTuesday 5/16 IDR & BGP

Thursday 5/18 IDR Inter-Domain Routing

8

Sunday 5/21 STPTuesday 5/23 Multicast STATUS REPORTS DUE

Thursday 5/25 Prof Garcia-Luna half lecture Multicast

9

Sunday 5/28 BGPMonday 5/29 BGP Extra Credit

Tuesday 5/30 Prof Garcia-Luna lecture

Thursday 6/1 Prof Garcia-Luna lecture

10Sunday 6/4 MulticastTuesday 6/6 ##? project presentations PRESENTATIONSThursday 6/8 ##? project presentations PRESENTATIONS

FINAL Thursday 6/15 8-11am ##? project presentations PRESENTATIONS

Logis@cs•  Thursday

–  Link-Staterou@ngexercise–  IPv6quiz

•  Sunday–  IPv6labdue

•  NextTuesday–  Distance-Vectorrou@nglecture–  Projectproposalsdue!

•  Dordalreadings•  Link-State–[email protected]•  Distance-Vector–[email protected]

Spring2017 CE151-AdvancedNetworks 5

Project Deliverables •  Proposal

–  Due Tuesday, 5/2 (5th week of class)… e-mail (same time as lab reports) –  A document (pdf) including

•  Describe topic you will develop a lab for •  Draft outline of what you plan to include in the lab •  What you need to investigate

–  Remember… links to command references are on web site…

•  Deliverables –  Presentation… 10 mins w/ some time for questions –  Turn in… by the day of our final slot (Thursday, June 15th)

•  Slides from presentation •  Paper describing

–  Technology covered in the lab –  Lessons learned

•  Lab, answer key, netref content

Spring 2017 CE 151 - Advanced Networks 6

Routing Introduction•  Remember… delivery of IP packets implemented by two processes

–  Forwarding –  Routing

•  Dynamic routing process is a distributed computation –  Triggered by topology changes –  Processing defined by a routing protocol –  Output of the computation is forwarding state

•  Goal of computation is convergence –  After finite sequence of topology changes –  Process should terminate updates to forwarding state –  Forwarding state should be correct

•  Loop-free (after convergence vs. instantaneous) •  With desired characteristics: performance, possibly conform to policy

Spring2017 CE151-AdvancedNetworks 7

�Fate-sharing� Principle•  �The fate-sharing model suggests that it is acceptable to lose the state

information associated with an entity if, at the same time, the entity itself is lost.� Dave Clark, �Design Philosophy of the DARPA Internet Protocols�, SIGCOMM �88.

•  Benefits –  Ensures the failure of any single component of an internet does not invalidate

state located elsewhere in the internet –  Localizing the effects of any failures –  Resulting in a more robust system

•  Internet routing architecture achives fate-sharing by co-locating –  Forwarding state –  Routing process that computes the state

•  Compared with virtual-circuit routing?

Spring2017 CE151-AdvancedNetworks 8

Routing Protocol•  A set of algorithms and messages that are used to exchange topology

information and populate the forwarding table with the routing protocol�s choice of best paths.

•  Purpose: –  Discover remote subnets –  Maintain up-to-date forwarding tables –  Choose the best path to destination subnets

•  Components of a routing protocol: –  Algorithm:

•  Event-driven procedures for –  Processing routing information –  Selecting best-paths

•  The data structures needed for these steps. –  Routing protocol messages:

•  Discover neighboring routers •  Exchange topology information

Spring2017 CE151-AdvancedNetworks 9

Classifying Routing Protocols•  Function:

–  Intra-domain/Interior Gateway Protocol (IGP) –  Inter-domain/Exterior Gateway Protocol (EGP)

•  Algorithm… distinguished by information exchanged: –  Distance-Vector –  Link-State –  Path-Vector

Spring2017 CE151-AdvancedNetworks 10

Functional Classification•  An autonomous system (AS) or routing domain is a region of the

Internet that is administered by a single entity –  UCSC�s network –  IBM�s corporate network –  AT&T�s ISP network

•  Routing inside an AS –  Focus is on performance –  Popular protocols: RIP, OSPF, IS-IS –  Called intra-domain or internal gateway (IGP) routing

•  Routing between ASs –  Focus is on policy –  Popular (only!) protocol: BGP –  Called inter-domain or external gateway (EGP) routing

Spring2017 CE151-AdvancedNetworks 11

Ethernet

Router

Ethernet

Ethernet

RouterRouter

Ethernet

Ethernet

EthernetRouterRouter

Router

AutonomousSystem 2

AutonomousSystem 1

Spring2017 12

How ensure correct routes? •  Requirement for correctness of routing protocol

–  Loop-free –  Desired path characteristics

•  Two strategies for ensuring correctness –  Use identical algorithm for selecting paths

•  Share minimal topology information

•  Use identical path selection algorithm at all nodes •  Used for IGP/Intra-domain routing •  Use shortest-path routing algorithms

–  Use custom (private) algorithm for selecting paths •  Share full path information •  Use policy-specific path selection algorithm at each node •  Used for EGP/Inter-domain routing •  Use path-vector protocol

CE151-AdvancedNetworks

Shortest-PathRou@ng•  Shortest-pathspanningtreeiscomputedforeachrouter.

•  Internetrou@ngisbasedontwoSPalgorithms–  Dijkstra–usedinlink-stateprotocols–  Bellman-Ford–usedindistance-vectorprotocols

Spring2017 CE151-AdvancedNetworks 13

Algorithm Classification•  Distance-Vector–“sign-post”

–  Vectors of destination and distance to destination sent to neighbors •  �Tell your neighbors about the rest of the network�

–  Destination in terms of a network prefix –  Distance in terms of a metric: hop count, delay, bandwidth –  Use Distributed Bellman-Ford path selection algorithm –  Popular protocol: Routing Information Protocol (RIP)

•  Link-State–“map” –  Flood description of your links (link state) to whole network

•  �Tell the rest of the network about your neighbors� –  Links described by

•  End-point routers of subnet in internet •  Cost of subnet: delay, bandwidth

–  Use Dijkstra path selection algorithm –  Popular protocol: Open Shortest Path First (OSPF)

•  Path-Vector –  Routes advertised as full-paths –  Paths described by sequence of ASs –  Only protocol is Border Gateway Routing Protocol (BGP)

Spring2017 CE151-AdvancedNetworks 14

Destination-Based Forwarding •  Internetrou@ngusesasinglepathperdes@na@on

•  Des-na-on-basedforwardingisarestrictedversionofsingle-path

•  Apaththroughanodetoades@na@on…

•  …mustbeanextensionofthepathfromthenodetothedes<na<on.

•  Thisiscomingbacktohauntus…

Spring2017 CE151-AdvancedNetworks 15

Review•  The Internet implements a distributed routing architecture that is triggered

by topology change events.

•  Convergence of routing in the Internet depends on the stability of the network topology for a sufficient period of time.

•  The Fate-Sharing Principle – “It is acceptable to lose the state information associated with an entity if, at the same time, the entity itself is lost.”

–  Ensures the failure of any single component of an internet does not invalidate state located elsewhere in the internet

–  Localizing the effects of any failures –  Results in a more robust system –  Achieved in Internet by co-locating

•  Forwarding state •  Routing process that computes the state

Spring2017 CE151-AdvancedNetworks 16

Review•  An Autonomous System (AS) is a region of the Internet that is administered

by a single entity and follows a single routing policy.

•  Functional classification of routing protocols –  IGP - routing inside an AS

•  Share minimal topology information •  Use identical path selection algorithm at all nodes

•  Optimize performance

–  EGP - routing between ASs •  Share full path information

•  Use custom path selection algorithm at each node to implement desired policies •  Enforce policies

Spring2017 CE151-AdvancedNetworks 17

Review •  Algorithmic classification of routing protocols

–  Distance-vector •  Send vectors of distances to destinations to neighbors

•  “Tell your neighbors about the rest of the network” •  “Distributed computation”

–  Link-state •  Flood description of your links to all routers •  “Tell the rest of the network about your neighbors”

•  “Distributed database”

–  Path-vector •  Distance-vector with full paths

Spring2017 CE151-AdvancedNetworks 18

Review •  Destination-based forwarding

–  A path through a node to a destination… must be an extension of the path from the node to the destination

–  Tends concentrates traffic on a subset of the network topology.

Spring2017 CE151-AdvancedNetworks 19

Link-State

Rou@ngAlgorithms•  Distance-Vector–“sign-post”

–  Vectorsofdes@na@onanddistancesenttoneighbors•  “Tellyourneighborsabouttherestofthenetwork”

–  Des@na@onintermsofanetworkprefix–  Distanceintermsofametric:hopcount,delay,bandwidth–  UseDistributedBellman-Fordpathselec@onalgorithm–  Popularprotocol:Rou@ngInforma@onProtocol(RIP)

•  Link-State–“map”–  Flooddescrip@onofyourlinks(linkstate)

•  “Telltherestofthenetworkaboutyourneighbors”

–  Linksdescribedby•  End-pointroutersofsubnetininternet•  Costofsubnet:delay,bandwidth

–  UseDijkstrapathselec@onalgorithm–  Popularprotocol:OpenShortestPathFirst(OSPF)

•  Path-Vector

–  Routesadver@sedasfull-paths–  PathsdescribedbysequenceofASs–  PopularprotocolisBorderGatewayRou@ngProtocol(BGP)

Spring2017 CE151-AdvancedNetworks 21

Howensurecorrectroutes?•  Requirementforcorrectnessofrou@ngprotocol

–  Loop-free–  Desiredpathcharacteris@cs

•  Twostrategiesforensuringcorrectness–  Useiden@calalgorithmforselec@ngpaths

•  Shareminimaltopologyinforma@on•  Useiden@calpathselec@onalgorithmatallnodes•  UsedforIGP/Intra-domainrou@ng•  Uselink-stateordistancevectorprotocol

–  Usecustom(private)algorithmforselec@ngpaths•  Sharefullpathinforma@on•  Usepolicy-specificpathselec@onalgorithmateachnode•  UsedforEGP/Inter-domainrou@ng•  Usepath-vectorprotocol

Spring2017 CE151-AdvancedNetworks 22

Link-StateProtocols•  AreInterior-GatewayProtocols(IGPs)

•  Exchangelink-stateinforma@on–  Pairofroutersconnectedbyasubnet–  Costofsubnet(hopcount,delay,etc.)

•  Conceptually,verysimple…

Spring2017 CE151-AdvancedNetworks 23

Link-StateProtocols–EachRouter…

•  Maintainsatopologydatabaseofallthelinksithasheardof–  Ini@alizewiththesubnetsitisconnectedto.

•  Floodslink-stateupdatesdescribingitsdirectlyconnectedsubnets,includinganychangestotheselinks.–  “Telltherestofthenetworkaboutyourneighbors”

•  Par@cipatesinthefloodingoflink-stateupdatesfromotherrouters.

•  Onupdateofitstopologydatabase–  Runsashortest-pathalgorithmonthedatabasetocomputeroutes

•  Dijkstraismostefficient

–  Updatesitsforwardingtablewithanychanges.

Spring2017 CE151-AdvancedNetworks 24

CharacterizingLinkStateLink-State

•  #updatesperlinkchange?–  One.

•  Howfarpropagateupdates?–  Floodedtoallnodes.

•  Oneupdate,globaldistribu@on.

•  Scalingproblemsduetoflooding

•  Aswe’llseenextlecture,thecharacteris<csofdistancevector…–  …areverydifferent

–  …hintatamuchbeKersolu<on

Spring2017 CE151-AdvancedNetworks 25

DijstraShortest-PathAlgorithm•  Searchpaths,byincreasingpathcost,forbestpathstoalldes@[email protected]

whenpathhasbeenfoundforalldes@na@ons.

•  Maintaintwosets–  Des@na@onsforwhichshortestpathshavebeenfound.

•  Permanentlylabeleddes@na@onsP•  Ini@alizewithself

–  Des@na@onsforwhichcandidateshortestpathshavebeenfound.•  Temporarilylabeleddes@na@onsT•  Ini@alizewithmyneighbors.

•  Iterate–  MoveshortestpathinT,sayfordes@na@ond,toP–  Addroutesford’sneighbors,thatareextensionsofthepathtoT,toTiftheyare

shorterthanthecurrentpathinTforeachneighbor.The“relaxa<on”step.–  Repeatun@laroutehasbeenaddedtoPforalldes@na@ons

Spring2017 CE151-AdvancedNetworks 26

Moreformally…•  Eisthesetofedges.

•  wijistheweightofthelinkbetweennodesiandj.

•  PandT…seepreviousslide.

•  PandTentriesaretriples,<d,p,w>:–  disthedes@na@on–  pisthepredecessor–  wisthelinkweight

Spring2017 CE151-AdvancedNetworks 27

2 BRAD

algorithm Dijkstrabegin

1 Push(<i, i, 0>, P );2 for each {(i, j) ⇥ E}3 Insert(<j, i, �ij >, T );4 while (|T | > 0)

begin5 <x, px, dx > � Min(T );6 DeleteMin(T );7 Push(<x, px, dx >, P );8 for each {(x, j) ⇥ E}9 if (Tj = ⇤)10 then Insert(<j, x, dx + �xj >, T )11 else if (dx + �xj < Tj .dj)12 then DecreaseKey(<j, x, dx + �xj >, T );

endend

Figure 2. Traditional Dijkstra Shortest-Path Algorithm.

The Dijkstra algorithm in Figure 2 works by maintaining a set T of temporarily assignedroutes, and a set P of permanently assigned routes. Each routes is specified by a 3-tuple< x, p

x

, dx

>. dx

is the path weight currently assigned to node x. For nodes in P , dx

isthe final weight assignment specifying the shortest distance to x. For nodes in T , d

x

is thecurrent best estimate of the shortest distance to x based on routes currently contained inP . p

x

is the predecessor to x on the currently selected route with weight �x

. Tj

is theentry in T for node j.

The Distributed Bellman-Ford protocols in Figures 3 and 4 implement the DBF al-gorithm with and without neighbor tables (respectively). These protocols compute theshortest path from the current (source) node s in a network with a set of nodes V . d

i

isthe current distance from s to i with n

i

is the next hop, and �ij

is the weight of a linkbetween nodes i and j. N is the set of neighbors of node s.

Spring2017 CE151-AdvancedNetworks 28

Dijkstra…increasingpathcostC,9 B,2

G,6 H,∞ 6

2 2

2 F,∞ E,4 1 A,0 D,∞

7 3

2

3 2

4

C,9

F,6 E,4 A,0

B,2

D,∞

G,5 H,∞ C,9

F,6 E,4 A,0

B,2

D,∞

G,5 H,9

C,9

F,6 E,4 A,0

B,2

D,∞

G,5 H,8 C,9

F,6 E,4 A,0

B,2

D,10

G,5 H,8

C,9

F,6 E,4 A,0

B,2

D,10

G,5 H,8 C,9

F,6 E,4 A,0

B,2

D,10

G,5 H,8 Spring2017 CE151-AdvancedNetworks 29

PermanentTemporary

Transla@ngtoaProtocol•  Dijkstrarequiresa“centralized”implementa@on

–  Maintainafullgraphofthenetwork,onanevent-drivenbasis–  Re-computeroutesasthegraphchanges–  Floodchangestoyourlinks

•  “Brute-force”protocol.–  Straight-forward,easytounderstand–  Inefficient…lotsofoverhead

Spring2017 CE151-AdvancedNetworks 30

Review•  Dijkstra

–  Iterateson“nextshortestpath”–  Requirescentralizedcomputa@on

•  LSprotocols–  IsanIGP–  Implementsacentralizedrou@ngmodel–  Floodslink-stateupdatesdescribingcurrentstateofitslinks

•  “Telltherestofthenetworkaboutyourneighbors”–  UseDijkstraalgorithmbecauseitismostefficientshortest-pathalgorithm

Spring2017 CE151-AdvancedNetworks 31

TheChallengeofInternetRou@ng•  Independentrou@ngcomputa@onsateachrouter…

•  Needtocomputepathsthat…–  Supportdes@na@on-basedforwarding–  Areshortest–  Areloop-free

•  Thisistrickierthanitlooks…

Spring2017 CE151-AdvancedNetworks 32

HerdingPackets…•  Des@na@on-based,hop-by-hoprou@ngtechnologydepends

on“tame”metrics

•  Aswemoveawayfrombasicintegers,thingsfallapart…

Spring2017 CE151-AdvancedNetworks 33

ShortestForwardingpaths•  C→D:C–D=1•  B→D:B–C–D=2•  A→D:A–B–C–D=3

ForwardingPathProper@es•  Shortest•  Loop-free

Spring2017 CE151-AdvancedNetworks 34

A

B

D

C

1

3

3

1

1

Widest-ShortestMetrics:(delay,bandwidth)•  “+”:(d1,b1)+(d2,b2)=(d1+d2,Min(b1,b2))•  “≤”:(d1,b1)≤(d2,b2)=(d1<d2)or

((d1=d2)and(b1≥b2))

Forwardingpaths•  C→D:C–D=(1,10)•  B→D:B–C–D=(2,10)•  A→D:A–B–C–D=(3,5)

A–B–D=(3,5)

ForwardingPathProper@es•  Shortest•  Loop-free

Spring2017 CE151-AdvancedNetworks 35

A

B

D

C

(1,5)

(3,5)

(2,5)

(1,10)

(1,10)

Shortest-WidestMetrics:(bandwidth,delay)•  “+”:(b1,d1)+(b2,d2)=(Min(b1,b2),d1+d2)•  “≤”:(b1,d1)≤(b2,d2)=(b1>b2)or

((b1=b2)and(d1≤d2))

Whatistheproblemhere?

Forwardingpaths•  C→D:C–B–D=(10,4)•  B→D:B–D=(10,3)•  A→D:A–B–C–D=(5,3)

ForwardingPathProper@es•  NotShortest

•  Loop-free

Spring2017 CE151-AdvancedNetworks 36

A

B

D

C

(5,1)

(5,4)

(10,3)

(5,1)

(10,1)

“Slope”Metrics:(cost,distance)•  “+”:(c1,d1)+(c2,d2)=(c1+c2,d1+d2)•  “≤”:(c1,d1)≤(c2,d2)=(c1/d1)≤(c2/d2)

Forwardingpaths•  C→D:C–B–D=3/2•  B→D:B–C–D=3/2•  A→D:A–B–C–D=4/3

ForwardingPathProper@es•  NotShortest

•  NotLoop-free

Spring2017 CE151-AdvancedNetworks 37

A

B

D

C

(1,1)

(5,1)

(2,1)

(2,1)

(1,1)

Challenges

•  …algorithmsdependonproper@esofmetricalgebratobehavecorrectly.

–  StrictlyBounded –  Monotonic

Spring2017 CE151-AdvancedNetworks 38

a ≤ b⇒ (a+ c) ≤ (b+ c)a < a+ b

OSPF

OSPF•  OSPF=OpenShortestPathFirst•  Themostwidelyusedrou@ngprotocol•  ThecomplexityofOSPFissignificant

•  History:–  1989:RFC1131OSPFVersion1–  1991:RFC1247OSPFVersion2–  1994:RFC1583OSPFVersion2(revised)–  1997:RFC2178OSPFVersion2(revised)–  1998:RFC2328OSPFVersion2(currentversion)

Spring2017 CE151-AdvancedNetworks 40

WhatWeCover…•  Messages

•  RouterIDs

•  Floodingprocess

•  Metrics

•  Designatedrouters

•  Areas

Spring2017 CE151-AdvancedNetworks 41

OSPFMessages•  AnOSPFmessagecancontainoneoffivepackettypes.

•  OSPFisembeddeddirectlyinanIPframe(doesn’tuseUDP)–  Protocolfieldissetto89(OSPF)–  Des@na@onaddressistypicallysettooneoftwomul@castaddresses:

•  224.0.0.5(“AllSPFRouters”…Hellomessages)or•  224.0.0.6(“AllDRouters”…rou@nginfoto“DesignatedRouters”).

•  IftheOSPFpacketisencapsulatedinanEthernetframe,thedes@na@onMACaddressisalsoamul@castaddress:–  01-00-5E-00-00-05 or01-00-5E-00-00-06

Spring2017 CE151-AdvancedNetworks 42

OSPFPacketTypes•  Hello:UsedtoestablishandmaintainadjacencywithotherOSPFrouters.

•  DBD:Thedatabasedescrip@on(DBD)packetcontainsanabbreviatedlistofthesendingrouter’slink-statedatabaseandisusedbyreceivingrouterstocheckagainstthelocallink-statedatabase.

•  LSR:Receivingrouterscanthenrequestmoreinforma@onaboutanyentryintheDBDbysendingalink-staterequest(LSR).

•  LSU:Link-stateupdate(LSU)packetsareusedtoreplytoLSRsandtoannouncenewinforma@on.LSUscontainsevendifferenttypesoflink-stateadver@sements(LSA).

•  LSAck:WhenanLSUisreceived,theroutersendsalink-stateacknowledgment(LSAck)toconfirmreceiptoftheLSU.

Spring2017 CE151-AdvancedNetworks 43

OSPFMessageHeader

source router IP address

authentication

authentication32 bits

version type message length

Area ID

checksum authentication type

Body of OSPF MessageOSPF MessageHeader

2: current version is OSPF V2

Message types: 1: Hello (tests reachability) 2: Database description 3: Link Status request 4: Link state update 5: Link state acknowledgement

ID of the Area from which the packet originated

Standard IP checksum taken over entire packet

0: no authentication 1: Cleartext password 2: MD5 checksum (added to end packet)

Authentication passwd = 1: 64 cleartext password Authentication passwd = 2: 0x0000 (16 bits)

KeyID (8 bits) Length of MD5 checksum (8 bits) Nondecreasing sequence number (32 bits)

Prevents replay attacks

Spring2017 CE151-AdvancedNetworks 44

RouterIDs

Router ID

Router ID

Router ID

Router ID

Router ID

Router ID

•  RouterIDplaysanimportantroleinOSPF–  Uniquelyiden@fieseachrouterinarou@ngdomain–  UsedinDesignatedRouterelec@onprocess

(explainedlater)

•  RouterIDisanIPaddressofarouter

•  CiscoroutersusefollowingalgorithmtodetermineRouterID

–  IPaddressconfiguredwithOSPFrouter-id command

–  Ifnotconfigured,usehighestIPaddressofaloopbackinterface

–  Ifnoloopbackinterfaces,usehighestac@veIPaddressofphysicalinterface

•  Advantageofloopbackinterfaceisitcannotfail

Spring2017 CE151-AdvancedNetworks 45

OSPFHelloPackets•  Used to

–  Discover OSPF neighbors and establish neighbor adjacencies –  Elect the Designated Router and Backup Designated Router on

multiaccess networks such as Ethernet and Frame Relay –  Negotiate

•  Hello interval (e.g. 10 sec on Ethernet segments) •  Dead interval: time to declare neighbor down (4x Hello interval) •  Network type

•  Five network types –  Point-to-point –  Point-to-multipoint –  Broadcast multiaccess (Ethernet) –  Nonbroadcast multiaccess (Frame Relay) –  Virtual links

Spring2017 CE151-AdvancedNetworks 46

OSPFLSUPackets•  Link State Update (LSU) packets

–  Used for OSPF routing updates –  Contain one or more LSAs

•  Link State Advertisements (LSAs) –  Contain route information for destination networks –  There are 11 types of LSAs

Spring2017 CE151-AdvancedNetworks 47

LinkStateAdver@sement(LSA)•  TheLSAofrouter10.10.10.1isasfollows:

•  LinkStateID: 10.10.10.1=canbeRouterID•  Adver@singRouter: 10.10.10.1=RouterID•  Numberoflinks: 3=2linksplusrouteritself

•  Descrip@onofLink1: LinkID=10.1.1.1,Metric=4•  Descrip@onofLink2: LinkID=10.1.2.1,Metric=3•  Descrip@onofLink3: LinkID=10.10.10.1,Metric=0

Spring2017 CE151-AdvancedNetworks 48

10.1.1.0 / 24.1 .2 .2

10.10.10.1

10.1.4.0 / 24

10.1.2.0 / 24

.1

.4

10.1.7.0 / 24

10

.1.6

.0 /

24

10

.1.3

.0 /

24

10.1.5.0/24

10.1.

8.0 / 2

4

.3

.3 .5

.2

.3

.5

.5

.4

.4

.6

.6

10.10.10.2 10.10.10.4 10.10.10.6

10.10.10.3 10.10.10.5

Each router sends its LSA to all routers in the network (using a method called reliable flooding)

LSAFormat

Spring2017 CE151-AdvancedNetworks 49

Link State ID

link sequence number

advertising router

Link Age Link Type

checksum length

Link ID

Link Data

Link Type Metric#TOS metrics

LSA

LSAHeader

LSAData

Link ID

Link Data

Link Type Metric#TOS metrics

LSA Header

Link 1

Link 2

OSPFMetrics•  TheOSPFmetriciscalledcost.ThefollowingpassageisfromRFC2328:

–  Acostisassociatedwiththeoutputsideofeachrouterinterface.Thiscostisconfigurable

•  RFC2328doesnotspecifywhichvaluesshouldbeusedtodeterminethecost.

•  InCiscoIOS–  Linkcostis108÷linkbandwidth.–  Referencebandwidth(108)canbechangedwithauto-cost referencebandwidth–  Modifylinkbandwidthvaluewithbandwidth

Spring2017 CE151-AdvancedNetworks 50

LinkStateDatabase•  Thecollec@onofallLSAsiscalledthelink-statedatabase

•  Eachrouterhasaniden@callink-statedatabase–  Usefulfordebugging:Eachrouterhasacompletedescrip@onofthenetwork

•  Ifneighboringroutersdiscovereachotherforthefirst@me,theywillexchangetheirlink-statedatabases

•  Thelink-statedatabasesaresynchronizedusingreliableflooding

Spring2017 CE151-AdvancedNetworks 51

LinkStateDatabase

Spring2017 CE151-AdvancedNetworks 52

10.1.1.0 / 24.1 .2 .2

10.10.10.1

10.1.4.0 / 24

10.1.2.0 / 24

.1

.4

10.1.7.0 / 24

10

.1.6

.0 /

24

10

.1.3

.0 /

24

10.1.5.0/24

10.1.

8.0 / 2

4

.3

.3 .5

.2

.3

.5

.5

.4

.4

.6

.6

10.10.10.2 10.10.10.4 10.10.10.6

10.10.10.2 10.10.10.5

Each router has a database which contains the LSAs from all other routers

LS Type Link StateID Adv. Router Checksum LS SeqNo LS Age

Router-LSA 10.1.10.1 10.1.10.1 0x9b47 0x80000006 0

Router-LSA 10.1.10.2 10.1.10.2 0x219e 0x80000007 1618

Router-LSA 10.1.10.3 10.1.10.3 0x6b53 0x80000003 1712

Router-LSA 10.1.10.4 10.1.10.4 0xe39a 0x8000003a 20

Router-LSA 10.1.10.5 10.1.10.5 0xd2a6 0x80000038 18

Router-LSA 10.1.10.6 10.1.10.6 0x05c3 0x80000005 1680

NeighborDiscovery•  Routermul@castsOSPFHellopacketsonallOSPF-enabledinterfaces.•  Iftworouterssharealink,theycanbecomeneighbors,andestablishan

adjacency

•  Aserbecominganeighbor,routersexchangetheirlinkstatedatabases

Spring2017 CE151-AdvancedNetworks 53

OSPF Hello

OSPF Hello: I heard 10.1.10.2

10.1.10.1 10.1.10.2

Scenario: Router 10.1.10.2 restarts

Neighbordiscoveryanddatabasesynchroniza@on

Spring2017 CE151-AdvancedNetworks 54

Scenario: Router 10.1.10.2 restarts

OSPF Hello

OSPF Hello: I heard 10.1.10.2

Database Description: Sequence = X

10.1.10.1 10.1.10.2

Database Description: Sequence = X, 5 LSA headers = Router-LSA, 10.1.10.1, 0x80000006 Router-LSA, 10.1.10.2, 0x80000007 Router-LSA, 10.1.10.3, 0x80000003 Router-LSA, 10.1.10.4, 0x8000003a Router-LSA, 10.1.10.5, 0x80000038 Router-LSA, 10.1.10.6, 0x80000005

Database Description: Sequence = X+1, 1 LSA header= Router-LSA, 10.1.10.2, 0x80000005

Database Description: Sequence = X+1

Sends empty database description

Discovery of adjacency

Sends database description. (description only contains LSA headers)

Database description of 10.1.10.2 Acknowledges

receipt of description

After neighbors are discovered the nodes exchange their databases

RegularLSAexchanges

Spring2017 CE151-AdvancedNetworks 55

10.1.10.1 10.1.10.2

Link State Request packets, LSAs = Router-LSA, 10.1.10.1, Router-LSA, 10.1.10.2, Router-LSA, 10.1.10.3, Router-LSA, 10.1.10.4, Router-LSA, 10.1.10.5, Router-LSA, 10.1.10.6,

Link State Update Packet, LSA = Router-LSA, 10.1.1.6, 0x80000006

Link State Update Packet, LSAs = Router-LSA, 10.1.10.1, 0x80000006 Router-LSA, 10.1.10.2, 0x80000007 Router-LSA, 10.1.10.3, 0x80000003 Router-LSA, 10.1.10.4, 0x8000003a Router-LSA, 10.1.10.5, 0x80000038 Router-LSA, 10.1.10.6, 0x80000005

10.1.10.2 explicitly requests each LSA from 10.1.10.1

10.1.10.1 sends requested LSAs 10.1.10.2 has more

recent value for 10.0.1.6 and sends it to 10.1.10.1 (with higher sequence number)

Dissemina@onofLSA-Update•  AroutersendsandrefloodsLSA-Updates,wheneverthetopologyorlink

costchanges.(IfareceivedLSAdoesnotcontainnewinforma@on,therouterwillnotfloodthepacket)

•  Excep@on:Infrequently(every30minutes),arouterwillfloodLSAseveniftherearenonewchanges.

•  AcknowledgementsofLSA-updates:–  explicitACK,or–  implicitviarecep@onofanLSA-Update

Spring2017 CE151-AdvancedNetworks 56

WhyDesignatedRouters?•  Largenumberofadjacencies

–  Fullmeshofadjacencies–  n(n-1)/2adjacencies

•  ExcessiveloadfromfloodingLSAs

Spring2017 CE151-AdvancedNetworks 57

Elec@ngDesignatedRouter•  OSPFelectsaDesignatedRouter(DR)onmul@accessnetworks•  DRiscollec@onanddistribu@onpointforLSAsonnetwork•  BackupDesignatedRouter(BDR)alsoelectedforcasewhereDRfails

Spring2017 CE151-AdvancedNetworks 58

224.0.0.6

224.0.0.5

Elec@ngDesignatedRouter•  Elec@onheldthroughexchangeofHellomessages

•  DR/BDRelec@oncriteria–  DRisrouterwithhighestinterfacepriority–  BDRisrouterwithsecond-highestinterfacepriority–  Ifinterfacepriori@esareequal,useRouterID

Spring2017 CE151-AdvancedNetworks 59

Elec@ngDesignatedRouter•  Furtherelec@onsonlyoccuronfailureofDR/BDR

•  OnDRfailure–  BDRpromotedtoDR–  NewBDRelected

•  OnBDRfailure–  NewBDRelected

•  Live(B)DRnotreplacedbyelec@on.–  IfDRdies

•  BDRreplacesDR•  Elec@onheldtoreplaceBDR

–  IfBDRdies•  Elec@onheldtoreplaceBDR

Spring2017 CE151-AdvancedNetworks 60

OSPFAreas•  AnOSPFAreaisasetofroutersthatsharelinkstateinforma@on

•  GoalistoaddressscalabilityproblemwithOSPFflooding

•  Area0isthebackbonearea–  Allareasmustbeconnectedtohebackbonearea–  Bestprac@cetousearea0insingle-areaOSPF–  Easesconversiontomul@-area

Spring2017 CE151-AdvancedNetworks 61

Review•  OSPFmessagetypes

–  Hello-establishandmaintainadjacencywithOSPFrouters–  DataBaseDescrip@on(DBD)-summaryofmydatabase–  Link-StateRequest(LSR)-requestfordetailedentry–  Link-StateUpdate(LSU)-responsetoLSR–  Link-StateAck(LSAck)-acknowledgereceiptofLSU

•  RouterIDs…–  Uniquelyiden@fieseachrouterinarou@ngdomain–  UsedinDesignatedRouterelec@onprocess–  [email protected]’tfail

Spring2017 CE151-AdvancedNetworks 62

Review•  OSPFmetrics…

–  “Costisassociatedwiththeoutputsideofeachrouterinterface.”–  InIOSis108/linkbandwidth(inverselypropor@onaltobandwidth)

•  Designatedrouters…–  Mi@gateimpactof“full-mesh”on#ofadjacenciesintopology(n(n-1)/2)–  DRiscollec@onanddistribu@onpointforLSAsonnetwork

•  OSPFdealswithscalingproblembyusing“areas,”area0isthebackbone.

Spring2017 CE151-AdvancedNetworks 63

Ques@ons?