The Wayback Machine - https://web.archive.org/web/20241008201308/https://www.geeksforgeeks.org/open-shortest-path-first-ospf-protocol-fundamentals/
Open In App

Open Shortest Path First (OSPF) Protocol fundamentals

Last Updated : 22 Feb, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Open shortest path first (OSPF) is a link-state routing protocol that is used to find the best path between the source and the destination router using its own shortest path first (SPF) algorithm. A link-state routing protocol is a protocol that uses the concept of triggered updates, i.e., if there is a change observed in the learned routing table then the updates are triggered only, not like the distance-vector routing protocol where the routing table is exchanged at a period of time. 

Open shortest path first (OSPF) is developed by Internet Engineering Task Force (IETF) as one of the Interior Gateway Protocols (IGP), i.e., the protocol which aims at moving the packet within a large autonomous system or routing domain. It is a network layer protocol that works on protocol number 89 and uses AD value 110. OSPF uses multicast address 224.0.0.5 for normal communication and 224.0.0.6 for updating to the designated router (DR)/Backup Designated Router (BDR). 

Criteria – 
To form a neighborship in OSPF, there is a criterion for both routers:  

  1. It should be present in the same area.
  2. The router I’d be unique.
  3. The subnet mask should be the same. 
  4. Hello, and the dead timer should be the same. 
  5. The stub flag must match. 
  6. Authentication must match. 
     

OSPF supports NULL, plain text, MD5 authentication. 

Note – Both the routers (neighbors) should have some type of authentication enabled. e.g- if one neighbor has MD5 authentication enabled then others should also have MD5 authentication enabled. 

OSPF messages – 
OSPF uses certain messages for the communication between the routers operating OSPF. 

  • Hello message – 
    These are keep-alive messages used for neighbor discovery /recovery. These are exchanged every 10 seconds. This includes the following information: Router I’d, Hello/dead interval, Area I’d, Router priority, DR and BDR IP address, authentication data. 
  • Database Description (DBD) – 
    It is the OSPF route of the router. This contains the topology of an AS or an area (routing domain). 
  • Link state request (LSR) – 
    When a router receives DBD, it compares it with its own DBD. If the DBD received has some more updates than its own DBD then LSR is being sent to its neighbor. 
  • Link state update (LSU) – 
    When a router receives LSR, it responds with an LSU message containing the details requested. 
  • Link state acknowledgement – 
    This provides reliability to the link-state exchange process. It is sent as the acknowledgement of LSU. 
  • Link state advertisement (LSA) – 
    It is an OSPF data packet that contains link-state routing information, shared only with the routers to which adjacency has been formed. 

Note – Link State Advertisement and Link State Acknowledgement both are different messages. 

Timers – 

  • Hello timer – 
    The interval in which the OSPF router sends a hello message on an interface. It is 10 seconds by default. 
  • Dead timer – 
    The interval in which the neighbor will be declared dead if it is not able to send the hello packet. It is 40 seconds by default. It is usually 4 times the hello interval but can be configured manually according to need. 
     

OSPF supports/provides/advantages – 

  • Both IPv4 and IPv6 routed protocols 
  • Load balancing with equal-cost routes for the same destination 
  • VLSM and route summarization 
  • Unlimited hop counts 
  • Trigger updates for fast convergence 
  • A loop-free topology using SPF algorithm. 
  • Run-on most routers 
  • Classless protocol 
     

There are some disadvantages of OSPF like, it requires an extra CPU process to run the SPF algorithm, requiring more RAM to store adjacency topology, and being more complex to set up and hard to troubleshoot.

OSPF can be used in several types of networks, such as:

Point-to-Point Network: In this network type, two routers are connected via a single point-to-point link. OSPF uses a hello message to maintain the connection between the two routers.

Broadcast Network: In this type of network, there are multiple routers connected to a single broadcast medium, such as Ethernet. OSPF uses a Designated Router (DR) and a Backup Designated Router (BDR) to communicate with all other routers in the network.

Point-to-Multipoint Network: In this type of network, a single router is connected to multiple other routers. OSPF uses a hello message to maintain connections with all other routers in the network.

NBMA Network: Non-Broadcast Multiple Access (NBMA) networks are networks where broadcast is not supported. OSPF can be used in this type of network by using a hello message to discover and maintain connections with other routers in the network.

OSPF Configuration

Configuring OSPF in a network requires a basic understanding of OSPF concepts and a knowledge of the network topology. The following steps outline the basic steps for configuring OSPF in a network:

  1. Define the router ID (RID) for the router. This is a unique identifier for the router in the OSPF network.
  2. Configure the interfaces that will participate in OSPF. This involves enabling OSPF on the interface and defining the network type (point-to-point, broadcast, etc.).
  3. Create an OSPF process and define the area to which the process belongs.
  4. Define the router priority for each interface. This is used to determine which router will be the Designated Router (DR) and Backup Designated Router (BDR).
  5. Enable OSPF authentication, if desired. This is used to secure OSPF communication between routers.
  6. Verify the OSPF configuration and monitor the OSPF status. This can be done using show commands in the router’s CLI.

