Computer Networks
OSPF: Inside an Organization
A corporate network with hundreds of routers can't use RIP (15-hop limit) or manual statics (too many changes). OSPF scales through areas, converges quickly, and works on any equipment.
- **Enterprise:** standard IGP for campus/WAN
- **Datacenter:** OSPF or BGP for underlay
- **Service Provider:** often IS-IS, but OSPF is also used
Предварительные знания
OSPF Areas
**OSPF** (Open Shortest Path First) - a link-state IGP protocol. It divides the network into **areas** for scalability: each area has its own LSDB. Area 0 (backbone) is central - all others must connect to it. This reduces SPF load.
**Rule:** All non-backbone areas must connect to Area 0. If physically impossible - use a virtual link through an intermediate area.
What is an ABR in OSPF?
LSA Types
**LSA** (Link State Advertisement) - OSPF messages about network state. Different LSA types carry different information: about routers, networks, external routes. LSAs are stored in the LSDB and used for SPF calculation.
**LSA Aging:** Every LSA has a max age (3600 sec). A router refreshes its LSAs every 30 minutes. If an LSA is not refreshed - it is removed from the LSDB.
Who generates the Type 5 (External) LSA?
SPF Algorithm
**SPF (Shortest Path First)** - Dijkstra's algorithm for computing shortest paths. Each router builds a tree from itself as the root to all networks. When an LSA changes, SPF is re-run (with optimizations to minimize load).
**SPF Throttling:** OSPF doesn't run SPF immediately on every change. There is a hold-time (to accumulate changes) to avoid overloading the CPU with constant recalculations.
Why do 1 Gbps and 10 Gbps have the same OSPF cost by default?
OSPF Neighbors and DR/BDR
**OSPF Neighbors** are established via Hello packets. On multi-access networks (Ethernet), a **DR** (Designated Router) and **BDR** (Backup DR) are elected for optimization - all LSAs go through the DR, not N×N.
**Non-broadcast:** On NBMA networks (Frame Relay), neighbors must be specified manually since there is no broadcast for Hello. Or use point-to-multipoint mode.
OSPF only works on Cisco equipment
OSPF is an open standard (RFC 2328), works on any equipment
Unlike EIGRP (Cisco proprietary), OSPF is an open protocol. Supported by Linux (FRR, Quagga, BIRD), Juniper, Arista, MikroTik, and any serious network equipment.
Why is a DR needed on a multi-access network?
Summary
- **Areas** scale OSPF; Area 0 is the backbone, all areas connect to it
- **LSA Types:** 1 (Router), 2 (Network), 3 (Summary), 5 (External)
- **SPF** (Dijkstra) builds a shortest path tree from the LSDB
- **DR/BDR** optimize multi-access networks (N adjacencies vs N²)
Related Topics
OSPF often works alongside other technologies:
- BGP — BGP for external routing, OSPF for internal
- Dynamic Routing — OSPF vs RIP vs EIGRP - IGP comparison
- MPLS — OSPF is often used with MPLS in SP networks
Вопросы для размышления
- Why must all areas connect to Area 0?
- How does DR election affect segment fault tolerance?
- When should you increase OSPF reference bandwidth?