Open In App

Open shortest path first (OSPF) - Set 2

Last Updated : 10 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

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 such as a local area network (LAN). 

OSPF Open Shortest Path First

To handle routing efficiently and on time, this protocol divides an autonomous system into areas. Area is a collection of routers, hosts, networks all contained within an autonomous system. An autonomous system can be divided into many different areas, but at the same time, all networks inside an area must be connected. 

ospf
OSPF

From the figure above, we can see that the network is divided and can be structured, or subdivided, into routing areas to simplify administration and optimize traffic and resource utilization. Routers within an area flood the area with routing information. At the borders of these areas are special routers called Area Border Routers (ABRs). These routers summarize the routing information within their respective areas and send it to other areas.

Among the different areas, there is a special area called the backbone area, to which all other areas are connected. It serves as the primary area in the network. Each area has a unique identification. Two different areas cannot be directly connected; they must be connected through the backbone area this is a mandatory requirement. Routers that connect two areas, such as Area 1 and Area 3, do so through an Area Border Router.

Method of Working of OSPF

The OSPF protocol supports authentication and its updates are sent through multicast address 224.0.0.5/6. If one of the links fails the protocol finds the other shortest path to reach the destination hence it possesses faster convergence. While communication hello packets are sent over each 10 sec, and when the reply is not received within 40 sec it is considered time out.

Also when there is a slight change in the router configuration (routers added/removed ) the routing table is updated very fast. It is based on the link state routing protocol. 
As the name suggested shortest path first OSPF calculates the shortest route to a destination through the network based on an algorithm. It uses the Dijkstra algorithm for calculating the shortest path. 

In OSPF, a connection is also referred to as a link, which can be a connection between two routers or between a router and a network. OSPF defines four types of links:

  • Point-to-Point Link: A link between two routers with no hosts or intermediate routers between them.
ospf-2
point to point link
  • Transient Link: This occurs when many routers are attached to a single network, such as a LAN or Wi-Fi. It is often represented in two ways:
    • Realistic Topology: A network layout that closely represents actual physical connections and configurations.
    • Unrealistic Topology: A simplified or abstract representation used for easier understanding or simulation, not reflecting physical reality.
ospf-3
Transient Link
  • Stub Network: A network connected to the OSPF domain through a single router. All data packets sent or received go through this single router.
  • Virtual Link: When a direct link is broken or not possible, a virtual link can be configured by the network administrator to connect two routers indirectly. This is used to maintain OSPF area connectivity. 

OSPF uses five different types of packets:

  • Hello Packet
    • Used to establish and maintain neighbor relationships.
    • Sent periodically to discover and confirm connectivity with other OSPF routers.
    • Includes information such as router ID, hello/dead intervals, and area ID.
  • Database Description (DBD) Packet
    • Used during the exchange of OSPF routing information between routers.
    • Summarizes the contents of the link-state database.
    • Helps routers compare their databases to identify missing or outdated information.
  • Link State Request (LSR) Packet
    • Sent by a router to request specific pieces of link-state information from a neighbor.
    • Typically used after receiving a DBD packet to request details of missing or outdated LSAs.
  • Link State Update (LSU) Packet
    • Carries one or more Link-State Advertisements (LSAs).
    • Sent in response to LSRs or to notify neighbors of a change in the network topology.
  • Link State Acknowledgement (LSAck) Packet
    • Confirms receipt of LSU packets.
    • Ensures reliable delivery of LSAs between routers.

Routing Decisions and Path Optimization

When a packet needs to be forwarded, the key question is: to which network should it be sent, and why?

  • This decision is based on optimization. One common method involves assigning a cost to each network path, known as a metric. The metric helps determine the most efficient route for the packet. 
  • The value of the metric depends on the routing protocol in use. For instance, OSPF (Open Shortest Path First) allows administrators to assign costs to network links based on the type of service required. These costs can be calculated using various factors such as maximum delay, maximum throughput, bandwidth, or error rate.
  • In some cases, multiple routing tables may exist to support different types of services, allowing for optimized routing based on specific requirements like speed, reliability, or load balancing.

Next Article
Article Tags :
Practice Tags :

Similar Reads