Distance Vector Routing
Distance Vector Routing
Definition
Core Concept
• In distance-vector routing, routers do not maintain a complete topology map of the network
(unlike link-state routing); instead, they rely on information provided by their neighbors
about the "distance" to destinations and the "vector" (direction or next hop) to reach them,
building their routing tables through this iterative exchange process.
Key Characteristics
• Local Knowledge Only: Each router knows only about its directly connected neighbors and
relies on them to provide distance information to other destinations, lacking a global view of
the network.
• Periodic Updates: Routers broadcast their entire routing tables to neighbors at fixed intervals
(e.g., every 30 seconds in RIP), regardless of changes, ensuring all routers eventually
converge on a consistent set of routes.
• Distance Metric: Typically uses hop count (number of routers traversed) as the metric,
though some protocols (e.g., EIGRP) use composite metrics like bandwidth and delay.
• Routing Table:
o Contains entries for each destination, including the total distance (e.g., hop count)
and the next hop router.
• Update Messages:
o Packets sent periodically to neighbors, containing the router’s full routing table or
changes (in enhanced versions like EIGRP).
• Neighbors:
• Bellman-Ford Algorithm:
o The underlying algorithm that computes the shortest path by comparing distances
and selecting the lowest-cost route through a neighbor.
o Each router starts with a routing table containing only its directly connected
networks, assigning a distance of 0 to itself and 1 to immediate neighbors, with all
other destinations initially set to infinity (unreachable).
o At regular intervals, each router sends its entire routing table to its neighbors,
including destination networks, distances, and sometimes next hops (depending on
the protocol).
o Upon receiving a neighbor’s table, the router adds its own distance to the neighbor
(typically 1 hop) to the reported distances, compares the total with its current entry,
and updates its table if a shorter path is found (Bellman-Ford principle: Distance via
neighbor = Distance to neighbor + Neighbor’s distance to destination).
• Step 4: Convergence:
o This process repeats across all routers, with tables updated iteratively until no
further improvements are found, meaning all routers have consistent, shortest-path
information (assuming no network changes).
o Example: After several exchanges, Router A learns 172.16.0.0 is 2 hops away via B,
which learned it from C.
o When forwarding a packet, the router looks up the destination in its routing table
and sends it to the listed next hop, repeating this hop-by-hop until the packet
reaches its destination.
o If a link fails or a new network is added, the affected router updates its table and
shares the change in the next periodic update, triggering recalculation across the
network; however, this can lead to slow convergence or issues like count-to-infinity.
o Example: If B-C link fails, B updates its distance to 172.16.0.0 as infinity and informs
A.
• Steps:
1. Initialize distances: 0 for self, 1 for direct neighbors, infinity for others.
2. For each neighbor’s update, calculate new distance: D(new) = D(to neighbor) +
D(neighbor to destination).
3. Update table if new distance is less than current distance, setting the neighbor as the
next hop.
• Example:
o A’s table after updates: B (1 via B), C (2 via B), D (3 via B).
Example Scenario
• Process:
Diagram Descriptions
o Lines connecting: A-B (label: 1 hop), B-C (1), C-D (1), A-D (4).
o Table:
▪ A|0|-
▪ B|1|B
▪ C|2|B
▪ D|3|B
• Simplicity: Easy to implement and understand, requiring minimal computation and memory
compared to link-state routing, making it suitable for small networks or resource-constrained
devices.
• Low Overhead Initially: Only shares routing tables with neighbors, not the entire topology,
reducing initial complexity.
• Slow Convergence: Periodic updates and hop-by-hop propagation delay network stabilization
after changes, especially in large networks.
• Count-to-Infinity Problem: When a link fails, routers may incrementally increase distances to
infinity due to looping updates, slowing convergence (e.g., A thinks D is via B, B thinks via A).
• Routing Loops: Temporary loops can form during convergence, causing packet loss or delays
until resolved.
• Limited Scalability: Periodic broadcasts and table size grow with network size, overwhelming
bandwidth and router resources.
• Metric Simplicity: Basic hop count ignores factors like bandwidth or latency, leading to
suboptimal paths (e.g., a 1-hop slow link vs. a 2-hop fast link).
• Split Horizon: Prevents a router from advertising a route back to the neighbor it learned it
from, reducing loops.
• Route Poisoning: When a link fails, the router advertises an infinite distance (e.g., 16 in RIP)
to quickly invalidate the route.
• Hold-Down Timers: After a route is marked unreachable, the router ignores updates for a
period, allowing bad news to propagate fully.
• Triggered Updates: Send immediate updates on topology changes instead of waiting for the
next periodic cycle, speeding convergence.
Popular Distance-Vector Protocols
o Uses hop count (max 15), updates every 30 seconds, simple but limited by scale and
convergence speed.
• Distance-Vector:
• Link-State:
• In classful addressing (e.g., 10.0.0.0/8), distance-vector routing dynamically builds tables for
packet forwarding, using hop count to decide next hops within class boundaries, though it
adapts to classless addressing (CIDR) in modern implementations like EIGRP.
• Example: Packet from 10.1.2.3 to 192.168.1.10 → Router A’s table (from RIP) sends it to B (1
hop), then to destination network.
Additional Notes
• Hop Count Limit: RIP caps at 15 hops (16 = infinity), restricting network diameter.
• Convergence Example: After A-D (4) fails, A learns D via B-C (3 hops) but may loop until split
horizon or poisoning resolves it.
• Vector: Refers to direction (next hop), distinguishing it from scalar distance metrics.