Showing posts with label OSPF. Show all posts
Showing posts with label OSPF. Show all posts

OSPF, LSR, LSA & LS-DB Everything you must know !!

Link State Routing Protocol:

  • Link state protocols are based on Shortest Path First (SPF) algorithm to find the best path to a destination.
  • Shortest Path First (SPF) algorithm is also known as Dijkstra algorithm, since it is conceptualized by Dijkstra.

LS-DB [Link-State Data Base] Tables:

  • OSPF is link state protocol and when configured it will collect available data to develop a map of all paths available in its network, this data is later saved in its db which is known as LS-DB.
  • LS-DB is collection of all OSPF LSA's received.
  • The information stored in this LS-DB is used to calculate the shortest path using SPF algorithms.
  • Each OSPF router has identical LS-DB.
  • LS-DB are exchanged between neighboring routers soon after they are discovered as neighbors.
  • The information is propagated in DB tables of single OSPF Area.

LS-DB includes below tables :

Neighbor Table → Which contains details of discovered OSPF neighbor.
Topology Table → Which contains details of entire topology map within OSPF area and is also use to calculate the alternate & best paths.


Routing Table → Which contains details of presently being used the best working path which can be forwarded to neighboring routers.
  • All routers in same Area share single topology table, but different routing tables.
  • This is only because OSPF calculates separate best paths for each router on basis of its location in the topology, while all router share the same Link State Topology Table.
  • This helps the topology table to be in sync with each and every available router in network.


What is LSA and how does it helps router to communicate ?

  • LSA stands for Link State Advertisement is basic communication means of OSPF routing protocol for the internet protocol (IP).
  • OSPF uses LS-DB and fills this with LSA.

OSPF uses LSR potocols via LSA.

  • In Shortest Path First (SPF) algorithm, whenever a link's state changes, a routing update called a Link-State Advertisement (LSA) is exchanged between routers.
  • When a router receives an LSA routing update, the link-state algorithm is used to recalculate the shortest path to affected destinations.
  • Each router constructs a map of the complete network. An example of Link State protocol is OSPF.


OSPF Versions and Packets types

OSFPv1 , OSFPv2 and OSPFv3 are 3 types of OSFP version.

OSPFv1 was the first protocol type deployed on internet in early 1990 and since first deployment no issues were seen related to protocol, but they wanted enhance the protocol by adding more features.
These features were then added to OSPFv2.
Thus, OSFPv1 and OSFPv2 does not have any significant differences. But OSPFv2 and OSPFv3 has below differences.


There are 5 types of OSPF Packets available. 
  1. Hello packets
  2. Data base description packets
  3. Link-State request packets
  4. Link-State Update packets
  5. Link-State Acknowledgement packets.

OSPF Protocol



OSPF Protocol stands for open shortest path first.

Its a routing protocol for Internet Protocol networks.
If network is based on IP, the OSPF algorithm will calculate the most efficient way for data to be transmitted.
OSPF has largely replaced RIP protocol in most of corporate networks.
It uses a link state routing (LSR) algorithm and falls into the group of interior gateway protocols (IGPs), operating within a single autonomous system (AS).

Following diagrams will help you understand why OSPF protocol is necessary !!

OSPF network protocol
Basic network topology with data flow.

If we see above network the data/traffic from source to destination is going via router A-H-D.
Let assume this path is the primary and is assigned by user after calculating the shortest path manually.Whenever, there will be any issue in the network the user needs to manually check shortest path and reassign.
Which is definitely cumbersome and time consuming if user have a huge network with many routers.


OSPF network protocol
Fibre cut between router A and H