N10-009Chapter 42 of 163Objective 1.5

OSPF Concepts for Network+

This chapter covers OSPF (Open Shortest Path First), a core dynamic routing protocol tested on the CompTIA Network+ N10-009 exam under Objective 1.5 (Routing and Switching). OSPF is a link-state protocol that uses cost-based metrics and the SPF algorithm to determine the best path, making it more efficient and scalable than distance-vector protocols like RIP. Expect 3-5 exam questions on OSPF concepts, including neighbor states, area types, DR/BDR election, and metric calculation. Mastering OSPF is critical for understanding how modern enterprise networks achieve fast convergence and loop-free routing.

25 min read
Intermediate
Updated May 31, 2026

OSPF as a Postal Route Optimization System

Imagine a national postal system that delivers mail between 50 cities. Initially, each post office has a map showing every city but no routes. The post offices elect a central hub (Designated Router) in each region to coordinate route information. Each post office sends a 'Hello' postcard every 10 seconds to its neighbors to confirm they are still operating. When a new road opens or a bridge collapses, the affected post office sends a 'Link State Advertisement' to all other post offices, describing only its direct connections. Each post office then runs a calculation (Shortest Path First algorithm) using all received advertisements to rebuild its map and determine the best route to every city. This calculation uses the cost of each road segment (inverse of bandwidth) to find the path with the lowest total cost. Routes are updated only when a change occurs, not periodically, saving bandwidth. The postal system uses areas to limit the spread of changes: a road closure in one region only triggers recalculations within that region, while other regions continue using their existing maps. This is exactly how OSPF works: routers exchange link-state information, run SPF to compute loop-free paths, use Hello packets for neighbor discovery and keepalive, elect DRs on broadcast networks, and use areas to contain routing updates.

How It Actually Works

What is OSPF and Why It Exists

OSPF (Open Shortest Path First) is a link-state routing protocol defined in RFC 2328. Unlike distance-vector protocols that send entire routing tables to neighbors periodically, OSPF sends only link-state advertisements (LSAs) describing directly connected links. Each router builds an identical link-state database (LSDB) and independently computes the shortest path to every destination using Dijkstra's Shortest Path First (SPF) algorithm. This eliminates routing loops and provides fast convergence (typically under 10 seconds in a well-designed network). OSPF uses a metric called cost, which is inversely proportional to bandwidth: cost = reference bandwidth / interface bandwidth. The default reference bandwidth is 100 Mbps, so a FastEthernet interface (100 Mbps) has cost 1, a GigabitEthernet interface (1000 Mbps) also has cost 1 unless the reference is adjusted. OSPF supports VLSM and CIDR, authenticates routing updates, and scales to large networks through hierarchical areas.

OSPF Packet Types

OSPF uses five packet types encapsulated directly in IP (protocol 89): - Hello (Type 1): Discovers neighbors and maintains adjacency. Sent every 10 seconds on broadcast links (default Hello interval). Contains Router ID, Area ID, authentication data, and list of neighbors seen. - Database Description (DBD) (Type 2): Summarizes LSDB during adjacency formation. Routers exchange DBDs to compare databases. - Link-State Request (LSR) (Type 3): Requests specific LSAs from a neighbor. - Link-State Update (LSU) (Type 4): Carries one or more LSAs in response to LSRs or when a change occurs. - Link-State Acknowledgment (LSAck) (Type 5): Acknowledges receipt of LSUs.

OSPF routers progress through eight neighbor states: 1. Down: No Hello packets received. 2. Attempt (NBMA only): Router sends Hello to a neighbor known via configuration. 3. Init: Hello received but the router's own Router ID is not in the Hello's neighbor list. 4. 2-Way: Hello received with own Router ID in neighbor list. On broadcast networks, DR/BDR election occurs at this state. 5. ExStart: Master/slave election using DBD packets with sequence numbers. 6. Exchange: DBD packets exchanged to describe LSDB. 7. Loading: LSRs and LSUs exchanged to get full LSDB. 8. Full: Routers are fully adjacent and have identical LSDBs.

