OSPF Protocol implementing Dijkstra’s Algorithm

Jyoti Pawar
2 min readJun 14, 2022

Router works on third layer of our OSI model. OSPF (Open Shortest Path First) is a routing protocol. When data move across multiple network, IP routing helps to determine the path of data by setting some protocols to reach the source destination. RIP (Routing Information Protocol) and OSPF (Open Shortest Path First) Protocol are types of dynamic routing.

Comparing difference between Static and Dynamic Routing :

Static routing is for small networks like small scale organization that has predicted number of users and static or minimum bandwidth usage

Dynamic Routing used in case of large networks because of it’s capabilities like it keep changing and updating along with network topologies. Dynamic Routing Protocols dynamically discover network destinations.

Dijkstra algorithm is for finding the shortest paths between nodes in the graph. For the case of directed +ve weighted graphs we conclude the minimum path by using this particular algorithm.

OSPF Workflow:

Collect info of all the available path, from neighbour => Storing collected info => determining shortest path.

OSPF (Open Shortest Path First) is a Link State Protocol and is a most famous protocol among the Interior Gateway Protocol (IGP) family, working group of IETF. When configured OSPF will listen to neighbours and gather all link state data available to build a topology map of all available paths in its network and then save the information in its topology database, also known as it’s LSDB (Link-State Database). OSPF has capability to calculate the best shortest path to each reachable subnet/network using an algorithm called SFP (Shortest Path First) also known as Dijkstra algorithm.

OSPF maintains information in three tables:-

“Neighbor Table” that contain all discovered OSPF neighbour with whom routing information will be interchanged. In simple words it contains information about neighbouring routers.

“Topology Table” contains the entire road map of the network with all available OSPF routers and calculated best and alternative paths.

“Routing Table” where the current working best paths will store and it is used to forward the data traffic between neighbours.

Thanks for reading !!

--

--

Jyoti Pawar

Devops || AWS || ML || Deep learning || Python || Flask || Ansible RH294 || OpenShift DO180