Dynamic Routing Protocols

Routing protocols allow routers to dynamically share information about network topology. They are essential for scalability and fault tolerance.

1. Historical Context: RIP vs EIGRP vs OSPF

Routing has evolved from simple hop-counts to complex link-state algorithms.

2. Classification

Protocols are categorized by their scope (IGP vs EGP) and their underlying algorithm (Distance Vector vs Link State).

2. OSPF (Open Shortest Path First)

OSPF builds a complete map (topology) of the network using Link State Advertisements (LSAs). Every router knows about every link in its area.

OSPF LSA Types Cheat Sheet

Type Name Description
1 Router LSA Advertises directly connected links. Flooded within an area.
2 Network LSA Generated by the DR. Advertises the multi-access segment.
3 Summary LSA Generated by the ABR. Advertises inter-area routes (Area 1 -> Area 0).
4 ASBR Summary Advertises the path to the ASBR.
5 AS External Generated by the ASBR. Advertises external routes (Redistributed).
7 NSSA External Used in Not-So-Stubby Areas. Converted to Type 5 by the ABR.
Engineer's Notebook: Troubleshooting Adjacencies

If OSPF neighbors are stuck in EXSTART/EXCHANGE, check for an MTU Mismatch.

If they are stuck in INIT, the other side is seeing your Hellos but you aren't seeing theirs (Multicast/ACL issue).

Show ip ospf neighbor is your best friend.

3. BGP (Border Gateway Protocol)

BGP makes routing decisions based on policies (Path Attributes). It is the only protocol capable of handling the size of the Internet table (>900k routes).

BGP Path Selection Algorithm (Best Path)

  1. Weight: (Cisco proprietary) Local to the router. Higher is better.
  2. Local Preference: Local to the AS. Higher is better. (The main way to influence outbound traffic).
  3. Locally Originated: Prefer routes sourced by this router (network command).
  4. AS Path: Shortest AS Path length (fewer hops).
  5. Origin: IGP < EGP < Incomplete (?).
  6. MED: (Multi-Exit Discriminator) Lower is better. Hints neighbors how to enter your AS.
  7. eBGP over iBGP: Prefer external paths.
  8. Router ID: Lowest BGP Router ID.

Mnemonic: "We Love Oranges As Oranges Mean Pure Refreshment"

4. Administrative Distance (AD) Cheat Sheet

When a router learns the same route from two different protocols, Administrative Distance determines which one is trusted more (Lower is Better).

Protocol Default AD Notes
Connected Interface 0 Most trusted.
Static Route 1 Manually configured.
eBGP 20 External BGP is highly trusted.
EIGRP 90 Internal EIGRP.
OSPF 110 Standard for enterprise.
RIP 120 Least trusted IGP.
iBGP 200 Internal BGP.