DR/BDR Election

On multiaccess broadcast networks (e.g., Ethernet), OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) to reduce LSA flooding. The DR is the router with the highest OSPF priority (default 1) or highest Router ID if priorities tie. The BDR is the second highest. All other routers (DROthers) form full adjacencies only with the DR and BDR, not with each other. DROthers remain in 2-Way state with each other. If the DR fails, the BDR takes over, and a new BDR is elected. Router ID is the highest loopback IP or highest active interface IP; it can be manually set with the router-id command.

OSPF Areas and LSA Types

OSPF uses areas to segment the network and reduce LSDB size. All areas must connect to Area 0 (backbone). Common LSA types: - Type 1 (Router LSA): Describes a router's directly connected links within its area. Flooded within the area only. - Type 2 (Network LSA): Generated by the DR on a broadcast segment, listing all routers attached. Flooded within the area. - Type 3 (Summary LSA): Generated by Area Border Routers (ABRs) to advertise routes between areas. (Note: Type 3 is a summary, not a default route.) - Type 4 (ASBR Summary LSA): Generated by ABRs to advertise the location of an ASBR. - Type 5 (External LSA): Generated by Autonomous System Boundary Routers (ASBRs) to advertise external routes (redistributed from another protocol). Flooded throughout the AS. - Type 7 (NSSA External LSA): Used in Not-So-Stubby Areas (NSSA) to carry external routes.

OSPF Timers

Hello Interval: 10 seconds (broadcast, point-to-point); 30 seconds (NBMA).

Dead Interval: 40 seconds (broadcast); 120 seconds (NBMA). Typically 4x Hello.

Wait Timer: 40 seconds (broadcast); used before DR election.

Retransmit Interval: 5 seconds (default); wait before retransmitting an unacknowledged LSA.

Transmit Delay: 1 second; accounts for propagation delay.

LS Refresh Time: 1800 seconds (30 minutes); LSAs are refreshed periodically.

Max Age: 3600 seconds (1 hour); an LSA is discarded after this time if not refreshed.

OSPF Metric Calculation

The OSPF cost of an interface is calculated as: cost = reference-bandwidth / interface-bandwidth. Default reference bandwidth is 100 Mbps. For example: - 10 Mbps Ethernet: cost = 100/10 = 10 - 100 Mbps FastEthernet: cost = 100/100 = 1 - 1000 Mbps GigabitEthernet: cost = 100/1000 = 0.1 → truncated to 1 (cost must be integer 1-65535) - 1544 kbps T1: cost = 100,000 / 1544 ≈ 64 To adjust for higher-speed links, use auto-cost reference-bandwidth <Mbps> (e.g., 10000 for 10 Gbps). The path cost is the sum of all outgoing interface costs along the route.

OSPF Configuration Commands

Basic OSPF configuration on a Cisco router:

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0
 network 192.168.1.0 0.0.0.255 area 0

To set the Router ID manually:

router ospf 1
 router-id 1.1.1.1

To verify OSPF:

show ip ospf neighbor
show ip ospf database
show ip route ospf
show ip ospf interface

OSPF Network Types

Broadcast: Default on Ethernet. Uses DR/BDR. Hello 10s, Dead 40s.

Point-to-Point: Default on serial links with HDLC or PPP. No DR/BDR. Hello 10s.

Non-Broadcast (NBMA): Used on Frame Relay. Requires neighbor statements. Hello 30s, Dead 120s.

Point-to-Multipoint: Treats NBMA as a collection of point-to-point links. No DR/BDR.

Loopback: Advertises the loopback interface as a host route (/32) by default.

OSPF Area Types

Standard Area: Default. Accepts all LSA types.

Stub Area: Blocks Type 5 LSAs. ABR injects a default route. No external routes.

