TechKnowSurge
Cisco CCNA 3.4
VideoNetworkFree

OSPF States

OSPF neighbor states define the step-by-step process a router uses to discover, synchronize, and maintain routing relationships with adjacent devices. This content covers each state from Down through Full convergence, the role of the Designated Router, and how topology changes are propagated across the network.

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

About this video

OSPF uses a structured neighbor state machine to govern how routers discover and establish routing relationships. When an interface first comes online, it enters the Down state, meaning it is sending Hello packets but has not yet received any. It then moves to Init once a Hello packet arrives from a neighbor, and advances to Two-Way once each router confirms it has seen the other's Router ID in a received Hello. The Two-Way state marks the establishment of a neighbor relationship, and it is at this point that the Designated Router and Backup Designated Router are elected on multi-access networks. Routers that need to fully synchronize their Link State Databases continue beyond Two-Way into the ExStart state, where a primary and secondary role are assigned based on Router ID. The router with the higher ID becomes the primary and controls the database sequence numbering. In the Exchange state, routers share Database Description packets containing LSA headers, and in the Loading state they follow up with Link State Requests and Updates to retrieve any missing full LSA details. Once all information is exchanged and acknowledged, the adjacency reaches the Full state, indicating complete database synchronization. After convergence, neighbor relationships appear in one of several forms depending on the devices involved. Full adjacencies exist between any router and the Designated Router or Backup Designated Router, while two non-DR routers maintain only a Two-Way relationship and do not exchange Link State updates directly with each other. All LSA traffic flows through the Designated Router, which listens on the multicast address 224.0.0.6 and redistributes updates to the rest of the network on 224.0.0.5. When a topology change occurs — such as a link going down — the affected router sends a Link State Update to the Designated Router via multicast. The Designated Router updates its own Link State Database and floods the change to all other devices, which respond with Link State Acknowledgments. This centralized update model keeps the entire network synchronized efficiently while limiting unnecessary traffic between non-DR routers. Periodic LSA refreshes also occur every 30 minutes to ensure database accuracy even in the absence of changes.

What you'll learn

What's covered

OSPF Neighbor States

Aligned to

Cisco CCNA
3.4 Configure and verify single area OSPFv2

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.
Router
A network device that forwards data packets between networks based on IP addresses.
Routing Protocol
A protocol used by routers to communicate and share routing information to determine the best path for data.
Disaster Recovery
DR
The process and procedures for recovering IT systems and data following a disruptive event.
Backup Designated Router
BDR
An OSPF router elected on a multi-access network segment as the backup to the Designated Router, ready to take over DR functions if the DR fails. The BDR maintains adjacencies with all other routers on the segment to minimize reconvergence time.
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.
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.
Neighbor Adjacency
A relationship formed between OSPF routers that have exchanged Hello packets and agreed on key parameters, enabling them to share routing information.

Transcript

When an interface on your router has OSPF turned on and is plugged into a network, it will start trying to communicate with other devices. As it establishes those connections it goes through a process and several different states.

OSPF neighbor states

In this example we are going to say that R1 is talking to R2.

First of all, R1 is going to start in the down state. The down state just means it is sending out hello packets but it has not received any hello packets yet. Everything is going to start in that down state.

Then it is going to jump to the init state. Notice I skipped attempt - that is because it is specific to certain networks and we are not really going to deal with it, and some literature does not even have it listed as an option.

What happens in the init state is that R1 receives a hello packet from R2, but within the hello packet we know that R2 lists out all of its neighbor relationships, all of its neighbors. So the init state exists when that hello packet does not list the RID, the router ID, of router 1. That tells router 1 that router 2 has not received a hello packet yet.

As soon as the hello packet gets to R2, and then R2 sends a hello packet to R1 and the router ID of R1 is in that hello packet, then it knows: yes, we now are on the same wavelength, you see me and I see you. So then it goes into two-way, where they now see each other. Once they have seen each other, that is when we say the neighborship is established. We have got a true neighborship going on there, and part of this will also elect a DR and BDR, so that is where that takes place as well.

This is the division line right here. Some of these relationships never progress on past this, and we will see what that looks like in a little bit.

