Forum

Notifications
Clear all

OSPF Routing Protocol Explained.

1 Posts
1 Users
0 Reactions
20 Views
 josh
(@josh)
Member Admin
Joined: 2 months ago
Posts: 510
Topic starter  

OSPF, which stands for Open Shortest Path First, is a widely used link-state routing protocol and an Interior Gateway Protocol (IGP). This means it’s designed to distribute routing information within a single Autonomous System (AS) – a large, cohesive network managed by a single administrative entity, such as an enterprise network or an Internet Service Provider (ISP) segment.

 

 

Key Characteristics of OSPF:

 

  1. Link-State Protocol:

    • Unlike distance-vector protocols (like RIP) that only know the “distance” to a destination and the “next hop,” OSPF routers have a complete “map” of the network topology within their area.

       
    • Each router sends out Link-State Advertisements (LSAs), which describe the state of its directly connected links and its neighbors.

       
    • These LSAs are flooded throughout the OSPF area, and every router in that area builds an identical Link-State Database (LSDB), which is essentially a detailed map of the network’s topology.

       
  2. Dijkstra’s Shortest Path First (SPF) Algorithm:

    • Once a router has a complete LSDB, it runs Dijkstra’s SPF algorithm.

       
    • This algorithm calculates the shortest path to every other destination in the network, with the router itself as the root of the “shortest-path tree.”

       
    • The results of the SPF calculation are then installed into the router’s IP routing table.

  3. Cost-Based Metric:

    • OSPF uses a cost as its metric to determine the best path.

       
    • The cost of a link is inversely proportional to its bandwidth. A higher bandwidth link has a lower cost, making it more desirable.

       
    • The formula commonly used is Cost = Reference_Bandwidth / Interface_Bandwidth. The Reference_Bandwidth is typically set to 100 Mbps by default (though it can be adjusted for faster links like Gigabit Ethernet or 10 Gigabit Ethernet to ensure accurate cost calculations).

       
       
    • The total cost to a destination is the sum of the costs of all links along the path.

       
  4. Hierarchical Design (Areas):

    • One of OSPF’s most significant advantages is its ability to segment a large AS into smaller, more manageable units called areas.

       
    • This hierarchical design offers several benefits:

      • Reduced LSDB Size: Routers only maintain a detailed LSDB for their own area, reducing memory and CPU overhead.

      • Reduced LSA Flooding: Topology changes (LSAs) are typically contained within their area, minimizing the impact on the rest of the network.

      • Faster SPF Calculation: Running SPF on a smaller LSDB takes less time, leading to faster convergence when network changes occur.

    • Area 0 (Backbone Area): All other OSPF areas must connect to Area 0. This forms the backbone of the OSPF network, providing a central point for inter-area communication.

       
       
    • Area Border Routers (ABRs): Routers that connect one or more non-backbone areas to the backbone area (Area 0). They maintain separate LSDBs for each area they belong to and summarize routes between areas.

       
       
    • Autonomous System Boundary Routers (ASBRs): Routers that connect the OSPF AS to another routing domain (e.g., another AS running BGP, EIGRP, or RIP). They inject external routes into the OSPF domain.

       
       
  5. Neighbor Adjacencies and States:

    • OSPF routers establish neighbor adjacencies before exchanging routing information.

       
    • This process involves several states:

      • Down: No Hello packets received from the neighbor.

      • Init: Router has received a Hello packet from a neighbor, but it hasn’t seen its own Router ID in the neighbor’s Hello.

         
      • Two-Way: Both routers have seen each other’s Router IDs in their Hellos, confirming bi-directional communication. On multi-access networks (like Ethernet), Designated Router (DR) and Backup Designated Router (BDR) election occurs here.

         
      • ExStart: Routers determine which one will be the “master” for the Database Description (DBD) exchange (based on Router ID).

         
      • Exchange: Routers exchange DBD packets, which are summaries of their LSDBs.

         
      • Loading: Routers request full LSA information for any entries in the DBDs they don’t have, using Link-State Request (LSR) and Link-State Update (LSU) packets.

         
      • Full: LSDBs are synchronized, and routers are fully adjacent. They can now run the SPF algorithm and build their routing tables.

         
  6. Designated Router (DR) and Backup Designated Router (BDR) Election:

    • On multi-access networks (e.g., Ethernet segments), a DR and BDR are elected to reduce the number of adjacencies and LSA flooding.

       
    • All other routers on the segment form full adjacencies only with the DR and BDR, not with each other. The DR is responsible for distributing LSAs from all routers on that segment to others. The BDR acts as a hot standby for the DR.

    • This election is based on OSPF priority (higher is preferred) and then Router ID (higher is preferred if priorities are equal).

  7. Packet Types:

    • Hello: Used for neighbor discovery and maintenance, and DR/BDR election. (Multicast to 224.0.0.5)

       
    • Database Description (DBD/DD): Summaries of the LSDB to ensure synchronization.

       
    • Link-State Request (LSR): Requests specific LSA information.

       
    • Link-State Update (LSU): Carries the actual LSAs (routing information).

       
    • Link-State Acknowledgment (LSAck): Acknowledges receipt of LSUs.

       

 

Benefits of OSPF:

 

  • Fast Convergence: Rapidly detects network changes and recalculates routes, leading to quick recovery from failures.

     
  • Scalability: Hierarchical area design allows it to scale effectively in large, complex networks.

     
  • Loop-Free Paths: The SPF algorithm inherently guarantees loop-free paths.

     
  • Efficient Updates: Only sends updates when changes occur (triggered updates), and only the specific LSA that changed is flooded.

  • Support for VLSM/CIDR: Classless routing protocol, fully supporting Variable Length Subnet Masks and Classless Inter-Domain Routing.

     
  • Equal-Cost Multipath (ECMP): Can load balance traffic across multiple paths to the same destination if they have the same calculated cost.

     
  • Open Standard: Being an open standard (RFCs 2328 for OSPFv2 for IPv4, RFC 5340 for OSPFv3 for IPv6), it’s supported by virtually all network vendors, ensuring interoperability.

     
  • Authentication: Supports authentication of routing updates to prevent unauthorized routers from participating.


   
Quote
Share: