Domain 3IP ConnectivityCORE

Dynamic Routing Concepts

Fundamentals of dynamic routing protocols, comparing distance vector, link-state, and path-vector, and understanding AD and metrics.

Domain: Domain 3: IP Connectivity•Updated: 2026-08-26
#Dynamic Routing#IGP#EGP#Administrative Distance#Metric

Dynamic Routing Fundamentals (CCNA 200-301)

Static vs. Dynamic Routing

  • Static Routing: Manually configured routes to each destination. Does not adapt to network failures automatically.
  • Dynamic Routing: Routers run a routing protocol to automatically discover networks, share routing information, and adapt to topology changes (e.g., link failures) by finding the next-best path.
  • Route Types:
    • Network Route: A route to a network or subnet (mask length less than /32). Example: 192.168.4.0/24.
    • Host Route: A route to a specific, single host address, specified with a /32 mask. Example: 10.0.12.1/32. Automatically added for router interface IP addresses.

Routing Protocol Categories & Algorithms

Routing protocols are categorized by their scope (IGP vs. EGP) and the algorithm they use to share information and calculate the best path.

  • IGP (Interior Gateway Protocol): Used to share routes within a single Autonomous System (AS) or organization (e.g., a company network).
  • EGP (Exterior Gateway Protocol): Used to share routes between different Autonomous Systems (e.g., across the Internet).
Protocol Category Algorithm Type Primary Use Case
RIP (Routing Information Protocol) IGP Distance Vector Legacy/Small networks
EIGRP (Enhanced Interior Gateway Routing Protocol) IGP Distance Vector Cisco-centric enterprise networks
OSPF (Open Shortest Path First) IGP Link State Modern enterprise networks (CCNA Focus)
IS-IS (Intermediate System to Intermediate System) IGP Link State Service Provider networks
BGP (Border Gateway Protocol) EGP Path Vector Internet routing (Between ASes)

Things to note: For the CCNA, you must know the names of these protocols, their categories, and their algorithm types. OSPF is the primary focus, but you must be able to compare it to others.

  • Distance Vector:
    • Concept: Often called “routing by rumor”. Routers only know the routes their directly connected neighbors tell them about, along with the metric to reach them. They do not have a full picture of the network topology.
    • Mechanism: Shares its routing table (or parts of it) with neighbors.
    • Protocols: RIP, EIGRP.
  • Link State:
    • Concept: Every router creates a complete “connectivity map” (topology database) of the entire network.
    • Mechanism: Routers advertise information about their own interfaces and connected networks. These advertisements are flooded throughout the network until all routers have the identical map. Each router then independently calculates the best path.
    • Trade-off: Uses more CPU and memory, but converges (reacts to changes) much faster than distance vector protocols.
    • Protocols: OSPF, IS-IS.

Metrics and ECMP

  • Metric: A value used by a routing protocol to determine the best path to a destination. Lower metric is always preferred.
  • ECMP (Equal Cost MultiPath): If a router learns two or more routes to the exact same destination (same network address and prefix length) via the same routing protocol with the same metric, both routes are installed in the routing table. Traffic is load-balanced across both paths.
Protocol Metric Type Calculation Details
RIP Hop Count Number of routers to the destination. Ignores link speed (10 Mbps = 10 Gbps).
EIGRP Composite Based primarily on Bandwidth (slowest link in path) and Delay (sum of all links).
OSPF Cost Calculated based on interface Bandwidth. Higher bandwidth = lower cost.
IS-IS Cost Default cost is 10 for all links (functions like hop count unless manually tuned).

Administrative Distance (AD)

  • Concept: A measure of the trustworthiness of a routing information source. Used to choose the best route when a router learns about the same destination from different routing protocols.
  • Rule: Lower AD is preferred. Metrics cannot be compared across different protocols (e.g., OSPF cost vs. EIGRP metric), so AD is the tiebreaker.
Route Source Default Administrative Distance (AD)
Connected Interface 0 (Most trusted)
Static Route 1
eBGP (External BGP) 20
EIGRP (Internal) 90
IGRP (Legacy) 100
OSPF 110
IS-IS 115
RIP 120
iBGP (Internal BGP) 200
Unusable / Unknown 255 (Router will not install this route)

Things to note: AD values listed are Cisco defaults. Other vendors may rank these differently. An AD of 255 means the router does not believe the source and will not install the route.

Floating Static Routes

  • Concept: A static route configured with a manually assigned AD higher than the dynamic routing protocol’s AD.
  • Purpose: Acts as a backup route. It remains inactive (out of the routing table) as long as the dynamic route is available. If the dynamic route fails (e.g., adjacency lost), the floating static route is installed.
Router(config)# ip route 192.168.4.0 255.255.255.0 10.0.12.2 150

Things to note: The 150 at the end is the Administrative Distance. Since 150 is higher than OSPF (110) or EIGRP (90), this route will only appear in the routing table if the dynamic routes disappear.

Route Selection Logic (Longest Prefix Match)

When a router receives a packet, it evaluates the routing table using a strict hierarchy. Longest Prefix Match always overrides AD and Metric if the destination networks have different subnet masks.

graph TD
    A[Packet arrives at Router] --> B{Does destination match multiple routes?}
    B -->|Yes, different prefix lengths| C[Select Longest Prefix Match]
    B -->|Yes, exact same prefix| D{Learned from different protocols?}
    D -->|Yes| E[Select Lowest Administrative Distance AD]
    D -->|No, same protocol| F[Select Lowest Metric]
    F --> G[ECMP: If metrics are equal, load-balance]

Things to note: In the Boson ExSim example, a router had routes to 10.20.0.0/22, /24, /26, and /28. A packet destined for 10.20.0.14 matched all four. Despite /22 being a static route (AD 1) and /28 being OSPF (AD 110), the router chose the OSPF /28 route because it is the most specific match (Longest Prefix Match).


Consolidated Cisco IOS Commands

! Configure a standard static route (AD defaults to 1)
Router(config)# ip route [destination_network] [subnet_mask] [next_hop_ip | exit_interface]

! Configure a host route (specific /32 destination)
Router(config)# ip route 10.0.12.1 255.255.255.255 [next_hop_ip]

! Configure a floating static route (Backup route with higher AD)
Router(config)# ip route [destination_network] [subnet_mask] [next_hop_ip] [administrative_distance]
! Example:
Router(config)# ip route 192.168.4.0 255.255.255.0 10.0.12.2 150

! Verify routing table to check AD (left number in brackets) and Metric (right number)
Router# show ip route

Things to note: In show ip route output, routes are displayed with codes (e.g., C for Connected, S for Static, O for OSPF, D for EIGRP, R for RIP). The values in brackets [AD/Metric] are critical for troubleshooting route selection (e.g., [110/3] means AD is 110, Metric is 3). Static routes will show a metric of 0. Connected routes have an AD of 0, but it is not explicitly displayed in the brackets.