Totally Stubby Area: Cisco proprietary. Blocks Type 3, 4, 5 LSAs. Only default route from ABR.

Not-So-Stubby Area (NSSA): Allows Type 7 LSAs for external routes, which are translated to Type 5 by ABR. Blocks Type 5.

Totally NSSA: Blocks Type 3, 4, 5, but allows Type 7. Default route injected.

OSPF Authentication

OSPF supports plaintext (Type 1) and MD5 (Type 2) authentication. Configured per interface or per area:

interface GigabitEthernet0/0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 mykey

OSPF vs. Other Protocols

RIP: Distance-vector, hop-count metric, max 15 hops, slow convergence, periodic full updates.

EIGRP: Cisco proprietary, hybrid protocol, uses composite metric (bandwidth, delay, load, reliability), supports unequal-cost load balancing.

OSPF: Link-state, cost metric, fast convergence, hierarchical, open standard.

OSPF Convergence

When a link changes state, the detecting router floods a new LSA to all neighbors. Each router runs SPF to recalculate routes. Convergence time depends on:

Detection time (dead interval if no Hello)

LSA flooding time

SPF calculation time (proportional to LSDB size)

RIB update time

OSPF and the N10-009 Exam

The CompTIA Network+ exam expects you to know:

OSPF is a link-state protocol.

It uses cost as a metric (not hop count).

It supports VLSM/CIDR.

It uses areas to improve scalability.

It elects a DR on broadcast networks.

It uses Hello packets to maintain adjacencies.

Default Hello interval is 10 seconds.

Default Dead interval is 40 seconds.

Neighbor states: Down, Init, 2-Way, ExStart, Exchange, Loading, Full.

Router ID selection: highest loopback, then highest active interface IP, or manually configured.

LSA types: Type 1 (Router), Type 2 (Network), Type 3 (Summary), Type 4 (ASBR Summary), Type 5 (External).

Area types: standard, stub, totally stubby, NSSA.

Authentication: plaintext and MD5.

Common OSPF Troubleshooting Commands

show ip ospf neighbor
show ip ospf interface
show ip ospf database
show ip route ospf
debug ip ospf events
debug ip ospf packet

OSPF Design Best Practices

Use a single area for small networks (under 50 routers).

Use multiple areas for larger networks, with Area 0 as backbone.

Assign Router IDs manually for consistency.

Tune Hello/Dead intervals on slow links to avoid flapping.

Use authentication to prevent rogue routers.

Adjust reference bandwidth for high-speed links.

OSPF Path Selection

OSPF always chooses the path with the lowest total cost. If multiple equal-cost paths exist, OSPF will load-balance (up to 4 by default, configurable up to 32). OSPF does not support unequal-cost load balancing (unlike EIGRP).

Walk-Through

1

Router sends Hello packets

When an OSPF-enabled router initializes, it sends Hello packets out of all OSPF-configured interfaces every 10 seconds (broadcast/point-to-point) or 30 seconds (NBMA). The Hello packet includes the router's Router ID, Area ID, authentication data, and a list of neighbors from which it has already received Hellos. The destination IP is 224.0.0.5 (AllSPFRouters) for broadcast networks. The router transitions from Down to Init state when it receives a Hello from a neighbor, but the neighbor's Router ID is not yet in its own Hello.

2

Neighbor discovery and 2-Way state

When a router receives a Hello packet that contains its own Router ID in the neighbor list, it transitions from Init to 2-Way state. The 2-Way state indicates bidirectional communication is established. On multiaccess broadcast networks (e.g., Ethernet), the DR and BDR election occurs while routers are in 2-Way state. Routers that are not DR or BDR (DROthers) remain in 2-Way state with each other and do not form full adjacencies. All routers form full adjacencies with the DR and BDR.

3

DR/BDR election (broadcast networks)

