link%state%&%ospf% - university of california, … protocol% • a set of algorithms and...

63
Link State & OSPF Spring 2015 CE 151 Advanced Networks 1

Upload: hoangdung

Post on 06-Mar-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Link  State  &  OSPF  

Spring  2015   CE  151  -­‐  Advanced  Networks   1  

Stuff  •  VMs  -­‐  Resume-­‐Session…  

–  Don’t  change  “port”  field  to  your  login…  –  But  may  need  to  change  #...  from  5910  to  5911,  5912,  …  

•  Palo  Alto  Networks  summer  internship  hUps://www.paloaltonetworks.com/company/careers/open-­‐posiXons-­‐north-­‐america.html?p=job%2Fo1KI0fwd  

•  Guest  lectures  –  Thursday  4/30  –  Cruzio  CEO  and  CTO  discuss  running  a  regional  ISP  –  Thursday  5/21  –  Jim  Warner  (Senior  Network  Engineer)  on  cable  plant  –  Tuesday  5/26  -­‐  Prof  Garcia-­‐Luna  on  DUAL/EIGRP  and  current  research.  

•  Dates  –  IPv6  quiz  Thursday  –  IPv6  lab  Sunday  –  Dordal  readings  

•  SecXons  9.5-­‐7  for  rouXng  intro  and  OSPF  •  SecXons  9.1-­‐4  for  Distance  Vector  and  RIP  

Spring  2015   CE  151  -­‐  Advanced  Networks   2  

Summary  of  VM  Guidelines  •  Before  logging  out  or  disconnecXng  

–  Halt  VB  VMs  •  This  may  take  some  Xme…  wait  for  couple  of  lines  aoer  “login:”  prompt  

–  Stop  GNS3  (the  red  buUon)  –  Quit  GNS3  –  Logout/disconnect  

•  To  “Resume-­‐Session”  (aoer  disconnecXon)  –  Don’t  change  port  #  field  to  login  name  –  May  need  to  increase  port  #  by  small  amount  

•  From  5910  to  5911,  5912,  …  •  Caused  by  other  X11  sessions  on  host…  e.g.  SSH  

Spring  2015   CE  151  -­‐  Advanced  Networks   3  

Projects  •  Proposal  

–  Due  Tuesday,  4/28  (next  week)  –  A  document  (pdf)  including  

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

•  Deliverables  –  Paper  describing  

•  Technology  covered  in  the  lab  •  Lessons  learned  

–  Lab  –  Answer  key  –  Netref  content  

Spring  2015   CE  151  -­‐  Advanced  Networks   4  

Overall  Scores  

Spring  2015   CE  151  -­‐  Advanced  Networks   5  

Per-­‐QuesXon  Averages  

Spring  2015   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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 –  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?

Spring  2015   CE  151  -­‐  Advanced  Networks   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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 protocol: BGP –  Called inter-domain or external gateway (EGP) routing

Spring  2015   CE  151  -­‐  Advanced  Networks   11  

Ethernet

Router

Ethernet

Ethernet

RouterRouter

Ethernet

Ethernet

EthernetRouterRouter

Router

AutonomousSystem 2

AutonomousSystem 1

Spring  2015   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 algorithm

–  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

CE  151  -­‐  Advanced  Networks  

Shortest-­‐Path  RouXng  •  Shortest-­‐path  spanning  tree  is  computed  for  each  router.  

•  Internet  rouXng  is  based  on  two  SP  algorithms  –  Dijkstra  –  used  in  link-­‐state  protocols  –  Bellman-­‐Ford  –  used  in  distance-­‐vector  protocols  

Spring  2015   CE  151  -­‐  Advanced  Networks   13  

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

–  Vectors of destination and distance 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 –  Popular protocol is Border Gateway Routing Protocol (BGP)

Spring  2015   CE  151  -­‐  Advanced  Networks   14  

Destination-Based Forwarding •  Internet  rouXng  uses  a  single  path  per  desXnaXon  

•  Des/na/on-­‐based  forwarding  is  a  restricted  version  of  single-­‐path  

