Routing

RIPv2 Enhancements

Improvements in RIPv2: VLSM support, authentication, and multicast updates.

Introduction: RIPv2 extensions

The Routing Information Protocol RIPv1 was one of the early dynamic routing protocols and allowed routers to learn routes automatically. As networks grew more complex in the late 1980s and early 1990s, RIPv1's limitations made VLSM and update protection difficult to use. Its message format did not carry all information required by those networks.

The first specification of RIP version 2 (RIPv2) was published in 1994. The protocol retained the basic distance-vector algorithm and hop-count metric. Its update format added subnet masks, multicast support, and authentication mechanisms. These changes addressed the main limitations of RIPv1 without changing the basic method used to select a route.

RIPv2 includes three extensions: classless routing with VLSM support, multicast updates, and update authentication. RIPv2 remains a simple distance-vector protocol, but it carries more information with each route. It still uses UDP port 520520, and a valid metric ranges from 1 to 1515; 1616 represents an unreachable destination.

Classless Routing: Supporting VLSM and CIDR

RIPv2 transitioned from classful to classless routing. A router can interpret a prefix together with its mask, which permits different subnet sizes and route summarization.

The Problem with Classful Routing (RIPv1's Flaw)

RIPv1 used . Its updates did not contain subnet mask information. A router derived the mask from the address class, usually using the first octet. This led to two problems:

  • Inefficient Address Use: It did not support Variable Length Subnet Masking (VLSM). A network for 20 computers required an entire Class C network, wasting more than 200 addresses. One default mask could not match the subnet size to the number of hosts.
  • Discontiguous Networks: It couldn't handle network designs where subnets of the same major network were separated by a different major network, leading to routing errors and incorrect summaries.

The RIPv2 Solution: Including the Subnet Mask

RIPv2 solved this problem by adding a subnet mask field to its routing update messages. A router receives the mask with each network address and can determine the exact prefix without inferring it from the address class. This enables VLSM and classless route advertisements. An entry can also identify a next hop and carry a route tag used during redistribution.

Example: A Network with VLSM

Consider a company with offices in New York, Chicago, and a central link between them. The network uses subnets from the major network 172.16.0.0172.16.0.0.

  • New York Office: Needs about 100 hosts, so it's assigned 172.16.1.0/25172.16.1.0/25.
  • Chicago Office: Needs about 50 hosts, so it's assigned 172.16.2.0/26172.16.2.0/26.
  • WAN Link: The point-to-point link between routers needs only 2 addresses, so it's assigned 172.16.10.0/30172.16.10.0/30.
How RIPv1 Fails:

When NYC_Router sends an update to Link_Router, it sends only the network 172.16.1.0172.16.1.0. Since 172.16.0.0172.16.0.0 is a Class B address, Link_Router treats the route as the /16/16 prefix (255.255.0.0255.255.0.0) and may advertise a summary to CHI_Router. This incorrect interpretation breaks the routing, as the specific /25/25, /26/26, and /30/30 subnets are lost. Communication fails.

How RIPv2 Succeeds:

NYC_Router sends an update to Link_Router containing the pair: (Network: 172.16.1.0172.16.1.0, Subnet Mask: 255.255.255.128255.255.255.128). Link_Router now knows the exact prefix 172.16.1.0/25172.16.1.0/25. It can then correctly advertise this route to CHI_Router. All entries retain their masks, so the specific prefixes are not replaced by a classful summary. This capability is known as classless routing.

Efficient Communication: Multicast Updates

The second major upgrade in RIPv2 addressed the inefficient way RIPv1 communicated.

The Problem with Broadcasts (RIPv1's Method)

RIPv1 sent updates as broadcasts to 255.255.255.255255.255.255.255. A frame carrying such a datagram could reach every host in the segment. A host without a RIP process discarded the datagram after checking its addressing and protocol number, but the transmission still reached non-router devices. This increased traffic and packet-processing work.

The RIPv2 Solution: Group Updates

RIPv2 replaced inefficient broadcasts with updates. On multicast-capable networks, RIPv2 sends updates to 224.0.0.9224.0.0.9, the address reserved for RIPv2 routers. This address has local-segment scope, so routers do not forward these messages as routed packets.

Routers running RIPv2 listen to this multicast group. Other devices do not join it, and their interface or network stack can filter the traffic without delivering it to a routing process. This results in:

  • Reduced load on non-router hosts.
  • Less unnecessary traffic on the local network.
  • Less update-processing work for end hosts.

Update Authentication

RIPv1 did not authenticate updates. A device with access to the local segment could therefore introduce false routes and direct traffic to an invalid next hop or an unreachable destination.

The Problem with Unsecured Updates (RIPv1's Flaw)

Since RIPv1 updates were unauthenticated, a malicious actor could connect a laptop to the network, generate fake RIP packets, and broadcast them. For example, they could advertise a fraudulent default route with a low metric. Other routers would believe this fake advertisement and start sending outbound traffic to the attacker's laptop instead of the real internet gateway, enabling a man-in-the-middle attack.

The RIPv2 Solution: Verifying the Source

RIPv2 introduced update authentication. The base format defines a clear-text password, while cryptographic extensions add verification based on a shared key. RIPv2 supports two methods:

  1. Clear-Text Password Authentication:

    Administrators configure a shared password on the routers. The password is placed in the RIPv2 update authentication field, and the receiver compares it with its local value. This limits acceptance of messages from devices without the configured key, but the password is transmitted in clear text and can be read by packet analysis.

  2. Cryptographic Authentication (MD5/HMAC):

    A cryptographic extension does not send the key. Routers use a shared secret to calculate a of the message content. The historical RIPv2 extension used MD5 and carried a key identifier and sequence number. A newer extension uses HMAC-SHA1 and other SHA-family algorithms. The receiver performs the same calculation; a matching result indicates knowledge of the key and message integrity. The mechanism does not provide confidentiality.

The RIPv2 Packet Format

The RIPv2 changes are reflected in a message format that extends the RIPv1 structure. An update can contain up to 25 route entries without an authentication entry; an authentication entry uses one slot, leaving up to 24 route entries. The header is 4 bytes, and each route entry occupies 20 bytes.

FieldSize (Bytes)Description
Command1Indicates a request (1) or response (2) message.
Version1Set to 2 for RIPv2.
Must be Zero2Reserved field.
Route Entry (repeated up to 25 times)
Address Family Identifier (AFI)2Specifies the protocol family; for IP, this value is 2.
Route Tag2Carries a route tag from an external protocol or redistribution process into the IGP.
IP Address4The destination network address.
Subnet Mask4The subnet mask for the destination network. The key addition for VLSM.
Next Hop4Specifies a better next-hop address if one exists, optimizing routing on multi-access networks.
Metric4The hop count to the destination; values from 1 to 15 are reachable, while 16 represents infinity.

Is RIPv2 Still Relevant?

While RIPv2 fixed the critical flaws of its predecessor, it still retains the core limitations of a simple distance-vector protocol.

  • Slow Convergence: It still relies on periodic updates and timers, making it much slower to react to network failures than modern link-state protocols like OSPF.
  • Hop Count Metric: Its reliance on hop count is a major drawback in networks with varied link speeds.
  • 15-Hop Limit: The maximum reachable metric of 15 limits it to domains with a diameter of no more than 15 hops; larger networks usually choose protocols without this limit.

For these reasons, RIPv2 is less common in production networks than protocols such as OSPF, IS-IS, and EIGRP. It remains useful in laboratories, teaching, and small non-critical networks where simplicity and low overhead matter more than rapid convergence and richer metrics. Its update schedule and timers still limit the reaction to failures. The choice depends on topology, reaction-time requirements, and device capabilities.

Related articles