Tutorial 6: RIP and Advanced Distance-Vector Techniques Expanded

Table of Contents

  1. Learning Objectives
  2. Overview
  3. Detailed Technical Content
  4. Quiz
  5. Exercises
  6. Homework
  7. Summary

Learning Objectives

Overview

Routing Information Protocol (RIP) is one of the oldest dynamic routing protocols, based on the distance-vector algorithm. It is simple to configure and deploy, making it suitable for small, homogeneous networks. RIP uses hop count as its metric, with a maximum of 15 hops (16 = infinity). Version 1 (RIPv1) is classful and does not support authentication; Version 2 (RIPv2) adds support for classless routing (CIDR), subnet masks, and authentication. However, RIP's slow convergence and limited scalability have relegated it to small networks or stub environments. This tutorial covers RIP in detail, including its timers, message formats, and loop prevention mechanisms. We also explore advanced distance-vector protocols like EIGRP, which uses the Diffusing Update Algorithm (DUAL) to achieve fast convergence and loop-free operation. The tutorial concludes with a comparative analysis of distance-vector and link-state protocols.

Detailed Technical and Theoretical Content

1. RIP Protocol Architecture and Versions

RIP is defined in RFC 1058 (RIPv1) and RFC 2453 (RIPv2). It operates over UDP port 520.

RIP routers exchange their entire routing tables every 30 seconds (by default). Each route entry includes the destination network, next hop, and metric (hop count).

2. RIP Message Formats and Operation

A RIP message consists of a header and up to 25 route entries (RIPv2) or 25 entries (RIPv1). Each entry includes:

RIPv2 adds a subnet mask and next-hop field, and a route tag for external routes. The message is sent using UDP.

3. RIP Timers and Aging Mechanisms

RIP uses several timers to manage routes:

These timers can be adjusted, but are typically left at defaults.

4. Loop Prevention Techniques in RIP

To mitigate the count-to-infinity problem and routing loops, RIP employs:

5. RIP Convergence and Performance Analysis

Convergence time in RIP is dominated by the periodic update interval (30s) and the network diameter. The worst-case convergence time to detect an unreachable destination (count-to-infinity) can be up to 16 * 30 = 480 seconds without triggered updates. Triggered updates reduce this significantly, but hold-down timers add delay. RIP is not suitable for large networks due to its hop-count limit and slow convergence.

6. Advanced Distance-Vector: EIGRP and DUAL

Enhanced Interior Gateway Routing Protocol (EIGRP) is a Cisco-proprietary distance-vector protocol that improves upon RIP by using:

DUAL ensures loop-free operation by maintaining feasible successors (backup routes) and only diffusing queries when a route is lost and no feasible successor exists. This guarantees convergence without count-to-infinity.

7. Comparison of RIP, EIGRP, and OSPF

FeatureRIPEIGRPOSPF
TypeDistance-vectorAdvanced distance-vectorLink-state
MetricHop countComposite (bandwidth, delay, etc.)Cost (based on bandwidth)
Max hops15255 (default)Unlimited
ConvergenceSlow (minutes)Fast (sub-second with BFD)Fast (seconds)
ScalabilitySmall networksMedium to large (hierarchical possible)Large (with areas)
UpdatesFull table every 30sPartial, triggeredTriggered LSAs
Loop-freeWith mechanismsYes (DUAL)Yes (inherently)

8. Practical Deployment Scenarios and Limitations

RIP is often used in small office/home office (SOHO) networks, or as a stub routing protocol in larger networks (e.g., for small branch offices). Its simplicity makes it easy to deploy but its limitations (slow convergence, hop count, lack of scalability) make it unsuitable for enterprise backbones. RIP may also be used in legacy networks or for educational purposes. EIGRP and OSPF are preferred for larger, more dynamic environments.

Figure 1: RIP message format (RIPv2)

    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Command (1) | Version (2)  |      Unused (must be zero)     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Address Family Identifier (2) |     Route Tag (2)            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | IP Address (4)                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Subnet Mask (4)                                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Next Hop (4)                                                 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Metric (4)                                                   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    (Up to 25 route entries)
    