•  A  path  through  a  node  to  a  desXnaXon…  

•  …must  be  an  extension  of  the  path  from  the  node  to  the  des3na3on.  

•  This  is  coming  back  to  haunt  us…  

Spring  2015   CE  151  -­‐  Advanced  Networks   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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

Spring  2015   CE  151  -­‐  Advanced  Networks   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.

Spring  2015   CE  151  -­‐  Advanced  Networks   19  

Link-­‐State  

Spring  2015   CE  151  -­‐  Advanced  Networks   20  

RouXng  Algorithms  •  Distance-­‐Vector  –  “sign-­‐post”  

–  Vectors  of  desXnaXon  and  distance  sent  to  neighbors  •  “Tell  your  neighbors  about  the  rest  of  the  network”  

–  DesXnaXon  in  terms  of  a  network  prefix  –  Distance  in  terms  of  a  metric:  hop  count,  delay,  bandwidth  –  Use  Distributed  Bellman-­‐Ford  path  selecXon  algorithm  –  Popular  protocol:  RouXng  InformaXon  Protocol  (RIP)  

•  Link-­‐State  –  “map”  –  Flood  descripXon  of  your  links  (link  state)  

•  “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  selecXon  algorithm  –  Popular  protocol:  Open  Shortest  Path  First  (OSPF)  

•  Path-­‐Vector  –  Routes  adverXsed  as  full-­‐paths  –  Paths  described  by  sequence  of  ASs  –  Popular  protocol  is  Border  Gateway  RouXng  Protocol  (BGP)  

Spring  2015   CE  151  -­‐  Advanced  Networks   21  

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

–  Loop-­‐free  –  Desired  path  characterisXcs  

•  Two  strategies  for  ensuring  correctness  –  Use  idenXcal  algorithm  for  selecXng  paths  

•  Share  minimal  topology  informaXon  •  Use  idenXcal  path  selecXon  algorithm  at  all  nodes  •  Used  for  IGP/Intra-­‐domain  rouXng  •  Use  link-­‐state  or  distance  vector  protocol  

–  Use  custom  (private)  algorithm  for  selecXng  paths  •  Share  full  path  informaXon  •  Use  policy-­‐specific  path  selecXon  algorithm  at  each  node  •  Used  for  EGP/Inter-­‐domain  rouXng  •  Use  path-­‐vector  protocol  

Spring  2015   CE  151  -­‐  Advanced  Networks   22  

Link-­‐State  Protocols  •  Are  Interior-­‐Gateway  Protocols  (IGPs)  

•  Exchange  link-­‐state  informaXon  –  Pair  of  routers  connected  by  a  subnet  –  Cost  of  subnet  (hop  count,  delay,  etc.)  

•  Conceptually,  very  simple…  

Spring  2015   CE  151  -­‐  Advanced  Networks   23  

Link-­‐State  Protocols  •  Maintains  a  topology  database  of  all  the  links  it  has  heard  of  

–  IniXalize  with  the  subnets  it  is  connected  to.  

•  Floods  link-­‐state  updates  describing  its  directly  connected  subnets,  including  any  changes  to  these  links.  –  “Tell  the  rest  of  the  network  about  your  neighbors”  

•  ParXcipates  in  the  flooding  of  link-­‐state  updates  from  other  routers.  

•  On  update  of  its  topology  database  –  Runs  a  shortest-­‐path  algorithm  on  the  database  to  compute  routes  

•  Dijkstra  is  most  efficient  

–  Updates  its  forwarding  table  with  any  changes.  

Spring  2015   CE  151  -­‐  Advanced  Networks   24  

Characterizing  Link  State  Link-­‐State  •  #  updates  per  link  change?  

–  One.    

•  How  far  propagate  updates?  –  Flooded  to  all  nodes.  

•  One  update,  global  distribuXon.    

•  Scaling  problems  due  to  flooding  

•  As  we’ll  see  next  lecture,  the  characteris3cs  of  distance  vector…  –  …are  very  different  –  …hint  at  a  much  beGer  solu3on  

