Week 6 · Lesson 19

OSPFv2 Fundamentals

OSPF is the open-standard, link-state routing protocol that dominates enterprise IPv4 networks. Instead of swapping rumours, every router builds an identical map of the network and computes the shortest path itself. This lesson gives you the vocabulary — areas, router ID, cost, timers, LSAs — before the configuration in Lesson 20.

CCNA 200-301 Domain 3.0 IP Connectivity Verified 2026-10-11
Learning objectives
Part 1

From distance-vector to link-state

RIP is a distance-vector protocol: it learns routes from its neighbours’ reports of distance and direction, sight unseen. It works, but every router sees only what its neighbours tell it, convergence is slow, and loops are only prevented by mechanisms such as split horizon. OSPF takes a different approach. As a link-state protocol it floods information about the state of each link to every router in an area, so each router builds a complete, identical topology map and computes the best paths itself.

AspectDistance-vector (RIP)Link-state (OSPF)
What is sharedWhole routing table entries (destinations and distances)Local link states, flooded unchanged area-wide
Each router knowsOnly its neighbours' viewAn identical map of the whole area
Path computationBellman-Ford; incremental updatesDijkstra SPF on the full database
ConvergenceSlow, loop-proneFast, loop-free within an area
MetricHop count (max 15)Cost based on bandwidth
Default AD120110

The trade-off is resource use. OSPF stores a database and runs a graph algorithm, so it asks more of CPU and memory than RIP. In exchange it scales to large networks, converges quickly, and is supported by virtually every vendor, which is why it is the enterprise default.

Definition — OSPF OSPF (Open Shortest Path First) is an open-standard, link-state interior gateway protocol. OSPFv2 routes IPv4 and has a default administrative distance of 110; OSPFv3 routes IPv6.
In this lesson · select a part to jump

Reference table · select a row

Key ideas & exam traps · select one

Part 2

How OSPF builds its map

Each router describes its own directly connected links in a link-state advertisement (LSA). LSAs are flooded to every other router in the same area and stored in the link-state database (LSDB). Because flooding is reliable and every router receives every LSA, all routers in an area end up with the same database — the same map. Each then runs Dijkstra’s shortest path first (SPF) algorithm over that map, rooted at itself, and installs the resulting best paths into the routing table.

R1 R2 R3 LSAs flooded to every router in the area LSDB LSDB LSDB Same map everywhere → each runs SPF → computes its own routing table
Flooding LSAs gives every router the same link-state database. Each router then runs SPF independently, so the computation is distributed but the input map is identical.
Part 3

Areas and the backbone

Flooding every LSA to every router does not scale — a network with thousands of routers would generate an enormous database and frequent SPF runs. OSPF contains the flooding with areas: a group of routers that share the same LSDB. LSAs are flooded only within their area, so a change in one area does not ripple through the others.

One area is special. Area 0, the backbone area, must be the transit core: every other area must connect to area 0, and inter-area traffic passes through it. In a small network you may have only area 0 — a single-area design, which is exactly what the CCNA labs use. In a larger network, areas 1, 2, 3, and so on attach to area 0 via area border routers (ABRs) that belong to both area 0 and their own area.

Note — the single-area shortcut Cisco IOS accepts any area number in configuration, but a valid design requires an area 0 and, if other areas exist, that they all touch it. For the exam and beginner labs, remember: area 0 is the backbone; all other areas attach to it.
Part 4

Router ID

Every OSPF router is identified by a 32-bit router ID, written in dotted-decimal form like an IPv4 address. It is unique within the OSPF domain and is used in LSAs to say “this came from me”. IOS selects it with a fixed order of preference:

  1. The value set explicitly with the router-id command (highest priority).
  2. Otherwise, the highest IP address among loopback interfaces.
  3. Otherwise, the highest IP address among active physical interfaces.

Because the router ID is chosen when OSPF starts, an administrator who relies on interface addresses can be surprised when an interface goes down: the ID can change on a restart, disrupting adjacencies. Best practice is to set a stable router-id or configure a loopback interface and let its address become the ID.

! a loopback address often becomes the router ID by preference
R1(config)# interface Loopback0
R1(config-if)# ip address 1.1.1.1 255.255.255.255

! or set it explicitly in OSPF configuration
R1(config-router)# router-id 1.1.1.1
Part 5

The cost metric

OSPF’s metric is cost, and cost is derived from interface bandwidth: faster links have lower cost (shorter paths), which matches intuition. The default formula uses a reference bandwidth of 100 Mbps:

cost = reference bandwidth / interface bandwidth = 100,000,000 / bandwidth (bps)

Cost is calculated on each interface and is the cumulative cost along the path, so a route’s metric is the sum of the outgoing interfaces it crosses. The default reference of 100 Mbps creates a problem on modern networks: any link at 100 Mbps or faster rounds to the minimum cost of 1, so a gigabit link and a 10-gigabit link look identical. Administrators fix this by raising the reference bandwidth to 1 Gbps or higher with auto-cost reference-bandwidth on every router.

Interface bandwidthDefault OSPF cost (ref 100 Mbps)
10 Mbps10
100 Mbps1
1 Gbps (1000 Mbps)1
10 Gbps1
Exam tip — cost is a sum, and lower wins OSPF chooses the path with the lowest total cost, not the fewest hops. With the default 100 Mbps reference, everything gigabit and above is cost 1, so many exam questions simplify to counting cost-1 and cost-10 links. If a scenario says the reference was changed, use the formula with the new reference value.
Part 6

Neighbours, hellos, and timers

Before routers exchange LSAs they must become neighbours. OSPF sends periodic Hello packets to discover and maintain neighbours. On broadcast and point-to-point networks the defaults are:

The Hello packet carries parameters that must match before an adjacency forms: the Hello and dead intervals, the area ID, authentication, and the stub-area flag. A common exam trap is a misconfigured timer or area number that silently prevents adjacency — the interfaces are up and pinging, but OSPF never converges. A mismatch is not automatically negotiated away as it is with some other parameters.

Watch out — adjacent parameters must match OSPF neighbours must agree on area ID and (on the same segment) hello/dead timers and authentication. If they differ, routers stop at INIT or never progress and no routes are exchanged. Check show ip ospf interface on both ends.
Part 7

Multicast addresses and LSAs

OSPF does not use broadcast; it multicasts Hello and update packets to two well-known IPv4 addresses:

Multicast addressReceived by
224.0.0.5All OSPF routers on the segment (AllSPFRouters).
224.0.0.6Only the DR and BDR (AllDRouters).

A normal router sends LSAs to 224.0.0.5 and neighbours update to 224.0.0.6. (For IPv6, OSPFv3 uses the equivalents FF02::5 and FF02::6.) OSPFv2 runs directly over IP using protocol number 89.

LSAs themselves come in several types. The ones worth knowing early are the Type 1 Router LSA (a router describing its own links) and the Type 2 Network LSA (produced on a broadcast segment by the designated router, Lesson 21). The full database these LSAs build is what SPF runs on.

Exam tip — the numbers to know OSPF: AD 110; hello 10 s, dead 40 s on broadcast/point-to-point; multicast 224.0.0.5 (all OSPF routers) and 224.0.0.6 (DR/BDR); backbone area 0; default reference bandwidth 100 Mbps.
Key terms

The vocabulary you need

Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.

Key terms · select a term

Part 8 · Your turn

Review

Check what you have learned with these review questions.

Review · 5 questions

Sources

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics. cisco.com.
  2. IETF. Request for Comments (RFCs). rfc-editor.org.
  3. IANA. Internet Assigned Numbers Authority registries. iana.org.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.