A must-read for network engineers! Essential knowledge points for IP routing in 2020

A must-read for network engineers! Essential knowledge points for IP routing in 2020

RIP

RIP (Routing Information Protocol) is a pure distance vector routing protocol. RIP sends its complete routing table from all active interfaces every 30 seconds. RIP only uses the hop count as the basis for determining the best path to the remote network, and the maximum hop count allowed by default is 15, which means that 16 hops are considered unreachable. RIP works well in small network applications, but it is inefficient for large networks equipped with slow WAN links or those with a large number of routers.

RIP version 1 uses only classful routing, which means that all devices on the network must use the same subnet mask. This is because RIP version 1 does not carry subnet mask information in the updates it sends. RIP version 2 provides prefix routing information and can transmit subnet mask information in routing updates. This is classless routing.

[[339043]]

RIP Timer

RIP uses four timers to manage performance.

  • The routing update timer is used to set the routing update interval (usually 30 seconds), which is the interval at which the router sends a complete copy of its routing table to all adjacent routers.
  • The route invalidation timer is used to determine the length of time (usually 180 seconds) that the router needs to wait before finally determining that a route is invalid. If the router does not receive any update message about a specific route during this determination waiting time, the router will determine that the route is invalid. When this happens, the router will send an update to all adjacent devices that the route is no longer valid.
  • The hold invalid timer is used to set the length of time that routing information is suppressed. When a router receives an update packet indicating that a route is unreachable, it will enter the hold invalid state. This hold state will continue until the router receives an update packet with a better metric, or the initial route returns to normal, or the hold invalid timer expires. By default, the timer is set to 180 seconds.
  • The route refresh timer is used to set the time interval (usually 240 seconds) from when a route is identified as invalid to when it is deleted from the routing table. Before deleting the route from the routing table, the router will notify the neighboring devices that the route is about to disappear. The value of the route invalidation timer must be smaller than the value of the route refresh timer. This reserves enough time for the router to notify the neighboring devices of the invalid route when updating the local routing table.

Configuring RIP Routing

To configure RIP routing, we just need to enable the protocol using the router rip command and configure the networks that the RIP routing protocol needs to advertise. It's that simple. Let's configure an internetwork with 4 routers using RIP routing.

1. Corp

The administrative distance of the RIP protocol is 120. The default administrative distance of static routes is 1. Since there are static routes in the current configuration, the routing information formed by RIP will not appear in the routing table under default conditions. However, since the previous configuration adds 150 after each static route, that is, its administrative distance is not the default value, the configuration here can work normally.

By using the router rip command and the network command, we can add the RIP routing protocol to the configuration. The network command is used to tell this routing protocol which classful networks need to be advertised. With these RIP routing configuration operations, all router interfaces with addresses within the network specified by the network command will run the RIP routing process.

Below is the configuration of the Corp router, we can see that the process is very simple:

That's it. Usually, we only need to use two or three commands to complete the configuration. This is much simpler than the configuration operation when using static routes, isn't it? However, it is important to remember that such a configuration will take up more router CPU processing time and bandwidth. Note that we have not entered any information about the subnet here, only the classful network address (all of its subnet bits and host bits are 0!). Finding subnet information and putting them in the routing table is the job of the routing protocol. Since no routers are running RIP yet, you will not see any routes given by RIP in this routing table for the time being.

!NOTE: Remember that RIP requires classful addressing when configuring network addresses. Because of this, all subnet masks in any given classful network must be the same on all devices in that network (this is classful routing). To illustrate this, suppose you need to configure a class B network 172.16.0.0/24 with subnets 172.16.10.0, 172.16.20.0, and 172.16.30.0. In this case, you would enter only the classful network address 172.16.0.0 in the configuration and let RIP find these subnets and put the information into the routing table.

2. R1

Next, we configure the R1 router, which is connected to three networks. We need to configure all these directly connected classful networks (subnet information is not used during configuration):

As you can see, the configuration process is quite simple. Now let's discuss the routing table. Since we have already configured a router using RIP, we can already exchange routing tables with it. Here we can see the RIP network from the Corp router.

(Note that all other routes are still static for now.) RIP will also discover that there are two connections to the Corp router, and since the hop count to each network is advertised as 1, it will use load balancing on the two networks advertised as RIP injected routes. Fortunately, the two connections have the same bandwidth, so there will be no pinhole congestion problems.

3. R2

Next, use RIP to configure the R2 router:

As the number of RIP configurations increases, the number of R entries in the routing table also increases! We can still find all routes in this routing table, but some of them are still static routes. There is only one router left to be configured.

