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.
- RIP (Routing Information Protocol): Early distance-vector protocol. Metric is purely Hop Count (max 15). Slow convergence. If a link goes down, it can take minutes for the network to recover.
- EIGRP (Enhanced Interior Gateway Routing Protocol): Cisco's proprietary answer to RIP. Uses a composite metric (Bandwidth + Delay). Converges instantly (sub-second) due to Feasible Successors (backup routes).
- OSPF (Open Shortest Path First): The modern open standard. Builds a complete map (SPF Tree). CPU intensive but highly scalable and loop-free by design.
2. Classification
Protocols are categorized by their scope (IGP vs EGP) and their underlying algorithm (Distance Vector vs Link State).
- Interior Gateway Protocols (IGP): Used within an organization (Autonomous System).
- OSPF: Link State. Open standard. Fast convergence.
- EIGRP: Advanced Distance Vector (Hybrid). Cisco proprietary (mostly). Fast convergence.
- RIP: Distance Vector. Legacy. Hop count limit of 15.
- Exterior Gateway Protocols (EGP): Used between organizations (the Internet).
- BGP: Path Vector. The protocol of the Internet. Slow but scalable.
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.
- Algorithm: Dijkstra's Shortest Path First (SPF).
- Metric: Cost = Reference Bandwidth / Interface Bandwidth. (Default Ref BW is 100 Mbps; recommended to set to 100 Gbps in modern networks).
- Areas: Hierarchy to reduce LSA flooding. All areas must connect to the Backbone Area 0.
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. |
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)
- Weight: (Cisco proprietary) Local to the router. Higher is better.
- Local Preference: Local to the AS. Higher is better. (The main way to influence outbound traffic).
- Locally Originated: Prefer routes sourced by this router (network command).
- AS Path: Shortest AS Path length (fewer hops).
- Origin: IGP < EGP < Incomplete (?).
- MED: (Multi-Exit Discriminator) Lower is better. Hints neighbors how to enter your AS.
- eBGP over iBGP: Prefer external paths.
- 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. |