How RIP Routing Protocol Works

This tutorial explains how the RIP routing protocol learns and advertises network paths. Learn what the RIP routing protocol is and how it works in detail through examples.

What is the RIP routing protocol?

When an IP packet arrives on an interface of the router, the router reads the destination address of the IP packet and searches the destination address in the routing table. A routing table entry contains two important pieces of information: the destination subnet and the local interface that is connected with that destination.

If the router finds an entry for the destination address in the routing table, the router forwards the incoming packet from the interface that is associated with the destination address in the entry. If the router does not find an entry for the destination address in the routing table, it immediately discards the incoming packet.

There are two ways to add entries in the routing table: manual and dynamic. In the manual method, we manually add entries for all network paths in the routing table. In dynamic routing, we configure and activate a routing protocol and the routing protocol automatically discovers all network paths and adds them to the routing table.

RIP (Routing Information Protocol) is a dynamic routing protocol. Once configured and activated, it not only automatically discovers all network paths but also adds them to the routing table.

In the following section, we will understand how the RIP routing protocol works.

How does RIP routing protocol work?

RIP requires information about locally available networks. On the first step, we add this information and activate the RIP routing protocol on routers of the network. Once configured and activated, each router sends the routing update out of all active interfaces every 30 seconds.

Each router also receives routing updates from its neighboring routers. A routing update contains the entire routing table of the sending router. Routers compare the received routing tables with their routing tables. If they find any new route in the received routing tables, they add them to their routing tables.

In the next routing update, routers advertise the updated routing tables. Over time, as each router learns more routes, they advertise about those routes as well. By the end of the process, all routers know about all routes.

Let's understand this process in detail through a simple example.

In a network, two routers: A and B are connected. An administrator configures the RIP routing protocol on both routers. After configuration, the RIP routing protocol of both routers automatically exchanges the information of locally available networks.

The following image shows this process.

how rip exchange routing information

If RIP detects any change in locally available networks’ information, it updates the other router about this change in the next update. This way, an administrator only needs to provide information about locally available networks once. After that, the RIP protocol automatically manages all changes in the network.

RIP Routing broadcasts

To share the paths' information, the RIP protocol uses broadcast messages. RIP protocol periodically reads the routing table and shares it with neighbors through a broadcast message. Upon receiving a broadcast message from a neighbor, the RIP protocol reads the broadcast message and updates the routing table accordingly.

For example, if the broadcast message contains information about a new path, the RIP protocol adds that path in the routing table or if the broadcast message contains information that an existing path has gone down, the RIP protocol removes that path from the routing table or marks that path unusable in the routing table.

When a router running RIP protocol broadcasts the routing table, it not only broadcasts the information about the locally connected networks but also broadcasts the information about the networks that it has learned from its neighbors through the previously received broadcasts.

This update sequence eventually allows all routers to learn all paths. Let’s understand this process through an example. Suppose, in a network, four routers: A, B, C, and D are connected in a sequence. All four routers are using the RIP routing protocol. Networks 10.0.0.0/8, 20.0.0.0/8, 30.0.0.0/8, and 40.0.0.0/8 are locally connected to the routers A, B, C, and D respectively.

The routing update sequence goes in the following way.

Router A broadcasts information of the network 10.0.0.0/8 to Router B.

Router B broadcasts information of the network 20.0.0.0/8 to Router A and C.

Router C broadcasts information of the network 30.0.0.0/8 to Router B and D.

Router D broadcasts information of the network 40.0.0.0/8 to Router C.

All routers after receiving broadcast update their routing tables, respectively.

Router A adds an entry in the routing table that indicates the network 20.0.0.0/8 is reachable through Router B.

Router B adds an entry in the routing table that indicates the networks 10.0.0.0/8 and 30.0.0.0/8 are reachable through Router A and C, respectively.

Router C adds an entry in the routing table that indicates the networks 40.0.0.0/8 and 20.0.0.0/8 are reachable through Router B and D, respectively.

Router D adds an entry in the routing table that indicates the network 30.0.0.0/8 is reachable through Router C.

The following image shows this process.

rip routing broadcast

After the next routing update:-

Router A adds an entry in the routing table that indicates the network 30.0.0.0/8 is reachable through Router B.

Router B adds an entry in the routing table that indicates the network 40.0.0.0/8 is reachable through Router C.

Router C adds an entry in the routing table that indicates the network 10.0.0.0/8 is reachable through Router B.

Router D adds an entry in the routing table that indicates the network 20.0.0.0/8 is reachable through Router C.

The following image shows routing tables before and after the second routing broadcast.

how rip routing protocol works

After the next routing update:-

Router A adds an entry in the routing table that indicates the network 40.0.0.0/8 is reachable through Router B.

Router D adds an entry in the routing table that indicates the network 10.0.0.0/8 is reachable through Router C.

The following image shows routing tables before and after the third routing broadcast.

rip routing update process

The situation in which all routers know all paths of the network is called convergence. After the convergence, the RIP routing protocol actively monitors all paths. If it detects any change in any path, it updates neighboring routers about that change in the next broadcast.

That's all for this part. This tutorial is the first part of the article "How to configure RIP routing protocol explained with features and functions of the RIP protocol ". In the next part of this tutorial, we will understand various timers that RIP uses to perform its operations.

ComputerNetworkingNotes CCNA Study Guide How RIP Routing Protocol Works