OSPF states Explained [with Infograhic]

The OSPF Neighbor States Explained with Infographic

I recommend you read my previous blog post about OSPF and how it works first. This article will help you understand different OSPF states and the importance of forming and maintaining OSPF neighbors. Let us get started.

I also recommend going through these posts to grasp the overall routing concept.

What is Routing in Networking, and How does Routing work

What is a Routing table, explained with Show IP Route Command Cisco

Understanding Dynamic Routing Protocols Types

Let me give you an OSPF primer before we begin.

Open Shortest Path First (OSPF) is a link-state routing protocol that uses the Shortest Path First algorithm to discover the best route between the source and the destination network. It is an Interior Gateway Protocol (IGP) and is designed to work within an autonomous system. 
OSPF has its own transport protocol number 89 and an Administrative Distance(AD) value of 110. OSPF uses multicast address 224.0.0.5 for normal communication and 224.0.0.6 for updating Designated Router(DR) and Backup Designated Router(BDR).

OSPF states Infographic

OSPF States Infographic

What are the OSPF states, and why are they important to understand?

OSPF states are the different stages an OSPF-enabled router goes through when initializing and establishing an OSPF connection before it becomes fully adjacent to its neighbors.

There are eight states, and each has a specific purpose.

  • Down
  • Attempt
  • Init
  • 2Way
  • Exstart
  • Exchange
  • Loading
  • Full

Understanding the different OSPF states is important because it can help troubleshoot problems with OSPF connections. For example, if you see that two devices are in the down state, you know that there is no OSPF adjacency between them, and you can begin to troubleshoot the problem.

Let us look into each state in detail.

1

Down State

As the name suggests, in the Down state, the OSPF-enabled router has no information about any other OSPF routers and does not participate in the OSPF routing process.

This is the initial state of a neighbor, and it indicates that no hellos are heard from its neighbor till the dead interval has expired.

If a neighbor goes into the DOWN state, the link state retransmission, database summary, and link state request lists are cleared.

2

Attempt State

An OSPF attempt state is valid only for neighbors manually configured on NBMA networks.

Instead of sending packets to neighbors every poll interval, routers send packets to neighbors at the hello intervals. The local router will send a unicast Hello packet to the neighbor in the set hello interval if it has not yet received a hello packet from that neighbor.

3

Init State

When a router is in the Init state, it is aware of the presence of another router but lacks sufficient information to exchange routing updates with it.

In other words, when an OSPF router gets a hello packet but the local router ID isn’t specified in the received Neighbor field, it enters the Init state. This means that during the last router dead-interval, the router received a Hello packet from the neighbor, but 2-way communication has not yet been established.

4

2-Way State

In a 2-way state, the router knows enough about the other router to exchange routing updates, but the other router hasn’t learned enough about this router to do the same.

This indicates that a two-way dialogue has been formed between two routers because its own router ID is visible in the neighbor field of a neighbor’s Hello packets.

At this point, you can say that two OSPF-enabled routers are officially OSPF neighbors, but there are still many more things to learn, like databases.

One thing to note here is that neighbors must be in a 2-way state or higher to be elected as the OSPF DR or BDR on multi-access networks.

5

Exstart State

ExStart state is the first step in the adjacency formation process; the local router and its neighbor determine which router is responsible for synchronizing the database.

Furthermore, to exchange Data Descriptor Packets (DDPs), an OSPF router will establish a Master/Slave connection between itself and its neighbor.

The master is the neighbor with the highest router ID.

Please note: DDP (Data Descriptor Packets), short for DD or DBD (Data Base Descriptors), are all the same packet types used to summarize database contents.

6

Exchange State

An OSPF router exchanges Data Descriptor Packets(DDPs) between the local router and its OSPF neighbor in the Exchange state.

The router delivers DDPs to neighbors that summarize its whole link state database.

Link-state request packets can also be sent by the router to neighbors in this state, asking for more recent LSAs.

7

Loading State

In the loading state, OSPF routers send and receive Link State Requests (LSR) and Link State Updates (LSU) containing all Link State Advertisements(LSA). These updates are based on neighbors’ DDP or Data Base Descriptors (DBD).

Link State Updates (LSUs) are envelopes that contain all of the Link State Advertisements (LSAs) that have been sent to OSPF neighbors with fresh updates or new networks learned.

8

Full State

The full state is the normal functional state of OSPF, which signifies that everything is operating normally. This means all router and network Link State Advertisements (LSAs) are exchanged periodically, and the databases of all routers are fully synced.

It is important to note that for Broadcast networks and NBMA media, routers will only attain Full State with their DR and BDR routers. However, for point-to-point and point-to-multipoint networks, a router should be in a full state with every surrounding router.

OSPF Packet Types 

There are six different types of packets in the OSPF protocol:

1. Hello Packet: Used to establish a connection between the routers.

2. Database Description Packet: Sent from one router to another to describe how to route traffic to the destination.

3. Router Advertisement: A router sends this packet to announce itself to the rest of the world.

4. Link State Request: Used to request routes from a remote router.

5. Link State Update: Used to inform the local router about changes in the network topology.

6. LSAck: Link State Acknowledgement packets (type 5)

In my last post, I discussed the Hello packet, which is essential to discover a neighbor; in this post, we will discuss the rest of the packet types used to build adjacency between OSPF neighbors.

The adjacency building process uses four OSPF packet types.

What are DDP-Database Description Packets (type 2) or DBD (Data Base Descriptors)?

These packets are used to carry a brief description or summary of each LSA in the link state database of the originating router. However, these descriptions are only partial LSAs.

Three flags govern the adjacency-building process in the DDP:

First, I-bit, or Initial bit, denotes the initial DDP transmission when set.

When the M-bit, or More bit, is set, it indicates that this is not the final DDP transmission.

The MS-bit, also known as the Master/Slave bit, is set in the DDP sent by the master. 

What are LSR-Link State Request packets (type 3)?

After two OSPF neighbor routers have exchanged all of their DD packets, each router has a complete list of LSAs known by its neighbor. Then, any outstanding LSA can be requested.

The router analyses the sequence number of the LSA header received from the neighbor to determine if the neighbor has a more current version of the LSA. If the sequence number is greater than its own, the router recognizes that the neighbor has the latest version of the LSA and sends an LSR (Link State Request) packet to the neighbor to request one or more LSAs.

What are LSU-Link State Update packets (type 4)?

A neighbor responds with an LSU (Link State Update) packet after receiving an LSR packet. Both routers are in the loading state during this process. When the procedure is complete, the state is changed to “Full.”

What are LSAck-Link State Acknowledgement packets (type 5)?

The LSU can either be acknowledged by sending the identical LSU packet back to the transmitting router, called Implicit Acknowledgment, or by sending an LSAck packet, which refers to Explicit Acknowledgment.

Due to the acknowledgment of received update packets, transmitting LSR/LSU packets is a reliable procedure.

Furthermore, all LSAs sent in update packets must be individually acknowledged by one of two means:

Quick Tip:-LSA (Link State Advertisement) and (Link State Acknowledgement)are two different packet types.

Conclusion

This post has covered different OSPF states and packet types used to establish OSPF adjacency. Knowing these concepts will not only help you troubleshoot OSPF-related issues like a neighbor not coming up and out-of-sync OSPF databases, but it will also help you design better networks.

If you have any questions, feel free to reach out! Thanks for reading till the end!

Leave a Reply

Your email address will not be published. Required fields are marked *