Chapter 18: Open Shortest Path First
Introduces OSPF as an open-standard interior gateway protocol, clarifies the meaning of its name, and sets the chapter’s focus on OSPFv2.
After this chapter you will be able to
- OSPF identity and name. Explain that OSPF is an interior gateway protocol and that its name identifies both its open-standard status and the Shortest Path First algorithm used to calculate routes.
- OSPF routing process. Describe the three main steps OSPF routers take to share routing information and build their routing tables, in order.
- LSA flooding and LSDB construction. Describe how OSPF routers create and share LSAs to build a link-state database.
- Shared topology map for routing. Explain why routers in an OSPF area need the same LSDB and how they use it to calculate routes; contrast this map with the information held by distance-vector routers.
- Benefits of multiple OSPF areas. Explain why a large OSPF network may be divided into areas instead of using one area.
- Backbone and non-backbone areas. Describe the two-level structure of a multi-area OSPF network and the role of area 0.
- Four OSPF router types. Distinguish internal, backbone, area border, and autonomous system boundary routers, including how the types can overlap.
- Cumulative OSPF route cost. Explain how OSPF determines a route’s cost by adding the costs of the interfaces a packet exits on its way to the destination.
- Default bandwidth cost limitation. Describe how reference bandwidth determines an interface’s automatic OSPF cost and why the default can treat substantially different link speeds as equal.
- Reference bandwidth consistency. Explain why a network may need a higher OSPF reference bandwidth and why all routers should use the same value.
- OSPF process setup. Explain that configuring OSPF begins with `router ospf process-id`, which enters router configuration mode, and that activating OSPF on interfaces lets a router attempt to form neighbors and share LSAs.
- OSPF router ID selection. Explain what an OSPF router ID identifies and how a router selects one when the OSPF process is first created.
- Router ID changes. Explain why adding a loopback interface does not automatically change an existing RID and how to change that RID manually.
- Purpose of OSPF activation. Explain that activating OSPF on an interface tells the router to form OSPF neighbor relationships and share routing information. Describe why R1’s internet-facing G0/2 does not need OSPF activated even though R1 will later advertise a default route through it.
- Two interface activation methods. Distinguish the network command from the interface-configuration command ip ospf process-id area area: the former activates OSPF on interfaces whose IP addresses fall in a specified range, while the latter explicitly selects interfaces.
- Passive interface behavior and purpose. Explain that a passive OSPF interface still has its network prefix advertised to neighbors but does not send OSPF messages to initiate neighbor relationships. Describe why this is useful on interfaces without another router, including loopbacks.
- Passive interface configuration options. Describe how to make a specific interface passive, or make all interfaces passive by default and then exempt those that need OSPF neighbor relationships.
- OSPF default route advertisement. Explain why an ISP-connected router shares a default route with other routers in its OSPF AS, and describe how R1 does so.
- OSPF process order. Explain that OSPF routers first form neighbor relationships, then exchange routing information, and then calculate routes.
- Down to 2-Way progression. Trace what Down, Init, and 2-Way mean as two routers exchange hellos, and distinguish becoming neighbors from exchanging routing information.
- Database description exchange. Describe the purposes of ExStart and Exchange, including how routers choose who leads and what their database description messages summarize.
- Loading and full adjacency. Explain how routers obtain specific LSAs in Loading and what reaching Full says about their databases and relationship.
- Broadcast segment adjacency pattern. Describe which routers form full adjacencies on a broadcast segment and why electing a DR and BDR reduces OSPF traffic.
- DR and BDR election criteria. Explain where DR/BDR elections occur and how interface priority and router ID determine the roles.
- Nonpreemptive roles and succession. Explain why a newly higher-priority router does not replace an existing DR and what happens when the DR goes down.
- Point-to-point link behavior. Justify using the point-to-point network type on a direct two-router link and describe how it is configured on Ethernet.
- OSPF neighbor formation requirements. State the settings that must agree for OSPF routers to become neighbors, and identify the router ID as the setting that must be unique. Explain that an OSPF process that is shut down also prevents neighbor formation.
- Network type mismatch effects. Explain why matching OSPF network types matters even when neighbor tables report a full adjacency.
- Three OSPF LSA types. Distinguish the three LSA types covered here by who generates each one and what it advertises.
- Shared LSA database. Explain how LSAs are carried and how the section says to inspect and compare routers’ OSPF databases.
What it builds on
- Interior gateway protocols (chapter 17) · The earlier distinction between interior and exterior gateway protocols.
- Dynamic routing vs. static routing (chapter 17) · Introduces dynamic routing as an alternative to static routing.
- Types of routing protocols (chapter 17) · Assumes the earlier introduction to types of routing protocols.
- The metric parameter (chapter 17) · The role of a metric in route selection
- The network command (chapter 17) · The network command as a way to activate OSPF on interfaces.
- The structure of an IPv4 address (chapter 7) · The form of an IPv4 address.
- Configuring a default route (chapter 9) · The meaning of a default route.
- Route selection examples (chapter 17) · The earlier route-selection examples and ECMP discussion referenced by this section.
Section by section
Introduction
Introduces OSPF as an open-standard interior gateway protocol, clarifies the meaning of its name, and sets the chapter’s focus on OSPFv2.
- OSPF identity and name: Explain that OSPF is an interior gateway protocol and that its name identifies both its open-standard status and the Shortest Path First algorithm used to calculate routes.
Why it matters: The name gives you a starting point for understanding what kind of routing protocol OSPF is, without yet needing its mechanics. - OSPF version focus: Distinguish the usual uses of OSPFv2 and OSPFv3, and state which version this book means when it says OSPF.
Why it matters: This distinction keeps the chapter’s references to OSPF anchored to the version it actually covers.
Key terms: OSPF, interior gateway protocol (IGP), open standard, Shortest Path First (SPF), Dijkstra’s algorithm, OSPFv2, OSPFv3, IPv4, IPv6
18.1 OSPF foundations
Introduces the three broad steps by which OSPF routers share routing information and build routing tables.
- OSPF routing process: Describe the three main steps OSPF routers take to share routing information and build their routing tables, in order.
Why it matters: This sequence gives you a framework for understanding the OSPF details that follow.
Key terms: neighbor relationships, routing information, connectivity map, best routes
18.1.1 The link-state database
Explains how OSPF routers flood link-state advertisements to build a shared topology map and use it to calculate routes.
- LSA flooding and LSDB construction: Describe how OSPF routers create and share LSAs to build a link-state database.
Why it matters: Flooding explains how routers obtain the information needed to build their topology maps. - Shared topology map for routing: Explain why routers in an OSPF area need the same LSDB and how they use it to calculate routes; contrast this map with the information held by distance-vector routers.
Why it matters: The shared map is what lets each OSPF router calculate paths from the same topology information.
Key terms: link-state advertisement (LSA), link-state database (LSDB), LSA flooding, OSPF area, network topology, SPF algorithm, distance-vector routing protocols
18.1.2 OSPF areas
Explains why OSPF uses areas in larger networks and how area structure determines router and route types.
- Benefits of multiple OSPF areas: Explain why a large OSPF network may be divided into areas instead of using one area.
Why it matters: Areas make OSPF more manageable as a network grows. - Backbone and non-backbone areas: Describe the two-level structure of a multi-area OSPF network and the role of area 0.
Why it matters: The backbone explains how separate OSPF areas fit together. - Four OSPF router types: Distinguish internal, backbone, area border, and autonomous system boundary routers, including how the types can overlap.
Why it matters: Router types describe whether a router belongs to an area, joins areas, or connects OSPF to outside networks. - OSPF route type distinctions: Distinguish intra-area, inter-area, and external routes by where their destinations are relative to the router and the OSPF AS.
Why it matters: Route types indicate whether a destination is local to an area, in another area, or outside OSPF.
Key terms: OSPF area, LSDB, SPF algorithm, LSAs, backbone area, area 0, non-backbone areas, internal router, backbone router, area border router
18.1.3 OSPF cost
Explains how OSPF calculates route cost, why its default bandwidth setting can produce poor path choices, and how to adjust costs safely.
- Cumulative OSPF route cost: Explain how OSPF determines a route’s cost by adding the costs of the interfaces a packet exits on its way to the destination.
Why it matters: Adding the right interface costs lets you predict which path OSPF considers shortest. - Default bandwidth cost limitation: Describe how reference bandwidth determines an interface’s automatic OSPF cost and why the default can treat substantially different link speeds as equal.
Why it matters: Equal calculated costs can send traffic over a slower link even when a faster path is available. - Reference bandwidth consistency: Explain why a network may need a higher OSPF reference bandwidth and why all routers should use the same value.
Why it matters: A better bandwidth scale helps OSPF prefer faster paths only if routers calculate costs consistently. - Per interface cost changes: Distinguish setting an interface’s OSPF cost directly from changing its bandwidth value, and explain why direct cost configuration is usually preferred.
Why it matters: Changing the intended OSPF cost directly avoids unintentionally affecting other uses of the bandwidth value.
Key terms: OSPF cost, metric, outgoing interface, link cost, reference bandwidth, interface bandwidth, cost, ECMP, auto-cost reference-bandwidth mbps, routing loops
18.2 OSPF configuration
Introduces how to start an OSPF process, what basic interface activation does, and why the process ID need not match on neighboring routers.
- OSPF process setup: Explain that configuring OSPF begins with `router ospf process-id`, which enters router configuration mode, and that activating OSPF on interfaces lets a router attempt to form neighbors and share LSAs.
Why it matters: This connects the first configuration command to the basic behavior it enables. - Local OSPF process IDs: Explain that an OSPF process ID is locally significant, so neighboring routers can use different process IDs; multiple processes on one router calculate routes independently but are rarely used.
Why it matters: A process-ID mismatch alone does not prevent two routers from becoming OSPF neighbors.
Key terms: OSPF process, router ospf process-id, network command, router config mode, LSAs, OSPF process ID, locally significant, OSPF processes
18.2.1 The router ID
Explains how an OSPF router ID is selected and changed, and why loopback interfaces provide stable router addresses.
- OSPF router ID selection: Explain what an OSPF router ID identifies and how a router selects one when the OSPF process is first created.
Why it matters: This lets you predict a router’s initial OSPF identity without mistaking that identity for a usable IP address. - Loopback interface purpose: Describe why a loopback interface provides a stable address for reaching a router and distinguish it from a reserved loopback address.
Why it matters: The distinction explains both why loopbacks are useful as stable router addresses and why they cannot overcome a total loss of connectivity. - Router ID changes: Explain why adding a loopback interface does not automatically change an existing RID and how to change that RID manually.
Why it matters: It prevents you from expecting a newly configured loopback to silently replace a router’s established OSPF identity.
Key terms: router ID, RID, OSPF AS, loopback interface, physical interface, loopback address, 127.0.0.0/8, physical path, router-id, clear ip ospf process
18.2.2 Activating OSPF on interfaces
This section explains why OSPF must be activated on selected interfaces and contrasts two ways to do it.
- Purpose of OSPF activation: Explain that activating OSPF on an interface tells the router to form OSPF neighbor relationships and share routing information. Describe why R1’s internet-facing G0/2 does not need OSPF activated even though R1 will later advertise a default route through it.
Why it matters: It helps you choose where OSPF belongs rather than enabling it on every interface. - Two interface activation methods: Distinguish the network command from the interface-configuration command ip ospf process-id area area: the former activates OSPF on interfaces whose IP addresses fall in a specified range, while the latter explicitly selects interfaces.
Why it matters: You can recognize both CCNA configuration methods and choose interfaces deliberately.
Key terms: activate OSPF, OSPF neighbors, default route, network command, ip ospf process-id area area, interface config mode
18.2.3 Passive interfaces
This section explains how passive OSPF interfaces advertise their network prefixes without sending messages to form neighbor relationships, and shows two ways to configure them.
- Passive interface behavior and purpose: Explain that a passive OSPF interface still has its network prefix advertised to neighbors but does not send OSPF messages to initiate neighbor relationships. Describe why this is useful on interfaces without another router, including loopbacks.
Why it matters: You can advertise a connected network through OSPF without sending needless hello messages on an interface that has no router neighbor. - Passive interface configuration options: Describe how to make a specific interface passive, or make all interfaces passive by default and then exempt those that need OSPF neighbor relationships.
Why it matters: The default-passive approach is convenient when only a few OSPF interfaces need to form neighbors.
Key terms: passive interface, network prefix, OSPF hello messages, neighbor relationships, loopback interface, passive-interface interface-name, passive-interface default, no passive-interface interface-name, router config mode
18.2.4 Advertising a default route
This section explains how an OSPF router shares a default route for external destinations and illustrates equal-cost routes in an OSPF routing table.
- OSPF default route advertisement: Explain why an ISP-connected router shares a default route with other routers in its OSPF AS, and describe how R1 does so.
Why it matters: Sharing one router’s default route lets the other OSPF routers direct traffic toward external networks. - Advertised route verification: Describe how the section confirms that R1 advertises a default route and R2 learns it.
Why it matters: These outputs show both the advertising router’s role and whether another router received the route. - Equal-cost OSPF routes: Describe what R2’s two paths to 172.16.1.4 illustrate and state OSPF’s default limit for equal-cost routes.
Why it matters: The example shows that OSPF need not choose just one path when routes have equal cost.
Key terms: default route, OSPF AS, default-information originate, ASBR, show ip protocols, show ip route ospf, ECMP, equal-cost routes, maximum-paths
18.3 Neighbors and adjacencies
This introduction identifies neighbor relationships as the first step OSPF routers need before exchanging routing information and calculating routes.
- OSPF process order: Explain that OSPF routers first form neighbor relationships, then exchange routing information, and then calculate routes.
Why it matters: This sequence puts the neighbor-formation details that follow in context.
Key terms: neighbor relationships, exchanging routing information, calculating routes
18.3.1 Neighbor states
Explains how OSPF routers discover neighbors with hello messages, progress through neighbor states, synchronize routing information, and maintain the relationship.
- Hello discovery and multicast: Explain how OSPF hello messages discover neighbors and why a hello sent to 224.0.0.5 is processed by OSPF-enabled interfaces rather than every host that receives it.
Why it matters: Hellos are how routers first find one another and recognize which neighbors have seen them. - Down to 2-Way progression: Trace what Down, Init, and 2-Way mean as two routers exchange hellos, and distinguish becoming neighbors from exchanging routing information.
Why it matters: The 2-Way state marks mutual recognition, not completion of the routing-information exchange. - Database description exchange: Describe the purposes of ExStart and Exchange, including how routers choose who leads and what their database description messages summarize.
Why it matters: ExStart and Exchange let routers compare what their databases contain before requesting specific routing information. - Loading and full adjacency: Explain how routers obtain specific LSAs in Loading and what reaching Full says about their databases and relationship.
Why it matters: Full is the point at which neighbor recognition has become a synchronized OSPF adjacency. - Hello and dead timers: Explain how continuing hello messages maintain a neighbor relationship and when a router removes an unresponsive neighbor.
Why it matters: Hellos let a router detect when an established neighbor is no longer responding.
Key terms: OSPF hello messages, RID, 224.0.0.5, multicast, Down, Init, 2-Way, OSPF neighbors, ExStart, Exchange
18.3.2 OSPF network types
Explains how OSPF network types affect neighbor discovery, timers, adjacencies, and DR/BDR elections, with a focus on broadcast and point-to-point links.
- Network type and shared defaults: Explain what an OSPF network type controls and describe the neighbor discovery and timer defaults shared by broadcast and point-to-point interfaces.
Why it matters: These shared defaults help you distinguish what changes—and what does not—when choosing between the two network types. - Broadcast segment adjacency pattern: Describe which routers form full adjacencies on a broadcast segment and why electing a DR and BDR reduces OSPF traffic.
Why it matters: The adjacency pattern explains why a shared Ethernet segment does not need every router to exchange LSAs directly with every other router. - DR and BDR election criteria: Explain where DR/BDR elections occur and how interface priority and router ID determine the roles.
Why it matters: These rules let you predict the DR and BDR for each shared segment rather than for an entire area. - Nonpreemptive roles and succession: Explain why a newly higher-priority router does not replace an existing DR and what happens when the DR goes down.
Why it matters: This explains why current DR/BDR roles may not match the highest priorities you see on running interfaces. - Point-to-point link behavior: Justify using the point-to-point network type on a direct two-router link and describe how it is configured on Ethernet.
Why it matters: Choosing point-to-point avoids an unnecessary election on a direct connection while preserving full adjacency.
Key terms: network type, dynamic neighbor discovery, hello timer, dead timer, broadcast, designated router, backup designated router, DROther, 2-Way, LSA
18.3.3 Neighbor requirements
This subsection explains which OSPF settings affect neighbor formation and why an apparent neighbor relationship may still fail to exchange routes.
- OSPF neighbor formation requirements: State the settings that must agree for OSPF routers to become neighbors, and identify the router ID as the setting that must be unique. Explain that an OSPF process that is shut down also prevents neighbor formation.
Why it matters: These checks help explain why two connected OSPF routers may fail to become neighbors. - IP MTU adjacency limit: Distinguish becoming OSPF neighbors from reaching a full adjacency when the routers’ IP MTU settings differ.
Why it matters: Seeing a neighbor is not enough to conclude that OSPF has reached a full adjacency. - Network type mismatch effects: Explain why matching OSPF network types matters even when neighbor tables report a full adjacency.
Why it matters: A Full neighbor state alone does not prove that OSPF has exchanged usable routing information.
Key terms: area number, subnet, OSPF process, RIDs, hello and dead timers, authentication settings, IP MTU, neighbor, full adjacency, ExStart/Exchange states
18.4 LSA types
This section identifies three OSPF LSA types and shows how their advertisements appear in a shared link-state database.
- Three OSPF LSA types: Distinguish the three LSA types covered here by who generates each one and what it advertises.
Why it matters: The LSA type tells you what information an OSPF router is sharing and why it appears in the database. - Shared LSA database: Explain how LSAs are carried and how the section says to inspect and compare routers’ OSPF databases.
Why it matters: It connects individual advertisements to the database that OSPF routers share. - Neighborless DR interfaces: Explain why the example’s R3, R4, and R5 do not advertise type 2 LSAs for their G0/1 interfaces.
Why it matters: It explains why a DR designation does not always correspond to a type 2 LSA in this example.
Key terms: type 1 (Router LSA), type 2 (Network LSA), type 5 (AS External LSA), DR, ASBR, LSU messages, LSAs, LSDB, show ip ospf database, type 2 LSA
18.5 Summary
Where this is used later
- FHRP neighbor relationships (chapter 19) · The comparison with OSPF neighbor relationships.
Concepts explained in this chapter
- router idAn OSPF router ID is a unique 32-bit identifier used to identify an OSPF router and break ties in designated-router elections.
- link-state databaseA link-state database is an in-memory data structure containing the network topology information used by a link-state routing protocol to calculate routes.
- full stateAn OSPF full adjacency is a synchronized relationship in which neighboring routers have exchanged link-state information and synchronized their link-state databases.
- OSPF dead timerAn OSPF dead timer is the interval after which a neighbor is removed when no hello message has been received.
- OSPF hello timerAn OSPF hello timer is the interval between successive OSPF hello messages sent by an interface.
- link-state advertisementA link-state advertisement is a routing protocol data structure that describes a router's links and connected networks for distribution to other routers.
- OSPF neighbor relationshipAn OSPF adjacency is an established neighbor relationship between two OSPF routers that enables protocol database synchronization.
- OSPF hello messageAn OSPF hello message is an OSPF control message used to discover neighbors and maintain established neighbor relationships.
- OSPF DROtherAn OSPF DROther is a router on a broadcast segment that is neither the designated router nor the backup designated router.
- OSPF backup designated routerAn OSPF backup designated router is the elected standby router that takes over the designated-router role if the DR is lost.
- OSPF broadcast network typeThe OSPF broadcast network type is an OSPF interface configuration for multi-access networks that supports dynamic neighbor discovery and designated-router and backup-designated-router election.
- OSPF designated routerAn OSPF designated router is the elected router that reduces adjacency and flooding overhead on a broadcast network segment.
- OSPF point-to-point network typeThe OSPF point-to-point network type describes a network segment connecting exactly two routers without designated-router election.
- router ospfrouter ospf is a Cisco IOS configuration command that creates or selects an OSPF process and enters OSPF router configuration mode.
- OSPF areaAn OSPF area is a logical subdivision of an OSPF autonomous system whose routers share a link-state database.
- 2-Way neighbor stateThe OSPF 2-Way neighbor state indicates that routers have established bidirectional communication without necessarily forming a full adjacency.
- Open Shortest Path FirstOSPFv2 is the version of OSPF primarily used to route IPv4 networks.
- OSPF network typeAn OSPF network type is an interface setting that determines the OSPF communication behavior used on a connected network.
- loopback interfaceA loopback interface is a virtual software-based router interface that remains operational while the device is operational unless administratively disabled.
- router-id commandThe router-id command configures the router ID for a Cisco IOS OSPF process.
- OSPF processAn OSPF process is a locally running instance of OSPF on a router that independently maintains routing information and calculates routes.
- Dijkstra's algorithmDijkstra's algorithm is a shortest-path graph algorithm for calculating minimum-cost paths from a source node.
- OSPF autonomous system border routerAn OSPF autonomous system border router connects an OSPF autonomous system to external networks or routing domains.
- OSPF reference bandwidthOSPF reference bandwidth is the configured baseline bandwidth used to calculate interface costs.
- OSPF neighbor stateAn OSPF neighbor state is a stage in the process by which two OSPF routers verify compatibility and establish a neighbor relationship.
- OSPF area border routerAn OSPF area border router connects one or more nonbackbone areas to the backbone area.
- backbone areaThe OSPF backbone area is area 0, the central area through which traffic between non-backbone areas passes.
- external routeAn external route is a route to a destination outside the OSPF autonomous system that is advertised by an ASBR.
- inter-area routeAn inter-area route reaches a destination in an OSPF area other than one to which the router is directly connected.
- intra-area routeAn intra-area route reaches a destination within an OSPF area to which the router is connected.
- multi-area ospfMulti-area OSPF is an OSPF design that divides an autonomous system into multiple areas to limit database size and change propagation.
- DR/BDR electionA DR/BDR election is the OSPF selection process that chooses a designated router and backup designated router on a broadcast segment.
- OSPF interface priorityOSPF interface priority is a configurable value used to influence a router's eligibility and rank in designated-router elections.
- dynamic neighbor discoveryDynamic neighbor discovery is the automatic identification of connected routing neighbors through protocol messages rather than manually configured neighbor addresses.
- passive-interface default commandThe passive-interface command configures a specified OSPF-enabled interface to avoid sending OSPF messages for neighbor formation.
- passive OSPF interfaceA passive OSPF interface participates in OSPF but does not send hello messages to form neighbor relationships.
- default-information originate commandThe default-information originate command is a Cisco IOS OSPF configuration command that causes an OSPF router to advertise a default route.
- lsa floodingLSA flooding is the process of distributing link-state advertisements to all routers within an OSPF area.
- type 1 lsaA Type 1 LSA is an OSPF router advertisement generated by every router to describe that router's links.
- type 2 lsaA Type 2 LSA is an OSPF network advertisement generated by the designated router for a broadcast network to list the routers on the segment.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
