Understanding the OSPF Theory

Understanding the OSPF Theory
Understanding the OSPF Theory
Understanding the OSPF Theory
Understanding the OSPF Theory

Tuesday, October 5, 2021

Introduction: (OSPF Theory) Open Shortest Path First

OSPF stands for open shortest path first. OSPF is a dynamic routing protocol that comes under IGP(interior gateway protocol). It is also known as the link state protocol. It works on the shortest path first algorithm (SPF). To advertise route information, OSPF running routers send LSAs to exchange information with neighbors.

LSA Flooding

This picture shows how LSA flooding takes place whenever a change occurs in the network. You can see, at router 8, a new interface with IP address 172.16.3.1 is added, and to notify other routers about this change, R8 sent LSAs to their neighbors, and neighbors will send to their neighbors, and the process will go on until all routers don’t get LSA updates.

  • It is an open standard protocol.

  • In OSPF, no router limit like EIGRP; it supports unlimited routers.

  • It uses 2 multicast addresses, 224.0.0.5 and 224.0.0.6.

  • IP protocol = 89, AD value = 110

  • It supports subnetting.

Basic Terminology

Wildcard Mask: It is the inverted form of the subnet mask (1 is replaced by 0 and 0 is replaced by 1). Learn a step-by-step process to calculatea wildcard mask.

For class A subnet mask is 255.0.0.0, and wild card mask is 0.0.0.255.
For class B subnet is 255.255.0.0, and wild card mask is 0.0.255.255.
For class C subnet is 255.255.255.0 and wildcard mask is 0.0.0.255.

RID: RID stands for router identity. RID is a unique identity of a router. It is a 32-bit number. OSPF used RID to uniquely identify the router. By default, IOS selects one of its interface IP addresses as a RID. You can also configure it manually.

Backbone Router: A router that belongs to area 0 is known as a backbone router. All routers inside area 0, including ABRs, come under the backbone routers.

Internal Routers: Routers that lie inside a single area (all interfaces of the router should be in the same area) are called internal routers.

ABR (Area Border Router): An OSPF router that belongs to area 0 and at least one other area is called an ABR.

ASBR (Autonomous System Boundary Router): A router that belongs to area 0 and one other area. It is a similar definition to ABR, yes, it is similar, only one difference, on both interfaces, different protocols are running.

OSPF Area Design Conditions

  1. Area 0 is mandatory.

  2. All areas should be connected to area 0.

  3. All areas should be continuous.

Why do we use the area concept in OSPF?

The straight-forward answer to this question is to reduce LSA flooding; we make areas in OSPF. For a smaller network single area will not impact the performance. But for a larger network, a single area is not a good choice. Why?

Here are 3 reasons

  1. SPF algorithm takes more time to calculate routes.

  2. To manage a large database, routers require more processing power and memory.

  3. If any small changes occur in the network, LSAs (link state advertisements) are generated, and every router floods the LSA to their neighbours, and after this again SPF algorithm runs to update their routes.

  • Case 1: For example, in a network, a total of 100 routers (all are in one area), so when a change occurs in the topology, all routers receive LSA updates.

  • Case 2: Same topology, a network has 100 routers, but this time we divided the whole network into areas, so whenever a change occurs, routers that reside in the same area where the change occurred only receive the LSA updates.

So, in short, you can say that to reduce LSA flooding, to reduce processing power and memory, we use the area concept in OSPF.

OSPF tables

  1. Neighbour Table: Neighbor table contains information about the directly connected OSPF neighbors.

  2. Database Table: The Database table contains information about the entire topology with respect to each router.

  3. Routing Table: The Routing table contains a list of the best paths calculated by the shortest path first(SPF) algorithm.

OSPF Packets

  1. Hello

  2. DBD (database description)

  3. LSR (Link State Request)

  4. LSU (Link State Update)

  5. LSACK (Link State Acknowledgement)

Hello Message: OSPF uses hello packets to discover neighbors. The routers that are connected on the same link can become neighbors. Hello packets are sent to the multicast IP address 224.0.0.5. Inside hello packets, the router ID (RID) is exchanged. After exchanging hello packets, neighborship is formed.

Database description (DBD): After becoming neighbors, both routers exchange DBD summaries with each other to synchronise their databases.

LSR (Link State Request): After receiving DBD from neighbors, the router matches its own database with DBD. And ifthe router doesn’t have any routes that neighbors have, the router send LSR message to ask for missing route information.

LSU (Link State Update): In response to LSR, the neighbor sends LSU. The neighbor put all the missing route information in LSU and send to the router.

LSAK (Link State Acknowledgment): After receiving LSU, the router send a acknowledge message that I have received the LSU message properly.

After all this process, both routers have the same link state database (LSDB), and now they will form an adjacency.