On broadcast networks, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) after the Wait timer expires (40 seconds). The election uses the OSPF priority (default 1) on each interface; the highest priority wins. If priorities are equal, the highest Router ID wins. The DR is responsible for generating Network LSAs (Type 2) and acting as the central point for LSA flooding. The BDR takes over if the DR fails. A router with priority 0 never participates in the election and remains a DROther.

4

Database description exchange

After the DR/BDR election (or immediately on point-to-point links), routers transition to ExStart state. One router is elected master (higher Router ID) and begins sending Database Description (DBD) packets containing a summary of its LSDB. The slave acknowledges each DBD packet. The sequence numbers ensure reliable delivery. This exchange allows each router to determine which LSAs it is missing or have outdated versions. After the DBD exchange, routers move to Exchange state.

5

Link-state request and update

In the Loading state, routers compare their LSDBs based on the DBD summaries. They send Link-State Request (LSR) packets to neighbors requesting specific LSAs that are missing or newer. The neighbor responds with Link-State Update (LSU) packets containing the requested LSAs. Each LSU is acknowledged with an LSAck packet. This process continues until both routers have identical LSDBs, at which point they transition to Full state. Full adjacency means the routers have synchronized databases and are ready to exchange routing information.

6

SPF calculation and route installation

Once the LSDB is synchronized, each router runs Dijkstra's Shortest Path First (SPF) algorithm independently. The SPF algorithm uses the LSDB to build a tree of shortest paths to all destinations, with the router itself as the root. The metric is the sum of costs along each path. The router then installs the best routes (lowest cost) into the routing table. Routes are recalculated only when the LSDB changes (e.g., a link goes down or a new LSA is received). This event-driven convergence is faster than periodic updates used by distance-vector protocols.

What This Looks Like on the Job

Enterprise Campus Network

A large university with 500 routers across multiple buildings uses OSPF with a two-tier area design. The core backbone is Area 0, connecting three distribution routers in the data center. Each building is a separate standard area (e.g., Area 10 for Engineering, Area 20 for Business). ABRs in each building summarize routes to Area 0, reducing LSDB size and SPF calculation time. The network uses Gigabit Ethernet links with adjusted reference bandwidth (auto-cost reference-bandwidth 10000) so that 10 Gbps links have cost 1. OSPF authentication (MD5) is configured to prevent unauthorized routers from injecting false LSAs. Convergence time after a link failure is under 2 seconds because of fast Hello timers (1 second) and BFD integration. Common issues include misconfigured area IDs (a router in the wrong area fails to form adjacencies) and mismatched Hello/Dead timers causing neighbor flapping.

Service Provider MPLS Network

A regional ISP uses OSPF as the IGP within its MPLS core. The network has 2000 routers divided into multiple areas, with Area 0 as the backbone. OSPF runs on loopback interfaces (advertised as /32) to establish iBGP sessions for MPLS LDP. The ISP uses NSSA areas for customer edge routers that redistribute static routes or BGP into OSPF. The NSSA translates Type 7 LSAs into Type 5 at the ABR. To improve scalability, the ISP uses route summarization at ABRs and filters Type 3 LSAs using area filters. A frequent problem is when an ASBR redistributes a large number of external routes, causing LSDB size to grow and SPF calculation times to spike. Mitigation includes using stub areas for customer sites and limiting redistribution with route maps.

Data Center Leaf-Spine Fabric

A modern data center uses OSPF in a leaf-spine topology with 100 leaf switches and 8 spine switches. Each leaf is configured as an OSPF router in Area 0. The spine switches act as route reflectors but do not participate in OSPF; instead, they use BGP for underlay routing. However, some legacy designs still use OSPF between leaf and spine. In this case, the network uses point-to-point OSPF network type on all inter-switch links to avoid DR/BDR election and speed up convergence. The OSPF cost is set manually to equalize paths across spines (e.g., cost 10 on all uplinks). Misconfiguration often occurs when the OSPF network type is left as broadcast on point-to-point links, causing unnecessary DR election and delayed convergence.

