What is OSPF ?
Course Contents
Introduction
Imagine you’re late for a meeting. You jump in your car, open your GPS, and ask it to find the fastest route. It scans the roads, traffic conditions, and construction zones, then gives you the best possible path to arrive on time.

That’s exactly how OSPF behaves in your network. Like a GPS, it constantly updates its view of the network and recalculates routes whenever something changes, always aiming for the shortest and most efficient path to your destination.

Just like your GPS guides you to the best path, OSPF ensures that for example PC1 sends traffic to PC2 using the most optimal route available in our network.
OSPF in the Routing Landscape
Before we dive deeper into how OSPF works, it’s important to understand what kind of protocol it is and how it compares to others.
In a network, routers need a way to learn where different destinations are and how to reach them. They do this by using routing protocols, which fall into two main categories:

EGP vs IGP
- EGP (Exterior Gateway Protocol):
Used to exchange routes between organizations, like between Internet Service Providers or large networks.
Today, the only EGP still in common use is BGP (Border Gateway Protocol).
- IGP (Interior Gateway Protocol):
Used inside an organization’s network, between internal routers.
This is where OSPF belongs.
Since OSPF is used within an organization, it’s classified as an IGP.
Types of IGPs
Within IGPs, protocols are categorized by how they exchange routing information:

Distance-Vector protocols
Share information only with direct neighbors. Each router makes decisions based on what its neighbors report.
Example: RIP
Uses hop count as the main metric, fewer hops mean a better path, regardless of link quality.
Link-State protocols
Share detailed link information with all routers in the area. Each router has a synchronized map of the network.
Example: OSPF
Calculates the best path based on interface cost, often tied to bandwidth, for more accurate and efficient routing.
Hybrid protocols
Combine characteristics of both Distance-Vector and Link-State.
Example: EIGRP
EIGRP uses neighbor-based communication like Distance-Vector, but applies more advanced metrics and maintains a partial view of the topology making it faster and more accurate than RIP.
OSPF Sees the Whole Network
Let’s start with OSPF.
It’s a Link-State protocol, which means every router shares full details about its connected links. This allows each router to build a complete and synchronized map of the network.
Once the map is ready, each router runs the Dijkstra algorithm to calculate the shortest paths.

RIP Has a Limited View
RIP works very differently.
It’s a Distance-Vector protocol, meaning each router only shares its known routes with direct neighbors. Routers then slowly build a view of the rest of the network, hop by hop.

Because of these constraints, RIP became too limited for modern networks.
What About EIGRP?
EIGRP is a bit different. It’s considered a hybrid routing protocol, combining features from both Distance-Vector and Link-State:
- Like Distance-Vector, it exchanges routing information with neighbors.
- But like Link-State, it uses advanced metrics and tracks the state of links more intelligently.
This makes EIGRP faster and more efficient than RIP.
However, there’s one big limitation:
EIGRP was originally Cisco proprietary, meaning it only worked in Cisco-only environments.
That’s why EIGRP is rarely used in multi-vendor networks where interoperability is critical.
For most enterprise networks, the need for standardized, vendor-neutral protocols made OSPF the preferred choice.
Summary Table
Protocol | Type | Characteristics | Vendor Support | Typical Use Case |
---|---|---|---|---|
RIP | Distance Vector | Very simple, 15-hop limit | All vendors | Small or legacy networks |
EIGRP | Hybrid | Fast convergence, Cisco-only originally | Cisco only | Cisco-specific environments |
OSPF | Link-State | Full topology view, open standard | All vendors | Modern enterprise networks |
How OSPF Works (Step by Step)
Just like a GPS constantly updates its map, OSPF routers follow a clear process to keep the network updated and choose the best paths.
This process includes five steps that every OSPF router performs to stay in sync with others and calculate the most efficient routes.
Step 1 – Establish Neighbor Adjacencies
OSPF starts by discovering other routers on the network.
Each router sends Hello packets to let others know it’s active.

If another router receives the Hello packet, it replies to confirm it’s also running OSPF.
A neighbor relationship is then formed between them, allowing both routers to share routing information.
Step 2 – Exchange LSAs
After neighbors are discovered, routers begin exchanging Link-State Advertisements (LSAs).
Each router sends information about the links it has and the networks it is connected to.

These LSAs are flooded across the entire area, so that every router receives the same information and can build a complete view of the network.
Step 3 – Build the LSDB
Each router collects all the received LSAs into a structure called the Link-State Database (LSDB).
This database represents the complete network topology from the router’s point of view.

Because all routers receive the same LSAs, their databases are identical.
This keeps the entire OSPF area consistent and synchronized.
Step 4 – Run the SPF Algorithm
Once a router has received all LSAs and built its own Link-State Database (LSDB), it runs the Shortest Path First (SPF) algorithm also known as Dijkstra’s algorithm to calculate the best routes to all destinations in the OSPF area.

The router builds a tree of shortest paths, using itself as the starting point.
This helps it determine the most efficient way to reach every network in the area.
Step 5 – Install the Best Routes
After calculating the shortest paths, the router installs the best routes into its routing table.

Thanks to OSPF, the router now knows how to reach each destination network efficiently.
It can then use these routes to forward traffic through the network, depending on what it learns from OSPF.
Summary
LLet’s recap what you’ve just learned:
- Now you know what OSPF is: a dynamic routing protocol that builds a complete and synchronized map of the network.
- It forms neighbor relationships, exchanges LSAs, builds a database, calculates optimal routes, and installs them.
- It can adapts quickly to changes, using smart communication between routers.
Just like a GPS that constantly reroutes you in traffic, OSPF keeps your network optimized and efficient in real time.
Ready to Practice?
In the next lesson, we’ll move from theory to practice.
You’ll configure OSPF on real routers and see everything you’ve just learned come to life step by step.
Let’s get started.