You are on page 1of 29

CS 341

Dynamic Routing

Routing Information Protocol


(RIP)

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 only uses hop count to determine
the best way to a remote network, but it has a maximum allowable
hop count of 15 by default, meaning that 16 is deemed unreachable.
RIP works well in small networks, but its inefficient on large
networks with slow WAN links or on networks with a large number
of routers installed.
RIP version 1 uses only classful routing, which means that all
devices in the network must use the same subnet mask. This is
because RIP version 1 doesnt send updates with subnet mask
information in tow. RIP version 2 provides something called prefix
routing, and does send subnet mask information with the route

updates. This is called classless routing


RIP Timers

RIP uses three different kinds of timers to regulate its performance:


Route update timer Sets the interval (typically 30 seconds)
between periodic routing updates, in which the router sends a
complete copy of its routing table out to all neighbors.
Route invalid timer Determines the length of time that must elapse
(180 seconds) before a router determines that a route has become
invalid. It will come to this conclusion if it hasnt heard any updates
about a particular route for that period. When that happens, the
router will send out updates to all its neighbors letting them know
that the route is invalid.

Holddown timer This sets the amount of time during which routing
information is suppressed. Routes will enter into the holddown state
when an update packet is received that indicated the route is
unreachable. This continues until either an update packet is received
with a better metric or until the holddown timer expires. The default is
180 seconds.
Route flush timer Sets the time between a route becoming invalid
and its removal from the routing table (240 seconds). Before its
removed from the table, the router notifies its neighbors of that routes
impending demise. The value of the route invalid timer must be less
than that of the route flush timer. This gives the router enough time to
tell its neighbors about the invalid route before the local routing table
is updated.

Configuring RIP Routing

To configure RIP routing, just turn on the protocol with the


router rip command and tell the RIP routing protocol
which networks to advertise. Thats it. Lets configure our
three-router internetwork (shown again in Figure bellow)
with RIP routing and practice that.
Lab_A
RIP has an administrative distance of 120. Static routes
have an administrative distance of 1 by default and, since
you currently have static routes configured, the routing
tables wont be propagated with RIP information. So, the
first thing you need to do is to delete the static routes off
each router. This is done with the no ip route command:

Lab_A(config)#no ip route 192.168.30.0 255.255.255.0 192.168.20.2


Lab_A(config)#no ip route 192.168.40.0 255.255.255.0 192.168.20.2
Lab_A(config)#no ip route 192.168.50.0 255.255.255.0 192.168.20.2

Once the static routes are deleted from the configuration, you
can add the RIP routing protocol by using the router rip
command and the network command. The network command
tells the routing protocol which network to advertise.

Lab_A(config)#router rip
Lab_A(config-router)#network 192.168.10.0
Lab_A(config-router)#network 192.168.20.0
Lab_A(config-router)#^Z

Note the fact that you need to type in every directly


connected network that you want RIP to advertise. But
because theyre not directly connected were going to
leave out networks 30, 40, and 50, its RIPs job to find
them and populate the routing table.Thats it. Two or three
commands, and youre done. However, keep in mind the
extra router CPU process and bandwidth that youre
consuming.

Lab_B
To configure RIP on the Lab_B router, you need to remove the
two static routes you added from the earlier example. Once you
make sure no routes are in the routing table with a better
administrative distance than 120, you can add RIP. The Lab_B
router has three directly connected networks and we want RIP to
advertise them all, so we will add three network statements.
Again, if you dont remove the static routes, RIP routes will never
be found in the routing table even though RIP will still be running
in the background causing a bunch of CPU processing on the
routers and gobbling up precious bandwidth.

Lab_B#config t
Enter configuration commands, one per line. End with CNTL/Z.
Lab_B(config)#no ip route 192.168.10.0 255.255.255.0 192.168.20.1
Lab_B(config)#no ip route 192.168.50.0 255.255.255.0 192.168.40.2
Lab_B(config)#router rip
Lab_B(config-router)#network 192.168.20.0
Lab_B(config-router)#network 192.168.30.0
Lab_B(config-router)#network 192.168.40.0
Lab_B(config-router)#^Z

Lab_C
Weve already removed the static routes on the Lab_C router
because we placed a default route on it. So all thats needed
here is to remove the default route from the Lab_C router.
Once its dust, you can turn on RIP routing for the two
directly connected routes.

