INTERNET TEACHING LAB:  COUNT TO INFINITY LAB

OVERVIEW

 

In this lab, we will explore the “count to infinity” problem of distance vector routing protocols such as RIP version 1.  (For background information, read Tanenbaum’s Computer Networks 3rd Edition pages 357 through 359.)  Normally, routers with distance vector routing protocols implement the split horizon algorithm where they will not advertise a network route out an interface to a neighbor from whom the route was learned.  This can help reduce the convergence time, the time it takes the routing tables in each router to reach a steady state.  We will configure the lab network on routers R1, R2, R3, and R4 as shown on the diagram above.  By configuring routers R1, R2, and R3 in a cycle, we will attempt to defeat the split horizon hack and will try to demonstrate the count to infinity problem, the problem where distance vector routing protocols can take a very long time to reach convergence. 

 

Routers R1, R2, and R3 are connected with serial links in the shape of a triangle.  R3 also has a serial link to R4.  R4 has a loopback interface to network 192.168.44.0/24 which we will simply call “network 44”.  This lab network contains five IP networks that will be abbreviated as shown in the following table.

 

IP NETWORK

ABBREVIATION

192.168.12.0/24

12

192.168.13.0/24

13

192.168.23.0/24

23

192.168.34.0/24

34

192.168.44.0/24

44

[IP Networks in this Lab]

 

We will perform the following experiment:

 

1.                  Configure the network as in the above diagram with RIP version 1 protocol and wait for RIP to converge to a steady state.

2.                  Examine the routing tables and verify that each router has a route for networks 12, 13, 23, 34, and 44.  We are especially interested in network 44 on the loopback interface of R4.

3.                  “Break” the connection between R3 and R4 by installing an access list on R3’s Serial1/4 interface that blocks RIP traffic received R4.

4.                  Examine the routing announcements on R1, R2, and R3 and watch how their routing tables change the R3---R4 connection is “broken.”  Pay particular attention to network 44 which is no longer reachable but this will not be immediately known to router R3.  We expect the routing metric on routers R1, R2, and R3 for network 44 to gradually increase, by one hop at a time, until a hop count of 16 or RIP infinity is reached.

 

 

BACKGROUND

 

The RIP protocol uses four adjustable timers to control its operation.  There is a single UPDATE timer and an instance of the INVALID, HOLDDOWN, and FLUSH timers for each entry in the routing table.

 

-                     UPDATE

This timer controls how frequently a router announces routes to its neighbors.  By default, this occurs every 30 seconds.

-                     INVALID

This controls how long after not hearing an update for a route that the route will be declared invalid.  By default, this timer is set to 180 seconds or 3 minutes which represents 6 RIP update cycles.  It is restarted whenever a route is received.

-                     HOLDDOWN

This controls how long after a route has been invalidated  a router will wait before accepting a new route of a higher metric.  This helps reduce the count-to-infinity problem.  By default, this timer is set to 180 seconds or 3 minutes.

-                     FLUSH

This timer controls when a routing table entry is removed.  It restarts every time a route is received and runs concurrently with the INVALID and HOLDDOWN timers.  When the FLUSH timer has expired for a route, the route is removed from the routing table.  The FLUSH timer expires before the HOLDDOWN timer, so HOLDDOWN never runs for its complete cycle.

 

The “show ip protocols” router command displays the current values for the RIP timers, as well as a list of routers from whom RIP announcements have been received:

 

 

r3#show ip protocols

Routing Protocol is "rip"

  Sending updates every 30 seconds, next due in 6 seconds

  Invalid after 180 seconds, hold down 180, flushed after 240

  Outgoing update filter list for all interfaces is not set

  Incoming update filter list for all interfaces is not set

  Redistributing: rip

  Default version control: send version 1, receive any version

    Interface        Send  Recv   Key-chain

    Serial1/1        1     1 2                   

    Serial1/2        1     1 2                   

    Serial1/4        1     1 2                    

  Routing for Networks:

    192.168.13.0

    192.168.23.0

    192.168.34.0

  Routing Information Sources:

    Gateway         Distance      Last Update

    192.168.34.4         120      00:00:03

    192.168.13.1         120      00:00:16

    192.168.23.2         120      00:00:04

  Distance: (default is 120)

r3#

 

 

STEP1 – Configure the Network:

 

