Distance Vector Routing Protocols
# CHAPTER 6
Distance Vector Routing Protocols
1. Introduction
When dynamic routing was first invented, computers had very little memory and weak processors. Engineers needed a routing language that was extremely simple to calculate. The result was the Distance Vector algorithm. The most famous Distance Vector protocol is RIP (Routing Information Protocol). While rarely used in modern enterprise networks today due to its severe limitations, understanding how Distance Vector protocols operate is an absolute prerequisite for networking students. It teaches you how routers calculate distance, how "Routing Loops" are formed, and how engineers invented clever hacks like "Split Horizon" to prevent the internet from destroying itself.2. Learning Objectives
By the end of this chapter, you will be able to:- Define the core mechanics of a Distance Vector routing protocol.
- Understand the metric of "Hop Count" used by RIP.
- Identify the fatal flaws of Distance Vector routing (Count-to-Infinity).
- Explain the mechanism of Routing Loops.
- Describe the "Split Horizon" and "Poison Reverse" loop-prevention mechanisms.
3. Beginner-friendly Explanations
The "Rumor Mill" (Routing by Rumor): Distance Vector protocols operate exactly like a game of telephone, or a rumor mill.- Router A is holding a box.
- Router A turns to Router B and says: *"I am 0 steps away from the box."*
- Router B records this. It turns to Router C and says: *"I heard from Router A that the box is 1 step away from me."*
- Router C turns to Router D and says: *"I heard from Router B that the box is 2 steps away from me."*
The Problem: Router C has absolutely no idea where the box actually is. It has never seen the box. It doesn't have a map. It only knows what Router B told it. This is why Distance Vector is often called "Routing by Rumor."
4. RIP and the Hop Count Metric
RIP (Routing Information Protocol) is the classic Distance Vector protocol. It uses a metric called Hop Count. Every time a packet passes through a router, that is exactly 1 Hop. If RIP has two paths to a destination:- Path 1: Passes through 2 routers (2 Hops).
- Path 2: Passes through 5 routers (5 Hops).
The Fatal Flaw of RIP: RIP does not understand Bandwidth! Path 1 might be a slow, dial-up copper wire. Path 2 might be a blazing fast Fiber Optic cable. RIP is blind to speed. It will stubbornly choose the 2-Hop dial-up path, causing terrible network performance.
5. The Routing Loop (Count-to-Infinity)
Because routers are relying on rumors, what happens when a cable breaks?- 1. Network X is connected to Router A.
- 2. Router A tells Router B: "I can reach Network X in 1 Hop."
- 3. The cable breaks. Router A loses Network X.
- 4. Before Router A can tell anyone it's broken, Router B turns to Router A and says: *"Hey, I know a path to Network X! It takes me 2 Hops!"* (Router B is talking about the old path it learned from A).
- 5. Router A, desperate for a path, says: *"Great! I'll route through you. That makes me 3 Hops away!"*
- 6. Router B updates its table: *"Oh, Router A is now 3 hops away. That makes me 4 hops away!"*
6. Loop Prevention Mechanisms
To stop the Count-to-Infinity problem, engineers coded strict rules into the protocol.1. A Maximum Hop Count: RIP has a hard-coded maximum limit of 15 Hops. If the routers start looping and hit Hop 16, the protocol declares the network "Unreachable" and kills the packet. (This is why RIP can never be used on large networks; it literally cannot route further than 15 routers away).
2. Split Horizon: The Golden Rule of Distance Vector: *"Never tell a router about a route that you originally learned from that exact same router."* If Router B learned about Network X from Router A, Router B is mathematically banned from ever mentioning Network X back to Router A. This breaks the rumor loop instantly.
7. RIP Example (Routing Table)
If you look at a table running RIP, the Administrative Distance (AD) is 120, and the Metric is the Hop Count.-
R: Learned via RIP.
-
[120/3]: Administrative Distance is 120. The destination is 3 Hops away.
8. Best Practices
- Legacy Systems: Do not deploy RIP in a modern enterprise network. It is too slow, its convergence time can be several minutes, and its hop limit of 15 is too restrictive. It exists in modern curriculums primarily to teach the fundamental mathematics of routing algorithms. Modern networks use Link-State protocols (Chapter 7).
9. Common Mistakes
- Disabling Split Horizon: In highly specific, advanced Frame Relay topologies, network engineers sometimes intentionally disable the Split Horizon rule to allow certain routes to propagate. However, doing this without a profound understanding of the topology guarantees a catastrophic network loop will form.
10. Mini Project: Trace a Routing Loop (Theory)
Draw two routers (R1 and R2).- R1 is connected to PC1.
- Tell R2 that PC1 is 1 Hop away.
- Disconnect PC1.
- Erase R1's knowledge of PC1.
- Watch what happens if R2 blindly tells R1: "I can reach PC1 in 2 hops." R1 will send traffic for PC1 to R2. R2 will send it back to R1. The packet loops in a circle forever. This visual exercise proves why the Split Horizon rule was invented!
11. Practice Exercises
- 1. Explain the "Routing by Rumor" concept. Why is a Distance Vector router "blind" to the actual map of the network?
- 2. If RIP is presented with a 1-Hop 10Mbps link and a 3-Hop 1000Mbps link, which path will it choose and why?
12. MCQs with Answers
What is the metric utilized by the Routing Information Protocol (RIP) to determine the best path to a destination?
Which loop prevention mechanism dictates that a router must never advertise a route back out the same interface it originally learned it from?
13. Interview Questions
- Q: Explain the Count-to-Infinity problem in Distance Vector routing. How does setting a maximum hop limit mitigate this?
- Q: Describe the Split Horizon rule. How does it prevent a routing loop from forming between two adjacent routers?
- Q: Why is RIP largely obsolete in modern enterprise networking, specifically regarding its metric calculation?