RIPv2
RIPv2 was first described in RFC 1388 and RFC 1723 (1994); the current RFC is 2453, written in November 1998. Although current environments use advanced routing protocols such as OSPF and EIGRP, there still are networks using RIP. The need to use VLSMs and other requirements prompted the definition of RIPv2.
RIPv2 improves upon RIPv1 with the ability to use VLSM, with support for route authentication, and with multicasting of route updates. RIPv2 supports CIDR. It still sends updates every 30 seconds and retains the 15-hop limit; it also uses triggered updates. RIPv2 still uses UDP port 520; the RIP process is responsible for checking the version number. It retains the loop-prevention strategies of poison reverse and counting to infinity. On Cisco routers, RIPv2 has the same administrative distance as RIPv1, which is 120. Finally, RIPv2 uses the IP address 224.0.0.9 when multicasting route updates to other RIP routers. As in RIPv1, RIPv2 will, by default, summarize IP networks at network boundaries. You can disable autosummarization if required.
You can use RIPv2 in small networks where VLSM is required. It also works at the edge of larger networks.
Authentication
Authentication can prevent communication with any RIP routers that are not intended to be part of the network, such as UNIX stations running routed. Only RIP updates with the authentication password are accepted. RFC 1723 defines simple plain-text authentication for RIPv2.
MD5 Authentication
In addition to plain-text passwords, the Cisco implementation provides the ability to use Message Digest 5 (MD5) authentication, which is defined in RFC 1321. Its algorithm takes as input a message of arbitrary length and produces as output a 128-bit fingerprint or message digest of the input, making it much more secure than plain-text passwords.
RIPv2 Forwarding Information Base
RIPv2 maintains a routing table database as in Version 1. The difference is that it also keeps the subnet mask information. The following list repeats the table information of RIPv1:
IP addressIP address of the destination host or network, with subnet mask
GatewayThe first gateway along the path to the destination
InterfaceThe physical network that must be used to reach the destination
MetricA number indicating the number of hops to the destination
TimerThe amount of time since the route entry was last updated
RIPv2 Message Format
The RIPv2 message format takes advantage of the unused fields in the RIPv1 message format by adding subnet masks and other information. Figure 12-3 shows the RIPv2 message format.
Figure 12-3 RIPv2 Message Format
The following is a description of each field:
CommandIndicates whether the packet is a request or a response message. The request message asks that a router send all or a part of its routing table. Response messages contain route entries. The router sends the response periodically or as a reply to a request.
VersionSpecifies the RIP version used. It is set to 2 for RIPv2 and set to 1 for RIPv1.
AFISpecifies the address family used. RIP is designed to carry routing information for several different protocols. Each entry has an AFI to indicate the type of address specified. The AFI for IP is 2. The AFI is set to 0xFFF for the first entry to indicate that the remainder of the entry contains authentication information.
Route tagProvides a method for distinguishing between internal routes (learned by RIP) and external routes (learned from other protocols). You can add this optional attribute during the redistribution of routing protocols.
IP addressSpecifies the IP address (network) of the destination.
Subnet maskContains the subnet mask for the destination. If this field is 0, no subnet mask has been specified for the entry.
Next hopIndicates the IP address of the next hop where packets are sent to reach the destination.
MetricIndicates how many router hops to reach the destination. The metric is between 1 and 15 for a valid route or 16 for an unreachable or infinite route.
Again, as in Version 1, the router permits up to 25 occurrences of the last five 32-bit words (20 bytes) for up to 25 routes per RIP message. If the AFI specifies an authenticated message, the router can specify only 24 routing-table entries. The updates are sent to the multicast address of 224.0.0.9.
RIPv2 Timers
RIPv2 timers are the same as in Version 1. They send periodic updates every 30 seconds. The default invalid timer is 180 seconds, the holddown timer is 180 seconds, and the flush timer is 240 seconds. You can write this list as 30/180/180/240 representing the U/I/H/F timers.
RIPv2 Design
Things to remember in designing a network with RIPv2 include that it supports VLSM within networks and CIDR for network summarization across adjacent networks. RIPv2 allows for the summarization of routes in a hierarchical network. RIPv2 is still limited to 16 hops; therefore, the network diameter cannot exceed this limit. RIPv2 multicasts its routing table every 30 seconds to the multicast IP address 224.0.0.9. RIPv2 is usually limited to accessing networks where it can interoperate with servers running routed or with non-Cisco routers. RIPv2 also appears at the edge of larger internetworks. RIPv2 further provides for route authentication.
As shown in Figure 12-4, when you use RIPv2, all segments can have different subnet masks.
Figure 12-4 RIPv2 Design
RIPv2 Summary
The characteristics of RIPv2 follow:
Distance-vector protocol.
Uses UDP port 520.
Classless protocol (support for CIDR).
Supports VLSMs.
Metric is router hop count.
Maximum hop count is 15; infinite (unreachable) routes have a metric of 16.
Periodic route updates sent every 30 seconds to multicast address 224.0.0.9.
25 routes per RIP message (24 if you use authentication).
Supports authentication.
Implements split horizon with poison reverse.
Implements triggered updates.
Subnet mask included in route entry.
Administrative distance for RIPv2 is 120.
Used in small, flat networks or at the edge of larger networks.