OSPF

Course Description

OSPF (Open Shortest Path First) is a popular link-state routing protocol. Routers exchange pieces of information called LSAs (link-state advertisements) to build a complete topology database, the LSDB (link-state database), and use it to calculate the shortest path to every destination. OSPF is an open standard, so you’ll find it in enterprise, campus, data center, and service provider networks. We start with the basics and work our way through the most advanced OSPF topics.

Course Highlights

In this course you will learn:

  • How link-state routing protocols and OSPF work.
  • How to configure single and multi-area OSPF.
  • How to secure OSPF with authentication.
  • How OSPF neighbors form an adjacency, and how to troubleshoot it.
  • What the different OSPF LSA types are used for, and how to read the OSPF database.
  • How OSPF uses different network types.
  • What the different OSPF stub areas are and how they work.
  • How OSPF selects the best path, and how to summarize and filter prefixes.
  • Advanced topics like SPF tuning, LFA fast reroute, and graceful restart.

Presented to you by instructor Rene Molenaar, CCIE #41726

Course at a glance

  • 63 lessons in 5 units, plus a hands-on OSPF lab.
  • Exams: covers the OSPF topics of CCNA 200-301, CCNP ENCOR 350-401, CCNP ENARSI 300-410, and CCIE Enterprise Infrastructure.
  • Format: self-paced lessons with Cisco IOS configurations, packet captures, and video.
  • Last updated: October 2026.

Requirements

  • No OSPF knowledge required; we start from the beginning.
  • Basic knowledge of IP addressing, subnetting, and how routers forward packets.

Course Schedule

What is OSPF?

OSPF (Open Shortest Path First) is a link-state interior gateway protocol (IGP). It routes traffic within a network that is under your own administrative control. Each OSPF router describes its own links in LSAs and floods them to its neighbors, so every router in an area ends up with an identical link-state database. Each router then runs Dijkstra’s SPF (Shortest Path First) algorithm on that database to find the path with the lowest cost to every destination.

Distance vector protocols only know what their neighbors tell them. OSPF is different: every router has a complete map of its area, which makes OSPF loop-free and quick to converge. To keep that map manageable in large networks, OSPF uses areas. Area 0 is the backbone, and all other areas connect to it through Area Border Routers (ABRs). OSPF runs directly on top of IP (protocol 89), uses multicast to find neighbors, and only sends updates when something changes.

Who uses OSPF? It’s one of the most popular IGPs in enterprise and campus networks, and service providers use it in their core, often together with MPLS and BGP. Because it’s an open standard, it works between routers from different vendors. OSPFv2 is used for IPv4, and OSPFv3 for IPv6.

OSPF Learning Roadmap

This roadmap follows the course units. Each topic has a short explanation and links to the lessons where we cover it in detail.

OSPF Fundamentals

OSPF calculates a cost for each link, based on its bandwidth, and picks the path with the lowest total cost. To keep large networks manageable, we split them into areas, connected to the backbone area 0. In this unit you configure single and multi-area OSPF, tune the reference bandwidth for fast links, secure OSPF with authentication, and advertise a default route.

Lessons: OSPF explained, Basic OSPF configuration, Multi-area OSPF, Reference bandwidth, MD5 authentication, HMAC-SHA authentication, Default route

OSPF LSAs and the LSDB

OSPF routers don’t exchange routes; they exchange LSAs (link-state advertisements) that describe routers, links, and networks. All routers in an area build the same link-state database (LSDB) from these LSAs. There are different LSA types for intra-area, inter-area, and external information, and once you know them, you can read the OSPF database like a map of your network.

Lessons: OSPF LSA types, Type 1 Router LSA, Type 2 Network LSA, Type 3 Summary LSA, Type 5 External LSA, LSAs and LSDB flooding, How to read the OSPF database

OSPF Neighbor Adjacency

OSPF routers discover their neighbors automatically with hello packets. Before two routers become neighbors, parameters like the area, hello and dead interval, subnet, and authentication have to match. They then go through several states, from Down to Full, to synchronize their databases. On multi-access networks like Ethernet, a DR and BDR are elected to reduce the number of adjacencies.

Lessons: OSPF packets and neighbor discovery, Hello and dead interval, Router ID, DR/BDR election, Passive interface, Troubleshooting OSPF neighbor adjacency

OSPF Network Types

The OSPF network type of an interface decides whether OSPF discovers neighbors automatically, whether it elects a DR and BDR, and which hello and dead timers it uses. Broadcast and point-to-point are the most common, but you also need to understand non-broadcast and point-to-multipoint for hub and spoke networks like DMVPN. The network type also affects the next hop address of your routes.

