OSPF Version 2
Extracted elements (30)
Area border routers summarize their attached areas for the backbone using summary-LSAs rather than flooding full topology, creating an information-hiding hierarchy. This star topology (backbone as hub, non-backbone areas as spokes) reduces database size and routing traffic significantly.
Non-broadcast networks can operate in NBMA mode (DR elected, more efficient for fully-meshed topologies) or Point-to-MultiPoint mode (no DR, each connection treated as a point-to-point link). Point-to-MultiPoint is recommended when not all routers can communicate directly, such as on PVC-only Frame Relay, because NBMA mode requires full mesh reachability.
MTU mismatch detection (added in RFC 2178 vs. RFC 1583): if a router receives a Database Description packet with an Interface MTU exceeding the receiving interface's IP MTU, the packet should be rejected to prevent incomplete database exchange between neighbors with mismatched MTUs.
RFC 2178 is fully backward-compatible with RFC 1583; all differences are backward-compatible in nature and implementations of both documents will interoperate. Key additions include cryptographic authentication, Point-to-MultiPoint interface, overlapping area ranges, and the MinLSArrival constant.
A router MUST NOT originate a new instance of an LSA more often than once every MinLSArrival seconds. When a self-originated LSA is received via flooding with a higher sequence number, the router must re-originate immediately to reclaim it.
For cryptographic (Type 2) authentication, an OSPF packet whose Cryptographic Sequence Number is less than the last received from the same neighbor on the same interface MUST be discarded, preventing replay attacks.
Routers receiving OSPF packets must verify the packet's Area ID matches a configured area interface (or a virtual link endpoint) and that the packet's Router ID does not equal the receiving router's own Router ID; packets failing these checks MUST be discarded.
The flooding algorithm is reliable: all routers in an area must maintain exactly the same link-state database. LSAs are acknowledged on each adjacency and retransmitted until acknowledged; the MinLSArrival constant (1 second) prevents oscillation by rate-limiting re-acceptance of the same LSA.
Each broadcast and NBMA network with at least two attached routers elects a Designated Router (DR) and Backup Designated Router (BDR) via Hello priority fields. The DR originates a Network-LSA for the network and reduces required adjacencies from O(n²) to O(n), substantially reducing routing traffic.
Equal-cost multipath (ECMP) is natively supported: when multiple equal-cost paths to a destination exist during SPF tree construction, all are retained and traffic is distributed equally among them without any additional protocol mechanism.
Five LSA types are defined: Router-LSA (Type 1, originated by every router describing its links), Network-LSA (Type 2, originated by the Designated Router), Summary-LSA (Types 3 and 4, originated by area border routers), and AS-external-LSA (Type 5, originated by AS boundary routers for external routes).
Five OSPF packet types are defined: Hello (Type 1) for neighbor discovery/maintenance, Database Description (Type 2) for database summaries, Link State Request (Type 3), Link State Update (Type 4), and Link State Acknowledgment (Type 5). All share a common 24-byte OSPF header.
LS Age is measured in seconds from origination. MaxAge is 3600 seconds; an LSA reaching MaxAge is removed from the database and flushed by flooding. The LS checksum uses Fletcher's algorithm over all LSA fields except LS Age.
LS Sequence Number is a signed 32-bit integer in the range [InitialSequenceNumber (0x80000001), MaxSequenceNumber (0x7fffffff)]. When an LSA's sequence number reaches MaxSequenceNumber, the originating router must flush it and re-originate at InitialSequenceNumber.
LSA freshness is determined by comparing: first LS Sequence Number (higher is newer), then LS Checksum (higher is newer if sequence numbers equal), then LS Age (newer if one is MaxAge; otherwise the one less than MaxAgeDiff=900 seconds older is considered newer).
OSPF runs directly over IP using protocol number 89. It does not provide explicit fragmentation/reassembly; IP fragmentation is used when necessary, though it should be avoided. Routing packets should be sent with IP TOS=0 and IP Precedence set to Internetwork Control.
OSPF supports two external metric types: Type 1 is expressed in the same units as internal link cost; Type 2 is considered greater than any internal AS path cost. When both exist, Type 1 always takes precedence. A forwarding address field in AS-external-LSAs allows direct routing to the actual exit point rather than through the advertising router.
OSPF supports variable-length subnetting (VLSM) and CIDR by attaching an IP address mask to every advertised route. Forwarding always uses the longest (most specific) matching prefix. Host routes are advertised with mask 0xffffffff.
Router classification defines four overlapping categories: Internal routers (all interfaces in one area), Area Border Routers (interfaces in multiple areas, run one SPF instance per area), Backbone Routers (at least one backbone interface), and AS Boundary Routers (exchange routing info with other Autonomous Systems and advertise external routes throughout the AS).
Stub areas do not receive AS-external-LSAs; routing to external destinations uses a per-area default route advertised by area border routers in summary-LSAs. AS boundary routers cannot reside inside stub areas, and virtual links cannot be configured through stub areas.
The Hello Protocol dynamically discovers and maintains neighbors. On broadcast and point-to-point networks, Hellos are sent to AllSPFRouters (224.0.0.5). On NBMA networks, Hellos are unicast to configured neighbor addresses. The Hello Protocol also elects the DR and BDR on broadcast/NBMA networks.
The OSPF backbone is Area 0 (0.0.0.0). All area border routers must attach to the backbone. The backbone distributes routing information between non-backbone areas and must remain contiguous; virtual links can be used to repair a partitioned backbone.
Three authentication types are defined in Appendix D: Type 0 (Null, no authentication), Type 1 (Simple password: 8-byte plaintext key in the Authentication field), and Type 2 (Cryptographic: MD5 keyed digest appended after the packet, with a per-interface Key ID and a non-decreasing cryptographic sequence number).
Virtual links are configured between two backbone routers sharing a common non-backbone transit area. The protocol treats them as unnumbered point-to-point backbone links whose cost equals the intra-area distance between the two routers. Virtual links may not traverse stub areas.
All OSPF routing exchanges must be authenticated to prevent unauthorized routers from injecting false routing information. Simple password (Type 1) authentication is vulnerable to passive eavesdropping since the password appears in cleartext; cryptographic (Type 2, MD5) authentication is strongly preferred for production deployments.
The interface state machine has seven states: Down, Loopback, Waiting, Point-to-Point, DROther, Backup, and DR. Key triggers include InterfaceUp (Down→Waiting or Point-to-Point), WaitTimer or BackupSeen (Waiting→DR/Backup/DROther), and NeighborChange (re-evaluates DR/BDR election).
The neighbor state machine has eight states: Down, Attempt, Init, 2-Way, ExStart, Exchange, Loading, and Full. A neighbor reaches Full when database synchronization is complete; adjacency is only formed with neighbors that should be adjacent (DR/BDR on broadcast networks, all on point-to-point).
The Hello packet appends to the common header: Network Mask (4 bytes), HelloInterval (2 bytes), Options (1 byte), Router Priority (1 byte), RouterDeadInterval (4 bytes), Designated Router IP (4 bytes), Backup DR IP (4 bytes), followed by a list of Neighbor Router IDs (4 bytes each).
The LSA header is 20 bytes: LS Age (2 bytes, unsigned), Options (1 byte), LS Type (1 byte), Link State ID (4 bytes), Advertising Router (4 bytes), LS Sequence Number (4 bytes, signed), LS Checksum (2 bytes, Fletcher), Length (2 bytes).
The OSPF common packet header is 24 bytes: Version (1 byte, value 2), Type (1 byte), Packet Length (2 bytes), Router ID (4 bytes), Area ID (4 bytes), Checksum (2 bytes), AuType (2 bytes), Authentication (8 bytes).