Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Distance-Vector Routing Protocols

Author: Sophia
what's covered
In this lesson, you will learn distance-vector routing protocols.

Specifically, this lesson will cover the following:

Table of Contents

1. Distance-Vector Routing Protocols

The distance-vector routing algorithm passes its complete routing table contents to neighboring routers, which then combine the received routing table entries with their own routing tables to complete and update their individual routing tables. This is sometimes called routing by rumor because a router receiving an update from a neighboring router believes the information about remote networks without verifying for itself that the information is correct.

It is possible to have a network that has multiple links to the same remote network, and if that is the case, the administrative distance (AD) of each received update is checked first. If the AD is the same, the protocol will then have to use other metrics to determine the best path to use to get to that remote network.

Distance vector uses only hop count to determine the best path to a network. If a router finds more than one link with the same hop count to the same remote network, it will automatically perform what is known as round-robin load balancing.

It is important to understand what a distance-vector routing protocol does when it starts up. In the diagram below, the four routers start off with only their directly connected networks in their routing table. After a distance-vector routing protocol is started on each router, the routing tables are updated with all the route information gathered from neighboring routers.

An internetwork of four routers using distance-vector routing with initial routing tables. At the top, there are four routers arranged horizontally and labeled from left to right 2621A, 2501A, 2501B, and 2501C. Each router is connected in series. 2621A connects to 2501A via F0/0 and E0 using the network 172.16.10.0. 2501A connects to 2501B via S0 and S0 with a lightning bolt symbol using the network 172.16.20.0. 2501B connects to 2501C via S1 and S0 with a lightning bolt symbol using the network 172.16.40.0. Additional Ethernet networks branch off from the following routers: 2501B connects to 172.16.30.0 via E0. 2501C connects to 172.16.50.0 via E0. At the bottom of each router, there is a ‘Routing Table’ arranged from left to right and has the following entries: 1) 2621A: 172.16.10.0, F0/0, and 0, 2) 2501A: 172.16.10.0, F0/0, and 0 and 172.16.20.0, S0 and 0, 3) 2501B: 172.16.20.0, F0/0, and 0; 172.16.30.0, S0, and 0; and 172.16.40.0, S1 and 0, 4) 2501C: 172.16.40.0, S0, and 0, and 172.16.50.0 and E0

As you can see in the diagram above, each router only has the directly connected networks in its routing table. Also notice that their hop count is zero in every case. Each router sends out its complete routing table to each active interface, which includes the network number, exit interface, and hop count to the network.

In the diagram below, the routing tables are complete because they include information about all the networks in the internetwork. They are considered converged. Convergence is the state of a set of routers that have the same topological information about the internetwork in which they operate. The hop count for every directly connected network remains zero, but notice that the hop count is incremented by one each time the path completely passes through a router. So, for router 2621A, the path to the 172.16.10.0 network still has a hop count of zero, but the hop count for the path to network 172.16.20.0 is one. The hop count to networks 172.16.30.0 and 172.16.40.0 increases to two, and so on. Usually, data transmission will cease while routers are converging, which is a good reason in favor of fast convergence time! In fact, one of the main problems with RIP is its slow convergence time.