How N10-009 Actually Tests This

What N10-009 Tests on OSPF (Objective 1.5)

The CompTIA Network+ N10-009 exam expects you to understand OSPF fundamentals, not complex configuration. Key tested concepts:

OSPF is a link-state protocol (not distance-vector).

It uses cost as a metric (not hop count).

It supports VLSM/CIDR.

It uses areas to improve scalability.

Hello interval default: 10 seconds; Dead interval: 40 seconds.

DR/BDR election occurs on broadcast multiaccess networks.

Router ID selection: highest loopback, then highest active IP, or manual.

Neighbor states: Down, Init, 2-Way, ExStart, Exchange, Loading, Full.

LSA types: Type 1 (Router), Type 2 (Network), Type 3 (Summary), Type 4 (ASBR Summary), Type 5 (External).

Area types: standard, stub, totally stubby, NSSA.

Authentication: plaintext and MD5.

Common Wrong Answers and Traps

1.

'OSPF uses hop count as a metric.' This is the most common trap. Candidates confuse OSPF with RIP. OSPF uses cost (bandwidth-based).

2.

'OSPF sends full routing table updates every 30 seconds.' This describes RIP (30-second updates). OSPF sends only LSAs when changes occur.

3.

'OSPF elects a DR on point-to-point links.' DR/BDR election only occurs on broadcast multiaccess networks, not point-to-point.

4.

'The default Hello interval is 30 seconds.' This is true for NBMA networks, but the default for broadcast/point-to-point is 10 seconds. The exam often uses the broadcast default.

5.

'OSPF uses the SPF algorithm to calculate metrics.' SPF calculates the shortest path, not the metric. The metric is cost, which is pre-assigned to interfaces.

Specific Numbers to Memorize

Hello interval: 10 seconds (broadcast/point-to-point)

Dead interval: 40 seconds (broadcast)

Default reference bandwidth: 100 Mbps

OSPF protocol number: 89

AllSPFRouters multicast: 224.0.0.5

AllDRouters multicast: 224.0.0.6

Maximum paths for load balancing: 4 (default), up to 32

LSA MaxAge: 3600 seconds

LSA refresh interval: 1800 seconds

Edge Cases

If a router's OSPF priority is set to 0, it never becomes DR or BDR.

In a point-to-point network, no DR/BDR election occurs; neighbors go from ExStart to Full directly.

A loopback interface is advertised as a /32 host route by default, even if configured with a different subnet mask.

OSPFv3 (for IPv6) uses link-local addresses and runs on a different protocol (also 89).

How to Eliminate Wrong Answers

If the question mentions 'periodic full updates' or '30 seconds', eliminate OSPF as the answer.

If the question asks about 'metric', remember OSPF uses cost, not hop count, bandwidth, or delay alone.

If the question describes a 'hybrid' protocol, it's likely EIGRP, not OSPF.

If the question mentions 'distance-vector', it's not OSPF.

For questions about neighbor states, the correct order is Down, Init, 2-Way, ExStart, Exchange, Loading, Full. Any deviation (e.g., missing Init) is wrong.

Key Takeaways

OSPF is a link-state protocol that uses cost as a metric (inversely proportional to bandwidth).

Default Hello interval is 10 seconds; Dead interval is 40 seconds on broadcast networks.

DR/BDR election occurs only on broadcast multiaccess networks; point-to-point links do not elect DR/BDR.

OSPF uses areas to reduce LSDB size and improve scalability; all areas must connect to Area 0 (backbone).

The SPF algorithm (Dijkstra) calculates the shortest path tree; routes are recalculated only when LSDB changes.

Router ID is the highest loopback IP, then highest active interface IP, or manually configured.

Common LSA types: Type 1 (Router), Type 2 (Network), Type 3 (Summary), Type 4 (ASBR Summary), Type 5 (External).

