OSPF Version 2
Extracted elements (30)
LS sequence numbers use a linear (non-circular) signed 32-bit space from 0x80000001 to 0x7fffffff (InitialSequenceNumber to MaxSequenceNumber) to provide unambiguous ordering of LSA instances without the wraparound ambiguity present in circular sequence spaces.
OSPF uses area routing to achieve information hiding: intra-area routing is protected from bad external routing data, and the volume of routing traffic is reduced because each area only needs to know its own topology in detail rather than the entire AS topology.
OSPF utilizes IP multicast (AllSPFRouters) for Hello and flooding packets on broadcast networks, building on prior IS-IS work, to reduce bandwidth consumption compared to sending individual unicasts to each neighbor or flooding to the IP broadcast address.
The Designated Router concept (borrowed from IS-IS) eliminates the O(n²) adjacency problem on multi-access networks: instead of every pair forming an adjacency, each router only becomes adjacent with the DR and BDR, drastically reducing routing traffic and topological database size.
RFC 1583 is backward-compatible with its predecessor RFC 1247. All differences are bug fixes and clarifications; implementations of RFC 1247 and RFC 1583 will interoperate. The key fixes are documented in Appendix E (virtual link fix, supernetting/subnet-0 support, TOS encoding update, etc.).
All OSPF implementations must be capable of calculating routes based on IP Type of Service. However, routers may be configured to route all packets on the TOS 0 path, eliminating non-zero TOS path calculations to conserve routing table space and processing resources.
All OSPF protocol exchanges are authenticated; only trusted routers can participate in the AS routing. A single authentication scheme is configured per area, allowing some areas to use stricter authentication than others.
Routing protocol packets should always be sent with the IP TOS field set to 0. If at all possible, routing protocol packets should be given preference over regular IP data traffic both when being sent and received.
The backbone must be contiguous. If the backbone becomes partitioned, the system administrator must restore connectivity by configuring virtual links between backbone routers that share a common non-backbone area.
The OSPF protocol ensures that all routers belonging to an area agree on whether the area has been configured as a stub, guaranteeing that no confusion will arise in the flooding of AS external advertisements.
The OSPF protocol runs directly over IP using protocol number 89. OSPF provides no explicit fragmentation/reassembly support; IP fragmentation/reassembly is used when necessary, but should be avoided whenever possible by splitting large packets.
Virtual links cannot be configured through stub areas, and AS boundary routers cannot be placed internal to stub areas. These restrictions ensure no confusion arises in the flooding of AS external advertisements.
When forwarding an IP packet, it must always be forwarded to the network that is the best (longest/most specific) match for the packet's destination. Subnet masks must be assigned so that the best match for any IP destination is unambiguous.
Equal-cost multipath is natively supported: when multiple equal-cost routes to a destination exist, all are discovered during SPF computation and traffic is distributed equally among them without any conceptual changes to the basic algorithm.
OSPF areas group contiguous networks and routers, each running a separate copy of the link-state algorithm with its own topological database. Area border routers summarize area topology for distribution to the backbone, hiding internal area detail from the rest of the AS.
OSPF attaches a network mask to every advertised route, enabling variable-length subnetting (VLSM). A packet is always routed to the longest (most specific) matching prefix; host routes use mask 0xffffffff. This allows a single class A/B/C network to be subdivided into variable-sized subnets.
OSPF defines five LSA types: router links (1), network links (2), summary link to network (3), summary link to AS boundary router (4), and AS external link (5). Types 1–2 are flooded within an area; types 3–4 are generated by ABRs; type 5 is flooded AS-wide (except stub areas).
OSPF routers are classified into four overlapping categories: internal routers, area border routers (ABRs, connected to multiple areas), backbone routers (at least one interface to Area 0), and AS boundary routers (exchange routing info with other ASes).
Stub areas suppress flooding of AS external advertisements; routing to external destinations is based solely on a per-area default route advertised by area border routers via summary link advertisements. This reduces database size and memory requirements for stub area routers.
The backbone (Area 0) distributes routing information between all other areas. All inter-area traffic follows a three-segment path: intra-area to an ABR, backbone path, then intra-area to the destination. Virtual links can restore or augment backbone connectivity.
The Designated Router is elected on each multi-access network and originates the network links advertisement for that network. A Backup Designated Router is also elected to allow fast failover. Only the DR and BDR form adjacencies with all other routers on the segment.
The 'forwarding address' field in AS external link advertisements allows an ASBR to direct traffic to a specific IP address (e.g., a non-OSPF router) rather than to the advertising router itself, enabling route-server functionality and eliminating unnecessary hops.
Two types of AS external metrics are defined: Type 1 (equivalent to internal link-state metric, added to the internal cost to the ASBR) and Type 2 (treated as greater than any internal path cost). When both are present, Type 1 always takes precedence.
OSPF supports two authentication types per area: AuType 0 (no authentication, 64-bit authentication field set to zero) and AuType 1 (simple plaintext password, 8-octet password placed directly in the authentication field). The simple password provides only weak protection against passive eavesdroppers.
The interface state machine defines seven states: Down, Loopback, Waiting, Point-to-Point, DROther, Backup, and DR. Key triggers include InterfaceUp (Down→Waiting or Point-to-Point), WaitTimer expiry (Waiting→DR/Backup/DROther), and NeighborChange (re-evaluating DR/BDR role).
The neighbor state machine defines eight states: Down, Attempt, Init, 2-Way, ExStart, Exchange, Loading, and Full. Database synchronization progresses ExStart→Exchange→Loading→Full; the Full state indicates a complete, synchronized adjacency used for flooding.
The Database Description packet carries: Interface MTU (16-bit), Options (8-bit), flags byte with I (Init), M (More), MS (Master/Slave) bits, DD Sequence Number (32-bit), and a variable-length list of LSA headers summarizing the sender's link-state database.
The Hello packet includes: Network Mask (32-bit), HelloInterval (16-bit), Options (8-bit), Router Priority (8-bit), RouterDeadInterval (32-bit), Designated Router IP (32-bit), Backup Designated Router IP (32-bit), and a variable-length list of neighbor Router IDs.
The LSA header (20 bytes) contains: LS Age (16-bit, in seconds), Options (8-bit), LS Type (8-bit), Link State ID (32-bit), Advertising Router (32-bit), LS Sequence Number (32-bit signed), LS Checksum (16-bit Fletcher), and Length (16-bit).
The OSPF packet header (24 bytes) contains: Version (8-bit, value 2), Type (8-bit), Packet Length (16-bit), Router ID (32-bit), Area ID (32-bit), Checksum (16-bit), AuType (16-bit), and Authentication data (64-bit).