OSPF States

  1. Down

  2. Init

  3. 2-way

  4. Exstart

  5. Exchange

  6. Loading

  7. Full

OSPF DR/BDR Election:

DR (Designated Router): DR is like the head of a network. Whenever a change occurs, routers will send the LSA to DR and BDR only. DR sends LSA to other routers (DRothers).

  • DR listens to LSAs on multicast address 224.0.0.6.

  • DR transmits LSAs to other routers on 224.0.0.5.

  • DR ensures that all routers have the same synchronised LSDB.

BDR (Backup designated router): BDR takes the responsibility of DR when DR goes down because of any technical issue.

It listens to LSAs on 224.0.0.5 and 224.0.0.6.

DRothers: In a network, all routers other than DR and BDR are known as DRothers.

  • DRother routers transmit LSAs to DR on 224.0.0.6.

  • Listens to network LSAs on 224.0.0.5.

OSPF has 2 types of network.

  1. Point-to-point network

  2. Broadcast or multiaccess network.

In a point-to-point network, there is no need for DR/BDR election. But ina broadcast network, DR/BDR election helps in reducing LSA flooding. Ina broadcast network, whenever changes occur (like a link fails or any new link is added), LSAs are generated and flooded throughout the network so that all routers in the topology can update their LSDB (link state database).

Why do we need DR/BDR?

To reduce LSA flooding and to improve network performance, DR/BDR election is done. Once DR is selected, there is no more LSA flooding in the network. Whenever there is any change in topology, instead of sending LSAs to their neighbor, the router will only inform the DR on 224.0.0.6 multicast address. And then DR takes care of other routers' LSDB, it informs other routers by sending LSAs on 224.0.0.5, so that they can update their LSDB.

Selection criteria for DR (Designated router)

  1. It checks interface priority. The router with the highest priority is selected as DR. By default, all OSPF interface priority is 1.

  2. If all routers have the same priority, then it checks the highest RID. The router that has the highest RID is selected as DR, and the router that has second highest RID is selected as BDR.

By default, IOS select highest IP address as the router RID.

In order to select RID, OSPF gives priority to the loopback interface over physical interfaces. The reason is that loopback are virtual interface, never goes down.

ceo
ceo

Atul Sharma

Atul Sharma

The founder of Network Kings, is a renowned Network Engineer with over 12 years of experience at top IT companies like TCS, Aricent, Apple, and Juniper Networks. Starting his journey through a YouTube channel in 2013, he has inspired thousands of students worldwide to build successful careers in networking and IT. His passion for teaching and simplifying complex technologies makes him one of the most admired mentors in the industry.

LinkedIn |🔗 Instagram

Consult Our Experts and Get 1 Day Trial of Our Courses

Consult Our Experts and Get 1 Day Trial of Our Courses

Consult Our Experts and Get 1 Day Trial of Our Courses

Network Kings is an online ed-tech platform that began with sharing tech knowledge and making others learn something substantial in IT. The entire journey began merely with a youtube channel, which has now transformed into a community of 3,20,000+ learners.

Address: 4th floor, Chandigarh Citi Center Office, SCO 41-43, B Block, VIP Rd, Zirakpur, Punjab

Contact Us :

© Network Kings, 2026 All rights reserved

whatsapp
youtube
telegram
linkdin
facebook
twitter
instagram

Network Kings is an online ed-tech platform that began with sharing tech knowledge and making others learn something substantial in IT. The entire journey began merely with a youtube channel, which has now transformed into a community of 3,20,000+ learners.

Address: 4th floor, Chandigarh Citi Center Office, SCO 41-43, B Block, VIP Rd, Zirakpur, Punjab

Contact Us :

© Network Kings, 2026 All rights reserved

whatsapp
youtube
telegram
linkdin
facebook
twitter
instagram

Network Kings is an online ed-tech platform that began with sharing tech knowledge and making others learn something substantial in IT. The entire journey began merely with a youtube channel, which has now transformed into a community of 3,20,000+ learners.

Address: 4th floor, Chandigarh Citi Center Office, SCO 41-43, B Block, VIP Rd, Zirakpur, Punjab

Contact Us :

© Network Kings, 2026 All rights reserved

whatsapp
youtube
telegram
linkdin
facebook
twitter
instagram

Network Kings is an online ed-tech platform that began with sharing tech knowledge and making others learn something substantial in IT. The entire journey began merely with a youtube channel, which has now transformed into a community of 3,20,000+ learners.

Address: 4th floor, Chandigarh Citi Center Office, SCO 41-43, B Block, VIP Rd, Zirakpur, Punjab

Contact Us :

© Network Kings, 2026 All rights reserved

whatsapp
youtube
telegram
linkdin
facebook
twitter
instagram