• Link-state protocol.
  • Uses Dijkstra which calculates the shortest path tree in each area.
  • OSPF v2 for IPv4 and OSPFv3 for IPv6.
  • LSDB = link-state database.
  • Area 0 = backbone, all inter-area traffic goes via area 0.
  • Directly attached routers (i.e. in the same broadcast domain) form adjacencies using hello packets:
    • DR and BDR controls traffic between neighbours
    • = all SPF/link-state routers
    • = all DR routers
  • Does not use TCP/UDP, but IP protocol 0x89.

Area Types

  • Backbone: all other areas connect to it, so it must be (logically) contiguous.
  • Stub: contains intra-, inter-area and default routes, but no external routes.
  • Totally stubby: contains intra-area and default routes only.
  • NSSA: contains intra-, default and external routes:
    • within NSSA, ASBR sends type 7 LSAs.
    • at ABR, sends type 5 LSAs to rest of domain.

Router Types

  • ABR: connects one or more areas to area 0.
  • ASBR: connected to more than one AS, and typically runs BGP as well.
  • IR: internal router (inside an area).
  • BR: backbone router (inside area 0).

Path Preference

  • Path cost/metric is usually associated with link speed
  • 4 metric types:
    • intra-area
    • inter-area
    • external type 1 = external + internal path cost
    • external type 2 = external path cost


  • If priority = 0 then never DR/BDR.
  • Highest priority wins, then highest logical IP address, then highest active interface IP address.
  • When DR fails, BDR becomes new DR and another BDR is elected.
  • New routers with higher priority do not take over DR/BDR unless there is a DR/BDR failure.

LSA Types

 Type  LSA  Description
 1  Router  Intra-area (generated by all routers)
 2  Network  Intra-area (generated by DR on NBMA networks)
 3  Summary  Routes to networks (generated by ABR for intra-AS routes)
 4  Summary  Routes to ASBRs (generated by ABR for intra-AS routes)
 5  AS external  Routes to external destinations (generated by ASBR)
 NSSA external link state
8    External attributes for BGP
9,10,11    Opaque LSA

  • Extension to OSPF.
  • Additional properties:
    • max reservable bandwidth
    • unreserved bandwidth
    • available bandwidth

IOS Configuration Example

router ospf
  router-id x.x.x.x
  auto-cost reference-bandwidth <...>
  area authentication message-digest
  passive-interface default
  no passive-interface <...>
  network x.x.x.x y.y.y.y area z.z.z.z

JUNOS Configuration Example

    reference-bandwidth <x>
      authentication type md5
      interface <i/f>
          md5 <...>

  prefix-list <name>

policy-statement <name>
  term <name>
    from <...>
    then [accept|reject]

  filter <name>
    term <name>
      from [src/dst address|src/dst port]
        count <name>

Useful Articles

Robert Larsen,
4 Jan 2011, 01:05