🧭

OSPF Version 2 Essentials

Nov 5, 2025

Overview

OSPF Version 2 is a link-state interior gateway protocol (IGP) designed for routing within a single Autonomous System. The protocol maintains identical topology databases across routers, calculates shortest-path trees, and supports rapid route recalculation with minimal protocol traffic overhead.

Protocol Fundamentals

  • Classification: Interior Gateway Protocol (IGP) based on SPF/link-state technology
  • Version: Documents OSPF Version 2 (IP protocol number 89)
  • Routing Method: Constructs shortest-path tree with router as root; routes IP packets based solely on destination address
  • Authentication: All protocol exchanges authenticated with multiple schemes supported
  • Multicast Support: Utilizes IP multicast (224.0.0.5 AllSPFRouters, 224.0.0.6 AllDRouters) for efficient packet distribution
  • Metric: Single dimensionless cost metric; supports equal-cost multipath routing

Area Architecture

  • Hierarchical Design: AS divided into areas to reduce routing traffic and database size
  • Backbone Area: Area 0.0.0.0 connects all other areas; must remain contiguous
  • Area Border Routers: Connect multiple areas; condense topology information for distribution
  • Stub Areas: Exclude AS-external-LSAs; use default route for external destinations
  • Virtual Links: Unnumbered point-to-point links through non-backbone areas to maintain backbone connectivity
  • Transit Areas: Non-backbone areas capable of carrying transit traffic (TransitCapability = TRUE)

Link State Advertisements (LSAs)

LSA Types Summary:

TypeNamePurposeFlooding Scope
1Router-LSADescribes router's interfaces to areaSingle area
2Network-LSALists routers on transit networkSingle area
3Summary-LSADescribes inter-area network routesSingle area
4Summary-LSADescribes AS boundary router routesSingle area
5AS-external-LSADescribes routes external to ASEntire AS (except stubs)
  • LSA Header: 20-byte standard header with LS age, type, ID, advertising router, sequence number, checksum
  • Aging: LS age increments to MaxAge (3600 seconds); LSAs refreshed every LSRefreshTime (1800 seconds)
  • Sequence Numbers: Range from InitialSequenceNumber (0x80000001) to MaxSequenceNumber (0x7fffffff)
  • Flooding: Reliable algorithm ensures database synchronization across adjacencies

Router Classification

  • Internal Routers: All interfaces in same area; run single SPF algorithm copy
  • Area Border Routers: Connect multiple areas; run separate algorithm per area; summarize topology
  • Backbone Routers: Have interface to backbone; includes all area border routers
  • AS Boundary Routers: Exchange routing with other autonomous systems; advertise external routes

Adjacency Formation

  • Hello Protocol: Discovers neighbors; sends packets every HelloInterval; declares router down after RouterDeadInterval
  • Neighbor States: Down, Attempt, Init, 2-Way, ExStart, Exchange, Loading, Full
  • Database Synchronization: Master/slave relationship during Database Description exchange
  • Designated Router: Elected on broadcast/NBMA networks; originates network-LSA; reduces adjacency count
  • Backup Designated Router: Becomes DR when current DR fails; maintains adjacencies with all routers

Packet Types

TypeNameFunction
1HelloDiscover/maintain neighbors; elect DR/BDR
2Database DescriptionSummarize database during synchronization
3Link State RequestRequest specific LSAs during loading
4Link State UpdateFlood LSAs reliably
5Link State AcknowledgmentAcknowledge received LSAs

Routing Table Calculation

  • Intra-Area Routes: Dijkstra shortest-path algorithm calculates routes within area using router-LSAs and network-LSAs
  • Inter-Area Routes: Area border routers examine summary-LSAs; backbone distributes between areas
  • AS External Routes: Examine AS-external-LSAs originated by boundary routers
  • Path Type Preference: Intra-area > inter-area > type 1 external > type 2 external
  • Incremental Updates: Recalculation triggered only for affected destinations when LSA changes
  • Equal-Cost Multipath: Multiple paths with same cost maintained; traffic distributed equally

Network Types

  • Point-to-Point: Direct connection between two routers; adjacency always forms
  • Broadcast: Supports multicast; DR/BDR elected; neighbors discovered dynamically
  • NBMA: Non-broadcast multi-access; DR/BDR elected; neighbors may require configuration
  • Point-to-MultiPoint: Treated as collection of point-to-point links; no DR election

Authentication Options

  • Null Authentication: No security; only checksum verification
  • Simple Password: 64-bit clear password in header; vulnerable to passive attacks
  • Cryptographic Authentication: MD5 message digest appended; protects against passive attacks; uses non-decreasing sequence numbers

Key Terms & Definitions

  • Router ID: 32-bit unique identifier for router within AS
  • Autonomous System: Group of routers using common routing protocol
  • Link State Database: Collection of all LSAs describing AS topology
  • Flooding: Reliable distribution and synchronization of LSAs between routers
  • SPF Algorithm: Shortest Path First (Dijkstra) algorithm for tree construction
  • Designated Router: Router responsible for network-LSA generation on multi-access networks
  • Forwarding Address: IP address where packets should be forwarded (in AS-external-LSAs)
  • LSInfinity: Metric value (0xffffff) indicating unreachable destination

Configurable Parameters

  • Global: Router ID, RFC1583Compatibility flag
  • Area: Area ID, address ranges, ExternalRoutingCapability, StubDefaultCost
  • Interface: IP address/mask, HelloInterval (10s default), RouterDeadInterval (40s default), RxmtInterval, InfTransDelay, Router Priority, AuType
  • Virtual Link: Endpoint router ID, transit area, RxmtInterval
  • NBMA: Neighbor list with eligibility, PollInterval