Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The topic of today's lesson is RIP, or Routing Information Protocol. We will talk about various aspects of its application, its settings and limitations. As I said, the topic of RIP is not included in the Cisco 200-125 CCNA curriculum, but I decided to devote a separate lesson to this protocol, since RIP is one of the main routing protocols.

Today we will look at 3 aspects: understanding and configuring RIP in routers, RIP timers, RIP limits. This protocol was created in 1969, so it is one of the oldest network protocols. Its advantage lies in its extraordinary simplicity. Today, many network devices, including Cisco, continue to support RIP because it is not proprietary like EIGRP, but a public protocol.

There are 2 versions of RIP. The first, classic version, does not support VLSM, the variable subnet mask length on which classless IP is based, so we can only use one network. I will talk about this a little later. This version also does not support authentication.

Suppose you have 2 routers connected to each other. At the same time, the first router tells the neighbor everything it knows. Suppose network 10 is connected to the first router, network 20 is located between the first and second router, and network 30 is behind the second router. Then the first router tells the second that it knows networks 10 and 20, and router 2 tells router 1 that it knows about network 30 and network 20.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The routing protocol indicates that these two networks should be added to the routing table. In general, it turns out that one router tells about the networks connected to it to a neighboring router, that router tells its neighbor, and so on. Simply put, RIP is a gossip protocol that serves to ensure that neighboring routers share information with each other, and each of the neighbors unconditionally believes what he was told. Each router "listens" for changes in the network and shares them with its neighbors.

The lack of authentication support means that any router that is connected to the network immediately becomes its full member. If I want to bring down the network, I will connect my hacker router with a malicious update to it, and since all other routers trust it, they will update their routing tables in the way I need. Against such a hack, the first version of RIP does not provide any protection.

RIPv2 can provide authentication by configuring the router accordingly. In this case, updating information between routers will become possible only after passing network authentication by entering a password.

RIPv1 uses broadcasting, that is, all updates are sent using broadcast messages, so that they are received by all participants in the network. Let's say a computer is connected to the first router, which does not know anything about these updates, since only routing devices need them. However, router 1 will send these messages to all devices that have a Broadcast ID, that is, even to those who do not need it.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

In the second version of RIP, this problem is solved - it uses Multicast ID, or multicast traffic. In this case, only those devices that are specified in the protocol settings receive updates. In addition to authentication, this version of RIP supports classless VLSM IP addressing. This means that if the network 10.1.1.1/24 is connected to the first router, then all network devices whose IP address is in the address range of this subnet also receive updates. The second version of the protocol supports the CIDR method, that is, when the second router receives an update, it knows which specific network or route it concerns. In the case of the first version, if the network 10.1.1.0 is connected to the router, then devices on the 10.0.0.0 network and other networks belonging to the same class will also receive updates. In this case, router 2 will also receive full information about updating these networks, however, without CIDR, it will not know that this information concerns a subnet with Class A IP addresses.

This is what the RIP protocol is in very general terms. Now let's look at how it can be configured. You need to enter the global configuration mode of the router settings and use the Router RIP command.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

After that, you will see that the command line header has changed to R1(config-router)# because we have moved to the router subcommand level. The second command will be Version 2, that is, we tell the router that it should use the 2nd version of the protocol. Next, we must enter the address of the advertised classful network over which updates should be transmitted using the network XXXX command. This command has 2 functions: firstly, it indicates which network should be advertised, secondly, which interface should be used for this. You will understand what I mean when you look at the network configuration.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

Here we have 4 routers and a computer connected to the switch through a network with the identifier 192.168.1.0/26, which is divided into 4 subnets. We only use 3 subnets: 192.168.1.0/26, 192.168.1.64/26 and 192.168.1.128/26. We still have the 192.168.1.192/26 subnet, but it is not used due to uselessness.

