RIP – Routing Information Protocol Explained

This tutorial explains the concept of distance-vector routing in detail. Learn what a distance and a vector are and how they are used by the RIP routing protocol to learn and advertise network paths.

In the distance-vector routing, routers learn the routing information from directly connected neighbors, and these neighbors may have learned these networks from other neighboring routers. Because of this, the distance-vector routing is also known as the routing by rumor.

In the following section, we will not only understand the distance-vector routing concept in detail through an example but will also understand how the RIP routing protocol uses this concept to learn and select the best route for each subnet of the network.

This tutorial is the second part of the article "How to configure RIP routing protocol explained with features and functions of the RIP protocol ". The first part of this article is the following.

This part explains how the RIP routing protocol uses broadcast messages to exchange network paths' information.

Distance-vector routing and RIP routing protocol

RIP routing protocol uses the concept of distance-vector routing. Routers running RIP protocol learn about the destination networks from neighboring routers through broadcast messages. Routers running RIP protocol periodically broadcast the configured networks from all ports. Listing routers update their routing tables from these broadcasts.

Let's understand this concept through an example.

The following figure illustrates a simple network running the RIP routing protocol.

rip routing exchange

When we start this network, the routers only know the IP subnets that are available on their local interfaces.

Router R1 knows the networks 10.0.0.0/8 and 192.168.1.252/30 are available on interfaces F0/1 and S0/0, respectively.

Router R2 knows the networks 192.168.1.252/30 and 192.168.1.248/30 are available on interfaces S0/0 and S0/1, respectively.

Router R3 knows the networks 192.168.1.248/30 and 20.0.0.0/8 are available on interfaces S0/0 and F0/1, respectively.

After the booting process, routers share configured routes in the network through the broadcasts. These broadcasts are known as routing updates.

The following image shows this process.

network running rip routing protocol

Routers also receive broadcasts (routing updates) on their active interfaces. Routers compare their routing tables with routing updates to learn about new IP subnets.

Router R1 receives one broadcast from the router R2 and learns one new IP subnet 192.168.1.248/30.

Router R2 receives two broadcasts: one from the router R1 and another from the router R2. From these broadcasts, the router R2 learns two new IP subnets: 10.0.0.0/8 and 20.0.0.0/8.

Router R3 receives one broadcast from the router R2 and learns one new IP subnet 192.168.1.252/30.

Routers add newly learned IP subnets with their respective ports in routing tables.

The following image shows routers with their updated routing tables.

routing tables after routing update

After 30 seconds (default time interval between two routing updates) all routers broadcast their routing tables again with updated information.

Routers also learn from the received broadcasts.

The following image shows routing tables of all routers after these routing updates.

rip routing convergence

After 30 seconds, routers broadcast new routing information again. But this time, all routers know all routes of the network, so they will update nothing. This stage is known as convergence. The convergence is a term that refers to the time taken by all routers in understanding the current topology of the network.

The RIP protocol broadcasts successive routing updates even after achieving the phase of convergence. This helps the router to detect and adapt to any new changes that occur after the convergence.

Selecting/calculating the best route

Distance-vector routing protocols use distance (accumulated metric value) and direction (vector) to find and select the single best route for each IP subnet of the network. When a router running a distance-vector routing protocol learns about network routes, it learns three important facts related to each route: the destination subnet, the distance (routing protocol metric), and the vector (link and next-hop router to use as part of that route).

RIP uses distance to select the best route for each destination subnet. Distance is calculated in the term of hops. Each instance where a packet goes through a router is called a hop, and the route with the least number of hops to the destination subnet is selected as the best route for that destination subnet. The term vector indicates the direction to the destination subnet. RIP uses the interface of the next-hop router as the vector.

Let's understand this concept through an example.

The following figure shows an example of a network running the RIP routing protocol.

example of distance vector routing

In this network, the router A has three routes to the destination network. These routes are the following.

  1. The four-hops route (distance) through router B (vector)
  2. The one-hop route (distance) through router F (vector)
  3. The two-hops route (distance) through router G (vector)

Since the second route has the lowest hop count, router A uses this route to forward all packets of the destination network.

Key points: -

That's all for this part. In the next part of this tutorial, we will understand various timers and options that RIP uses to manage routing information. If you like this tutorial, please don't forget to share it with friends through your favorite social network.

ComputerNetworkingNotes CCNA Study Guide RIP – Routing Information Protocol Explained