Lessons: OSPF network types, Broadcast, Non-broadcast, Point-to-point, Point-to-multipoint over DMVPN, Loopback, Next hop with network types

OSPF Stub Areas

Not every router needs to know every network. Stub areas reduce the size of the LSDB and routing table by replacing external and inter-area routes with a default route. There are four flavors: stub, totally stubby, NSSA (not-so-stubby area), and totally NSSA. The NSSA variants let you redistribute external routes into the area anyway, with type 7 LSAs.

Lessons: Introduction to stub areas, Stub area, Totally stubby area, NSSA, Totally NSSA, NSSA P-bit

OSPF Path Selection, Summarization and Filtering

OSPF doesn’t only look at cost. It always prefers intra-area routes over inter-area routes, and inter-area routes over external routes, before it compares the cost. Because all routers in an area need the same LSDB, you can only summarize and filter at area borders (ABR) and redistribution points (ASBR). When an area can’t connect directly to area 0, a virtual link fixes it.

Lessons: OSPF path selection, Summarization, Distribute-list filtering, Type 3 LSA filtering, Type 5 LSA filtering, Virtual link, Troubleshooting OSPF route advertisement

OSPF Convergence and High Availability

When a link fails, OSPF floods new LSAs and every router runs SPF again. SPF and LSA throttling let you decide how quickly routers react, and incremental SPF reduces the work. Loop-Free Alternate (LFA) Fast Reroute pre-computes a backup path, so traffic switches over almost immediately. For planned maintenance, the stub router feature, graceful shutdown, and graceful restart keep traffic flowing while a router reloads.

Lessons: SPF throttling, LSA throttling, Incremental SPF, LFA fast reroute, Remote LFA, Stub router, Graceful restart, Prefix suppression

Practice: OSPF Lab

Reading about OSPF is one thing; configuring it is another. The OSPF professional lab lets you put everything together: neighbors, areas, network types, stub areas, and troubleshooting.

Lab: OSPF Professional Lab 1

Frequently Asked Questions

What is OSPF?

OSPF (Open Shortest Path First) is a link-state routing protocol. Every OSPF router builds a complete map of the network and uses the SPF algorithm to calculate the shortest path to each destination. It’s an open standard, so it runs on routers from every vendor. Read our introduction to OSPF.

What is OSPF used for?

OSPF routes traffic within a network under your own control, like a company network, a campus, a data center, or the core of a service provider network. It’s one of the most popular interior gateway protocols (IGPs) because it scales well, converges quickly, and is supported by every vendor.

How does OSPF work?

OSPF routers discover their neighbors with hello packets and form adjacencies. Neighbors exchange LSAs (link-state advertisements) until every router in the area has the same link-state database (LSDB). Each router then runs the SPF algorithm on this database to find the path with the lowest cost to each destination and installs those paths in its routing table.

What are OSPF areas?

An area is a group of OSPF routers that share the same link-state database. Areas keep the LSDB small and limit the impact of changes, which is why OSPF scales to large networks. Every area has to connect to the backbone area, area 0, through an Area Border Router (ABR). Learn how to configure multi-area OSPF.

What is an OSPF LSA?

An LSA (link-state advertisement) is the building block of the OSPF database. Routers use different LSA types to describe themselves, multi-access networks, networks in other areas, and external networks. Learn about the OSPF LSA types.

What is the DR and BDR in OSPF?

On multi-access networks like Ethernet, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR). All other routers only form a full adjacency with the DR and BDR, which reduces the number of adjacencies and the amount of LSA flooding. Learn how the DR/BDR election works.

What is the difference between OSPF and BGP?

OSPF is an interior gateway protocol: it routes traffic within your own network and always picks the path with the lowest cost. BGP routes traffic between networks of different organizations and selects paths based on policy. Many networks run both: OSPF inside, and BGP at the edge to their ISPs. Learn more about BGP.

What is the difference between OSPFv2 and OSPFv3?

OSPFv2 is the version for IPv4. OSPFv3 was created for IPv6 and can also carry IPv4 routes with address families. The two work the same way, but OSPFv3 runs per link instead of per subnet, uses new LSA types for prefixes, and originally relied on IPsec for authentication. Compare OSPFv2 and OSPFv3.

Ready to master OSPF?

Get access to all 63 OSPF lessons, the OSPF lab, and every other course on NetworkLessons.com.

Sign up