The next state is the ExStart state. The ExStart state is when the DR and BDR establish a primary and secondary relationship. ExStart, and actually the next couple of exchanges here, is just establishing the database and getting the database going. The DR and BDR have to communicate back and forth and figure out who is going to be the primary and who is going to be the secondary - you can also see it in some places listed as master and slave. Whoever becomes the primary is going to have the higher router ID, so the higher router ID becomes the primary and the lower router ID becomes the secondary.

That could be different than the DR and BDR if there is a priority set on those. The DR and BDR use a different set of criteria, which is kind of interesting, that the primary may not be the DR, but this is just a designator for these initial stages.

Based on the router ID, that is going to select a primary, and then the primary initiates an initial database sequence number. A database sequence number gets started, and that is going to be the basis for this first initial configuration.

Once that is done, it goes into exchange mode. In exchange mode, the database packets get sent back and forth and it builds this link state database. It is getting all of these updates to the database, and the database is incrementing through this sequence number. Only the primary can increment the sequence number, so the primary will increment the sequence number and the secondary will acknowledge the sequencing of this database.

Once it has done that, it goes into the loading state. The database just has the link state advertisement headers in it, so it is kind of like a synopsis of all of the different links that are out there. It builds this whole database that has a synopsis of what the database should look like, and realizes: now I actually need the information about these link states, so now I am going to send out link state requests and get link state updates back.

The designated router is going to send out all these link state requests saying, hey, I need these updates. The link state updates are going to get sent back, and the link state updates have the full link state advertisements, not just the header. That gets sent back to the designated router, and now the designated router communicates and sends out link state updates to the rest of the devices.

Once that is done and everything is fully converged, then we say full.

The converged neighbor state

Once everything is fully converged and everything is communicated, we call that the converged neighbor state. This is when the DR is elected, the BDR is elected, and everybody has their link state database all up to date.

So we are going to have several types of relationships that exist in this case.

  • Full. This means that everything is up to date, the link state databases are synced, and this is the relationship with the DR. This would be from any of these devices to the DR, to include the backup designated router to the DR. This is what is going to be listed when we do the show ip ospf neighbors, so that is the neighbor with the DR.
  • Full BDR. This is any device with the backup designated router.
  • Full DROther. This is when the BDR or DR is connected to any of these devices.
  • Two-way DROther. This would be just between two devices here.

Between the BDR and DR and any of these devices, they are going to have all the communication. But between any of the DROthers we do not have link state updates, we do not have link state acknowledgments, we do not have link state requests. Those are only going to be sent to the designated router and the backup designated router. Do notice, though, that we still maintain relationships with all of the devices on this network.

What happens on a topology change

First of all, just know what we have: hello timers, the database timer, a link state request, a link state update and a link state acknowledgment. Those are the different packets that we have that get sent out. The database ones are only for the initial setup. We mentioned how the DR is elected and the database gets passed around to the DR, the DR creates the link state database here and then sends all the updates to the other devices. Once that is done, that comes out of the picture.

The next thing to know is that all the other devices are going to, every 30 minutes, send out a link state update to 224.0.0.6. It is a multicast address, and the DR is listening to that multicast address. That happens every 30 minutes and it is going to contain all the link state advertisements. Remember, link state advertisements are information about each one of the links, and that just refreshes it to make sure that the database is always refreshed.

The other thing that is going to happen is if there is a change to the topology. Let us say there is a link on this router that goes down. That is also going to trigger a link state update, and it is going to send a link state update with that link state advertisement with the change to it. That is going to go to this DR, and once again it is a multicast, so it is being sent to this multicast address.

Then this designated router is going to update its link state database and send out that link state update to all of the other devices, and then a link state acknowledgment is sent back. The link state acknowledgment and everything goes to 224.0.0.6, so that way it is just the designated router that is getting that update - and actually the backup designated router is getting those updates as well, just in case it needs to take over.

But when communication is happening from the designated router to all the other devices, that is happening on 224.0.0.5, so that all the other devices can listen to that. Your hello packets get sent out on that also, because they are all maintaining relationships with each other and they all create those adjacencies.

So if there is a topology change, everything goes through that designated router.

As OSPF establishes communication with each one of its neighbors, it brings that communication through those different states. If we do the ip ospf neighbor, we will see what states those are. Once it is fully converged, these will either say that it is fully converged with that other device, or that it is in a two-way, which means two-way just between two DROthers and not between a DROther and a designated router or a backup designated router.

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 →