Open Shortest Path First (OSPF) Basics

Open Shortest Path First(OSPF) is a classless routing protocol. It uses a link-state routing protocol, which means that the routers exchange topology information with their nearest neighbors.

The OSPF maintains three separate tables that are:

Neighbor table – A neighbor table contains a list of all neighboring routers.

Topology table – A topology table contains a list of all possible routes to all known networks within an area.

Routing table – A routing table contains the best route for each known network.

OSPF Features

A list of OSPF features are given below:

  • It consists of areas and autonomous systems
  • It allows the scalability
  • It minimizes the routing update traffic
  • It supports the VLSM/CIDR
  • It has an unlimited hop count
  • It allows multi-vendor deployment
  • It supports only IP routing.
  • By default, OSPF routers have an administrative distance 110.
  • It uses the Dijkstra Shortest Path First algorithm to find the shortest path.
  • OSPF includes additional features such as equal-cost, multipath routing, and routing based on upper-layer type-of-service (TOS) requests

Advantage of OSPF

There are following advantages of OSPF:

  • OSPF is a combination of both RIP and IGRP routing protocols.
  • As we know, it is a link-state protocol, so it provides fast convergence and excellent scalability.
  • OSPF does not send the entire routing table. It only sends those updates in the routing table which have changed.

Disadvantage of OSPF

There are the following disadvantages of OSPF:

  • OSPF requires more RAM to store the topology.
  • OSPF requires extra CPU process to run the Shortest Path First (SPF) algorithm.
  • It is a more complex protocol to implement as compared to RIP.
  • It is very difficult to troubleshoot OSPF network.

Building Blocks of OSPF

Link – It is an interface of a router which is assigned to any given network.

Router ID (RID) –The Router ID is an IP address which is used to identify the router.

Neighbor – Neighbor routers are those that have an interface on a common network, such as two routers are connected on a point-to-point serial link.

Adjacency –It is a relationship between two OSPF routers that permits the direct exchange of the router updates (tables).

Hello protocol –The Hello protocol provides dynamic neighbor discovery and maintains neighbor relationships. Hello packets are mainly addressed to the multicast address 224.0.0.5.

Neighborship database –It contains a list of all OSPF routers from which Hello packets are seen. It includes a variety of details, like the Router ID and state.

Topological database –It contains information from the Link State Advertisement (LSA) packets that have been received for an area.

Link State Advertisement –It is used to update and maintain the topology database.

Designated Router (DR) –A Designated Router is elected whenever OSPF routers are connected to the same multi-access network.

Backup Designated Router (BDR) –A Backup Designated Router is a hot standby router for the DR on multi-access links. It receives all routing updates from the OSPF adjacent routers.

OSPF areas –The OSPF areas are a group of connected networks and routers.

Broadcast (multi-access) –Broadcast networks allow multiple devices to connect with the same network as well as provide an ability to deliver a single packet to all nodes present in the network.

Non-Broadcast Multi-Access (NBMA) – Non-broadcast-multi-access networks allow multi-access. It does not have the broadcast ability like Ethernet.

Example: ATM (Asynchronous Transfer Mode)

OSPF states                                         

  1. Down –It indicates that no Hellos have been received from the neighboring router.
  2. INIT –It indicates that a Hello packet has been received from the neighbor, but two-way communication has not been established.
  3. 2WAY –It indicates that bidirectional communication has been established.
  4. Exstart –It indicates that the routers are preparing to share link-state information.
  5. Exchange –It indicates that the routers are exchanging Database Descriptors (DBDs). A router will use a neighbor’s DBD to determine if it has information to share or not.
  6. Loading –It indicates that routers are exchanging Link State.
  7. Full –It indicates that the routers are fully synchronized.

Difference between OSPF and RIP Routing Protocols:

Characteristic OSPF RIPv2 RIPv1
 Protocol Link state Distance vector Distance vector
Classless support Yes Yes No
VLSM support Yes Yes No
Auto-summarization No Yes Yes
Manual summarization Yes No No
Path metric Bandwidth Hops Hops
Route Propagation Multicast on change Periodic multicast Periodic broadcast
Hop count limit None 15 15
Convergence Fast Slow Slow
Peer authentication Yes Yes No
Hierarchical network requirement Yes (Using areas concepts) No No
Update Event triggered Route table updates Route table updates
Route computation algorithm Dijkstra Bellman-Ford Bellman-Ford