4. R3

Now complete the configuration of the R3 router (the last one) using RIP:

Finally, all routes in the routing table are shown as RIP injected routes. Note that because of the classful network configuration description, the WLAN network should be 172.16.0.0, not 172.16.10.0! It is important to understand how administrative distance is used and why we need to delete static routes or set the AD of static routes higher than 120 before adding RIP routes.

By default, the administrative distance of directly connected routes is 0, the administrative distance of static routes is 1, and the administrative distance of RIP is 120. RIP is called the "rumor protocol" because it reminds people of the rumors they heard in high school (such as the routes being advertised here), which are usually accepted without exception. This is very similar to how RIP works on the Internet. It can be said that RIP is a protocolized rumor maker!

Verify the RIP routing table

Each routing table should now contain all routes directly connected to the router as well as routes injected by RIP from neighboring routers. Let's return to the Corp router and look at its output. The routing table contents of the Corp router are as follows:

In this routing table output, we see essentially the same routing table entries as when using static routing configuration, except for the R flag. The R here indicates that the networks listed in the table were added dynamically due to the use of the RIP routing protocol. The [120/1] refers to the administrative distance of the route (120) and the hop count required to reach the remote network (1). From the Corp router, all networks are only one hop away. One strange entry in this table is the 172.16.10.0 network, which you may have noticed is listed twice, once as a /16 and once as a /24. One of these is indicated as a static route, while the other indicates a route injected by RIP. This route should not appear twice in this table, especially the static route with [150/0], since it has a larger administrative distance.

Let's take a look at R2's routing table:

Note the same problem. RIPv1 cannot be used on disjoint networks, and the problem here illustrates that. Keep that in mind.

As you can see, RIP works fine in this small internetwork, but it is not a viable solution for every enterprise application, because the maximum hop count allowed by this technology is only 15 (16 hops will be considered unreachable). In addition, it requires updating the entire routing table every 30 seconds, which is almost an unacceptable disaster for large internetworks!

There is one more thing to note about the RIP routing table and the parameters used to advertise remote networks. Let's take a router in another network as an example. Notice that in the routing table below, the metric for network 10.1.3.0 is [120/15]. That is, the administrative distance of this route is 120, the default for RIP, but its hop count is 15. Remember that every time a router sends an update to its neighboring routers, it adds 1 to the hop count for each route.

It can be seen that [120/15] does not actually need to be propagated again, because the next router that receives the routing table from router R3 will ignore the route to network 10.1.3.0, because the hop count at that time will be 16, which is an invalid value.

Note: When a router receives a routing update that describes a path with a higher cost than the original routing path in the routing table, the update will be ignored.

Example 2 for configuring RIP routing

Before we delve deeper into RIP configuration, let's first discuss the network in Figure 8-17. In this example, we will first understand and complete the subnetting, and then configure RIP on the router.

In this configuration example, we will assume that the configuration of the Lab_B and Lab_C routers has been completed and only the Lab_A router needs to be configured. The network ID that can be used for configuration is 192.168.164.0/28. The s0/0 interface of Lab_A will use the last available IP address in the eighth subnet, and the fa0/0 interface will use the last available IP address in the second subnet. Subnet 0 will be considered illegal.

Before we start configuring, we should know that /28 is actually the subnet mask 255.255.255.240, and that the size of the block it uses in the fourth octet is 16. It is very important to master this content, and if you still feel confused about it, then you really need to go back to Chapter 3 and Chapter 4 for a necessary review! It is definitely beneficial and harmless to review subnetting.

Since the block size is 16, the subnets that can be obtained are 16 (note that the first subnet in this example is not subnet 0) 32, 48, 64, 80, 96, 112, 128, 144, etc. Among them, the eighth subnet (the subnet where the s0/0 interface is located) is subnet 128. The legal host address range of subnet 128 is 129~142, and 143 is the broadcast address of subnet 128. The second subnet (the subnet where the fa0/0 interface is located) is subnet 32. Its legal host address range is 33~46, and 47 is the broadcast address of subnet 32.

Thus, the configuration on the Lab_A router is as follows:

It is a fairly simple process to figure out which subnets need to be configured and complete the configuration using the last valid host address. If you are not able to do this easily, then you need to go back and review the relevant content in Chapter 4. I hope you can really notice that although two subnets are added to the Lab_A router in this configuration, there is only one network statement in the RIP configuration. Sometimes it is difficult to remember that the configuration of a classful network statement is actually to set all the host bits to 0.

