Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

OSPF (Open Shortest Path First) States

OSPF refers to a link-state routing protocol used to locate the best path present between a destination router and its source using its SPF (shortest path first) algorithm. A link-state routing protocol is exchanged at a time. It is basically a protocol that utilises the concept of triggered updates. So it means that in case we observe a change in the learned routing table, then all the updates would only be triggered. It is unlike the distance-vector protocol in which the routing tables are triggered.

In this article, we will look more into the OSPF (Open Shortest Path First) States according to the GATE Syllabus for (Computer Science Engineering) CSE. We will read ahead to find out more about it.

Table of Contents

What is OSPF?

The OSPF is an abbreviation for Open Shortest Path First. It belongs to the family of IP routing protocols. It’s an IGP, generally used to distribute the information of IP routing throughout a single AS (Autonomous System) in an IP network. To read more on OSPF, click here.

OSPF Terms

There are various terms associated with OSPF. Here are some of the important ones:

Router ID

The router ID refers to the IP address that is the highest active and is present on the router. The loopback address that is the highest is considered first. In case no loopback gets configured, the highest IP address that’s active on the router’s interface is considered.

Router Priority

The router priority refers to an 8-bit value that is assigned to a router that is operating OSPF. It is used to elect the BDR and DR in any broadcast network.

Designated Router (DR)

The DR is elected in order to minimize the total number of formed adjacencies. The LSAs (Link-State Advertisements) get distributed to the DR to the other routers. The election of a DR occurs on a broadcast network. It is the one to which the other routers share their individual DBDs (Database Descriptors). In any broadcast network, the given router would request an update to the DR. As a result, the DR would actually respond to this particular request with a recent update.

Backup Designated Router (BDR)

The BDR is nothing but a backup to the DR in any broadcast network. Whenever the DR goes down, the BDR becomes DR; then, it performs its assigned functions.

DR and BDR Election

The election of DR and BDR takes place in a multi-access network and a broadcast network. The criteria for this election are:

  1. The router that has the highest router priority gets declared as the DR.
  2. Whenever the network observes a tie in the priority of routers, then the highest router would be considered. Here, the highest loopback is considered first. In case the configuration doesn’t happen for any of the loopbacks, then the IP address that is the highest activity on the router’s interface is considered.

What are OSPF (Open Shortest Path First) States?

Any device that supports and operates on OSPF follows the following states:

1. Down

None of the hello packets has been received on a router’s interface in the down state.

Important note – The interface isn’t physically down in a down state. It rather means that the adjacency process of the OSPF hasn’t yet begun.

2. INIT

In the INIT state, the router has received the hello packets from the other router.

3. 2WAY

Both routers receive the hello packets from the other routers in the 2WAY state. Thus, bidirectional connectivity gets established here.

Important note – The BDR and the DR take place in between the 2WAY and Exstart the state only.

4. Exstart

The NULL DBD gets exchanged in this state. Here, the master and the slave elections take place. It means that the router that has the higher router ID happens to be the master, and the other one becomes the slave. Such a type of election decides if a router is supposed to send its DBD first. Those routers that form neighbourship would take part in such a part of the election.

5. Exchange

In the exchange state, there’s an exchange of the actual DBDs.

6. Loading

In the loading state, there’s an exchange of the LSU (Link State Update), LSR (Link State Request), and LSA (Link-State Advertisement).

Important note – Whenever a router receives a DBD from any other router, it then starts comparing its own DBD to the DBD of the other router. In case the DBD received is comparatively more updated than the DBD of its own, then this router would send an LSR to the other one while stating what links it actually needs. Then the other router replies to this router with the LSU, which consists of the updates that it needs. As a return, the router would eventually reply back with a Link State Acknowledgement (LSA) message.

7. Full

The synchronization of all data takes place in the full state. The routing of an OSPF can only begin after the full state.

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.