OSPF: A Dynamic Routing Protocol

Nirali Arora
3 min readAug 5, 2021

What is Dynamic Routing?

  • Dynamic Routing is a network routing procedure that facilitates the routers to pick and choose the routing paths depending on the network structure’s logical changes in real-time. This is opposite to the typical traditional static network routing. This is an automated routing technique that requires very little administration and supervision. Various protocols used in this routing method are Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Enhanced Interior Gateway Routing Protocol (EIGRP).

Introduction to OSPF:

  • Open Shortest Path First (OSPF) is a standard routing protocol that’s been used the world over for many years. Supported by practically every routing vendor, as well as the open-source community, OSPF is one of the few protocols in the IT industry you can count on being available just about anywhere you might need it.

Working of OSPF:

  • OSPF is based on link-state routing algorithm in which each router contains the information of every domain and based on this information it defines the shortest path also known as the Dijkstra algorithm. The OSPF learns about every router and subnet within the entire network. 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
  • The way through which OSPF learns about other routers is by sending Link State Advertisement or LSA. This LSA contains information about subnets, routers, and some of the network information. Once all the LSA’s are transferred within the network, OSPF put’s these in a database called LSDB i.e Link State Database. The main goal here is to have each router with the same information in their LSDB’s.
  • OSPF maintains information in three tables named “Neighbor Table” that contain all discovered OSPF neighbors with whom routing information will be interchanged. “Topology Table” contains the entire road map of the network with all available OSPF routers and calculated best and alternative paths. The “Routing Table” where the current working best paths will store and are used to forward the data traffic between neighbors.

What is Dijkstra Algorithm? How OSPF uses Dijkstra behind the scene?

  • Dijkstra Algorithm is a very famous greedy algorithm. It is used for solving the single-source shortest path problem. It computes the shortest path from one particular source node to all other remaining nodes of the graph.
  • So it’s not like we run Dijkstra’s algorithm and it answers all of the best paths. We run it each time we have to get to a unique destination network. And the way that it works is it assigns a cost to the links. And when it gets to a certain point when it says oh, I got something better, I’m going to stop running that calculation because I’ve already established a better pathway to that destination. And so Dijkstra’s algorithm, a complex algorithm, but ultimately it just tells us here’s the best way to go, and then where does that information go inside of our router? Well, that path with the shortest metric to get to that destination network ends up in our routing table.
  • The way through which OSPF chooses the best route is by a metric called cost. OSPF cost is the value to give to a link based on the bandwidth of that interface.
  • Cost = Reference Bandwidth / Interface Bandwidth, where reference bandwidth is 100 Mb/s.

So That’s It, Thank you for reading 😃

Keep Learning, Keep Hustling

--

--

Nirali Arora

ARTH Learner | AWS | Devops | Docker | Ansible | Kubernetes | MLOPS | Linux | Python | Python flask | AI | ML | DL | CV | MongoDB | Hadoop | GIT | GitHub