Device ports have the following IP addresses: computer 192.168.1.10, first port of the first router 192.168.1.1, second port 192.168.1.65, first port of the second router 192.168.1.66, second port of the second router 192.168.1.129, first port of the third router 192.168.1.130 . Last time we talked about conventions, so I cannot follow the convention and assign the second port of the router to the address .1, because .1 is not part of this network.

Next, I use other addresses, because we start another network - 10.1.1.0/16, so the second port of the second router to which this network is connected has an IP address of 10.1.1.1, and the port of the fourth router to which the switch is connected - address 10.1.1.2.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

To set up the network I created, I must assign IP addresses to the devices. Let's start with the first port of the first router.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

First, let's create a hostname R1, assign port f0/0 to 192.168.1.1, and set the subnet mask to 255.255.255.192 because we have a /26 network. We complete the configuration of R1 with the no shut command. The second port of the first f0/1 router will receive the IP address 192.168.1.65 and the subnet mask 255.255.255.192.
The second router will be named R2, we will assign the first port f0 / 0 the address 192.168.1.66 and the subnet mask 255.255.255.192, the second port f0 / 1 - the address 192.168.1.129 and the subnet mask 255.255.255.192.

Moving on to the third router, we will give it the host name R3, port f0/0 will be given the address 192.168.1.130 and the mask 255.255.255.192, and port f0/1 will be the address 10.1.1.1 and the mask 255.255.0.0, because this network is /16.

Finally, I'll go to the last router, name it R4, and assign port f0/0 address 10.1.1.2 and mask 255.255.0.0. So, we have configured all network devices.

Finally, let's look at the computer's network settings - it has a static IP address of 192.168.1.10, a half-net mask of 255.255.255.192, and a default gateway address of 192.168.1.1.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

So, you've seen how to configure the subnet mask for devices on different subnets, it's very simple. Now let's enable routing. I go into the R1 settings, set the global configuration mode, and type the router. The system then prompts for possible routing protocols for this command: bgp, eigrp, ospf, and rip. Since our lesson is about RIP, I use the router rip command.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

If you type a question mark, the system will issue a new hint for the next command with possible options for the functions of this protocol: auto-summary - automatic summation of routes, default-information - control of the default information presentation, network - networks, timings, and so on. Here you can select the information that we will exchange with neighboring devices. The most important feature is the version, so we'll start by entering the version 2 command. Next, we need to use the network key command, which creates a route for the specified IP network.

We'll continue configuring Router1 later, but for now I want to move on to Router 3. Before I use the network command on it, let's look at the right side of our network topology. The second port of the router has the address 10.1.1.1. How does RIP work? Even in version 10.1.1.0, RIP, as a fairly old protocol, still uses its own network classes. So even though our 16/10.0.0.0 network is class A, we must specify the full class version of this IP address using the network XNUMX command.

But even if I type the command network 10.1.1.1 and then look at the current configuration, I see that the system has fixed 10.1.1.1 to 10.0.0.0, automatically using the full-class addressing format. So if you have a question about RIP on the CCNA exam, you must use full-class addressing. If instead of 10.0.0.0 you type 10.1.1.1 or 10.1.0.0, you will make a mistake. Although the conversion to the full-class form of addressing is automatic, I advise you to use the correct address initially so that you do not have to wait for the system to correct the error later. Remember, RIP always uses full classful network addressing.

After you have used the network 10.0.0.0 command, the third router will insert this tenth network into the routing protocol and send the update along the route R3-R4. Now you need to configure the routing protocol of the fourth router. I go into its settings and enter the router rip, version 2 and network 10.0.0.0 commands in sequence. With this command, I ask R4 to start announcing the network 10. using the RIP routing protocol.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

Now these two routers could exchange information, but this would not change anything. Using the show ip route command shows that FastEthernrt port 0/0 is directly connected to network 10.1.0.0. The fourth router, having received the network announcement from the third router, will say: β€œgreat, buddy, I received your announcement of the tenth network, but I already know about it, because I am directly connected to this network.”