An internetwork of four routers using distance-vector routing with initial routing tables. At the top, there are four routers arranged horizontally and labeled from left to right 2621A, 2501A, 2501B, and 2501C. Each router is connected in series. 2621A connects to 2501A via F0/0 and E0 using the network 172.16.10.0. 2501A connects to 2501B via S0 and S0 with the lightning bolt symbol using the network 172.16.20.0. 2501B connects to 2501C via S1 and S0 with the lightning bolt symbol using the network 172.16.40.0. Additional Ethernet networks branch off from the following routers: 2501B connects to 172.16.30.0 via E0. 2501C connects to 172.16.50.0 via E0. At the bottom of each router, there is a ‘Routing Table’ arranged from left to right and has the following entries: Router (2621A) is connected to the 172.16.10.0 network via the interface F0/0. Its routing table lists: 1) 172.16.10.0 via F0/0, hop count 0, 2) 172.16.20.0 via F0/0, hop count 1, 3) 172.16.30.0 via F0/0, hop count 2, 4) 172.16.40.0 via F0/0, hop count 2, 5) 172.16.50.0 via F0/0, hop count 3; Router (2501A) connects to 2621A via E0 and to 2501B via S0. Its routing table includes: 1) 172.16.10.0 via E0, hop count 0, 2) 172.16.20.0 via S0, hop count 0, 3) 172.16.30.0 via S0, hop count 1, 4) 172.16.40.0 via S0, hop count 1, 5) 172.16.50.0 via S0, hop count 2; Router (2501B) connects to 2501A via S0, to 2501C via S1, and has a local network 172.16.30.0 via E0. Its routing table includes: 1) 172.16.20.0 via S0, hop count 0, 2) 172.16.30.0 via E0, hop count 0, 3) 172.16.40.0 via S1, hop count 1, 4) 172.16.10.0 via S0, hop count 1, 5) 172.16.50.0 via S1, hop count 2; Router (2501C) connects to 2501B via S0 and to the 172.16.50.0 network via E0. Its routing table includes: 1) 172.16.40.0 via S0, hop count 0, 2) 172.16.50.0 via E0, hop count 0, 3) 172.16.10.0 via S0, hop count 2, 4) 172.16.20.0 via S0, hop count 1, 5) 172.16.30.0 via S0, hop count 1

As you can see in the diagram above, once all the routers have converged, the routing table in each router keeps information about three important things:

  • The remote network number
  • The interface that the router will use to send packets to reach that particular network
  • The hop count, or metric, to the network
big idea
Routing convergence time is the time required by protocols to update their forwarding tables after changes in the network have occurred.

Let’s start discussing dynamic routing protocols with one of the oldest routing protocols that is still in existence today.

terms to know
Load Balancing
Balancing a workload among multiple computer devices.
Convergence
The state of a set of routers that have the same topological information about the internetwork in which they operate.

1a. Routing Information Protocol

RIP is a true distance-vector routing protocol. It sends the complete routing table out to all active interfaces every 30 seconds. RIP uses only one thing to determine the best way to a remote network—the hop count. And because it has a maximum allowable hop count of 15 by default, a hop count of 16 would be deemed unreachable. This means that although RIP works fairly well in small networks, it is pretty inefficient on large networks with slow WAN links or on networks populated with a large number of routers. Worse, this legacy protocol has a disadvantage of creating routing loops, which were somewhat kept in check by using things like maximum hop count. This is the reason why RIP only permits going through 15 routers before it will judge that route to be invalid. RIP is also slow at converging, which can easily cause latency in your network!

RIP version 1 (RIPv1) uses only classful routing, which means that all devices in the network must use the same subnet mask for each specific address class. This is because RIPv1 doesn’t send updates with subnet mask information in tow. RIP version 2 (RIPv2), discussed next, provides something called prefix routing and does send subnet mask information with the route updates. Doing this is called classless routing.

terms to know
Classful Routing
Routers do not send subnet mask information with the route updates.
Classless Routing
Routers send subnet mask information with the route updates.

1b. Routing Information Protocol Version 2

RIPv2 is mostly the same as RIPv1. Both RIPv1 and RIPv2 are distance-vector protocols, which means that each router running RIP sends out its complete routing tables to all active interfaces periodically. Also, the timers and loop-avoidance schemes are the same in both RIP versions. Both RIPv1 and RIPv2 are configured with classful addressing (but RIPv2 is considered classless because subnet information is sent with each route update), and both have the same AD (120).

The table below highlights the differences between RIPv1 and RIPv2.

