ietf-corpus

rfc-2178

OSPF Version 2

J. Moy
date1997-07 streamIETF areartg wgospf statusDRAFT STANDARD pages211 canonicalhttps://www.rfc-editor.org/rfc/rfc2178 doi10.17487/RFC2178
This memo documents version 2 of the OSPF protocol. OSPF is a link-state routing protocol. It is designed to be run internal to a single Autonomous System. Each OSPF router maintains an identical database describing the Autonomous System's topology. From this database, a routing table is calculated by constructing a shortest-path tree. OSPF recalculates routes quickly in the face of topological changes, utilizing a minimum of routing protocol traffic. OSPF provides support for equal-cost multipath. An area routing capability is provided, enabling an additional level of routing protection and a reduction in routing protocol traffic. In addition, all OSPF routing protocol exchanges are authenticated. [STANDARDS-TRACK]

obsoleted by

obsoletes

Extracted elements (30)

design-rationale §3.2

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.

routing

design-rationale §2.1.1

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.

routing

interoperability-note §G.9

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.

routing

interoperability-note §G

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.

routing

normative-requirement §13.4 MUST

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.

routing

normative-requirement §D.5.3 MUST

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.

routing, security, crypto

normative-requirement §8.2 MUST

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.

routing, security

normative-requirement §13 MUST

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.

routing

protocol-element §7.3

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.

routing

protocol-element §2.4

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.

routing

protocol-element §12.1.3

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).

routing

protocol-element §4.3

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.

routing

protocol-element §12.1.1

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.

routing

protocol-element §12.1.6

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.

routing

protocol-element §13.1

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).

routing

protocol-element §4.3

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.

routing, ip

protocol-element §2.3

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.

routing

protocol-element §3.5

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.

routing, ip

protocol-element §3.3

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).

routing

protocol-element §3.6

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.

routing

protocol-element §7.1

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.

routing, multicast

protocol-element §3.1

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.

routing

protocol-element §D

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).

routing, security, crypto

protocol-element §15

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.

routing

security-consideration §Security Considerations

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.

routing, security

state-machine §9.3

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).

routing

state-machine §10.3

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).

routing

wire-format §A.3.2

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).

routing

wire-format §A.4.1

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).

routing

wire-format §A.3.1

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).

routing