Quiz

Answer each question; check your understanding by revealing the answer.

Question 1: What is the maximum hop count in RIP?

Show Answer15; 16 is infinity.

Question 2: What transport protocol does RIP use?

Show AnswerUDP, port 520.

Question 3: What is the default periodic update interval for RIP?

Show Answer30 seconds.

Question 4: What is the purpose of the invalid timer in RIP?

Show AnswerTo mark a route as invalid (metric 16) if no update is received within 180 seconds.

Question 5: What is the difference between RIPv1 and RIPv2?

Show AnswerRIPv1 is classful and does not support authentication; RIPv2 is classless, supports CIDR, subnet masks, and authentication.

Question 6: What is split horizon?

Show AnswerA technique where a router does not advertise a route back to the neighbor from which it learned that route.

Question 7: What is poison reverse?

Show AnswerA technique where a router advertises a route with an infinite metric (16) back to the neighbor that supplied it.

Question 8: What is a triggered update?

Show AnswerAn immediate update sent when a route metric changes, instead of waiting for the next periodic interval.

Question 9: What is the hold-down timer used for?

Show AnswerTo prevent a router from accepting any new route for a destination for a period after a metric increase, to avoid flapping.

Question 10: What is the flush timer in RIP?

Show AnswerAfter a route is marked invalid, the flush timer (240s) removes it from the routing table.

Question 11: How does RIP prevent routing loops?

Show AnswerThrough split horizon, poison reverse, triggered updates, and hold-down timers.

Question 12: Can RIPv2 support Variable Length Subnet Mask (VLSM)?

Show AnswerYes, because it includes subnet masks in its updates.

Question 13: What is the multicast address used by RIPv2?

Show Answer224.0.0.9.

Question 14: What is the main advantage of EIGRP over RIP?

Show AnswerEIGRP uses a composite metric, supports partial updates, and has fast convergence with DUAL.

Question 15: What is the Diffusing Update Algorithm (DUAL) in EIGRP?

Show AnswerAn algorithm that ensures loop-free paths by maintaining feasible successors and diffusing queries only when needed.

Question 16: What is a feasible successor in EIGRP?

Show AnswerA backup route that is guaranteed to be loop-free and can be used immediately if the primary route fails.

Question 17: How does EIGRP's metric differ from RIP's hop count?

Show AnswerEIGRP uses a composite metric based on bandwidth, delay, load, and reliability, whereas RIP uses only hop count.

Question 18: Why is RIP unsuitable for large networks?

Show AnswerDue to the 15-hop limit, slow convergence, and high bandwidth usage from periodic full-table updates.

Question 19: What is the role of the authentication in RIPv2?

Show AnswerTo prevent unauthorized routers from injecting false routing information.

Question 20: Can RIP be used in IPv6 networks?

Show AnswerYes, via RIPng (RFC 2080), which uses UDP port 521.

Question 21: What happens when a route reaches metric 16 in RIP?

Show AnswerIt is considered unreachable and is removed from the routing table after the flush timer expires.

Question 22: How does triggered update speed up convergence in RIP?

Show AnswerBy immediately propagating route changes, reducing the time to inform neighbours of failures.

Exercises

Work through these problems; sample solutions are hidden.

Exercise 1: A RIP router has three routes: to 192.168.1.0/24 via 10.0.0.1 with metric 2, to 10.0.0.0/8 via 10.0.0.2 metric 1, and to 172.16.0.0/16 via 10.0.0.3 metric 3. It receives a RIP update from neighbor 10.0.0.1 containing: 192.168.1.0/24 metric 1, 10.0.0.0/8 metric 2, 172.16.0.0/16 metric 4. Assuming the link cost to 10.0.0.1 is 1, update the routing table. Show the new metrics and next hops.

Show Sample Solution

For each destination, compute new metric = received metric + 1 (cost to neighbor).

So no changes.

