OSPF States Between two Routers

OSPF : Open shortest path first is the one of the routing protocol in the category of Link State routing protocol. It uses dijkistra algorithm to compute the path between the source and destination.

OSPF is widely used routing protocol in the enterprise network and is favourite routing protocol some says. Even though some of the enterprises uses IS-IS routing protocol but OSPF is widely used.

I am sure a lot of people know about OSPF protocol as it is one of the most important topic in CCNA and CCNP studies. Many network engineers hardly understand the basic concepts of OSPF. When we talk about the basics of the OSPF protocol, first thing came into my mind is what are the states of the OSPF when start initiating the conversation with the neighbouring router.

That's the topic of the day we are going to discuss " The states of the OSPF between two routers ".

Before i started with the states, i am expecting you guys knew about the routing protocols. If no then let me remind you in a simplest way. Routing Protocol is the set of the rules on the router for forwarding the packets from source to destination in L3 network. Make sure i am talking about the packets not frames as frames are the part of the L2 Network and is associated with the Switching not routing. Hope it clears what routing means.

Now we have two kinds of routing protocol ( I am talking about Interior routing protocols ).. They are distance Vector and Link state routing Protocols. Let me remind you these as well.

Distance Vector Routing Protocol is the protocol which share its routing topology after every 30 seconds and is generally based on the Hop count factor. Means if there are two paths between the routers one is 5 hop count away and other is 7 hop count away, then the path with 5 Hop count will be selected as best path.

Link state is a different kind of routing protocol which shares the changes in the topology to the next router after 30 seconds and is based on some of the parameters defined like metric, reliability and so on. Hope you understand the concept of routing protocols and its type. Now lets start with the states of OSPF between the routers.

There are various states of the OSPF between the routers and they are

  • Down State
  • Attempt State
  • Init state
  • 2-Way State
  • Exchange State
  • Exstart State
  • Loading
  • Full state

Lets discuss all these states one by one as follows:-

Down State

Down state is primary OSPF neighbor state. It is the initial state of the OSPF router when you sent the hello to the other end but not received any communication for establishing the communication.
if a router doesn't receive hey packet from a neighbor inside the Router useless c language time (Router dead c programming language = 4*what's up c language by default) or if the manually configured neighbor is being eliminated from the configuration, then the neighbor nation changes from complete to Down.

Fig 1.1 OSPF States( NB)
Fig 1.1 OSPF States( NB)


In some of the network type this stage is not a valid stage.This state is only valid for manually configured neighbors in an NBMA ( Non-Broadcast Multi Access) environment. In Attempt state, the router sends unicast hello packets with every poll interval to the neighbor, from which hellos have not been received within the dead interval.

Init State

This state specifies that the router has received a hello packet from its neighbor, but the receiving router's ID was not included in the hello packet. So you receive the Hello but not received the full information for which you actually looking for.When a router receives a hello packet from a neighbor, it should list the sender's router ID in its hello packet as an acknowledgment that it received a valid hello packet.The state will be crossed whenever you got the packet with the full information.

2-Way State

This state designates that bi-directional communication has been established between two routers. Bi-directional communication means that each router has seen the other's hello packet. This state is attained when the router receiving the hello packet sees its own Router ID within the received hello packet's neighbor field.

At this state, a router decides whether to become adjacent with this neighbor. On broadcast media and non-broadcast multi access networks, a router becomes full only with the designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. On Point-to-point and Point-to-multipoint networks, a router becomes full with all connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multi access networks are elected. For more information on the DR election process, refer to DR Election.
Note: Receiving a Database Descriptor (DBD) packet from a neighbor in the Init state will also a cause a transition to 2-way state.

Exstart State

Once the DR and BDR are elected, the actual process of exchanging link state information can start between the routers and their DR and BDR.
In this state, the routers and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number.

Note that one would logically conclude that the DR/BDR with the highest router ID will become the master during this process of master-slave relation. Remember that the DR/BDR election might be purely by virtue of a higher priority configured on the router instead of highest router ID.

Thus, it is possible that a DR plays the role of slave. And also note that master/slave election is on a per-neighbor basis.

Fig 1.2 OSPF States( NB)
Fig 1.2 OSPF States( NB)

Exchange State

In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors contain link-state advertisement (LSA) headers information only and describe the information of the entire link-state database. Each DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave.

Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state. The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.

Loading State

In this state, the actual exchange of link state information occurs. Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets. During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state update packets are acknowledged.

Full State

In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers' databases are fully synchronized.
Full is the normal state for an OSPF router. If a router is stuck in another state, it is an indication that there are problems in forming adjacencies.

The only exception to this is the 2-way state, which is normal in a broadcast network. Routers achieve the FULL state with their DR and BDR in NBMA/broadcast media and FULL state with every neighbor in the remaining media such as point-to-point and point-to-multipoint.

Note: The DR and BDR that achieve FULL state with every router on the segment will display FULL/DROTHER when you enter the show ip ospf neighbor command on either a DR or BDR. This simply means that the neighbor is not a DR or BDR, but since the router on which the command was entered is either a DR or BDR, this shows the neighbor as FULL/DROTHER.

With this post, i am very much sure you guys understand the states of the OSPF between the two routers. It is one of the important topics as per the interview point of view. One should know at-least the states of the router. without this information OSPF fundamentals are not completed. Every network engineer should go through this post to understand and remember the states.
Share on Google Plus

About Inderdeep Singh ılılılı

Networks Baseline is a group of Network Engineers, which helps you to have the "Technical information" in the field of Networking and guide you with all their expertise.

Popular Posts