2. RIP

2.1. In This Chapter

This chapter provides information about configuring Routing Information Protocol (RIP) parameters.

Topics in this chapter include:

2.2. RIP Overview

The Routing Information Protocol (RIP) is an interior gateway protocol (IGP) that uses a distance-vector algorithm to determine the best route to a destination, using hop count as the metric. In order for the protocol to provide complete information on routing, every router in the domain must participate in the protocol.

RIP is a routing protocol based on a distance vector (Bellman-Ford) algorithm, which advertises network reachability by advertising prefix/mask and the metric (also known as hop count or cost). RIP selects the route with the lowest metric as the best route. RIP differs from link-state database protocols, such as OSPF and IS-IS, in that RIP advertises reachability information directly and link-state-database-based protocols advertise topology information. Each node is responsible for calculating the reachability information from the topology.

The router software supports RIPv1 and RIPv2. RIPv1, specified in RFC 1058, was written and implemented prior to the introduction of CIDR. It assumes the netmask information for non-local routes, based on the class the route belongs to:

  1. Class A – 8 bit mask
  2. Class B – 16 bit mask
  3. Class C – 24 bit mask

RIPv2 was written after CIDR was developed and transmits netmask information with every route. Because of the support for CIDR routes and other enhancements in RIPv2 such as triggered updates, multicast advertisements, and authentication, most production networks use RIPv2. However, there are some older systems (hosts and routers) that only support RIPv1, especially when RIP is used simply to advertise default routing information.

RIP is supported on all IP interfaces, including both network and access interfaces.

2.2.1. RIP Features

RIP, a UDP-based protocol, updates its neighbors, and the neighbors update their neighbors, and so on. Each host that uses RIP has a routing process that sends and receives datagrams on UDP port number 520.

Each RIP router advertises all RIP routes periodically via RIP updates. Each update can contain a maximum of 25 route advertisements. This limit is imposed by RIP specifications. RIP can sometimes be configured to send as many as 255 routes per update. The formats of the RIPv1 and RIPv2 updates are slightly different and are shown below. Additionally, RIPv1 updates are sent to a broadcast address, RIPv2 updates can be either sent to a broadcast or multicast address (224.0.0.9). RIPv2 supports subnet masks, a feature that was not available in RIPv1.

A network address of 0.0.0.0 is considered a default route. A default route is used when it is not convenient to list every possible network in the RIP updates, and when one or more closely-connected gateways in the system are prepared to handle traffic to the networks that are not listed explicitly. These gateways create RIP entries for the address 0.0.0.0, as if it were a network to which they are connected.

2.2.1.1. RIP Version Types

The router allows you to specify the RIP version that will be sent to RIP neighbors and RIP updates that will be accepted and processed. The router allows the following combinations:

  1. Send only RIPv1 or send only RIPv2 to either the broadcast or multicast address or send no messages.
    The default sends RIPv2 formatted messages to the broadcast address.
  2. Receive only RIPv1, receive only RIPv2, or receive both RIPv1 and RIPv2, or receive none.
    The default receives both.

2.2.1.2. RIPv2 Authentication

RIPv2 messages carry more information, which permit the use of a simple authentication mechanism to secure table updates. The router implementation enables the use of a simple password (plain text) or message digest (MD5) authentication.

2.2.1.3. RIP Packet Format

The RIP packet format is displayed in Figure 1:

Figure 1:  RIP Packet Format 

A RIP packet consists of the following fields:

  1. Command — Indicates whether the packet is a request or a response message. The request asks the responding system to send all or part of its routing table. The response may be sent in response to a request, or it may be an unsolicited routing update generated by the sender.
  2. Version — The RIP version used. This field can signal different potentially incompatible versions.
  3. Must be zero — Not used in RIPv1. This field provides backward compatibility with pre-standard varieties of RIP. The default value is zero.
  4. Address family identifier (AFI) — The AFI is the type of address. RIP can carry routing information for several different protocols. Each entry in this field has an AFI to indicate the type of address being specified. The IP AFI is 2.
  5. Address — The IP address for the packet.
  6. Metric — Specifies the number of hops to the destination.
  7. Mask — Specifies the IP address mask.
  8. Next hop — Specifies the IP address of the next router along the path to the destination.

2.2.1.3.1. RIPv1 Format

There can be between 1 and 25 (inclusive) RIP entries. Figure 2 displays RIPv1 format:

Figure 2:  RIPv1 Format 

2.2.1.3.2. RIPv2 Format

The RIP packet format is displayed in Figure 3:

Figure 3:  RIPv2 Format 

The RIPv2 packets include the following fields:

  1. Subnet mask — The subnet mask for the entry. If this field is zero, no subnet mask has been specified for the entry.
  2. Next hop —The IP address of the next hop to forward packets.

2.3. RIPng

RIPng is the IPv6 form of the interior gateway protocol (IGP) Routing Information Protocol (RIP), originally implemented for IPv4 routing. This protocol is a distance vector routing protocol that periodically advertises IPv6 routing information to neighbors, typically through the use of UDP based multicast updates carrying a list of one or more entires, each containing an IPv6 prefix, prefix length, route metric and a possible route tag.

RIPng is supported in the base routing context and also as a PE-CE routing protocol within a VPRN context. 

2.3.1. RIPng Protocol

RIPng packets are sent using the UDP protocol and the protocol port number 521. Unsolicited updates messages are sent with 521 as both the source and destination port.

  1. Source IP address
    1. The Link-Local IPv6 address of the interface sending the RIPng packet is used as the source IP address of any RIPng update sent.
  2. Destination IP address
    1. The destination IP for any periodic or triggered update should be sent to the multicast group FF02::9, (all-rip-routers multicast group).
    2. When sending responses to an RIPng request, the RIPng response is sent to the unicast IP address of the requester.

Each route entry in an update message contains the following:

  1. IPv6 prefix
  2. Prefix length
  3. Route metric
  4. Route tag (optional)

2.4. Common Attributes

2.4.1. Metrics

By default, RIP advertises all RIP routes to each peer every 30 seconds. RIP uses a hop count metric to determine the distance between the packet’s source and destination. The metric/cost values for a valid route is 1 through 15. A metric value of 16 (infinity) indicates that the route is no longer valid and should be removed from the router’s routing table.

Each router along the path increments the hop count value by 1. When a router receives a routing update with new or different destination information, the metric increments by 1.

The maximum number of hops in a path is 15. If a router receives a routing update with a metric of 15 and contains a new or modified entry, increasing the metric value by 1 will cause the metric increment to 16 (infinity). Then, the destination is considered unreachable.

The router implementation of RIP uses split horizon with poison reverse to protect from such problems as “counting to infinity”. Split horizon with poison reverse means that routes learned from a neighbor through a given interface are advertised in updates out of the same interface but with a metric of 16 (infinity).

2.4.2. Timers

RIP uses numerous timers to determine how often RIP updates are sent and how long routes are maintained.

  1. Update — Times the interval between periodic routing updates.
  2. Timeout — This timer is initialized when a route is established and any time an update message is received for the route. When this timer expires, the route is no longer valid. It is retained in the table for a short time, so that neighbors can be notified that the route has been dropped.
  3. Flush — When the flush timer expires, the route is removed from the tables.

2.4.3. Import and Export Policies

Routing policies can control the content of the routing tables, the routes that are advertised and the best route to take to reach a destination. Import route policies determine which routes are accepted from RIP neighbors. Export route policies determine which routes are exported from the route table to RIP. By default, RIP does not export routes it has learned to its neighbors.

There are no default routing policies. A policy must be created explicitly and applied to a RIP import or export command.

2.4.4. Hierarchical Levels

The minimum RIP configuration must define one group and one neighbor. The parameters configured on the global level are inherited by the group and neighbor levels. Parameters can be modified and overridden on a level-specific basis. RIP command hierarchy consists of three levels:

  1. Global
  2. Group
  3. Neighbor

Many of the hierarchical RIP commands can be modified on different levels. The most specific value is used. That is, a RIP group-specific command takes precedence over a global RIP command. A neighbor-specific statement takes precedence over a global RIP and group-specific command; for example, if you modify a RIP neighbor-level command default, the new value takes precedence over group- and global-level settings.

2.5. RIP Configuration Process Overview

Figure 4 displays the process to configure RIP parameters.

Figure 4:  RIP Configuration and Implementation Flow 

2.6. Configuration Notes

This section describes RIP configuration caveats.

2.6.1. General

Before RIP neighbor parameters can be configured, router interfaces must be configured.

RIP must be explicitly created for each router interface. There are no default RIP instances on a router.