Therefore, we will return to the R3 settings and insert another network with the network 192.168.1.0 command. I'm using the full-class addressing format again. After that, the third router will be able to announce the network 192.168.1.128 along the R3-R4 route. As I said, RIP is a "gossip" that tells about new networks to all its neighbors, passing them information from its routing table. If you now look at the table of the third router, you can see the data of the two networks connected to it.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

It will send this data to both ends of the route to both the second and fourth routers. Let's move on to the R2 settings. I enter the same router rip, version 2 and network 192.168.1.0 commands and this is where things get interesting. I'm specifying network 1.0, but it's both 192.168.1.64/26 and 192.168.1.128/26. Therefore, when I specify the network 192.168.1.0, I technically provide routing for both interfaces of this router. The convenience is that with just one command you can set the routing for all ports of the device.

I specify exactly the same parameters for the R1 router and provide routing for both interfaces in the same way. If you now look at the R1 routing table, you can see all the networks.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

This router is aware of both network 1.0 and network 1.64. It also knows about networks 1.128 and 10.1.1.0 because it uses RIP. This is indicated by the heading R in the corresponding line of the routing table.
Please pay attention to the information [120/2] - this is the administrative distance, that is, the reliability of the source of routing information. This value can be set to a higher or lower value, but the default for RIP is 120. For example, a static route has an administrative distance of 1. The smaller the administrative distance, the more reliable the protocol. If the router will have the opportunity to choose between two protocols, for example between a static route and RIP, then it will choose to forward traffic along a static route. The second value in brackets, /2, is the metric. In the RIP protocol, the metric means the number of hops. In this case, network 10.0.0.0/8 can be reached in 2 hops, i.e. router R1 must send traffic over network 192.168.1.64/26, this is the first hop, and over network 192.168.1.128/26, this is the second hop to get to to network 10.0.0.0/8 through a device with FastEthernet 0/1 interface with IP address 192.168.1.66.

For comparison, router R1 can reach network 192.168.1.128 with an administrative distance of 120 in 1 hop through interface 192.168.1.66.

Now, if you try to ping the interface of the R0 router with the IP address 4 from the PC10.1.1.2 computer, it will successfully return back.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The first attempt failed with a Request timed out message, because when using ARP, the first packet is lost, but the other three are successfully returned to the destination. Thus, there is a point-to-point communication in a network using the RIP routing protocol.

So, in order to activate the use of the RIP protocol by the router, you need to sequentially type the router rip, version 2 and network <network number / network identifier in full class form> commands.

Let's go into the R4 settings and enter the show ip route command. You can see that the network 10. is directly connected to the router, and the network 192.168.1.0/24 is accessible through port f0/0 with IP address 10.1.1.1 using the RIP protocol.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

If you pay attention to the network view 192.168.1.0/24, you will notice that there is a problem with autosummarization of routes. If autosummary is enabled, RIP will sum all networks up to 192.168.1.0/24. Let's look at what timers are. The RIP protocol has 4 main timers.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The Update timer is responsible for the frequency of updates, sending protocol updates every 30 seconds on all interfaces participating in RIP routing. This means that it takes the routing table and sends it out to all ports operating in RIP mode.
Imagine that we have router 1, which is connected to router 2 by network N2. Before the first and after the second router there are networks N1 and N3. Router 1 tells router 2 that it knows the networks N1 and N2 and sends it an update. Router 2 tells router 1 that it knows networks N2 and N3. At the same time, every 30 seconds, the ports of the routers exchange routing tables.

Let's imagine that for some reason the N1-R1 connection is broken and router 1 can no longer communicate with the N1 network. After that, the first router will send only updates related to the N2 network to the second router. Router 2, having received the first such update, will think: β€œgreat, now I have to put network N1 on the Invalid Timer”, and then start the Invalid timer. For 180 seconds, it will not exchange N1 network updates with anyone, but after this period of time, it will stop Invalid Timer and start Update Timer again. If during these 180 seconds it does not receive any network state updates N1, then it will put it in a Hold Down timer of 180 seconds, that is, the Hold Down timer starts immediately after the Invalid timer ends.