Exercise 2: Explain how split horizon would prevent a routing loop in a two-router network (A and B) when the link to a destination X from A fails.

Show Sample Solution If A has a route to X via B, split horizon prevents A from advertising X to B. When A's link to X fails, A stops advertising X to B, so B will not try to use A as a path, preventing a loop.

Exercise 3: In a three-router network (A-B-C), B learns a route to X from A (metric 2). B advertises X to C with metric 3. Later, A's link to X fails. Show how poison reverse can help prevent a loop between B and C.

Show Sample Solution Initially B has X via A (metric 2), C has X via B (metric 3). If A fails, B sets its metric to X as 16 (unreachable) and sends a triggered update to C with metric 16 (poison reverse). C receives this and sets its metric to 16 as well, breaking the loop.

Exercise 4: What is the convergence time for a network with diameter 4 (5 routers in a line) using RIP with default timers and no triggered updates? Assume a link at one end fails. Calculate the worst-case time for the furthest router to learn that the destination is unreachable.

Show Sample Solution With no triggered updates, changes propagate one hop per 30-second update interval. If the destination is at one end and the furthest router is 4 hops away, it will take 4 * 30 = 120 seconds for the unreachable metric (16) to reach the last router, plus the invalid timer (180s) to mark it invalid, but the count-to-infinity may take up to 16 * 30 = 480 seconds. However, the metric will increment one by one, so worst-case is 480 seconds.

Exercise 5: Compare the bandwidth usage of RIP vs. OSPF in a stable network with 50 routers.

Show Sample Solution RIP sends full routing tables every 30 seconds to all neighbours; with 50 routers, each update can be large (up to 25 entries per packet, so multiple packets). OSPF only sends LSAs when changes occur, and then floods them. In a stable network, OSPF has very low bandwidth usage (only periodic Hello packets). RIP consumes more bandwidth due to periodic full updates.

Exercise 6: Explain the concept of "route tagging" in RIPv2 and its purpose.

Show Sample Solution Route tagging allows a router to associate a tag (16-bit value) with a route. This can be used to identify routes originating from a particular domain or to control redistribution policies.

Exercise 7: In EIGRP, what is the difference between a successor and a feasible successor?

Show Sample Solution A successor is the primary route (best path) to a destination. A feasible successor is a backup route that satisfies the feasibility condition (reported distance < current distance) and is loop-free. It can be used immediately if the successor fails.

Exercise 8: Why is EIGRP considered an "advanced distance-vector" protocol rather than a pure distance-vector?

Show Sample Solution Because it uses a composite metric, maintains topology information (like link-state), and uses DUAL for fast convergence, but still distributes routing information based on distances and next hops.

Exercise 9: A RIP router receives a route with metric 15. Can it use this route? What if the metric is 16?

Show Sample Solution Metric 15 is valid (it means 15 hops away). Metric 16 is infinity and indicates unreachable, so it will be discarded.

Exercise 10: Explain how the hold-down timer in RIP interacts with triggered updates to prevent flapping.

Show Sample Solution When a route metric increases, a triggered update is sent, and the hold-down timer starts. During the hold-down period, the router ignores any better routes from other neighbours (except the one that sent the increase) to prevent accepting stale information that could cause flapping.

Homework Assignments

These questions require deeper thought and research. Write comprehensive answers.

Homework 1: Derive the worst-case convergence time for RIP in a network of diameter d, assuming periodic updates only, and then with triggered updates and hold-down timers. Provide formulas and explain the impact of each timer.

Show Answer Outline Without triggered updates: convergence time ≈ d * 30s for propagation plus (16 - old_metric) * 30s for count-to-infinity. With triggered updates, propagation is immediate, but hold-down timer (180s) adds delay. The total time is bounded by hold-down timer + flush timer (240s) in worst case.

Homework 2: Compare and contrast RIPv1, RIPv2, and RIPng. Include details on message formats, capabilities, and security features.

Show Answer Outline RIPv1: classful, no auth, broadcast. RIPv2: classless, auth, multicast. RIPng: IPv6, uses UDP 521, no authentication (relies on IPsec).

