🛰️ OSPF (Open Shortest Path First)

 

🛰️ OSPF (Open Shortest Path First)


🧠 Top 5 Key Points about OSPF

  1. Link-State Protocol → OSPF shares detailed information about network topology (not just hop count).

  2. Metric: Uses cost, calculated based on bandwidth (higher bandwidth = lower cost).

  3. Fast Convergence: Quickly detects and adapts to network changes.

  4. Supports VLSM & CIDR: Fully classless, allowing subnet flexibility.

  5. Area-Based Design: Supports hierarchical networks (Area 0 = Backbone, others connect to it).


⚙️ Additional Notes

  • Works at Layer 3 (Network Layer) of the OSI model.

  • Uses Dijkstra’s SPF (Shortest Path First) algorithm.

  • Multicast addresses:

    • 224.0.0.5 → All OSPF routers

    • 224.0.0.6 → Designated Router (DR) and Backup DR


🧰 OSPF Lab in Cisco Packet Tracer

🎯 Goal:

Configure OSPF routing between three routers so that all connected PCs can communicate.


🖥️ Network Topology

PC1 -- R1 -- R2 -- R3 -- PC2

IP Address Plan

DeviceInterfaceIP AddressNetwork
R1G0/0192.168.1.1192.168.1.0/24
S0/0/010.0.0.110.0.0.0/30
R2S0/0/010.0.0.210.0.0.0/30
S0/0/110.0.0.510.0.0.4/30
R3S0/0/110.0.0.610.0.0.4/30
G0/0192.168.2.1192.168.2.0/24
PC1NIC192.168.1.10192.168.1.0/24
PC2NIC192.168.2.10192.168.2.0/24

🪜 Step-by-Step Configuration

Step 1: Configure IP Addresses

🔹 Router R1

enable conf t interface g0/0 ip address 192.168.1.1 255.255.255.0 no shutdown exit interface s0/0/0 ip address 10.0.0.1 255.255.255.252 clock rate 64000 no shutdown exit

🔹 Router R2

enable conf t interface s0/0/0 ip address 10.0.0.2 255.255.255.252 no shutdown exit interface s0/0/1 ip address 10.0.0.5 255.255.255.252 clock rate 64000 no shutdown exit

🔹 Router R3

enable conf t interface s0/0/1 ip address 10.0.0.6 255.255.255.252 no shutdown exit interface g0/0 ip address 192.168.2.1 255.255.255.0 no shutdown exit

Step 2: Configure OSPF

We’ll use Process ID 1 and Area 0 (backbone area).

🔹 R1

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

🔹 R2

router ospf 1 network 10.0.0.0 0.0.0.3 area 0 network 10.0.0.4 0.0.0.3 area 0

🔹 R3

router ospf 1 network 10.0.0.4 0.0.0.3 area 0 network 192.168.2.0 0.0.0.255 area 0

Step 3: Verify OSPF Configuration

Use the following commands to verify:

show ip ospf neighbor

➡ Shows OSPF neighbor relationships.

show ip route ospf

➡ Displays routes learned via OSPF (marked with “O”).

show ip protocols

➡ Confirms OSPF is active on interfaces.


Step 4: Test Connectivity

  • Go to PC1 → Command Prompt
    Type:

    ping 192.168.2.10

✅ If replies are successful, OSPF routing works!


🧠 What You Learned

ConceptDescription
OSPF TypeLink-State Protocol
AlgorithmDijkstra’s SPF
MetricCost (based on bandwidth)
Area 0Backbone area for OSPF domains
Neighbor DiscoveryFormed using Hello packets (224.0.0.5)

💬 Summary

“OSPF is smarter than RIP — it builds a map of the entire network and chooses the fastest route based on cost, not just hop count.”

Comments

Popular posts from this blog

🖥️ Private IP vs Public IP Address

🧠 Introduction to CCNA Networking