At the same time, another, fourth Flush timer is running, which starts simultaneously with the Invalid timer. This timer determines the time interval between receiving the last normal update about the N1 network until the N240 network is excluded from the routing table. Thus, when the duration of this timer reaches 1 seconds, the NXNUMX network will automatically be excluded from the routing table of the second router.

So, Update Timer sends updates every 30 seconds. The Invalid Timer, which runs every 180 seconds, waits for a new update to reach the router. If it doesn't arrive, it puts that network on hold, with the Hold Down Timer running every 180 seconds. But the Invalid and Flush timers start at the same time, so that 240 seconds after Flush starts, a network that is not mentioned in the update is excluded from the routing table. The duration of these timers is set by default and can be changed. That's what the RIP timers are.

Now let's move on to considering the limitations of the RIP protocol, there are quite a few of them. One of the main limitations is autosummation.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

Let's go back to our network 192.168.1.0/24. Router 3 tells Router 4 about the whole network 1.0, which is indicated by /24. This means that all 256 IP addresses of this network, including the network ID and broadcast address, are reachable, i.e. messages from devices with any IP address in this range will be sent through the 10.1.1.1 network. Let's turn to the routing table R3.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

We see the 192.168.1.0/26 network divided into 3 subnets. This means that the router only knows about the three specified IP addresses: 192.168.1.0, 192.168.1.64 and 192.168.1.128, which belong to the /26 network. But it doesn't know anything about, for example, devices with IP addresses ranging from 192.168.1.192 to 192.168.1.225.

However, for some reason, R4 thinks it knows everything about the traffic that R3 sends to it, that is, about all the IP addresses on the 192.168.1.0/24 network, which is completely wrong. At the same time, routers can start dropping traffic because they β€œdeceive” each other - after all, router 3 does not have the right to tell the fourth router that it knows everything about the subnets of this network. This is due to a problem called "autosummation". It occurs when traffic moves through different large networks. For example, in our case, a network with class C addresses is connected through the R3 router to a network with class A addresses.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The R3 router considers these networks the same and automatically summarizes all routes into a single network address 192.168.1.0. Recall that we talked about supernet route summarization in one of the previous videos. The reason for the summation is simple - the router thinks that one entry in the routing table, we have an entry 192.168.1.0/24 [120/1] via 10.1.1.1, is better than 3 entries. If the network consists of hundreds of small subnets, then when summarization is disabled, the routing table will consist of a huge number of routing entries. Therefore, automatic route summarization is used to prevent the accumulation of a huge amount of information in the routing tables.

However, in our case, autosummarization of routes creates a problem, as it causes the router to exchange false information. Therefore, we need to go into the settings of the R3 router and enter a command that prohibits auto-summarizing routes.

To do this, I sequentially type router rip and no auto-summary commands. After that, you need to wait until the update spreads over the network, and then you can use the show ip route command in the R4 router settings.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

You can see how the routing table has changed. The entry 192.168.1.0/24 [120/1] via 10.1.1.1 is preserved from the previous version of the table, and then three entries follow, which, thanks to the Update timer, are updated every 30 seconds. The Flush timer ensures that 240 seconds after the update plus 30 seconds, i.e. 270 seconds, this network will be removed from the routing table.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

The networks 192.168.1.0/26, 192.168.1.64/26 and 192.168.1.128/26 are correct, so now if the traffic is destined for device 192.168.1.225, this device will drop it, because the router does not know where the device with such address. But in the previous case, when we had route autosummary enabled for R3, this traffic would be directed to the 10.1.1.1 network, which was completely wrong, because R3 would immediately drop these packets without sending them further.

As a network administrator, you must create networks with as little extra traffic as possible. For example, in this case, there is no need to forward this traffic through R3. Your task is to increase the network bandwidth as much as possible, preventing traffic from being forwarded to devices that do not need it.