RIP v1 RIP v2
Distance vector Distance vector
Maximum hop count of 15 Maximum hop count of 15
Classful Classless
Broadcast based Uses multicast 224.0.0.9
No support for variable length subnet mask (VLSM) Supports VLSM networks
No authentication Allows for MD5 authentication
No support for discontiguous networks Supports discontiguous networks (covered in the next section)

1c. Variable-Length Subnet Masks and Discontiguous Networks

Variable-length subnet masks (VLSMs) allow classless routing, meaning that the routing protocol sends subnet-mask information with the route updates. The reason it’s good to do this is to save address space. If we didn’t use a routing protocol that supports VLSMs, then every router interface, every device on the network, would have to use the same subnet mask.
As the name suggests, with VLSMs we can have different subnet masks for different router interfaces. Check out the diagram below to see an example of why classful network designs are inefficient.

A classful network design with multiple subnets connected through two routers. On the left side, two computers labeled ‘.66’ and ‘.67’ are connected to the router labeled ‘.73’ through a cable labeled ‘192.168.10.64/29’. The area right above these computers is labeled ‘6 Hosts’. The cable connecting the computer .67 to the cable ‘192.168.10.64/29’ is labeled ‘.65’. Another cable labeled ‘192.168.10.0/27’ is connected to two computers labeled ‘.2’ and ‘.3’ directly below it and is connected to the router .73 via a cable labeled ‘.1’. The area below these computers is labeled ‘25 Hosts’. On the right side, two computers labeled ‘.66’ and ‘.67’ are connected to the router labeled ‘.74’ through a cable labeled ‘192.168.10.64/28’. The area right above these computers is labeled ‘10 Hosts’. The cable connecting the computer .66 to the cable ‘192.168.10.64/28’ is labeled ‘.49’. Another cable labeled ‘192.168.10.32/28’ is connected to two computers labeled ‘.45’ and ‘.35’ directly below it and is connected to the router .74 via a cable labeled ‘.33’. The area below these computers is labeled ‘12 Hosts’. A lightning bolt symbol connects the routers .73 and .74 and is labeled 192.168.10.73/30, 2 Hosts.

Looking at this figure, you’ll notice that we have two routers, each with two LANs and connected together with a WAN serial link. In a typical classful network design example (RIP or RIPv2 routing protocol), you could subnet a network like this:

            192.168.10.0 = Network
            255.255.255.240 (/28) = Mask

Our subnets would be 0, 16, 32, 48, 64, 80, and so on. This allows us to assign 16 subnets to our internetwork. But how many hosts would be available on each network? Each subnet provides only 14 hosts. This means that with a /28 mask, each LAN can support 14 valid hosts—one LAN requires 25 addresses, so a /28 mask doesn’t provide enough addresses for the hosts in that LAN! Moreover, the point-to-point WAN link would consume 14 addresses when only 2 are required.

When all hosts and router interfaces have the same subnet mask, this is called classful routing. And if we want this network to be more efficient, we definitely need to add different masks to each router interface.

Another problem is that the link between the two routers will never use more than two valid host addresses, even though we have 14 host addresses available. This wastes valuable IP address space.

Now let’s take the diagram below that uses a classless design. In the previous example, we wasted address space; one LAN didn’t have enough addresses because every router interface and host used the same subnet mask.

A classful network design with multiple subnets connected through two routers. On the left side, two computers labeled ‘.66’ and ‘.67’ are connected to the router labeled ‘.73’ through a cable labeled ‘192.168.10.64/29’. The area right above these computers is labeled ‘6 Hosts’. Another cable labeled ‘192.168.10.0/27’ is connected to two computers labeled ‘.2’ and ‘.3’ directly below it and is connected to the router .73 via a cable labeled ‘.1’. The area below these computers is labeled ‘25 Hosts’. On the right side, two computers labeled ‘.66’ and ‘.67’ are connected to the router labeled ‘.74’ through a cable labeled ‘192.168.10.48/28’. The area right above these computers is labeled ‘10 Hosts’. The cable connecting the computer .66 to the cable ‘192.168.10.48/28’ is labeled ‘.49’. Another cable labeled ‘192.168.10.32/28’ is connected to two computers labeled ‘.45’ and ‘.35’ directly below it and is connected to the router .74 via a cable labeled ‘.33’. The area below these computers is labeled ‘12 Hosts’. A lightning bolt symbol connects the routers .73 and .74 and is labeled ‘192.168.10.72/30, 2 Hosts’.

