Post

Dynamic Routing

Dynamic Routing

πŸ“˜ Dynamic Routing Protocols & Route Selection

A Complete Technical Guide for Learners, Interviewees, and Network Engineers

πŸ”Ή Part 1: Dynamic Routing Basics

What is Dynamic Routing?

Dynamic routing allows routers to automatically exchange routing information using protocols, keeping their routing tables updated without manual configuration.

πŸ”„ Dynamic Routing vs. Static Routing

FeatureStatic RoutingDynamic Routing
Configured byManually by adminAutomatically by protocol
Reaction to network changesNo automatic responseAdapts dynamically
ScalabilityLimited and error-proneScales to large networks
Use caseSmall or stable networksLarge, complex, or changing topologies

βœ… A router can use both static and dynamic routing simultaneously.

πŸ”Ή Part 2: Types of Dynamic Routing Protocols

1️⃣ Interior Gateway Protocols (IGPs)

Used within a single Autonomous System (AS).

β–Ά By Algorithm:

AlgorithmDescriptionProtocols
Distance-VectorRouters exchange known routes and hop counts without a complete network map.RIP, EIGRP
Link-StateRouters share link info, build a full network map (LSDB), and compute best paths.OSPF, IS-IS

2️⃣ Exterior Gateway Protocols (EGPs)

Used between Autonomous Systems (e.g., enterprise to ISP).

AlgorithmDescriptionProtocol
Path-VectorSelects routes based on AS-paths (AS-to-AS logic).BGP

πŸ”Ή Part 3: Understanding Route Selection

2 Core Meanings of "Route Selection":

  1. Routing Table Population: Choosing which route(s) to insert into the routing table (only the best per destination is kept).

  2. Packet Forwarding Decision: Using the routing table to decide how to forward individual packets.

πŸ”Ή Part 4: Routing Table Population Logic

When multiple routes to the same destination exist, routers use:

1️⃣ Administrative Distance (AD)

Determines the trustworthiness of a source protocol.

Route SourceAD (Lower = Better)
Directly Connected0
Static Route1
External BGP20
EIGRP90
OSPF110
IS-IS115
RIP120
Internal BGP200
Unusable255

βœ… AD is only compared when multiple protocols provide routes to the same destination.

2️⃣ Metric

Used when multiple routes from the same protocol exist.

ProtocolMetric TypeDescription
RIPHop CountFewer hops = better
OSPFCostLower bandwidth = higher cost
EIGRPCompositeUses bandwidth, delay (and others if configured)

πŸ‘‰ Lower metric is always preferred.

3️⃣ Equal-Cost Multi-Path (ECMP)

If multiple routes to the same destination from the same protocol have equal metrics, they are all installed in the routing table for load balancing.

4️⃣ Floating Static Routes

A static route with higher AD than a dynamic route (e.g., AD 111 vs OSPF AD 110) is used as a backup, inserted only if the preferred route fails.

πŸ”Ή Part 5: Packet Forwarding Logic

After routing table population:

  • 🧭 Forwarding Rule: Choose the most specific route (longest prefix match) for the destination IP.
  • ❌ AD and Metric are NOT used during packet forwarding.
  • βœ… Example:
    • Destination: 10.0.1.5
    • Match:
      • 10.0.0.0/8 (Generic)
      • 10.0.1.0/24 βœ… (More specific β†’ Used)

πŸ”Ή Part 6: Activating Routing Protocols

πŸ“₯ Enabling Routing on Interfaces (OSPF Example)

1
2
router ospf 1
 network 192.168.1.0 0.0.0.255 area 0

πŸ” Understanding Wildcard Masks

Wildcard mask β‰  Subnet mask Wildcard mask inverts the subnet mask.

Subnet MaskWildcard Mask
255.255.255.0 (/24)0.0.0.255
255.255.255.252 (/30)0.0.0.3

Binary Logic:

  • 0 = bit must match
  • 1 = bit can vary

🎯 OSPF network Command Tasks:

  1. Interface Matching: Finds interfaces with IPs matching the network + wildcard.
  2. OSPF Activation: Enables OSPF on those interfaces.
  3. Prefix Advertisement: Router advertises the actual interface subnet, not the network command range.

🧠 Pro Tip:

To control precisely which interface runs OSPF:

1
network 192.168.1.1 0.0.0.0 area 0

This ensures only that interface is affected.

πŸ“ Final Notes for Interview & Exam Readiness

βœ… Know All AD Values βœ… Compare Metric Logic of RIP, OSPF, and EIGRP βœ… Understand ECMP & Floating Static Routes βœ… Be clear on the difference between Routing Table Population and Packet Forwarding βœ… Master OSPF network command & wildcard mask behavior

  • In enterprise networks, OSPF and EIGRP dominate for internal routing.
  • BGP is essential for Internet routing and multi-ISP connections.
  • Floating static routes are key for backup WAN paths.
  • Always test routing configurations using tools like:
    • show ip route
    • show ip protocols
    • show ip protocols

βœ… Summary Checklist

ConceptMust Know?
Difference: Static vs Dynamic Routingβœ…
Types of Routing Protocols (IGP, EGP)βœ…
AD & Metric Logicβœ…
ECMPβœ…
Floating Static Routesβœ…
Longest Prefix Match (Forwarding)βœ…
OSPF Network Command & Wildcardβœ…

πŸ™Œ Connect With Me

GitHub LinkedIn YouTube Gmail

This post is licensed under CC BY 4.0 by the author.