For this exercise, we will only need to use routers R1, R2, R3, and R4.  Configure these routers by erasing their configurations and pasting the following configuration information into the routers.  Note that the “COMMON” section should be applied to all 4 routers, and the other sections as appropriate.  For more information on router configuration basics, see the “Basic Router Configuration” lab.

 

INITIAL ROUTER CONFIGURATION:


COMMON:

service timestamp debug uptime

enable password cisco

no ip domain-lookup

ip classless

line con 0

 exec-timeout 0 0

line vty 0 4

 password cisco

 login

 

R1:

hostname r1

interface Serial1/2

 description Link to R2 S1/1

 ip address 192.168.12.1 255.255.255.0

 no shutdown

interface Serial1/3

 description Link to R3 S1/1

 ip address 192.168.13.1 255.255.255.0

 no shutdown

router rip

 network 192.168.12.0

 network 192.168.13.0

 

R2:

hostname r2

interface Serial1/1

 description Link to R1 S1/2

 ip address 192.168.12.2 255.255.255.0

 clockrate 2000000

 no shutdown

interface Serial1/3

 description Link to R3 S1/2

 ip address 192.168.23.2 255.255.255.0

 no shutdown

router rip

 network 192.168.12.0

 network 192.168.23.0

 

R3:

hostname r3

interface Serial1/1

 description Link to R1 S1/3

 ip address 192.168.13.3 255.255.255.0

 clockrate 2000000

 no shutdown

interface Serial1/2

 description Link to R2 S1/3

 ip address 192.168.23.3 255.255.255.0

 clockrate 2000000

 no shutdown

interface Serial1/4

 description Link to R4 S1/3

 ip address 192.168.34.3 255.255.255.0

 no shutdown

router rip

 network 192.168.13.0

 network 192.168.23.0

 network 192.168.34.0

 

R4:

hostname r4

interface Loopback0

 ip address 192.168.44.4 255.255.255.0

 no shutdown

interface Serial1/3

 description Link to R3 S1/4

 ip address 192.168.34.4 255.255.255.0

 clockrate 2000000

 no shutdown

router rip

 network 192.168.44.0

 network 192.168.34.0


 

 

STEP2 – Examine Routing Tables:

 

Output from the “show ip route” command on each of the four routers is shown below.  Note that routes for the same 5 networks appear on each router.  For each router, networks that are directly connected prefixed with “C” for Connected while those learned through RIP are prefixed with “R”.   Note that for the RIP entries in the square brackets are the administrative distance (120 for RIP) and the RIP hop count metric which are boldfaced.   You will also notice sometimes where there are more than one entry for the same network.  For example, notice that router R1 has two entries for network 23 both with metric 1.  This is because there are two equal cost paths from R1 to network 23, one via interface Serial1/2 and the other via interface Serial1/3.

 

r1#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

R    192.168.44.0/24 [120/2] via 192.168.13.3, 00:00:20, Serial1/3

R    192.168.34.0/24 [120/1] via 192.168.13.3, 00:00:20, Serial1/3

C    192.168.12.0/24 is directly connected, Serial1/2

C    192.168.13.0/24 is directly connected, Serial1/3

R    192.168.23.0/24 [120/1] via 192.168.13.3, 00:00:20, Serial1/3

                     [120/1] via 192.168.12.2, 00:00:07, Serial1/2

r2#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

R    192.168.44.0/24 [120/2] via 192.168.23.3, 00:00:06, Serial1/3

R    192.168.34.0/24 [120/1] via 192.168.23.3, 00:00:06, Serial1/3

C    192.168.12.0/24 is directly connected, Serial1/1

R    192.168.13.0/24 [120/1] via 192.168.12.1, 00:00:19, Serial1/1

                     [120/1] via 192.168.23.3, 00:00:07, Serial1/3

C    192.168.23.0/24 is directly connected, Serial1/3

r3#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

R    192.168.44.0/24 [120/1] via 192.168.34.4, 00:00:04, Serial1/4

C    192.168.34.0/24 is directly connected, Serial1/4

R    192.168.12.0/24 [120/1] via 192.168.13.1, 00:00:27, Serial1/1

                     [120/1] via 192.168.23.2, 00:00:27, Serial1/2

C    192.168.13.0/24 is directly connected, Serial1/1

C    192.168.23.0/24 is directly connected, Serial1/2

r4#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