It is good to provide only the number of hosts needed on each router interface, meaning VLSMs. Remember that if a "classful routed network" requires that all subnet masks be the same length, then it follows that a "classless routed network" would allow us to use VLSMs.
So, if we use a /30 on our WAN links and a /27, /28, and /29 on our LANs, we’ll get 2 hosts per WAN interface and 30, 14, and 6 hosts per LAN interface. This solution provides just the right number of hosts on each LAN, so we still have room to add more WANs and LANs using this same network.

Remember, in order to implement a VLSM design on your network, you need to have a routing protocol that sends subnet mask information with the route updates. This would be RIPv2, EIGRP, or OSPF. RIPv1 and IGRP will not work in classless networks and are considered classful routing protocols.

big idea
By using a VLSM design, you do not necessarily make your network run better, but you can save a lot of IP addresses.

Now, what’s a discontiguous network? It is one that has two or more subnetworks of a classful network connected together by different classful networks. The diagram below displays a typical discontiguous network.

A desktop on the left is labeled ‘Host_A’, which has the I P address 172.16.10.2/24. Host_A connects via a cable to a router labeled ‘Lab_A’ with the router interface E0: 172.16.10.1/24. Lab_A with the interface ‘S0/0 10.3.1.1/24’ connects to another router on the right labeled ‘Lab_B’ via a lightning bolt symbol. Lab_B has the interface ‘S0/0 10.3.1.2/24’, and it connects via a cable to another desktop labeled ‘Host_B’ with the I P address 172.16.20.2/24, using the router interface E0: 172.16.20.1/24. 172.16.10.0/24 is mentioned near the cable connecting Host_A and the router Lab_A, and 172.16.20.0/24 is mentioned near the cable connecting Host_B and the router Lab_B. 10.3.1.0/24 is mentioned above the lightning bolt symbol.

The subnets 172.16.10.0 and 172.16.20.0 are connected together with a 10.3.1.0 network. By default, each router thinks it has the only 172.16.0.0 classful network.
It’s important to understand that discontiguous networks just won’t work with RIPv1 at all. They don’t work by default on RIPv2 or EIGRP either, but discontiguous networks do work on OSPF networks by default because OSPF does not auto-summarize like RIPv2 and EIGRP.

terms to know
Variable-Length Subnet Masks (VLSMs)
Allows the specification of arbitrary-length subnet masks.
Discontiguous Network
A network that has two or more subnetworks of a classful network connected together by different classful networks.

summary
In this lesson, you learned about distance-vector routing protocols, including Routing Information Protocol (RIP), RIP Version 2 (RIPv2). You were also introduced to the concepts of variable-length subnet masks (VLSM) and discontiguous networks.

Source: This content and supplemental material has been adapted from CompTIA Network+ Study Guide: Exam N10-007, 4th Edition. Source Lammle: CompTIA Network+ Study Guide: Exam N10-007, 4th Edition - Instructor Companion Site (wiley.com)

Terms to Know
Classful Routing

Routers do not send subnet mask information with the route updates.

Classless Routing

Routers send subnet mask information with the route updates.

Convergence

The state of a set of routers that have the same topological information about the internetwork in which they operate.

Discontiguous Network

A network that has two or more subnetworks of a classful network connected together by different classful networks.

Load Balancing

Balancing a workload among multiple computer devices.

Variable-Length Subnet Masks (VLSMs)

Allows the specification of arbitrary-length subnet masks.