OSPF Basics

Understanding Open Shortest Path First Protocol

OSPF (Open Shortest Path First) is a link-state routing protocol used to find the best path between the source and the destination router using its own Shortest Path First (SPF) algorithm (Dijkstra's algorithm). Unlike EIGRP, OSPF is an open standard protocol, meaning it is supported by almost all network vendors.

Key Features

OSPF Tables

Table Name Description Command
Neighbor Table Lists directly connected OSPF neighbors (Adjacencies). show ip ospf neighbor
Database Table (LSDB) Contains the map of the network topology. show ip ospf database
Routing Table Contains the best paths calculated by SPF. show ip route ospf

OSPF Packet Types

OSPF Router Roles

DR & BDR Election

On multi-access networks (like Ethernet), OSPF elects a Designated Router (DR) and a Backup Designated Router (BDR) to minimize traffic. Instead of every router exchanging updates with every other router, they only send updates to the DR/BDR.

Basic Configuration (Single Area)

Router(config)# router ospf 1 ! 1 is the Process ID (locally significant)
Router(config-router)# network 192.168.10.0 0.0.0.255 area 0 ! Uses Wildcard Mask
Router(config-router)# router-id 1.1.1.1 ! Manually set Router ID
Router(config-router)# passive-interface gigabitEthernet0/1 ! Stop Hello packets on LAN