OSPF Fundamentals
๐ OSPF Fundamentals
OSPF (Open Shortest Path First) is a dynamic link-state routing protocol widely used in enterprise networks. It provides fast convergence, hierarchical network design, and scalability, making it ideal for medium to large-scale deployments.
๐ OSPF Overview
- Type: Link-State Routing Protocol
- Administrative Distance (AD): 110 (Cisco)
- Open Standard: Supports multivendor environments
๐ง OSPF Operation
- Link-State Database (LSDB): Contains a complete map of the network.
- LSA (Link-State Advertisement): Carries route information.
- LSU (Link-State Update): Transmits LSAs.
- LSAck: Acknowledges received LSUs.
๐งฉ OSPF Adjacency & Neighborship
๐ Neighborship Requirements
Routers must match the following parameters to form a neighbor relationship:
- Area ID
- Authentication settings
- Subnet
- Hello and Dead timers
- Stub flag
- MTU (Maximum Transmission Unit)
๐ค Neighborship Process
- Routers exchange Hello packets to form neighborship.
- Exchange of DBD (Database Description) and LSU packets establishes adjacency.
- Only adjacent routers exchange full routing information.
๐ DR/BDR Election
In broadcast/multi-access networks (e.g., Ethernet), a Designated Router (DR) and Backup Designated Router (BDR) are elected to reduce overhead.
๐ณ๏ธ Election Process
- Router Priority (Highest)
- Default: 1 (carried in Hello packet)
- Configuration:
ip ospf priority <number>
- Router ID (Highest) (Tie-breaker)
- Configuration:
router-id <ID>
- Configuration:
Routers with priority
0are ineligible for DR/BDR election.
โ Why DR/BDR?
Without DR/BDR:
- Number of adjacencies = n(n-1)/2
- Example: 5 routers โ 10 adjacencies
With DR/BDR:
- Each router forms adjacency only with DR and BDR โ Reduces overhead
๐ก Multicast Addresses
- 224.0.0.5 โ All OSPF Routers
- 224.0.0.6 โ DR/BDR Only
๐บ๏ธ OSPF Areas & Design
๐ Hierarchical Design
- Backbone Area (Area 0): Central required area.
- All other areas must connect to Area 0 (Backbone).
๐งฑ Router Types
| Type | Description |
|---|---|
| AR | Area Router โ exists within a single area |
| ABR | Area Border Router โ connects multiple areas |
| ASBR | Autonomous System Boundary Router โ connects to external networks |
๐ Scalability
- Old recommendation (Router Series 2500): Max 50 routers per area
- Current hardware: Supports unlimited routers per area (hardware-dependent)
๐งฎ Dijkstraโs Algorithm in OSPF
OSPF uses Dijkstraโs Shortest Path First (SPF) algorithm to calculate the best paths.
๐ What Is It?
Dijkstraโs algorithm finds the shortest path from the router to all other nodes in the network, building a Shortest Path Tree (SPT) using the LSDB.
โ๏ธ How OSPF Uses It:
- OSPF routers collect LSAs from others in the area.
- Create the Link-State Database (LSDB).
- Run Dijkstraโs algorithm on the LSDB to build the SPT.
- Update the routing table with optimal paths.
๐ Why Use It?
- Fast convergence
- Accurate and loop-free
- Responds quickly to topology changes
๐ Summary
| Concept | Description |
|---|---|
| Protocol Type | Link-State |
| SPF Algorithm | Dijkstraโs Algorithm |
| Areas | Hierarchical with mandatory Backbone (Area 0) |
| Adjacencies | Requires matching neighbor parameters |
| DR/BDR | Reduces link overhead in broadcast networks |
| Scalability | Modern OSPF allows large (virtually unlimited) areas |
| Packet Types | Hello, DBD, LSU, LSA, LSAck |