The next limitation of RIP is Loops, or routing loops. We have already talked about network convergence, when the routing table is correctly updated. In our case, the router should not receive updates for the 192.168.1.0/24 network if it does not know anything about it. Technically, convergence means that the routing table is only updated with correct information. This should happen when the router is turned off, rebooted, reconnected to the network, etc. Convergence is a state in which all the necessary updates to the routing tables have been made and all the necessary calculations have been made.
RIP has very poor convergence and is a very, very slow routing protocol. Because of this slowness, Loops, or the β€œinfinite counter” problem, arise.

I will draw a network diagram similar to the previous example - router 1 is connected to router 2 by network N2, router 1 is connected to network N1, and router 2 is connected to network N3. Suppose that for some reason the N1-R1 connection is broken.

Cisco Training 200-125 CCNA v3.0. Day 21: RIP Distance Vector Routing

Router 2 knows that network N1 is reachable in one hop through router 1, but that network is down at the moment. After the network fails, the timer process starts, router 1 puts it in the Hold Down state, and so on. However, router 2 has the Update timer running, and at the set time it sends an update to router 1, which says that the N1 network is available through it in two hops. This update arrives at Router 1 before it has time to send an update to Router 2 about the failure of N1's network.

Having received this update, router 1 thinks: β€œI know that the N1 network that is connected to me is down for some reason, but router 2 told me that it is available through it in two hops. I believe him, so I will add one hop, update my routing table and send an update to router 2, in which I will say that network N1 is reachable through router 2 in three hops!
Having received this update from the first router, router 2 says: β€œok, earlier I received an update from R1, which said that N1's network is available through it in one hop. Now he informed me that it is available in 3 hops. Maybe something has changed on the network, I can't help but believe it, so I'll update my routing table with one hop added." After that, R2 sends an update to the first router, which says that the N1 network is now available in 4 hops.
Do you see what the problem is? Both routers send updates to each other, each time adding one hop, and eventually the number of hops reaches a large value. In the RIP protocol, the maximum number of hops is 16, and as soon as it reaches this value, the router understands that there are problems and simply removes this route from the routing table. This is the problem with routing loops in RIP. This is due to the fact that RIP is a distance-vector protocol, it only monitors the distance, not paying attention to the state of the network sections. In 1969, when computer networks were much slower than they are now, the distance vector approach paid off, so the developers of RIP chose the hop count as their main metric. However, today this approach creates many problems, therefore, in modern networks, the transition to more advanced routing protocols, such as OSPF, has been widely implemented. De facto, this protocol has become the standard for the networks of most global companies. We will take a very detailed look at this protocol in one of the following videos.

We will no longer return to RIP, therefore, using the example of this oldest network protocol, I have told you enough about the basics of routing and the problems due to which they try not to use this protocol for large networks anymore. In the following video tutorials, we will look at modern routing protocols - OSPF and EIGRP.


Thank you for staying with us. Do you like our articles? Want to see more interesting content? Support us by placing an order or recommending to friends, 30% discount for Habr users on a unique analogue of entry-level servers, which was invented by us for you: The whole truth about VPS (KVM) E5-2650 v4 (6 Cores) 10GB DDR4 240GB SSD 1Gbps from $20 or how to share a server? (available with RAID1 and RAID10, up to 24 cores and up to 40GB DDR4).

Dell R730xd 2 times cheaper? Only here 2 x Intel TetraDeca-Core Xeon 2x E5-2697v3 2.6GHz 14C 64GB DDR4 4x960GB SSD 1Gbps 100 TV from $199 in the Netherlands! Dell R420 - 2x E5-2430 2.2Ghz 6C 128GB DDR3 2x960GB SSD 1Gbps 100TB - from $99! Read about How to build infrastructure corp. class with the use of Dell R730xd E5-2650 v4 servers worth 9000 euros for a penny?

Source: habr.com

Add a comment