In conclusion, OSPF is a powerful and widely used routing protocol that is used to determine the best path between source and destination routers. Its advantages, such as load balancing and fast convergence, make it a popular choice for large and complex networks. Understanding OSPF concepts and configuring OSPF in a network requires a solid understanding of network topology and OSPF concepts, but the end result is a highly efficient and reliable routing protocol.


Previous Article
Next Article

Similar Reads

Open Shortest Path First (OSPF) protocol States
Prerequisite - OSPF fundamentals Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path between the source and the destination router using its own Shortest Path First). OSPF is developed by Internet Engineering Task Force (IETF) as one of the Interior Gateway Protocol (IGP), i.e, the protocol which aims
4 min read
Open shortest path first (OSPF) router roles and configuration
Prerequisite - Open shortest path first (OSPF) Open shortest path first (OSPF) is a link-state routing protocol which is used to find the best path between the source and the destination router using its own SPF algorithm. Open shortest path first (OSPF) router roles - An area is a group of contiguous networks and routers. Routers belonging to same
3 min read
Open shortest path first (OSPF) - Set 2
OSPF is abbreviated as Open Shortest Path First. OSPF is an intradomain routing protocol and it is the implementation of link state routing protocol. It falls into the group of interior gateway protocols (IGPs), operating within a single autonomous system (AS). OSPF was designed as an interior gateway protocol. It is used in an autonomous system su
4 min read
Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Both the Stop and Wait protocol and the Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between the Stop-and-wait protocol and the Sliding window protocol is that in the Stop-and-Wait Protocol, the sender sends one frame and waits for acknowledgment from the receiver whereas in the sliding wi
5 min read
Difference between Border Gateway Protocol (BGP) and Routing Information Protocol (RIP)
When dealing with network routing, it's crucial to understand the various protocols that help direct traffic across complex networks. Two significant protocols in this space are the Border Gateway Protocol (BGP) and the Routing Information Protocol (RIP). Each serves different purposes and operates under different principles. This article explores
5 min read
Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
Data transfer is the most common task in network and system communications, and they involve transfer of files using two means i.e the File Transfer Protocol (FTP) and the Secure File Transfer Protocol (SFTP). FTP is a commonly applied protocol that enables files to be transferred through a network from one computer to another, but FTP is unsecure
5 min read
Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP), are designed to avoid network loops in Ethernet. It provide loop-free logical topology. They were both designed to provide network reliability and particularly avoid broadcast radiation, but the major differences are on the rate, functionality and versatility. In this article we
5 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
SLIP and PPP, which are the widely used serial connection techniques, help to connect the distant devices of the network. The fullform of SLIP is Session Layer Internetworking Protocol. SLIP being a primitive protocol put into use during the early connections to the Internet, when there was not much overhead. PPP is slightly more complex as the pro
6 min read
Difference between EIGRP and OSPF
EIGRP (Enhanced Interior Gateway Routing Protocol) It is used to share the information from one router to the neighbor routers if they exist in the same region. It is also a complex protocol but can be configured and make it work easily in small and large networks. It is also a hybrid protocol because it uses the features of the both distance vecto
2 min read
Difference between OSPF and IGRP
1. Open Shortest Path First (OSPF): OSPF uses a link-state routing algorithm. Using the link state information which is available in routers, it constructs the topology in which topology determines the routing table for routing decisions. It supports both variable-length subnet masking and classless inter-domain routing addressing models. Since it
3 min read
Difference between OSPF and IS-IS
1. OSPF : It was developed because of in demand in the internet society to launch a high functionality non-proprietary IGP for the TCP/IP protocol community. The OSPF is an intradomain routing protocol and is based on link state routing technology. It has introduced some new concepts that are authentication of routing updates, variable length Subne
2 min read
What is Passive-Interface Command Behavior in RIP, EIGRP & OSPF?
Routing protocols specify how routers talk to each other to exchange information about routes within the same system. This communication happens by sending all or a portion of routing tables in routing-update messages to their neighbors. Passive-Interface Command Behavior in RIPWhile configuring a router, if we want to prevent an interface from par
2 min read
OSPF Area Types
Open Shortest Path First is a link-state protocol that is used to find the best path between the source and the destination router using its own shortest path first algorithm. It comes under Link State Routing Protocol. It automatically decides the path or table and is used to send router packets with auto path decision and send hello packets every
3 min read
How OSPF Calculate the Best Route?
Answer: OSPF calculates the best route using the Dijkstra algorithm based on the lowest cumulative cost path.OSPF (Open Shortest Path First), that routing protocol very good for choosing the bestest route for data packets to follow from one router to another. It calculates shortest path by considering many many parameters through its algorithm. Cos
2 min read
Difference between RIP and OSPF
Among the dynamic routing protocols, RIP and OSPF are the most commonly used routing protocols for networking. RIP is necessary for the exchange of routing information between routers while OSPF is used for the same purpose but it is different from RIPE in that its function depends on the size and complexity of the network. In this article, I will
6 min read
Difference Between OSPF and BGP
OSPF(Open Shortest Path First) and BGP(Border Gateway Protocol) are routing protocols and both of them have there different characteristics. OSPF finds the best path within a network, while BGP finds the best path between networks. Basically, OSPF is Intra-domain routing and BGP is Inter-domain routing. What is OSPF?OSPF stands for Open Shortest Pa
3 min read
EIGRP fundamentals
Dynamic routing Protocol performs the same function as static routing Protocol does. In dynamic routing Protocol, if the destination is unreachable then another entry, in the routing table, to the same destination can be used. One of the routing protocols is EIGRP. EIGRP: Enhanced Interior Gateway Routing Protocol (EIGRP) is a dynamic routing proto
4 min read
Fundamentals of Fibre Channel
Fibre Channel is a high-speed network technology used to connect server to data storage area network. It handles high performance of disk storage for applications on many corporate networks. It supports data backup and replication. Fibre Channel is needed, as it is very flexible and enables the transfer of data at a faster speed. The topologies, th
3 min read
Fundamentals of Virtual Networking
In general, if we will see a well-established network has become an important part of our lives. Expanding networking helps us to establish relationships with people. Like our social networking in our day to day life, computer networking is also important in this digital world where everything is connected to each other. Computer networking helps u
4 min read
Gigabit Passive Optical Networks (GPON) Fundamentals
GPON is abbreviation for Gigabit Passive Optical Networks which is defined series G.984.1 through G.984.6 by ITU-T recommendation. Gigabit Passive Optical Networks can be transported ATM, TDM (PSTN, ISDN, E1, and E3) traffic and by Ethernet. The network architecture of GBON various FTTx architecture is given below as follows. Figure 1 shown above s
4 min read
Probabilistic shortest path routing algorithm for optical networks
Data transfer operations is a crucial aspect in case of networking and routing. So efficient data transfer operations is a must need, with minimum hardware cost (Optical Cables, WDM Network components, Decoders, Multiplexers) and also in the minimum time possible. Thus, the need is to propose an algorithm that finds the shortest path between two no
5 min read
Difference between Minimum Spanning Tree and Shortest Path
Spanning tree: A spanning tree (T) of an undirected graph(G) is a subgraph which is a tree that includes all the vertices of a graph (G) and the minimum number of edges required to connect the graph (G). And it is a known maximal set of edges with no cycles. Properties: If a graph(G) is not connected then it does not contain a spanning tree (i.e. i
4 min read
Shortest Path Algorithm in Computer Network
In between sending and receiving data packets from the sender to the receiver, it will go through many routers and subnets. So as a part of increasing the efficiency in routing the data packets and decreasing the traffic, we must find the shortest path. In this article, we are discussing the shortest path algorithms. What is Shortest Path Routing?
6 min read
How does the Packet Find the Shortest Path in a Computer Network?
Answer: Packets find the shortest path in a computer network using routing algorithms like OSPF or BGP, which calculate the most efficient route based on various metrics.Routing AlgorithmsVarious routing algorithms determine the shortest path for packets to travel from the source to the destination. Examples include Dijkstra's algorithm, Bellman-Fo
1 min read
Difference between First Come First Served (FCFS) and Longest Job First (LJF) CPU scheduling algorithms
1.First Come First Served (FCFS) : First Come First Served (FCFS) is the simplest type of algorithm. It is a non-preemptive algorithm i.e. the process cannot be interrupted once it starts executing. The FCFS is implemented with the help of a FIFO queue. The processes are put into the ready queue in the order of their arrival time. The process that
3 min read
Difference between Shortest Job First (SJF) and Round-Robin (RR) scheduling algorithms
1.Shortest Job First (SJF) : Shortest Job First (SJF) Scheduling Algorithm is based upon the burst time of the process. The processes are put into the ready queue based on their burst times. In this algorithm, the process with the least burst time is processed first. The burst time of only those processes is compared that are present or have arrive
3 min read
Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Difference between Multi Level Queue Scheduling (MLQ) and Shortest Job First
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all the processes. This is where multi level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the processes such as system process, I/O process etc. Thus we get 'n' number of queues for n c
3 min read