OSPF

Overview

  • 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

    • 224.0.0.5 = all SPF/link-state routers

    • 224.0.0.6 = 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).

LSA Types

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)

7 – NSSA external link state

8 – External attributes for BGP

9, 10, 11 – Opaque LSA

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

DR/BDR

  • 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.

OSPF-TE

  • Extension to OSPF.

  • Additional properties:

    • max reservable bandwidth

    • unreserved bandwidth

    • available bandwidth

Useful Articles

IOS Configuration Example

router ospf

router-id x.x.x.x

auto-cost reference-bandwidth <...>

area 0.0.0.0 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

protocol

ospf

reference-bandwidth <x>

area 0.0.0.0

authentication type md5

interface <i/f>

metric

authentication

md5 <...>

passive

policy-options

prefix-list <name>

<...>

policy-statement <name>

term <name>

from <...>

then [accept|reject]

firewall

filter <name>

term <name>

from [src/dst address|src/dst port]

then

count <name>

[accept|reject|discard]

© Robert Larsen. All rights reserved.