Spring  2015   CE  151  -­‐  Advanced  Networks   25  

Dijstra  Shortest-­‐Path  Algorithm  •  Breadth-­‐first  search  of  paths,  by  increasing  path  cost,  for  best  paths  to  all  

desXnaXons.  Terminate  when  path  has  been  found  for  all  desXnaXons.  

•  Maintain  two  sets  –  DesXnaXons  for  which  shortest  paths  have  been  found.  

•  Permanently  labeled  desXnaXons  P  •  IniXalize  with  self  

–  DesXnaXons  for  which  candidate  shortest  paths  have  been  found.  •  Temporarily  labeled  desXnaXons  T  •  IniXalize  with  my  neighbors.  

•  Iterate  –  Move  shortest  path  in  T,  say  for  desXnaXon  D,  to  P  –  Add  routes  for  D’s  neighbors,  that  are  extensions  of  the  path  to  T,  to  T  if  they  are  

shorter  than  the  current  path  in  T  for  each  neighbor.  The  “relaxa3on”  step.  –  Repeat  unXl  a  route  has  been  added  to  P  for  all  desXnaXons  

Spring  2015   CE  151  -­‐  Advanced  Networks   26  

More  formally…  •  E  is  the  set  of  edges.  

•  wij  is  the  weight  of  the  link  between  nodes  i  and  j.  

•  P  and  T…  see  previous  slide.  

•  P  and  T  entries  are  triples,  <d,  p,  w>:  –  d  is  the  desXnaXon  –  p  is  the  predecessor  –  w  is  the  link  weight  

Spring  2015   CE  151  -­‐  Advanced  Networks   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.

Dijkstra…  increasing  path  cost  C,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 Spring  2015   CE  151  -­‐  Advanced  Networks   28  

Permanent  Temporary  

TranslaXng  to  a  Protocol  •  Dijkstra  requires  a  “centralized”  implementaXon  

–  Maintain  a  full  graph  of  the  network,  on  an  event-­‐driven  basis  –  Re-­‐compute  routes  as  the  graph  changes  –  Flood  changes  to  your  links  

•  “Brute-­‐force”  protocol.  –  Straight-­‐forward,  easy  to  understand  –  Inefficient…  lots  of  overhead  

Spring  2015   CE  151  -­‐  Advanced  Networks   29  

Review  •  Dijkstra  

–  Iterates  on  “next  shortest  path”  –  Requires  centralized  computaXon  

•  LS  protocols  –  Is  an  IGP  –  Implements  a  centralized  rouXng  model  –  Floods  link-­‐state  updates  describing  current  state  of  its  links  

•  “Tell  the  rest  of  the  network  about  your  neighbors”  –  Use  Dijkstra  algorithm  because  it  is  most  efficient  shortest-­‐path  algorithm  

Spring  2015   CE  151  -­‐  Advanced  Networks   30  

The  Challenge  of  Internet  RouXng  •  Independent  rouXng  computaXons  at  each  router…  

•  Need  to  compute  paths  that…  –  Support  desXnaXon-­‐based  forwarding  –  Are  shortest  –  Are  loop-­‐free  

•  This  is  trickier  than  it  looks…  

Spring  2015   CE  151  -­‐  Advanced  Networks   31  

Herding  Packets…  •  DesXnaXon-­‐based,  hop-­‐by-­‐hop  rouXng  technology  depends  

on  “tame”  metrics  

•  As  we  move  away  from  basic  integers,  things  fall  apart…  

Spring  2015   CE  151  -­‐  Advanced  Networks   32  

Shortest  Forwarding  paths  •  C→D:  C  –  D  =  1  •  B→D:  B  –  C  –  D  =  2  •  A→D:  A  –  B  –  C  –  D  =  3    

Forwarding  Path  ProperXes  •  Shortest  •  Loop-­‐free  

Spring  2015   CE  151  -­‐  Advanced  Networks   33  

A  

B  

D  

C  

1  

3  

3  

1  

1  

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

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

Forwarding  paths  •  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)    

Forwarding  Path  ProperXes  •  Shortest  •  Loop-­‐free  