Lab_C#config t
Enter configuration commands, one per line. End with CNTL/Z.
Lab_C(config)#no ip route 0.0.0.0 0.0.0.0 192.168.40.1
Lab_C(config)#router rip
Lab_C(config-router)#network 192.168.40.0
Lab_C(config-router)#network 192.168.50.0
Lab_C(config-router)#^Z
Lab_C#

Verifying the RIP Routing


Tables

Each routing table should now have the routers directly


connected routes as well as RIP injected routes received from
neighboring routers.

Lab_A#sh ip route

[output cut]

R 192.168.50.0 [120/2] via 192.168.20.2, 00:00:23, Serial0/0


R 192.168.40.0 [120/1] via 192.168.20.2, 00:00:23, Serial0/0
R 192.168.30.0 [120/1] via 192.168.20.2, 00:00:23, Serial0/0
C 192.168.20.0 is directly connected, Serial0/0
C 192.168.10.0 is directly connected, FastEthernet0/0

Looking at this, you can see that the routing table has the same
entries that they had when we were using static routes, except for
that R. The R means that the networks were added dynamically
using the RIP routing protocol. The [120/1] is the administrative
distance of the route (120) along with the number of hops to that

remote network (1).

Lab B

Lab_B#sh ip route

[output cut]
R 192.168.50.0 [120/1] via 172.16.40.2, 00:00:11, Serial0/1
C 192.168.40.0 is directly connected, Serial0/1
C 192.168.30.0 is directly connected, FastEthernet0/0
C 192.168.20.0 is directly connected, Serial0/0
R 192.168.10.0 [120/1] via 172.16.20.1, 00:00:21, Serial0/0
Lab_B#

Notice that here again the same networks are in the routing
table and they werent added manually.

So while yes, its true that RIP has worked really well in our little
internetwork, its not the solution for every enterprise. Thats
because this technique has a maximum hop count of only 15 (16 is
deemed unreachable) and it performs full routing-table updates
every 30 seconds, both
things that can wreak havoc in a larger internetwork.
Note one thing about RIP routing tables and the parameters used
to advertise remote networks. Notice, as an example, that the
following routing table shows [120/15] in the 192.168.10.0
network metric. This means that the administrative distance is
120, the default for RIP, but the hop count is 15. Remember that
each time a router sends out an update to a neighbor router, it
increments the hop count by one for each route

Lab_C#sh ip route

[output cut]

Gateway of last resort is not set


C 192.168.50.0 is directly connected, FastEthernet0/0
C 192.168.40.0 is directly connected, Serial0/0
R 192.168.30.0 [120/1] via 192.168.40.1, 00:00:04, Serial0/0
R 192.168.20.0 [120/1] via 192.168.40.1, 00:00:26, Serial0/
R 192.168.10.0 [120/15] via 192.168.40.1, 00:00:04, Serial0/0
Lab_C#

So this [120/15] is really bad because the next router that


receives the table from router Lab_C will just discard the
route to network 192.168.10.0, since the hop count would
then be 16, which is invalid.

Holding Down RIP


Propagations

You probably dont want your RIP network advertised everywhere


on your LAN and WAN.
There are a few different ways to stop unwanted RIP updates from
propagating across your LANs and WANs. The easiest one is
through the passive-interface command. This command prevents
RIP update broadcasts from being sent out a defined interface, but
that same interface can still receive RIP updates.
Heres an example of how to configure a passive-interface
on a router:
Lab_A#config t
Lab_A(config)#router rip
Lab_A(config-router)#network 192.168.10.0
Lab_A(config-router)#passive-interface serial 0/0

This command will stop RIP updates from being ropagated


out serial interface 0, but serial interface 0 can still receive
RIP updates.

RIP Version 2 (RIPv2)

RIP version 2 is mostly the same as RIP version 1. Both


RIPv1 and RIPv2 are distance-vector protocols, which
means that each router running RIP sends its complete
routing tables out all active interfaces at periodic time
intervals. Also, the timers and loop-avoidance schemes are
the same in both RIP versionsi.e., holddown timers and
split horizon rule. Both RIPv1 and RIPv2 are configured as
classful addressing, (but RIPv2 is considered classless
because subnet information is sent with each route update),
and both have the same administrative distance (120).

