Learn Computer Networking PNETLab - Single-Area OSPF (Open Shortest Path First)
Episode 11 of 21

Learn Computer Networking PNETLab - Single-Area OSPF (Open Shortest Path First)

This episode discusses OSPFv2 as a link-state protocol based on the Dijkstra algorithm: its advantages, the backbone area 0 concept, and the seven neighbor formation states from Down to Full. You learn DR and BDR election on multi-access networks, configure single-area OSPF, and verify it with show ip ospf neighbor.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

EIGRP in episode 10 relied on information from neighbors. Now we switch to a different approach: link-state routing through OSPF (Open Shortest Path First). Every OSPF router builds a complete map of the network, then calculates its own best paths — no router "trusts" its neighbors blindly.

Episode 11 discusses single-area OSPFv2: the protocol's advantages, the backbone area 0 concept, the neighbor formation flow, the DR and BDR roles, and a complete configuration in PNETLab. This is the foundation for multi-area OSPF in episode 12.

Getting to Know OSPF (Open Shortest Path First)

OSPF is a link-state protocol: every router propagates information about its own links (state), all routers build an identical Link-State Database (LSDB), and then every router calculates the shortest paths with the Dijkstra algorithm (Shortest Path First / SPF). As a result, there are no routing loops and all routers choose consistent paths.

The Backbone Area 0 Concept

OSPF divides a network into areas to conserve resources. Area 0, called the backbone area, is mandatory and becomes the hub connecting all other areas. In single-area OSPF, the entire network is in area 0 — the simplest design and ideal for a lab.

The OSPF Neighbor Adjacency Formation Flow

The Seven Neighbor States

Before exchanging routes, two OSPF routers go through a series of states:

  • Down: no communication yet.
  • Init: a Hello has been received from a neighbor.
  • 2-Way: Hellos are received in both directions.
  • ExStart: master-slave negotiation and sequence numbers.
  • Exchange: exchanging database descriptions.
  • Loading: requesting LSAs not yet held.
  • Full: the LSDB is synchronized, adjacency is ready.

OSPF Hello is sent to the multicast address 224.0.0.5. Verify directly in PNETLab after the two routers are connected:

Verify the OSPF neighbor
R1# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:35    10.0.0.2        GigabitEthernet0/1

show ip ospf neighbor displays neighbors in the FULL state. This state indicates that adjacency was formed successfully.

Router Roles on Multi-Access Networks

DR and BDR Election

On a multi-access network such as a switch, hundreds of Hellos could flood the bandwidth. OSPF elects a Designated Router (DR) and a Backup Designated Router (BDR) to centralize the LSDB exchange. DR and BDR are chosen by the highest priority, then the highest Router ID as the tiebreaker.

Routers that are neither DR nor BDR only exchange with the DR and BDR, not with each other. On point-to-point links such as router-to-router directly, DR/BDR are not elected — the state shows Full/- without a role.

Single-Area OSPFv2 Configuration

Applying It in PNETLab

Use the three-router topology from episode 9. Configure R1:

Single-area OSPF configuration on R1
configure terminal
router ospf 1
 router-id 1.1.1.1
 network 10.0.0.0 0.0.0.3 area 0
 network 192.168.10.0 0.0.0.255 area 0
exit

router ospf 1 enables OSPF with process id 1, router-id sets the router identity, and network <network> <wildcard> area 0 determines which interface is advertised and into which area. The wildcard mask is the inverse of the subnet mask: 0.0.0.3 for /30, 0.0.0.255 for /24.

Configure R2 and R3 following the same pattern with their own router-ids and network statements. Make sure all routers use area 0 so adjacency forms.

Verifying OSPF

Three Mandatory Commands

After configuration, run a full verification:

OSPF verification on R1
R1# show ip ospf neighbor
R1# show ip ospf interface
R1# show ip route ospf

show ip ospf interface displays the interface status and OSPF timers, while show ip route ospf confirms that OSPF routes enter the routing table with code O. If a route does not appear, check whether both ends of the link are in the same area and the wildcard mask is correct.

Watching SPF in Action

To understand how SPF works directly, enable event logging:

Tracing SPF events
R1# debug ip ospf events

debug ip ospf events displays adjacency formation and SPF calculation events. The combination of show ip ospf neighbor at state FULL and the SPF log is the troubleshooting toolkit you will use in episodes 12 and 20.

Closing

Key takeaways:

  • OSPF is a link-state protocol based on the Dijkstra algorithm.
  • Area 0 is the mandatory backbone; single-area uses only area 0.
  • The seven neighbor states end at Full when the LSDB is synchronized.
  • DR and BDR centralize the exchange on multi-access networks.
  • network <network> <wildcard> area 0 determines the advertised interface.
  • Verify with show ip ospf neighbor, interface, and ip route ospf.

In the next episode, episode 12, we scale OSPF: multi-area OSPF — the benefits of an area hierarchy for shrinking the LSDB and SPF load, the roles of backbone routers, ABR, and ASBR, understanding LSA types 1 to 5, and configuring ABR and route summarization with the area range command.

Learn Computer Networking PNETLab - Single-Area OSPF (Open Shortest Path First) | Learn Computer Networking PNETLab