OSPF Routing Protocol (Use Cases)
Surayya Shaikh
1x RedHat Certified | ARTH LEARNER | RHCE | Kubernetes | DevOps | Docker | Linux | Python | AWS
OSPF is a Link State protocol that’s considered maybe the most famous protocol among the Interior Gateway Protocol (IGP) family, developed in the mid-1980s by the OSPF working group of the IETF(The Internet Engineering Task Force is the leading Internet standards body. It develops open standards through open processes with one goal in mind: to make the Internet work better.)
When configured, OSPF will listen to neighbors 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 its Link-State Database (LSDB). Using the information from its topology database. From the information gathered, it will calculate the best shortest path to each reachable subnet/network using an algorithm called Shortest Path First (SFP) that was developed by the computer scientist Edsger W. Dijkstra in 1956. OSPF will then construct three tables to store the following information:
Shortest Path First Algorithm
OSPF uses a shortest-path first algorithm in order 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. There is more overhead (higher cost) and time delays involved in 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.
OSPF Areas
OSPF offers a very distinguishable feature named: Routing Areas. It means dividing routers inside a single autonomous system running OSPF, into areas where each area consists of a group of connected routers.
The idea of dividing the OSPF network into areas is to simplify administration and optimize available resources. Resource optimization is especially important for large enterprise networks with a plethora of networks and links.?Having many routers exchange the link-state database could flood the network and reduce its efficiency – this was the need that led to the creation of concept Areas.
Areas are a logical collection of routers that carry the same Area ID or number inside of an OSPF network, the OSPF network itself can contain multiple areas, the first and main Area is called the backbone area “Area 0”, all other areas must connect to Area 0 as shown in the diagram below:
All routers within the same area have the same topology table -Link State Database- but a different routing table as OSPF calculates different best paths for each router depending on its location within the network topology while they will all share the same Link State topology.
领英推荐
The goal of having an Area is to localize the network as follow:
Basics of Dijkstra's Algorithm
Dijkstra’s algorithm is one of the most popular algorithms for solving many single-source shortest path problems having non-negative edge weight in the graphs i.e., it is to find the shortest distance between two vertices on a graph.
Requirements
Dijkstra's Algorithm can only work with graphs that have positive weights. This is because, during the process, the weights of the edges have to be added to find the shortest path.
If there is a negative weight in the graph, then the algorithm will not work properly. Once a node has been marked as "visited", the current path to that node is marked as the shortest path to reach that node. And negative weights can alter this if the total weight can be decremented after this step has occurred.
Algorithm implementation:-
Dijkstra’s Algorithm has several real-world use cases, some of which are as follows:
Thanks for Reading !! ??????
Keep Learning !! Keep Sharing !! ??
Technologue et photographe chez Luto Photographie
1 年"it will calculate the best shortest path to each reachable subnet/network using an algorithm called Shortest Path First (SFP)"?<- it should be (SPF) minor error
FRM @ Zupee, Ex-Airtel, Paytm
3 年Great