RIP features examples

Split-horizon example

../../../../_images/ripv2-split-horizon.png

2 - RIP v2 split-horizon

To enable RIP and to demonstrate the split-horizon feature, we will use this Figure 2 - RIP v2 split-horizon.

  1. Announce the different networks:

    In our example we assume that rt1 is announcing 10.1.1.0/28 network.

    rt1{conf:myconfig-rtg-rip}network 10.1.1.0/28
    

    You can also announce a network by typing the name of the interface to which it belongs, for example for announcing 192.168.1.0/24 network you can use the network command with the name of the interface.

    rt1{conf:myconfig-rtg-rip}network eth0_0
    
    rt1{conf:myconfig-rtg-rip}exit
    [...]
    

    Note

    When announcing an interface in the network statement, you announce all the networks to which this interface is attached.

  2. Exit the configuration and check the configuration:

    rt1{conf:myconfig-rtg}display
    [...]
    router rip
    network 10.1.1.0/28
    network eth0_0
    [...]
    
  3. Show routing information:

    Now RIP is running and RIP does not announce the learnt prefixes on the interfaces from which they were learnt. This is the default behavior of Turbo IPsec.

    Example

    For example, rt1’s RIP RIB is:

    rt1{}show routing ip rip
    
    Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
           D - DEP
    Sub-codes:
          (n) - normal, (s) - static, (d) - default, (r) - redistribute,
          (i) - interface
    
          Network         Next Hop  Metric  From      Tag  Time
    C(i)  10.1.1.0/28     0.0.0.0        1  self        0
    C(i)  192.168.1.0/24  0.0.0.0        1  self        0
    R(n)  192.168.2.0/24  10.1.1.2       2  10.1.1.2    0  02:40
    R(n)  192.168.3.0/24  10.1.1.3       2  10.1.1.3    0  02:53
    

By default, with this previous configuration, rt1 does not announce 192.168.2.0/24, neither 192.168.3.0/24 on the eth1_0 interface due to the split-horizon feature. When split-horizon is disabled, they are announced.

Next-hop option example

When sending a RIP message, the router will if necessary add a next-hop option to the routes it advertises. This option indicates the gateway via which the router can reach the advertised destinations. It enables the routers that receive the RIP message to create local shortcuts.

If the next-hop option is not set, then the router that originated the RIP packet is used as the next-hop.

Example

For example, if rt3 has a static route to the network 172.16.1.0/24 via a gateway - 10.1.1.4 - on the eth1_0 interface, rt2 and rt1 know that they can directly reach this gateway without sending packets to rt3, so they conclude that there is a shorter route to network 172.16.1.0/24 via the 10.1.1.4 gateway.

../../../../_images/next-hop-feature.png

Next-hop feature

Assuming the following configuration:

rt1

router rip
network 10.1.1.0/28
network 192.168.1.0/24
[...]

rt2

router rip
network 10.1.1.0/28
network 192.168.2.0/24
[...]

rt3

router rip
network 10.1.1.0/28
network 192.168.3.0/24
[...]

It leads to the following IPv4 FIB:

rt3{}show routing ip route
Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
       D - DEP
Sub-codes:
(n) - normal, (s) - static, (d) - default, (r) - redistribute,
(i) - interface

     Network          Next Hop  Metric  From    Tag  Time
C(i) 10.1.1.0/28      0.0.0.0        1  self      0
S(r) 172.16.1.0/24    10.1.1.4       1  self      0
R(n) 192.168.1.0/24   10.1.1.1       2  10.1.1.1  0  02:39
R(n) 192.168.2.0/24   10.1.1.2       2  10.1.1.2  0  02:20
C(i) 192.168.3.0/24   0.0.0.0        1  self      0

While on rt2 we have:

rt2{}show routing ip rip
Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
       D - DEP
Sub-codes:
(n) - normal, (s) - static, (d) - default, (r) - redistribute,
(i) - interface

     Network         Next Hop  Metric  From    Tag  Time
C(i) 10.1.1.0/28     0.0.0.0        1  self      0
R(n) 172.16.1.0/24   10.1.1.4       2  10.1.1.3  0  02:45
R(n) 192.168.1.0/24  10.1.1.1       2  10.1.1.1  0  02:46
C(i) 192.168.2.0/24  0.0.0.0        1  self      0
R(n) 192.168.3.0/24 10.1.1.3        2  10.1.1.3  0  02:45

rt1 and rt2 are using the same next-hop to join the network 172.16.1.0/24 without sending the data to rt3 that originates the route.

Note

When the next-hop is not reachable, the router should use the originator of the RIP packet as the gateway. Then, if this originator is not reachable too, the RIP entry should be ignored. Another router could announce better information.

ECMP example

RIP protocol is compatible with ECMP which allows defining several paths that have the same cost.

Example

rt1{}display conf running rtg
rtg
# IPV4 ROUTES
# IPV6 ROUTES
rtg
# DYNAMIC ROUTING PROTOCOLS
dynamic
#
router rip
network 10.10.10.0/24
network 11.11.11.0/24
network 20.20.20.0/24
rip equal-cost 3
#
exit
rt2{}display conf running rtg
rtg
# IPV4 ROUTES
# IPV6 ROUTES
rtg
# DYNAMIC ROUTING PROTOCOLS
dynamic
#
router rip
network 10.10.10.0/24
network 11.11.11.0/24
network 40.40.40.0/24
rip equal-cost 3
#
exit

Results are displayed as follows:

rt1{}show routing ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       B - BGP, D - Delegated Prefix, > - selected route, >* - FIB route

C>* 10.10.10.0/24 is directly connected, eth1_0
C>* 11.11.11.0/24 is directly connected, eth2_0
R>* 40.40.40.0/24 [120/2] via 10.10.10.2, eth1_0, 00:00:40
 >*                       via 11.11.11.2, eth2_0, 00:00:40
C>* 127.0.0.0/8 is directly connected, lo
rt2{}show routing ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       B - BGP, D - Delegated Prefix, > - selected route, >* - FIB route

C>* 10.10.10.0/24 is directly connected, eth1_0
C>* 11.11.11.0/24 is directly connected, eth2_0
R>* 20.20.20.0/24 [120/2] via 10.10.10.1, eth1_0, 00:00:26
 >*                       via 11.11.11.1, eth2_0, 00:00:26
C>* 40.40.40.0/24 is directly connected, eth0_0
C>* 127.0.0.0/8 is directly connected, lo