OSPF Explained Step By Step With Practicals From CCNA To CCIE Level
OSPF is a link-state routing protocol and works on link properties, when we think about metrics it has cost value to install routes in Routing Table, it uses a calculation to find the cost for each route To calculate the best, OSPF use SPF or Dijkstra algorithm.OSPF works on Area concepts (Single area and Dual Area) and when we talk about update exchange:
* Single Area: within the area, it sends full updates while getting any change in the topology * Dual Area: between two different areas it sends only partial updates, so whenever router detect a change in one area they just send the new changes in other area. OSPF does not exchange the prefixes individually it binds all the prefixes into a single packet and we call it a database, so OSPF exchanges the database with each other or we can say it exchanges the full database within the area to all the routers so all the routers will have the same database and can have the complete view of the full topology.OSPF has categorized databases in different ways, a different database for a different kind of routes, later we will talk about the database and all the different types and the real use of those
* OSPF routers discover OSPF neighbor routers on directly connected interfaces using hello packets, to establish OSPF neighborship OSPF uses Hello packets using destination address 224.0.0.5. Before bringing the neighbors up, both routers should agree on certain parameters that are specified in the hello packet. Using these steps two routers form neighbor adjacency
* Now OSPF operation begins, routers exchanges link-state information that describes the topology of the network within an OSPF Area. OSPF uses LSA concept to flood the network information throughout the same area, and all the routers in the same area will have identical entries that are stored in their LSDBs. OSPF routers have a granular view of the topology, using these LSA information they have a full topology view of how all the devices are connected and how they are communicating. In the Database, they exchange router ID, Interface details, IP address, Mask running on the segment, subnet ID and a list of all the OSPF neighbors reachable on each interface.
* Now finally all the OSPF routers run SPF to do the final best path calculation on all the prefixes that are present in LSDBs. the SPF algorithm analyzes and compares all possible paths to the destination from the local router’s perspective and selects the one with the smallest metric (cost). This path, together with the next hop and the outgoing interface to the destination, is then a candidate to be placed in the routing table.