How Open Shortest Path First (OSPF) uses Dijkstra's Algorithm for finding Shortest?Routing?
In this article, we will be understanding Routing Protocols and their background Working. There are many protocols for routing but my special focus will be on OSPF (Open Shortest Path First) routing protocol.
What is Dynamic Routing?
Background Information of OSPF
OSPF protocol was developed due to a need in the internet community to introduce a high functionality non-proprietary Internal Gateway Protocol (IGP) for the TCP/IP protocol family. The discussion of the creation of a common interoperable IGP for the Internet started in 1988 and did not get formalized until 1991. At that time the OSPF Working Group requested that OSPF be considered for advancement to Draft Internet Standard.
The OSPF protocol is based on link-state technology, which is a departure from the Bellman-Ford vector-based algorithms used in traditional Internet routing protocols such as RIP. OSPF has introduced new concepts such as authentication of routing updates, Variable Length Subnet Masks (VLSM), route summarization, and so forth.
Open Shortest Path First Algorithm
OSPF uses a shorted path first algorithm to build and calculate the shortest path to all known destinations. The shortest path is calculated with the use of the Dijkstra algorithm. The algorithm by itself is quite complicated. This is a very high level, simplified way of looking at the various steps of the algorithm:
The algorithm places each router at the root of a tree and calculates the shortest path to each destination based on the cumulative cost required to reach that destination. Each router will have its own view of the topology even though all the routers will build a shortest-path tree using the same link-state database. The following sections indicate what is involved in building a shortest-path tree.
OSPF Cost
The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. More overhead (higher cost) and time delays involved crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate the cost is:
For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10M Ethernet line and will cost 10 EXP8/1544000 = 64 to cross a T1 line.
By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the IP OSPF cost <value> interface sub configuration mode command.
Shortest Path Tree
Assume we have the following network diagram with the indicated interface costs. In order to build the shortest path tree for RTA, we would have to make RTA the root of the tree and calculate the smallest cost for each destination.
领英推荐
The above is the view of the network as seen from RTA. Note the direction of the arrows in calculating the cost. For example, the cost of RTB’s interface to network 128.213.0.0 is not relevant when calculating the cost to 192.213.11.0. RTA can reach 192.213.11.0 via RTB with a cost of 15 (10+5). RTA can also reach 222.211.10.0 via RTC with a cost of 20 (10+10) or via RTB with a cost of 20 (10+5+5). In case equal-cost paths exist to the same destination, Cisco’s implementation of OSPF will keep track of up to six next hops to the same destination.
After the router builds the shortest path tree, it will start building the routing table accordingly. Directly connected networks will be reached via a metric (cost) of 0 and other networks will be reached according to the cost calculated in the tree.
Working of OSPF
What is Dijkstra Algorithm? How OSPF uses Dijkstra behind the?scene?
Thanks for reading ?? . Hope you have learned something from this?article!!
ATSE@RedHat || Openshift || 3x RedHat Certified || DevOps(Docker??, Kubernetes?, Jenkins????) || Ansible || Cloud Computing ?(AWS) |||
3 年Good Job Adarsh Kumar