RIPv2, unlike RIPv1, is a classless routing protocol (even


though it is configured as classful, like RIPv1), which
means that it sends subnet mask information along with the
route updates. By sending the subnet mask information
with the updates, RIPv2 can support Variable Length
Subnet Masks (VLSMs) as well as the summarization of
network boundaries. In addition,
RIPv2 can support discontiguous networking.
Table bellow shows some differences between RIPv1 and
RIP v2

M
Lab_C(config)#router rip
Lab_C(config-router)#network 192.168.40.0
Lab_C(config-router)#network 192.168.50.0
Lab_C(config-router)#version 2

Thats it; just add the command version 2 under the


(config-router)# prompt and you are now running RIPv2.

Interior Gateway Routing


Protocol (IGRP)

Interior Gateway Routing Protocol (IGRP) is a Cisco-proprietary


distance-vector routing protocol. This means that to use IGRP in
your network, all your routers must be Cisco routers. Cisco
created this routing protocol to overcome the problems associated
with RIP. IGRP has a maximum hop count of 255 with a default
of 100. This is helpful in larger networks and solves the problem
of 15 hops being the maximum possible in a RIP network.
IGRP also uses a different metric than RIP. IGRP uses bandwidth
and delay of the line by default as a metric for determining the
best route to an internetwork. This is called a composite metric.
Reliability, load, and maximum transmission unit (MTU) can also
be used, although they are not used by default.

Comparing IGRP and RIP

IGRP Timers

To control performance, IGRP includes the following


timers with default settings:
Update timers These specify how frequently routingupdate messages should be sent. The
default is 90 seconds.
Invalid timers These specify how long a router should wait
before declaring a route invalid if it doesnt receive a
specific update about it. The default is three times the
update period.
Holddown timers These specify the holddown period. The
default is three times the update timer period plus 10
seconds.

Flush timers These indicate how much time should pass


before a route should be flushed from the routing table.
The default is seven times the routing update period. If the
update timer is 90 seconds by default, then 7 90 = 630
seconds elapse before a route will be flushed from the
route table.

Configuring IGRP Routing

The command used to configure IGRP is the same as the one


used to configure RIP routing with one important difference: you
use an autonomous system (AS) number. All routers within an
autonomous system must use the same AS number, or they wont
communicate with routing
information. Heres how to turn on IGRP routing:
Lab_A#config t
Lab_A(config)#router igrp 10
Lab_A(config-router)#network 192.168.10.0

Notice that the configuration in the above router commands is as


simple as in RIP routing except that IGRP uses an AS number.
This number advertises only to the specific routers you want to
share routing information with

IGRP can load-balance up to six unequal links. RIP


networks must have the same hop count to load-balance,
whereas IGRP uses bandwidth to determine how to loadbalance.
Configuring IGRP is pretty straightforward and not much
different from configuring RIP. You do need to decide on
an AS number before you configure your routers.
Remember that all routers in your internetwork must use the
same AS number if you want them to share routing
information.
Exercise:In the sample internetwork weve been using
throughout before, use AS 10 to configure the routers

Verifying the IGRP


Routing Tables

Once the routers are configured, you need to verify the


configuration with the show ip route command.
In all of the following router outputs, notice that the only
routes to networks are either directly connected or IGRPinjected routes. Since we didnt turn off RIP, its still
running in the background and taking up both router CPU
cycles and bandwidth. Whats more, the routing
tables will never use a RIP-found route because IGRP has
a better administrative distance than RIP does.
The router output below is from the Lab_A router. Notice
that all routes are in the routing table.

Lab_A#sh ip route

[output cut]

I 192.168.50.0 [100/170420] via 192.168.20.2, Serial0/0


I 192.168.40.0 [100/160260] via 192.168.20.2, Serial0/0
I 192.168.30.0 [100/158360] via 192.168.20.2, Serial0/0
C 192.168.20.0 is directly connected Serial0/0
C 192.168.10.0 is directly connected, FastEthernet0/0

The I means IGRP-injected routes. The 100 in


[100/160360] is the administrative distance of IGRP. The
160,360 is the composite metric. The lower the composite
metric, the better the route.
Run show ip route for all Labs and see what has
changed.

You might also like