Introduction to OSPF

  • OSPF is a link-state routing protocol that was developed as an alternative for the distance vector Routing Information Protocol (RIP).
  • OSPF has significant advantages over RIP in that it offers faster convergence and scales to much larger network implementations.
  • OSPF is a link-state routing protocol that uses the concept of areas.
  • A network administrator can divide the routing domain into distinct areas that help control routing update traffic.
  • A link is an interface on a router, a network segment that connects two routers, or a stub network such as an Ethernet LAN that is connected to a single router.
  • Information about the state of a link is known as a link-state.
  • All link-state information includes the network prefix, prefix length, and cost.

Components of OSPF

Routers running OSPF exchange messages to convey routing information using five types of packets:
these packets are used to discover neighboring routers and also to exchange routing information to maintain accurate information about the network.

  • The router builds the topology table using results of calculations based on the Dijkstra shortest-path first (SPF) algorithm. The SPF algorithm is based on the cumulative cost to reach a destination.
  • The SPF algorithm creates an SPF tree by placing each router at the root of the tree and calculating the shortest path to each node. The SPF tree is then used to calculate the best routes. OSPF places the best routes into the forwarding database, which is used to make the routing table.

OSPF Operational States

OSPF Operation

Down to Init State

When OSPFv2 is enabled on the interface, R1 transitions from Down to Init and starts
sending OSPFv2 Hellos out of the interface in an attempt to discover neighbors.

Init State

When a R2 receives a hello from the previously unknown router R1, it adds R1’s router ID
to the neighbor list and responds with a Hello packet containing its own router ID.

Two-Way State

R1 receives R2’s hello and notices that the message contains the R1 router ID in the list of R2’s neighbors.
R1 adds R2’s router ID to the neighbor list and transitions to the Two-Way State.
If R1 and R2 are connected with a point-to-point link, they transition to ExStart
If R1 and R2 are connected over a common Ethernet network, the DR/BDR election occurs.

Elect the DR & BDR

The DR and BDR election occurs, where the router with the highest router ID or highest priority
is elected as the DR, and second highest is the BDR

Synchronizing OSPF Databases
  • Decide first router: The router with the highest router ID sends its DBD first.
  • Exchange DBDs: As many as needed to convey the database. The other router must acknowledge each DBD with an LSAck packet.
  • Send an LSR: Each router compares the DBD information with the local LSDB. If the DBD has more current link information, the router transitions to the loading state.

After all LSRs have been exchanged and satisfied, the routers are considered synchronized and in a full state. Updates (LSUs) are sent:

  • When a change is perceived (incremental updates)
  • Every 30 minutes


Multiarea OSPF

The hierarchical-topology design options with multiarea OSPF can offer the following advantages.

  • Smaller routing tables– Tables are smaller because there are fewer routing table entries. This is because network addresses can be summarized between areas. Route summarization is not enabled by default.
  • Reduced link-state update overhead– Designing multiarea OSPF with smaller areas minimizes processing and memory requirements.
  • Reduced frequency of SPF calculations-– Multiarea OSPF localize the impact of a topology change within an area. For instance, it minimizes routing update impact because LSA flooding stops at the area boundary.

The Need for a DR

  • excessive number of LSAs exchanged between routers on the same network.
  • Extensive flooding of LSAs– Link-state routers flood their LSAs any time OSPF is initialized, or when there is a change in the topology. This flooding can become excessive.