C    192.168.44.0/24 is directly connected, Loopback0

C    192.168.34.0/24 is directly connected, Serial1/3

R    192.168.12.0/24 [120/2] via 192.168.34.3, 00:00:20, Serial1/3

R    192.168.13.0/24 [120/1] via 192.168.34.3, 00:00:21, Serial1/3

R    192.168.23.0/24 [120/1] via 192.168.34.3, 00:00:21, Serial1/3

 

 

STEP3 – “BREAK” the R3—R4 Connection:

 

We will now break the connection between R3 and R4 such that R3 will no longer hear advertisements for network 44.  Instead of unplugging the cable where R3 would immediately notice the that connection went down, we will be sneaky and instead install an access list on R3’s interface Serial1/4 input to prevent it from hearing any RIP advertisements.  From router R3’s RIP process perspective, it will not have any indication of any problems except that it will no longer hear advertisements for network 44.

 

!  First turn on debugging so we can see what is happening:

r3# debug ip rip

r3# debug ip rip events

r3# term monitor

! Now create an access list and apply to deny traffic from R4:

r3# config term

r3(config)# no access-list 1

r3(config)# access-list 1 deny any

r3(config)# interface Serial1/4

r3(config-if)# ip access-group 1 in

 

STEP4 – Examine Routing Table and Announcement Changes:

 

Router R3 was reconfigured to filter out all RIP updates from R4 at 23:11:00.  Here are the messages from “debug ip rip” and “debug ip rip events” on R3:

 

(R3 continues to advertise network 44 with metric 2 for about 3 minutes)

23:11:00:      network 192.168.44.0, metric 2

23:11:27:      network 192.168.44.0, metric 2

23:11:56:      network 192.168.44.0, metric 2

23:12:25:      network 192.168.44.0, metric 2

23:12:51:      network 192.168.44.0, metric 2

23:13:18:      network 192.168.44.0, metric 2

23:13:46:      network 192.168.44.0, metric 2

23:14:16:      network 192.168.44.0, metric 16  (advertising unreachable)

23:14:16: RT: flushed route to 192.168.44.0 via 192.168.34.4 (Serial1/4)

23:14:16: RT: no routes to 192.168.44.0, entering holddown

23:15:13: RT: garbage collecting entry for 192.168.44.0 

23:15:13: RIP: sending v1 update to 255.255.255.255 via Serial1/1

23:15:13:      (First update without any route to network 192.168.44.0)

23:15:13:      network 192.168.34.0, metric 1

23:15:13:      network 192.168.23.0, metric 1

23:15:13: RIP: Update contains 2 routes

23:15:13: RIP: Update queued

23:15:14: RIP: Update sent via Serial1/1

 

Here are the debug messages captured on router R1:

 

23:14:16: RIP: received v1 update from 192.168.13.3 on Serial1/3

23:14:16:      192.168.44.0 in 16 hops (inaccessible)

23:14:16: RT: delete route to 192.168.44.0 via

                 192.168.13.3, rip metric [120/2]

23:14:16: RT: no routes to 192.168.44.0, entering holddown

23:17:22: RT: 192.168.44.0 came out of holddown

23:17:56: RT: garbage collecting entry for 192.168.44.0

 

After “breaking” the R3—R4 connection, R3 continues to advertise network 44 to its neighbors with metric 44 every 30 seconds.  About  3 minutes after the “break”, the INVALID timer expires and R3’s entry for network 44 is marked as INVALID. It will still use this route, but will not advertise it as reachable to its neighbors.  R3 network 44 advertisements now have metric 16 or unreachable.   Since R3’s route for network 44 is now in HOLDDOWN, it will not accept any advertisements for this network with a metric greater than 2 preventing it from learning an incorrect route from R1 or R2.  After approximately 4 minutes after the “break”, the FLUSH timer expires and the route indicates “gabage collecting entry for 192.168.44.0”  and the entry to network 44 is completely removed.

 

In this example, routers R1, R2, and R3 marked their routes to network 44 with metric 16 or unreachable after just over 3 minutes after the “break” and converged to a consistent state.  This is much faster than we would have predicted from Tanenbaum.  The CISCO use of the HOLDDOWN timer when a router will not accept routes with a higher metric and the use of a technique called “poison reverse” where a router advertises a network with metric 16 or unreachable help the routing tables converge more quickly than predicted.