Spring  2015   CE  151  -­‐  Advanced  Networks   34  

A  

B  

D  

C  

(1,5)  

(3,5)  

(2,5)  

(1,10)  

(1,10)  

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

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

What  is  the  problem  here?    

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

Forwarding  Path  ProperXes  •  Not  Shortest  •  Loop-­‐free  

Spring  2015   CE  151  -­‐  Advanced  Networks   35  

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)    

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

Forwarding  Path  ProperXes  •  Not  Shortest  •  Not  Loop-­‐free  

Spring  2015   CE  151  -­‐  Advanced  Networks   36  

A  

B  

D  

C  

(1,1)  

(5,1)  

(2,1)  

(2,1)  

(1,1)  

Challenges  

•  …algorithms  depend  on  properXes  of  metric  algebra  to  behave  correctly.  

–  Strictly  Bounded    –  Monotonic        

Spring  2015   CE  151  -­‐  Advanced  Networks   37  

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

OSPF  

Spring  2015   CE  151  -­‐  Advanced  Networks   38  

OSPF  •  OSPF  =  Open  Shortest  Path  First  •  The  most  widely  used  rouXng  protocol  •  The  complexity  of  OSPF  is  significant  

•  History:  –  1989:  RFC  1131    OSPF  Version  1    –  1991:  RFC1247      OSPF  Version  2  –  1994:  RFC  1583  OSPF  Version  2  (revised)  –  1997:  RFC  2178  OSPF  Version  2  (revised)  –  1998:  RFC  2328  OSPF  Version  2  (current  version)  

Spring  2015   CE  151  -­‐  Advanced  Networks   39  

What  We  Cover…  •  Messages  

•  Router  IDs  

•  Flooding  process  

•  Metrics  

•  Designated  routers  

•  Areas  

Spring  2015   CE  151  -­‐  Advanced  Networks   40  

OSPF  Messages  •  An  OSPF  message  can  contain  one  of  five  packet  types.  

•  OSPF  is  embedded  directly  in  an  IP  frame  (doesn’t  use  UDP)  –  Protocol  field  is  set  to  89  (OSPF)  –  DesXnaXon  address  is  typically  set  to  one  of  two  mulXcast  addresses:    

•  224.0.0.5  (“AllSPFRouters”…  Hello  messages)  or    •  224.0.0.6  (“AllDRouters”…  rouXng  info  to  “Designated  Routers”).    

•  If  the  OSPF  packet  is  encapsulated  in  an  Ethernet  frame,  the  desXnaXon  MAC  address  is  also  a  mulXcast  address:    –  01-00-5E-00-00-05 or  01-00-5E-00-00-06!

Spring  2015   CE  151  -­‐  Advanced  Networks   41  

OSPF  Packet  Types  •  Hello:  Used  to  establish  and  maintain  adjacency  with  other  OSPF  routers.  

•  DBD:  The  database  descripXon  (DBD)  packet  contains  an  abbreviated  list  of  the  sending  router’s  link-­‐state  database  and  is  used  by  receiving  routers  to  check  against  the  local  link-­‐state  database.  

•  LSR:  Receiving  routers  can  then  request  more  informaXon  about  any  entry  in  the  DBD  by  sending  a  link-­‐state  request  (LSR).  

•  LSU:  Link-­‐state  update  (LSU)  packets  are  used  to  reply  to  LSRs  and  to  announce  new  informaXon.  LSUs  contain  seven  different  types  of  link-­‐state  adverXsements  (LSA).  

•  LSAck:  When  an  LSU  is  received,  the  router  sends  a  link-­‐state  acknowledgment  (LSAck)  to  confirm  receipt  of  the  LSU.  

Spring  2015   CE  151  -­‐  Advanced  Networks   42  

OSPF  Message  Header  

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

Spring  2015   CE  151  -­‐  Advanced  Networks   43  

RouterIDs  

Router ID

Router ID

Router ID

Router ID

Router ID

Router ID

