RFC 1058 from June 1988 defines RIPv1. RIP is a distance-vector routing protocol that uses router hop count as the metric. RIP is a classful routing protocol that does not support VLSMs or CIDR.
There is no method for authenticating route updates. A RIP router sends a copy of its routing table to its neighbors every 30 seconds. RIP uses split horizon with poison reverse; therefore, route updates are sent out an interface with an infinite metric for routes learned (received) from the same interface.
The RIP standard was based on the popular routed program used in UNIX systems since the 1980s. The Cisco implementation of RIP adds support for load balancing. RIP will load-balance traffic if there are several paths with the same metric (equal-cost load balancing) to a destination. Also, RIP sends triggered updates when the metric of a route changes. Triggered updates can help the network converge faster rather than wait for the periodic update. RIP has an administrative distance of 120. Chapter 11, "Routing Protocol Selection Criteria," covers administrative distance.
RIP summarizes to IP network values at network boundaries. A network boundary occurs at a router that has one or more interfaces that do not participate in the specified IP network. The IP address assigned to the interface determines participation. IP class determines the network value. For example, an IP network that uses 24-bit subnetworks from 184.108.40.206/24 to 220.127.116.11/24 is summarized to 18.104.22.168/16 at a network boundary.
RIPv1 Forwarding Information Base
The RIPv1 protocol keeps the following information about each destination:
IP addressIP address of the destination host or network
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 entry was last updated
The database is updated with the route updates received from neighboring routers. As shown in Example 12-1, the show ip rip database command shows the RIP private database of a router.
Example 12-1 show ip rip database Command
router9# show ip rip database 172.16.0.0/16 auto-summary 172.16.1.0/24 directly connected, Ethernet0 172.16.2.0/24  via 172.16.4.2, 00:00:06, Serial0 172.16.3.0/24  via 172.16.1.2, 00:00:02, Ethernet0 172.16.4.0/24 directly connected, Serial0
RIPv1 Message Format
As described in RFC 1058, the RIPv1 message format appears in Figure 12-1. The RIP messages are encapsulated using User Datagram Protocol (UDP). RIP uses the well-known UDP port 520.
Figure 12-1 RIPv1 Message FormatÅ@
The following is a description of each field:
CommandDescribes the purpose of the packet. The RFC describes five commands, two of which are obsolete and one of which is reserved. The two used commands are
requestRequests all or part of the responding router's routing table.
responseContains all or part of the sender's routing table. This message might be a response to a request, or it might be an update message generated by the sender.
VersionSet to the value of 1 for RIPv1.
Address Family Identifier (AFI)Set to a value of 2 for IP.
IP addressThe destination route. It might be a network address, subnet, or host route. Special route 0.0.0.0 is used for the default route.
MetricA field that is 32 bits in length. It contains a value between 1 and 15 inclusive, specifying the current metric for the destination. The metric is set to 16 to indicate that a destination is not reachable.
Because RIP has a maximum hop count, it implements counting to infinity. For RIP, infinity is 16 hops. Notice in the RIP message that there are no subnet masks accompanying each route. Five 32-bit words are repeated for each route entry: AFI (16 bits); unused, which is 0 (16 bits); IP address; two more 32-bit unused fields; and the 32-bit metric. Five 32-bit words equals 20 bytes for each route entry. Up to 25 routes are allowed in each RIP message. The maximum datagram size is limited to 512 bytes, not including the IP header. Calculating 25 routes by 20 bytes each, plus the RIP header (4 bytes), plus an 8-byte UDP header, you get 512 bytes.
The Cisco implementation of RIP uses four timers:
RIP sends its full routing table out all configured interfaces. The table is sent periodically as a broadcast (255.255.255.255) to all hosts.
The update timer specifies the frequency of the periodic broadcasts. By default, the update timer is set to 30 seconds. Each route has a timeout value associated with it. The timeout gets reset every time the router receives a routing update containing the route.
When the timeout value expires, the route is marked as unreachable because it is marked invalid. The router marks the route invalid by setting the metric to 16. The route is retained in the routing table. By default, the invalid timer is 180 seconds, or six updates periods (30 x 6 = 180).
A route entry marked as invalid is retained in the routing table until the flush timer expires. By default, the flush timer is 240 seconds, which is 60 seconds longer than the invalid timer.
Cisco implements an additional timer for RIP, the holddown timer. The holddown timer stabilizes routes by setting an allowed time for which routing information regarding different paths is suppressed. After the metric for a route entry changes, the router accepts no updates for the route until the holddown timer expires. By default, the holddown timer is 180 seconds.
The output of the show ip protocol command, as shown in Example 12-2, shows the timers for RIP, unchanged from the defaults.
Example 12-2 RIP Timers Verified with show ip protocol
router9> show ip protocol Routing Protocol is "rip" Sending updates every 30 seconds, next due in 3 seconds Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is Incoming update filter list for all interfaces is Redistributing: rip Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain Ethernet0 1 1 2 Serial0 1 1 2 Automatic network summarization is in effect Routing for Networks: 172.16.0.0 Routing Information Sources: Gateway Distance Last Update 172.16.4.2 120 00:00:00 172.16.1.2 120 00:00:07 Distance: (default is 120)
Things to remember in designing a network with RIPv1 include that it does not support VLSM and CIDR. The IP addressing scheme with RIPv1 requires the same subnet mask for the entire IP network, a flat IP network. RIPv1 is limited to 15 hops; therefore, the network diameter cannot exceed this limit. RIPv1 also broadcasts its routing table every 30 seconds. RIPv1 is usually limited to accessing networks where it can interoperate with servers running routed or with non-Cisco routers. RIP also appears at the edge of larger networks.
As shown in Figure 12-2, when you use RIPv1, all segments must have the same subnet mask.
Figure 12-2 RIPv1 Design
The characteristics of RIPv1 follow:
Uses UDP port 520.
Classful protocol (no support for VLSM or CIDR).
Metric is router hop count.
Maximum hop count is 15; unreachable routes have a metric of 16.
Periodic route updates broadcast every 30 seconds.
25 routes per RIP message.
Implements split horizon with poison reverse.
Implements triggered updates.
No support for authentication.
Administrative distance for RIP is 120.
Used in small, flat networks or at the edge of larger networks.