Friday , October 11 2024
Home / IP Routing / RIP loop protection

RIP loop protection

I am going to show you how RIP loop protection works. Let’s take the topology from the previous post to demonstrate the features.

RIP topology

There are 2 methods of loop protection: Split Horizon and Poison Reverse.

Split Horizon

It prohibits a router to advertise a route back to neighbors, through the interface that receives the routes. Split Horizon is enabled by default on Huawei routers:

[R1]display rip 1 interface Serial 0/0/0 verbose
Serial0/0/0(192.168.20.1)
State : UP MTU : 500
Metricin : 0
Metricout : 1
Input : Enabled Output : Enabled
Protocol : RIPv2 Multicast
Send version : RIPv2 Multicast Packets
Receive version : RIPv2 Multicast and Broadcast Packets
Poison-reverse : Disabled
Split-Horizon : Enabled
Authentication type : None
Replay Protection : Disabled

Split Horizon is disabled by default on NBMA networks like Frame Relay and X.25.

Let’s look at the RIP routing table of R2 router:

[R2]display rip 1 route 
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.10.2 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
          3.3.3.3/32      192.168.10.2      1    0        RA       8
 Peer 192.168.20.1 on Serial0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
         10.0.3.0/24      192.168.20.1      1    0        RA      17
         10.0.2.0/24      192.168.20.1      1    0        RA      17
         10.0.1.0/24      192.168.20.1      1    0        RA      17
         10.0.0.0/24      192.168.20.1      1    0        RA      17
          1.1.1.1/32      192.168.20.1      1    0        RA      17

2102311GHQ10FC000022

RIP split horizon_2

From the RIP routing table of R2 you can see which networks are advertised by router R1. As Split Horizon prohibits router R2 to advertise the routes back to router R1, so a loop is avoided.

Let’s check what will happen if we disable Split Horizon on router R2:

[R2]interface Serial 0/0/0
[R2-Serial0/0/0]undo rip split-horizon

RIP split horizon_3

RIP split horizon_4

We can see that R1 is still sending the proper routes but a loop has become the fact, because R2 is advertising the received routes back to R1. In this case, R1 believes that network 10.0.0.0 is available through R2 as the next hop:

[R1-GigabitEthernet0/0/1]dis rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.20.2 on Serial0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
     192.168.10.0/24      192.168.20.2      1    0        RA      15
         10.0.0.0/8       192.168.20.2      2    0        RA      15
          3.0.0.0/8       192.168.20.2      2    0        RA      15
          2.0.0.0/8       192.168.20.2      1    0        RA      15
          1.0.0.0/8       192.168.20.2      2    0        RA      15

Let’s check what will happen if we shut down network 10.0.0.0 on R1:

[R1-GigabitEthernet0/0/1]shutdown

Shutdown of the interface causes that Trigger Update function is activated, R1 sends an update immediately and Garbage-collect time starts counting. After 120s network 10.0.0.0 is deleted from RIP database. Trigger Update lets us to shorten time of network convergence from 300s to 120s.

[R1-GigabitEthernet0/0/1]dis rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.20.2 on Serial0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
     192.168.10.0/24      192.168.20.2      1    0        RA       7
          3.0.0.0/8       192.168.20.2      2    0        RA       7
          2.0.0.0/8       192.168.20.2      1    0        RA       7
          1.0.0.0/8       192.168.20.2      2    0        RA       7
         10.0.0.0/8       192.168.20.2     16    0        RG     120
Poison Reverse

It prevents routing loops by setting the metric of a route to 16 (unreachable route) and advertises the route back to neighbors, through the interface that received the routes. By default, Poison Reverse is disable on Huawei router. We can enable it by the command:

[R1]int Serial 0/0/0
[R1-Serial0/0/0]rip poison-reverse

[R2]interface Serial 0/0/0
[R2-Serial0/0/0]rip poison-reverse

We can easily verify it looking into captured packets:

RIP split horizon_5

Notice that, if both Poison Reverse and Split Horizon are enabled, only Poison Reverse takes effect.

Leave a Reply

Your email address will not be published. Required fields are marked *