•  Router  ID  plays  an  important  role  in  OSPF  –  Uniquely  idenXfies  each  router  in  a  rouXng  domain  –  Used  in  Designated  Router  elecXon  process  

(explained  later)  

•  Router  ID  is  an  IP  address  of  a  router  

•  Cisco  routers  use  following  algorithm  to  determine  Router  ID  

–  IP  address  configured  with  OSPF  router-id command  

–  If  not  configured,  use  highest  IP  address  of  a  loopback  interface  

–  If  no  loopback  interfaces,  use  highest  acXve  IP  address  of  physical  interface  

•  Advantage  of  loopback  interface  is  it  cannot  fail  

Spring  2015   CE  151  -­‐  Advanced  Networks   44  

OSPF  Hello  Packets  •  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

Spring  2015   CE  151  -­‐  Advanced  Networks   45  

OSPF  LSU  Packets  •  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

Spring  2015   CE  151  -­‐  Advanced  Networks   46  

Link  State  AdverXsement  (LSA)  •  The  LSA  of  router  10.10.10.1  is  as  follows:  

•  Link  State  ID:        10.10.10.1      =  can  be  Router  ID  •  AdverXsing  Router:    10.10.10.1      =  Router  ID  •  Number  of  links:      3      =  2  links  plus  router  itself  

•  DescripXon  of  Link  1:    Link  ID  =  10.1.1.1,  Metric  =  4  •  DescripXon  of  Link  2:    Link  ID  =  10.1.2.1,  Metric  =  3  •  DescripXon  of  Link  3:    Link  ID  =  10.10.10.1,  Metric  =  0  

Spring  2015   CE  151  -­‐  Advanced  Networks   47  

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)

LSA  Format  

Spring  2015   CE  151  -­‐  Advanced  Networks   48  

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

OSPF  Metrics  •  The  OSPF  metric  is  called  cost.  The  following  passage  is  from  RFC  2328:  

–  A  cost  is  associated  with  the  output  side  of  each  router  interface.  This  cost  is  configurable  

•  RFC  2328  does  not  specify  which  values  should  be  used  to  determine  the  cost.  

•  In  Cisco  IOS    –  Link  cost  is  108  ÷  link  bandwidth.  –  Reference  bandwidth  (108)  can  be  changed  with  auto-cost referencebandwidth!–  Modify  link  bandwidth  value  with  bandwidth!

Spring  2015   CE  151  -­‐  Advanced  Networks   49  

Link  State  Database  •  The  collecXon  of  all  LSAs  is  called  the  link-­‐state  database  

•  Each  router  has  an  idenXcal  link-­‐state  database  –  Useful  for  debugging:  Each  router  has  a  complete  descripXon  of  the  network  

•  If  neighboring  routers  discover  each  other  for  the  first  Xme,  they  will  exchange  their  link-­‐state  databases  

•  The  link-­‐state  databases  are  synchronized  using  reliable  flooding  

Spring  2015   CE  151  -­‐  Advanced  Networks   50  

Link  State  Database  

Spring  2015   CE  151  -­‐  Advanced  Networks   51  

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

Neighbor  Discovery  •  Router  mulXcasts  OSPF  Hello  packets  on  all  OSPF-­‐enabled  interfaces.  •  If  two  routers  share  a  link,  they  can  become  neighbors,  and  establish  an  

adjacency  

•  Aoer  becoming  a  neighbor,  routers  exchange  their  link  state  databases  

Spring  2015   CE  151  -­‐  Advanced  Networks   52  

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

Neighbor  discovery  and    database  synchronizaXon  

Spring  2015   CE  151  -­‐  Advanced  Networks   53  

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

Regular  LSA  exchanges  

Spring  2015   CE  151  -­‐  Advanced  Networks   54  

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)

DisseminaXon  of  LSA-­‐Update  •  A  router  sends  and  refloods  LSA-­‐Updates,  whenever  the  topology  or  link  

cost  changes.  (If  a  received  LSA  does  not  contain  new  informaXon,  the  router  will  not  flood  the  packet)  

