Routing Protocols (OSPF & BGP)

[!NOTE] This module explores the core principles of Routing Protocols (OSPF & BGP), deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. What is a Router?

A router is a Layer 3 device that forwards data packets between computer networks. It maintains a Routing Table to decide the best path for each packet.

2. Static vs. Dynamic Routing

  • Static: Routes are manually entered by an admin. (Good for simple, unchanging networks).
  • Dynamic: Routers talk to each other to learn about new networks and failures.

3. Interior Gateway Protocols (IGP)

Used to route traffic inside an organization (Autonomous System).

Distance Vector (RIP)

  • Routes based on Hop Count.
  • Slow convergence and prone to loops. (Legacy).
  • Every router has a complete map of the network topology.
  • Calculates the shortest path using Dijkstra’s Algorithm.
  • Metric: Cost (based on bandwidth). Fastest links are preferred.

4. Exterior Gateway Protocols (EGP)

Used to route traffic between organizations (The Internet).

Path Vector (BGP)

  • The “Glue” of the Internet.
  • Routes based on Policies/Business rules rather than strictly speed.
  • Uses AS Path to avoid loops.

5. Interactive: Dijkstra’s Path

Find the lowest cost path to the destination.

S
B
C
D
Cost: 10
Cost: 1
Cost: 2
Cost: 8
Waiting for Dijkstra...

6. Convergence

The state where all routers in a network have the same (and correct) view of the network topology.

  • Fast Convergence is critical! If a link dies and routers are not updated, you get a “Routing Black Hole” or a “Routing Loop”.