Skip to content

Theory - OSPF

On this page

Basic Info

  • link-state protocol
    • consider’s link speeds to determine best paths
    • compare to distance vector protocol RIP, which uses hop counts
  • 224.0.0.5 OSPF Hello packets sent here to discover neighbors
  • 224.0.0.6 all-OSPF-DRs multicast address for OSPF messages about DR, BDR
  • DR/BDR election
    • by default highest RID will win elections. elections only take place with failure
    • interface priority can be configured to influence election. highest from 0 to 255(default 1)

How OSPF Works

  1. Routers build database using information about the network. i.e. routers, IP addresses, status information, subnets, routes to subnets (port or interface to send data to reach subnet), metric
  2. Routers flood database to all other routers. Sends LSAs to neighbors. (Link State Advertisements)
  3. Routers calculate route to all subnets from their perspective to build IP table Routers share everything they know with every other router until all routers know everything there is to know about the network. Sharing all this detailed information requires more overhead relative to distance vector (RIP).

How OSPF Works - How OSPF Routers Use Neighbor Relationships

How Routers Exchange LSAs with Neighbors

LSAs (Link State Advertisements) make up the LSDB (Link State Database)

  • LSAs contain data about the network topology (ex. Router ID, IP address, state, cost)
  • LSDB is all LSAs known by router

Flooding is when routers send all LSAs they have to their neighbors.

LSA message loops are avoided by routers sending messages to neighbors asking if they have LSA first

Re-flooding of LSAs occur when:

  • aging timer expires 30 minutes default
  • link goes up or down

How Routers Calculate the Best Routes

Things to Memorize

  • DR/BDR Election
  • OSPF Neighbor Requirements
RequirementRequired for OSPFNeighbor Missing if Incorrect
Interfaces must be in the same subnet.
They must pass routing protocol neighbor authentication (if
configured).
Hello and hold/dead timers must match.
Router IDs (RID) must be unique.
They must be in the same area.
OSPF process must not be shut down.
Neighboring interfaces must use same OSPF network type.
Neighboring interfaces must use same MTU setting.
Access control lists (ACL) must not filter routing protocol messages.
Interfaces must be in an up/up state.
  • Issues that allow adjacencies, but prevent IP routes
    • Mismatched MTU settings
    • Mismatched OSPF Network Types

DR/BDR/DROther

  • Elections only take place when current DR fails Maybe a Power Outage
    • So if you have a router you wanted to be DR that fails, it might not be DR again until current DR and BDR(if there is one) fail
  • Election Winning
    • Highest OSPF interface priority: highest value wins election. 0 to 255
      • If Tied
    • Highest OSPF Router ID: router with the highest OSPF RID

Questions to Answer

  • What “should” router ID be?
    • mgmt loopback IP?
    • 1.1.1.1, 2.2.2.2, etc.
    • Is there a better way or is it not a big deal.
  • Is it better to use interface configuration or network configuration?
    • Hunch is network so miss-configured interface subnets aren’t advertised?
      • Could that really cause problems?
    • Is the easier interface config good enough, or possibly better for larger networks?…?
      • Steel man interface config.