Homework 3: Explain how EIGRP's DUAL algorithm ensures loop-free paths even during topology changes. Describe the concept of feasible distance, reported distance, and the feasibility condition.

Show Answer Outline Feasible distance (FD) = best known distance to destination. Reported distance (RD) = distance advertised by a neighbor. A neighbor is feasible if RD < FD. This condition guarantees no loops. When a successor fails, if a feasible successor exists, it is used immediately; otherwise, a query process (diffusion) is initiated.

Homework 4: Design a network topology where RIP would converge very slowly compared to OSPF. Explain the reasons and quantify the difference.

Show Answer Outline A long chain of routers (e.g., 10 routers in a line) with a failure at one end. RIP would take multiple update intervals to propagate the metric increase; OSPF would flood an LSA and all routers reconverge within seconds.

Homework 5: Research the "route poisoning" and "garbage collection" in RIP. How do they work together to flush stale routes?

Show Answer Outline When a route becomes unreachable, it is poisoned (metric 16) and advertised. The invalid timer marks it invalid, and the flush timer removes it after 240s. This ensures that other routers also flush the route.

Homework 6: Compare the administrative distances of RIP, EIGRP, and OSPF in Cisco routers. How does administrative distance affect route selection when multiple protocols are used?

Show Answer Outline Cisco default: static (1), EIGRP (90), OSPF (110), RIP (120). Lower AD wins. This allows preference for more reliable protocols.

Homework 7: Explain the concept of "split horizon with poison reverse" and provide a step-by-step example where it prevents a routing loop that split horizon alone would not prevent.

Show Answer Outline In a three-node network (A-B-C), if A learns X from B, split horizon prevents A from advertising X to B, but B may still advertise to C, and C to B, causing a loop. Poison reverse would have B advertise X to C with infinity, preventing C from using B as a path.

Homework 8: Discuss the scalability issues of RIP in terms of bandwidth consumption. Calculate the approximate bandwidth used by RIP with 100 routes, 30-second updates, and compare with OSPF.

Show Answer Outline RIP sends full table every 30s; with 100 routes, each update is ~520 bytes (25 routes per packet, so 4 packets). Overhead ~ 4*520*8 / 30 ≈ 555 bps per interface. OSPF only sends hellos (small) and LSAs on change.

Homework 9: Research the use of RIP in modern networks. Is it still relevant? Provide examples of where it might be used.

Show Answer Outline RIP is used in small networks, stub networks, or in environments with legacy devices. It is also used in some IoT or low-power networks due to its simplicity.

Homework 10: Explain the EIGRP "Stuck in Active" (SIA) state and how it is resolved.

Show Answer Outline When a router sends a query for a route and does not receive a reply within a certain time (active timer), it enters SIA. To resolve, the router may declare the route invalid and reset the neighbor, or use a hold-down timer. Cisco has implemented improvements to reduce SIA.

Homework 11: Compare the update mechanisms of RIP (periodic full updates) with EIGRP (partial updates). How does this affect network stability and convergence?

Show Answer Outline Periodic full updates cause more bandwidth usage and can propagate changes slowly; partial updates reduce bandwidth and speed convergence but require reliable transport.

Homework 12: Design a RIP network with redundancy and explain how hold-down timers prevent route flapping when a link flaps.

Show Answer Outline If a link goes down and comes back quickly, hold-down timers prevent the route from being reinstated immediately, avoiding flapping. The router will wait for the hold-down period before accepting a new route.

Summary

This tutorial provided a comprehensive examination of RIP and advanced distance-vector techniques. We covered RIP's architecture, message formats, timers, and loop prevention mechanisms. We also explored EIGRP and its DUAL algorithm, which overcomes many limitations of RIP. A comparative analysis highlighted the trade-offs between distance-vector and link-state protocols. While RIP is largely obsolete in large networks, understanding its operation is fundamental to grasping distance-vector concepts, which underpin more advanced protocols like EIGRP and even BGP in some aspects.


End of Tutorial 6 .