Note that the real purpose of the second RIP configuration example given here is to help you review the addressing method of classful networks. Also note that practicing subnetting is definitely beneficial and can never hurt.

Suppressing RIP Propagation

Broadcasting RIP network announcements across your LAN and WAN is probably not what you want. Likewise, broadcasting RIP network announcements to the Internet is not going to do much good.

There are several ways to limit the unnecessary spread of RIP updates in LANs and WANs, the simplest of which is to use the passive-interface command. This command blocks the broadcast of RIP updates on a specified interface while not affecting the reception of RIP updates on that interface.

The following is an example of configuring a passive-interface on a router through the CLI:

This command will prevent serial 0/0 from broadcasting RIP updates outward, but it does not prevent serial 0/0 from receiving RIP updates.

RIPv2

Although we have not yet solved the mystery of maintaining two routes for the same network in the routing tables of the Corp and R2 routers, we will still advertise the route on R3 to other routers on the internetwork." Let's take a moment to discuss RIPv2.

Real Case

Do we really need to use RIP in an internetwork?

Suppose you are hired as a consultant and are tasked with installing multiple Cisco routers for a growing network. There are several old Unix routers that still need to be retained in this network. These routers do not support any routing protocol other than RIP. I guess this means that you can only use RIP throughout the network.

Of course, it doesn't have to be that way. You don't have to run RIP on your entire network, just on the routers that connect to the older networks! You can do something called redistribution, which is basically switching from one routing protocol to another. That is, you can use RIP to support those older routers, and use a better protocol, such as enhanced IGRP, for the rest of the network.

This prevents RIP routes from being sent everywhere throughout the internetwork, saving valuable network bandwidth. RIP version 2 is essentially the same as version 1. Both RIPv1 and RIPv2 are distance vector protocols, which means that each router running RIP will periodically send its complete routing table from all active interfaces. In addition, both versions of RIP have the same

Timers and loop avoidance schemes (such as keep-alive timers and split-horizon rules). Both RIPv1 and RIPv2 can be configured to use classful addressing (but because RIPv2's subnet information is sent with routing updates, it is considered classless), and both have the same administrative distance (120). However, there are some important differences between them that make RIPv2 more scalable than RIPv1.

I would like to give a piece of advice: I do not recommend using RIP, no matter which version, in network configuration. Since RIP is an open standard, it can be used on any brand of router. But it should be noted that OSPF is also an open standard, so you can also choose OSPF in the same situation. Using RIP will only consume more bandwidth in the network, which will greatly affect network performance in specific applications. When you have other better options available, why insist on a less than ideal choice?

Table 8-3 shows the differences between RIPv1 and RIPv2.

Unlike RIPv1, RIPv2 is a classless routing protocol (although it can be configured as classful like RIPv1), that is, RIPv2 can send subnet mask information with routing updates. By sending subnet mask information with updates, RIPv2 can support VLSM (Variable Length Subnet Mask) and network boundary aggregation, which sometimes brings more inconvenience in our current network design. In addition, RIPv2 can also support discontinuous network partitioning.

Configuring RIPv2 is a fairly simple process. Here is an example:

The operation is like this, we just need to add the command version 2 in the (config-router)# prompt, and then the protocol running is RIPv2. The following will introduce the RIP verification command, and then configure RIPv2 in this internetwork. RIPv2 is classless and can support VLSM and discontinuous networks.

<<:  4G is still growing, but 5G is a bit awkward. Has the promised 5G phone replacement trend come to an end?

>>:  Division of wireless AP channels in WLAN

Recommend

How can blockchain become a “trust machine” amid market chaos?

In recent years, the development of blockchain te...

Industry hot spots of data center in 2018

For many people, 2017 has been an intense and bus...

Nginx log analysis: writing shell scripts for comprehensive log statistics

Nginx is a high-performance HTTP and reverse prox...

Three steps to converge cloud and edge computing for IoT

The Internet of Things has grown rapidly over the...

Get ready for Industry 4.0 with 5G and native AI

The Internet of Things (IoT) is a major business ...

4 major roles of the network in enterprise digital transformation

Currently, digital transformation is described as...

5G networks need to overcome three major barriers to large-scale commercial use

Although 5G licenses have been issued, the commer...

How do LoRa and LoRaWAN help build smart cities?

Smart city networks power everything from self-dr...

Prospects and challenges of 5G messaging development

With the rapid development and popularization of ...

Communication module, why is it so popular?

In recent years, with the rise of mobile communic...