TechKnowSurge
Cisco CCNA 3.4 Cisco CCNA 3.1 Cisco CCNA 3.2
VideoNetworkFree

OSPF Process

OSPF routers establish network connectivity through a four-step process: forming neighbor adjacencies, exchanging link state advertisements, building a shared link state database, and running Dijkstra's shortest path first algorithm to populate the routing table.

Complete this video to capture a CTF flag worth 1 point.

About this video

OSPF is a link-state routing protocol that brings a network to convergence through four sequential steps, each building on the last. The process begins when routers send hello packets out of their interfaces to discover neighboring Layer 3 devices. As hello packets are exchanged and adjacencies are confirmed, each router records its directly connected OSPF neighbors in a neighbor adjacency table. Because adjacencies are locally scoped, each router's neighbor table reflects only the devices it is directly connected to, so these tables differ across the network. Once neighbor relationships are established, routers flood link state advertisements throughout the topology. These LSAs describe each link in the network and which devices connect to it. Every router receives the same advertisements and uses them to build an identical link state database, giving each device a complete map of the entire network regardless of its position within it. With a full link state database in place, each router independently runs the Dijkstra shortest path first algorithm to compute an SPF tree. The SPF tree maps out every possible path to every known network and calculates a cost for each. The router then selects the lowest-cost path to each destination and installs those routes into its routing table. At this point the network has fully converged, meaning all routers share a consistent understanding of the topology and are forwarding traffic along optimal paths.

What you'll learn

What's covered

OSPF Process

Aligned to

Cisco CCNA
3.4 Configure and verify single area OSPFv2
3.1 Interpret the components of routing table
3.2 Determine how a router makes a forwarding decision by default

Key terms

Open Shortest Path First
OSPF
A link-state interior gateway routing protocol that maintains a complete map of the network topology and uses Dijkstra's Shortest Path First algorithm to calculate optimal, loop-free routes. OSPF divides networks into hierarchical areas to improve scalability and supports VLSM and rapid convergence.
Routing Protocol
A protocol used by routers to communicate and share routing information to determine the best path for data.
Router
A network device that forwards data packets between networks based on IP addresses.
Link State Advertisement
LSA
A packet generated by OSPF routers that describes the local router's links and their states, flooded throughout the OSPF area to build each router's link-state database. Different LSA types carry different information such as router links, network links, summary routes, and external routes.
Link-State Database
LSDB
An OSPF database containing the topology table, which holds information about all links and their states within an OSPF area, synchronized identically across all routers in that area.
Sender Policy Framework
SPF
Sender Policy Framework is an email authentication protocol that allows domain owners to specify which mail servers are authorized to send email on their behalf, helping receiving servers identify and reject spoofed messages.
Neighbor Adjacency
A relationship formed between OSPF routers that have exchanged Hello packets and agreed on key parameters, enabling them to share routing information.
Routing Table
A database stored in a router that lists known network destinations, the metric (cost) to reach them, and the next-hop address or outgoing interface to forward packets toward those destinations. Routers consult this table for every packet they forward.

Topics

Ospf Link State Routing Dijkstra Algorithm Routing Protocols Network Convergence Networking

Transcript

A quick rundown of the process

Here's a quick rundown of the OSPF process. The first thing a router is going to do is start sending out hello packets to establish neighbor adjacencies, to figure out which routers, which layer 3 devices, that router is connected to.

Next, what it's going to do is exchange link state advertisements with those routers to figure out where all the links in the network are. It's going to build the link state database. Once it has the link state database fully built, then it can run through its Dijkstra algorithm, or the OSPF algorithm, the shortest path first algorithm, to create the shortest path first tree. And then once it has the tree, figuring out where all of the different ways are to get to each one of the networks, then it can use that to install the best route onto the routing table.

Establishing neighbors

One of the first things that these routers will do is they'll reach out to each other and communicate with hello packets, and those hello messages that are being sent back and forth between these routers are going to establish some sort of neighbor adjacency.

Each one of these routers has a neighbor adjacency table that it will record its neighbors on. So for this layer 3 switch right here, it's going to say, I'm attached to R1. This Router 1 is going to say, well, I'm attached to Switch 1 and I'm also attached to Router 2, or I have an adjacency to Router 2. This Router 2 is going to say, well, I have a connection with Router 1 and Router 3. And this Router 3 is going to have a connection with Router 2.

So that is the first step, is establishing neighbors. With each one of these neighbors it records other information also. Notice that I have some blank fields here, because it records multiple things within here, but we're just going to keep it simple for the process of what we're doing right here.

Exchanging link state advertisements

Next in this process is they will exchange link state advertisements. So all of the link state advertisements get sent out across all of this topology here, and they'll exchange information about each one of the links.

So let's label each one of these links. This is link one right here, this is link two, and this is link three. And they'll start building out their link state database. So for instance, this Router 1 will see that link one is connected to HQ SW1 and it also is connected to Router 1. It will see that link 2 is connected to both Router 1 and Router 2, and it'll see that link 3 is connected to both Router 2 and Router 3.

And this information is passed to all of the devices, so they'll each one get the same information. Each of the link state database tables will be populated with all of the same information. So now what they can see is all of the links on the network, and all of who is connected to that link.

Building the shortest path first tree

The next step in this process is to figure out the SPF algorithm, that Dijkstra algorithm. It takes this information of all of the links and then creates that SPF tree. And that SPF tree, in this example right here, is very simple, so pretty much it's a straight line, and we'll do that for each one of the networks that it's trying to get to. So for instance, HQ SW1 can go through R1 and R2 and R3 to get to this network right over here. So it's going to do that for each one of the networks, and it knows of that network that's hanging off of R3 here.

Installing the best route

And then it will install that into the routing table. So that information then is compiled and goes into the routing table. What goes into the routing table is based off of cost, but what will happen is the best route is going to be installed on that routing table.

So at this point in time we have the full network, the full OSPF network is now converged. We have information in our neighbor table of all of the information of the connected layer 3 devices that are using OSPF in that area, and each one of those neighbor tables, remember, is different depending on which router you're looking at; they have different neighbors. Then the link state database is all the same there. So it creates that link state database, and then from that it creates that shortest path first tree to figure out what is going to be the cost for each one of those paths, and then it puts the best, the lowest cost path, into the routing table.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →