Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Table of content

Description

RIP (Routing Information Protocol) is a dynamic routing protocol based on the Bellman-Ford algorithm. The protocol has the following features:

  • the first RIP version was developed in 1969, as described in RFC 1058;
  • the second RIP version was developed in 1994, as described in RFC 2454. This version is the main one used in IPv4 networks. There is no backward compatibility between the first and the second versions;
  • there is a RIP version developed for IPv6 networks. This version is called RIPng and it is described in RFC 2080;
  • RIP is an internal distance vector routing protocol;
  • the number of hops is used as a metric, i.e. the number of routers on the path to the destination network. The maximum metric value is 16 and it limits the network size where RIP can be used;
  • the multicast address 224.0.0.9 is reserved for RIP version 2. The first version of the protocol uses the broadcast address 255.255.255.255;
  • UDP datagrams are used for service information transmission and port 520 is assigned to the protocol;
  • the first RIP version only supports the routes to classful networks, the second to classless;
  • the distance value of 120 is used for RIP;
  • RIP supports authentication: routing information will only be accepted from a router having the same key value.

RIP's operational algorithm

Let's look at an example on how is the routing information distributed over a network using RIP. The example follows the scheme in (Figure 1):

  • the network consists of four routers R1, R2, R3 and R4, connected in a ring. These routers form a RIP domain. A RIP domain is a set of routers that exchange routing information using RIP;
  • router R1 has an external link to the WAN-1 network;
  • an independent IP network class is assigned for each link.

RIP must be configured on all the routers. WAN-1 is the external network, i.e. the route to this network must be added to the RIP domain as external.

Figure 1 - Network scheme used to explain the RIP's operational principles

In this example, the distribution of the routing information from router R1 will be described, because the routes from the other devices will be distributed in the same way.

The RIP operational algorithm in the described scheme is the following:

  1. RIP starts.
  2. Routing information distribution.
  3. Adding routes to RIB.
  4. Adding routes to FIB.
  5. Timers control.
  6. Network changes control.

Start RIP

At this stage, RIP must be enabled on the routers and the list of interfaces that will participate in the RIP process must be defined.

The network list definition is performed using the "network A.B.C.D/M" command. All network interfaces whose IP addresses belong to the specified range participate in RIP. This means that the routing information will be distributed from these interfaces, and the information about the networks associated with these interfaces will be transmitted to other routers.

If an interface participates in the RIP process, but routing information should not be distributed over that interface, then the interface can be configured as passive.

Let's assume that the commands "network 10.10.13.0/30" and "network 10.10.12.0/30" have been executed on router R1. In this case, the router will assume that RIP is running on eth2 and eth3.

Routing information distribution

The routing information distribution about the networks connected to router R1 is performed in the following sequence:

  • Step 1: router R1 generates service messages with routing information. The service messages contain information about networks 10.10.13.0/30 and 10.10.12.0/30, since the interfaces associated with these networks are included in RIP when the protocol is started . The service messages include also information about the 192.168.1.0/24 network, since router R1 must redistribute the external routes. The metric value for each network is set to 1.
  • Step 2: the router sends out the service messages generated at step 1 (Figure 2a). The distribution is performed through the eth2 and the eth3 interfaces included in RIP when the protocol is started.

Figure 2a - R1's routing information distribution

  • Step 3: routers R2 and R3 generate service messages to transmit the routing information to router R4:
    • R2: the router includes in the service message the 192.168.1.0/24 and the 10.10.13.0/30 networks received from router R1, incrementing the metric value. The information about the 10.10.12.0/30 network received from R1 is ignored because R2 is directly connected to this network. Instead, router R2 includes the 10.10.12.0/30 network with the metric 1 in the service message, announcing the network by itself. Also, the service message includes information about the network 10.10.24.0/30.
    • R3: the router includes in the service message the 192.168.1.0/24 and the 10.10.12.0/30 networks received from router R1, incrementing the metric value. The information about the 10.10.13.0/30 network received from R1 is ignored because R3 is directly connected to this network. Instead, router R3 includes the 10.10.13.0/30 network with the metric 1 in the service message, announcing the network by itself. Also, the service message includes information about the network 10.10.34.0/30.
  • Step 4: routers R2 and R3 send the service messages generated in the previous step to router R4 (Figure 2b). Note that R2 and R3 send routing information to R1, but this process will not be described in this example.

Figure 2b - Routing information distribution by routers R2 and R3

Adding routes to the RIB

After exchanging the service messages, the routers add the received routes to the RIB. In this case, some routes are filtered out. To filter the routing information, the devices are guided by the following principles:

  • only one route to the destination network can be added to the RIB;
  • if there are two routes to the same network, the route with a lower metric value is added to the RIB;
  • a route with a higher metric value can be added to the RIB if it is received from the same source;
  • if there are two routes to the same destination network with the same metric values, then the route received first will be added to the RIB.

Let's assume that router R4 received a service message from router R2 earlier than from R3. Then, according to the described principles, the routers add the following routing information to the RIB:

R2 router
Destination networkMetricGateway
10.10.12.0/301-
10.10.24.0/301-
10.10.13.0/30210.10.12.1
192.168.1.0/24210.10.12.1
R3 router
Destination networkMetricGateway
10.10.13.0/301-
10.10.34.0/301-
10.10.12.0/30210.10.13.1
192.168.1.0/24210.10.13.1
R4 router
Destination networkMetricGateway
10.10.24.0/301-
10.10.34.0/301-
10.10.12.0/30210.10.24.1
10.10.13.0/30210.10.34.1
192.168.1.0/24310.10.24.1

Adding routes to the FIB

Routes export from RIB to FIB is go along with the analysis of distance values assigned to the route source. Distance value 120 is assigned to RIP, so some routes added to the RIB at the previous step will be filtered out. For example, all routes with metric 1 will be discarded because these are routes to directly connected networks and have 0 distance value.

Timers control

The routing information distribution described above is cyclically repeated. The repetition period is equal to the update timer value. By default the update timer is 30 seconds. Thus, all routing information on the network is distributed every 30 seconds.

Note, routers do not establish neighbor relations and do not synchronize the routing information exchange time, therefore, the time for sending service messages by routers is distributed in the 30 seconds interval, it helps to avoid service traffic bursts in the network.

After the route obtained via RIP is placed in the RIB, the timeout timer is started, by default its value is 180 seconds. If the router does not receive a route update within 180 seconds, the route will be marked as unavailable, i.e. the metric value of such a route is set to 16. The router cannot use this route for data transmission.

RIP service data exchange is not guaranteed, so the timeout timer value must be greater than the update timer. Otherwise, there may be false operation and determining routes as unavailable.

After adding a route to the RIB, in addition to the timeout timer, the garbage timer is also started with the default value 240 seconds. If the router does not receive a route update within 240 seconds, then such a route will be removed from the routing table.

Updating the routing information resets the timeout timer and garbage timer to their original values.

Network changes control

RIP is a dynamic routing protocol and must adapt to changes in the network. There are three scenarios of the changes:

  • new link has been added;
  • link is out of order;
  • router is out of order.
New link has been added

Let's add a new link between router R1 and WAN-2 to the example scheme (Figure 3a). In this case, the WAN-2 network will be external for RIP, it means that the route to this network will be distributed similarly to the route to the WAN-1 network: router R1 will announce this network with metric 1, R2 and R3 will increment the metric value and transmit route to R4. АIn case of new routers included to the RIP domain the algorithm will be similar.

Figure 3a - The example of service messages sending when a new link has been added

Link is out of order

Let's assume that the link between routers R1and R3 fails (Figure 3b):

  • Step 1: interfaces eth3 of R1 router and eth1 of R3 router will go to down state.
  • Step 2: R1 and R3 routers will set metric value 16 for the route to network 10.10.13.0/30 in RIB.
  • Step 3: in accordance with the update timer expiration, routers R1 and R3 will generate a service message including the known routing information. This message includes the route to the unreachable network with metric value 15.
  • Step 4: routers R2 and R4 receive service messages from R1 and R3, increment the metric value, and add the route in the RIB. The routers R2 and R4 RIB already has a route to the 10.10.13.0/30 network with metric 2, but since the sources of new routes with the worst metric are the same routers, then the route in the RIB will be replaced with a route with metric 16. Thus, all routers on the network will receive information about the link unavailability.

Figure 3b - The example of service messages distribution in case of link fails

Time during which updated information is distributed depends on the  network size and on the update timer value. As the maximum network size is 16 hops, and the update timer by default is 30 seconds, then in the worst scenario, the distribution information time about the link unavailability will be 15 * 30 = 450 seconds.

Router is out of order

Let's add two switches SW1 and SW2 to the scheme (Figure 3c) and assume the failure of router R1.

If router R1 fails, it does not have time to send a routing information update about its unavailable to routers R2 and R3. In addition, R2 and R3 won't be informed that R1 is unavailable because they are directly connected to switches SW1 and SW2 without RIP support. In this case, the network routers will assume R1 available during the timeout timer and will use the routes associated with R1. Particularly, routes to networks 10.10.12.0/30, 10.10.13.0/30 and 192.168.1.0/24 will be valid in the routing table of all routers.

Figure 3c - The example of service messages distribution in case of router fails

False routes appearance

Let's simplify the scheme, leaving two routers R1 and R3 (Figure 4a). We will assume that the routers have exchanged routing information and the device routing tables are up to date.

Figure 4a - Network scheme for the false route scenario

R1 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/241-



R3 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24210.10.13.1

The link between router R1 and the external WAN-1 network fails (Figure 4b). Router R1 sets the metric equal to 16 for such a route, but does not generate a service message with updated routing information, since the update timer value is 25 seconds. At the same time, the update timer on router R3 is 3 seconds.

Figure 4b - Route R1 - WAN-1 fails

R1 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/2416-



R3 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24210.10.13.1

3 seconds after the R1 - WAN-1 link fails, the R3 update timer expires, so R3 sends a routing update to R1 (Figure 4c). This update contains information about the 10.10.13.0/30 and 192.168.1.0/24 networks. Router R1 adds a route to the 192.168.1.0/24 network to the RIB, because its metric is better than the route that has already been added to the RIB.

A routing loop is formed, each router, passing traffic to the 192.168.1.0/24 network, refers to another router. Thus, traffic will be transmitted by routers to each other until the TTL expires. In addition to the routing loop generation, both routes are false as a connection to network 192.168.1.0/24 is lost.

Figure 4c - Service message distribution with routing information by router R3

R1 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24310.10.13.2
R3 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24210.10.13.1

The fails route usage will continue until the timeout timer expires on R3, after that R3 will set the metric value for this route to 16. In the next routing information distribution, router R1 will send route information to router R3 with information about the 10.10.13.0/30 and 192.168.1.0/24 networks (Figure 4d). Since the metric for the route to 192.168.1.0/24 is 3, and less than 16, R3 will add a false route to the RIB, incrementing the metric value.

The false route exchange will continue until the metric value reaches the invalid value 16. With default settings, this will happen 36 minutes after the link failure between R1 and WAN-1.

Figure 4d - Service message distribution with routing information by router R1

R1 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24310.10.13.2



R3 router
Destination networkMetricGateway
10.10.13.0/301-
192.168.1.0/24410.10.13.1

To avoid the false routes appearance in the RIP protocol, the following mechanisms are used:

  • split-horizont: мrouters do not distribute routing information updates to those routers which are sources of this information. In the example above (Figure 4d), router R3 will not include information about the route to the 192.168.1.0/24 network in the message for router R1, since R1 is the source of this information. This will allow to avoid the described situation, but will not work effectively in a scheme with a large number of routers. In scheme with four routers (Figure 1) link with WAN-1 is out of order, then routers R2 and R3 will not transmit information about the route to the 192.168.1.0/24 network for R1. However, this route is also in the router R4 RIB and it will be included in the periodic distribution of routing information, which will lead to a false route appearance.
  • poison-reverse: this mechanism implies immediate distribution of updates about unavailable routes without waiting for the update timer expiration. An unreachable route is sent with a metric 15, it incrementing by each router will lead to an unavailable route in the RIB. The mechanism has a disadvantage, since the routing information distribution about an unavailable route requires a certain time, during which a message with old routing information can be sent, where the unavailable route will be marked as available.
  • garbage-timer: the device does not accept updates for routes marked as unavailable before the garbage-timer expires.

The listed mechanisms make possible to adapt the RIP for modern networks, since the false routes existence for 36 minutes or a protocol convergence time for 450 seconds is unacceptable for many services.

RIP features

RIP has the following features:

  • the operation algorithm used in RIP is easy to understand and configure;
  • RIP is a standard protocol and can be implemented in devices from different network devices manufacturers;
  • false routes may appear in the protocol: this disadvantage was eliminated by adding additional functions to the protocol, this make protocol operation and implementation more complicated;
  • network size limitation where the RIP algorithm can be used;
  • long time of network adaptation to changes.

Additional materials

Other

  1. RFC 1058
  2. RFC 2454
  3. RFC 2080
  4. ARDA (Aqua Router Daemon)
  5. arip command
  6. rip command
  • No labels