OSPFv3 is used for IPv6; OSPFv2 is for IPv4.

Authentication can be plaintext or MD5 to secure OSPF updates.

OSPF supports equal-cost load balancing (up to 4 paths by default).

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

OSPF

Link-state protocol

Metric: cost (bandwidth-based)

Fast convergence (event-driven)

Supports VLSM and CIDR

No hop count limit

RIP

Distance-vector protocol

Metric: hop count

Slow convergence (periodic updates every 30s)

Does not support VLSM (RIPv1); RIPv2 supports VLSM

Maximum 15 hops

Watch Out for These

Mistake

OSPF sends routing table updates every 30 seconds.

Correct

OSPF does not send periodic routing table updates. It sends link-state advertisements (LSAs) only when a change occurs. Hello packets are sent every 10 seconds, but these are keepalives, not routing updates.

Mistake

OSPF uses hop count as its metric.

Correct

OSPF uses cost, which is based on interface bandwidth (cost = reference bandwidth / interface bandwidth). Hop count is used by RIP, not OSPF.

Mistake

OSPF requires a DR on every network type.

Correct

DR/BDR election only occurs on broadcast multiaccess networks (e.g., Ethernet). Point-to-point and point-to-multipoint networks do not use DR/BDR.

Mistake

OSPF areas are used to reduce routing table size only.

Correct

Areas reduce LSDB size and SPF calculation frequency, not just the routing table. LSAs are flooded within an area only, so routers in different areas have smaller databases.

Mistake

A router with a higher Router ID always wins the DR election.

Correct

The DR election first compares OSPF priority (0-255, default 1). Higher priority wins. Only if priorities are equal is the highest Router ID used as tiebreaker.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the default Hello interval for OSPF on a broadcast network?

The default Hello interval is 10 seconds on broadcast and point-to-point networks. On NBMA networks, it is 30 seconds. The Dead interval is typically 4 times the Hello interval (40 seconds for broadcast). The exam often tests these default values.

How does OSPF select the Designated Router (DR)?

OSPF elects the DR based on the highest OSPF priority (0-255, default 1) on the interface. If priorities are equal, the router with the highest Router ID wins. A priority of 0 means the router never becomes DR or BDR. The election occurs after the Wait timer (40 seconds) expires.

What is the difference between OSPFv2 and OSPFv3?

OSPFv2 is used for IPv4 routing, while OSPFv3 is used for IPv6. OSPFv3 runs over IPv6 and uses link-local addresses. The protocol number is still 89. OSPFv3 does not require per-interface IPv4 addresses and has a different LSA format.

What are the OSPF neighbor states in order?

The neighbor states are: Down, Attempt (NBMA only), Init, 2-Way, ExStart, Exchange, Loading, Full. The exam may ask about the sequence or what happens at each state. For example, DR/BDR election occurs in 2-Way state.

What is an OSPF stub area?

A stub area blocks Type 5 (external) LSAs from entering the area. The ABR injects a default route (0.0.0.0/0) so routers in the stub area can reach external destinations. Stub areas reduce LSDB size and are used for networks that do not need external route details.

What is the purpose of the OSPF Router ID?

The Router ID (RID) is a 32-bit number that uniquely identifies a router in the OSPF domain. It is used in LSAs and neighbor tables. The RID is chosen as the highest IP address on a loopback interface, or the highest active physical interface IP, or manually configured.

How does OSPF prevent routing loops?

OSPF is inherently loop-free because each router has a complete and identical link-state database (LSDB). Every router independently runs the SPF algorithm to compute the shortest path tree, ensuring that all paths are loop-free at every instant. LSAs are flooded reliably and acknowledged.

Terms Worth Knowing

Ready to put this to the test?

You've just covered OSPF Concepts for Network+ — now see how well it sticks with free N10-009 practice questions. Full explanations included, no account needed.

Done with this chapter?