•  ExcepXon:  Infrequently  (every  30  minutes),  a  router  will  flood  LSAs  even  if  there  are  no  new  changes.    

•  Acknowledgements  of  LSA-­‐updates:    –  explicit  ACK,  or  –  implicit  via  recepXon  of  an  LSA-­‐Update  

Spring  2015   CE  151  -­‐  Advanced  Networks   55  

Why  Designated  Routers?  •  Large  number  of  adjacencies  

–  Full  mesh  of  adjacencies  –  n(n  -­‐  1)/2  adjacencies  

•  Excessive  load  from  flooding  LSAs  

Spring  2015   CE  151  -­‐  Advanced  Networks   56  

ElecXng  Designated  Router  •  OSPF  elects  a  Designated  Router  (DR)  on  mulXaccess  networks  •  DR  is  collecXon  and  distribuXon  point  for  LSAs  on  network  •  Backup  Designated  Router  (BDR)  also  elected  for  case  where  DR  fails  

Spring  2015   CE  151  -­‐  Advanced  Networks   57  

224.0.0.6

224.0.0.5

ElecXng  Designated  Router  •  ElecXon  held  through  exchange  of  Hello  messages  

•  DR/BDR  elecXon  criteria  –  DR  is  router  with  highest  interface  priority  –  BDR  is  router  with  second-­‐highest  interface  priority  –  If  interface  prioriXes  are  equal,  use  Router  ID  

Spring  2015   CE  151  -­‐  Advanced  Networks   58  

ElecXng  Designated  Router  •  Further  elecXons  only  occur  on  failure  of  DR/BDR  

•  On  DR  failure  –  BDR  promoted  to  DR  –  New  BDR  elected  

•  On  BDR  failure  –  New  BDR  elected  

•  Live  (B)DR  not  replaced  by  elecXon.  –  If  DR  dies  

•  BDR  replaces  DR  •  ElecXon  held  to  replace  BDR  

–  If  BDR  dies  •  ElecXon  held  to  replace  BDR  

Spring  2015   CE  151  -­‐  Advanced  Networks   59  

OSPF  Areas  •  An  OSPF  Area  is  a  set  of  routers  that  share  link  state  informaXon  

•  Goal  is  to  address  scalability  problem  with  OSPF  flooding  

•  Area  0  is  the  backbone  area  –  All  areas  must  be  connected  to  he  backbone  area  –  Best  pracXce  to  use  area  0  in  single-­‐area  OSPF  –  Eases  conversion  to  mulX-­‐area  

Spring  2015   CE  151  -­‐  Advanced  Networks   60  

Review  •  OSPF  message  types  

–  Hello  -­‐  establish  and  maintain  adjacency  with  OSPF  routers  –  DataBase  DescripXon  (DBD)  -­‐  summary  of  my  database  –  Link-­‐State  Request  (LSR)  -­‐  request  for  detailed  entry  –  Link-­‐State  Update  (LSU)  -­‐  response  to  LSR  –  Link-­‐State  Ack  (LSAck)  -­‐  acknowledge  receipt  of  LSU  

•  Router  IDs…  –  Uniquely  idenXfies  each  router  in  a  rouXng  domain  –  Used  in  Designated  Router  elecXon  process    –  Best  pracXce  is  to  use  loopback  interface...  it  can’t  fail  

Spring  2015   CE  151  -­‐  Advanced  Networks   61  

Review  •  OSPF  metrics…  

–  “Cost  is  associated  with  the  output  side  of  each  router  interface.”  –  In  IOS  is  108  /  link  bandwidth  (inversely  proporXonal  to  bandwidth)  

•  Designated  routers…  –  MiXgate  impact  of  “full-­‐mesh”  on  #  of  adjacencies  in  topology  (n(n-­‐1)/2)  –  DR  is  collecXon  and  distribuXon  point  for  LSAs  on  network  

•  OSPF  deals  with  scaling  problem  by  using  “areas,”  area  0  is  the  backbone.  

Spring  2015   CE  151  -­‐  Advanced  Networks   62  

The  End  

Spring  2015   CE  151  -­‐  Advanced  Networks   63