RIP

This chapter provides information about configuring the Routing Information Protocol (RIP).

RIP overview

RIP is an interior gateway protocol (IGP) that uses a distance-vector (Bellman-Ford) algorithm to determine the best route to a destination. The algorithm advertises network reachability by advertising prefix/mask and the metric (also known as hop count or cost). RIP selects the route with the lowest metric as the best route. In order for the protocol to provide complete information about routing, every router in the domain must participate in the protocol.

RIP is a routing protocol based on a distance vector (Bellman-Ford) algorithm, which advertises network reachability by advertising prefix/mask and the metric (also known as hop count or cost). RIP selects the route with the lowest metric as the best route. RIP differs from link-state database protocols, such as OSPF and IS-IS, in that RIP advertises reachability information directly and link-state-database-based protocols advertise topology information. Each node is responsible for calculating the reachability information from the topology.

The router software supports RIPv1 and RIPv2. RIPv1, specified in RFC 1058, was written and implemented before the introduction of classless interdomain routing (CIDR). It assumes the netmask information for non-local routes, based on the class the route belongs to:

  • class A

    8 bit mask

  • class B

    16 bit mask

  • class C

    24 bit mask

RIPv2 was written after CIDR was developed and transmits netmask information with every route. Because of the support for CIDR routes and other enhancements in RIPv2 such as triggered updates, multicast advertisements, and authentication, most production networks use RIPv2. However, some older systems (hosts and routers) only support RIPv1, especially when RIP is used simply to advertise default routing information.

RIP is supported on all IP interfaces, including both network and access interfaces.

RIP features

RIP, a UDP-based protocol, updates its neighbors, and the neighbors update their neighbors, and so on. Each RIP host has a routing process that sends and receives datagrams on UDP port number 520.

Each RIP router advertises all RIP routes periodically via RIP updates. Each update can contain a maximum of 25 route advertisements. This limit is imposed by RIP specifications. RIP can sometimes be configured to send as many as 255 routes per update. The formats of the RIPv1 and RIPv2 updates are slightly different and are shown below. Additionally, RIPv1 updates are sent to a broadcast address, RIPv2 updates can be either sent to a broadcast or multicast address (224.0.0.9). RIPv2 supports subnet masks, a feature that was not available in RIPv1.

A network address of 0.0.0.0 is considered a default route. A default route is used when it is not convenient to list every possible network in the RIP updates, and when one or more closely-connected gateways in the system are prepared to handle traffic to the networks that are not listed explicitly. These gateways create RIP entries for the address 0.0.0.0, as if it were a network to which they are connected.

RIP version types

SR OS allows the user to specify the RIP version that is sent to RIP neighbors and RIP updates that are accepted and processed. The following combinations are allowed:

  • Send only RIPv1 or send only RIPv2 to either the broadcast or multicast address or send no messages.

    The default sends RIPv2 formatted messages to the broadcast address.

  • Receive only RIPv1, receive only RIPv2, or receive both RIPv1 and RIPv2, or receive none.

    The default receives both.

RIPv2 authentication

RIPv2 messages carry more information, which allows the use of a simple authentication mechanism to secure table updates. The router implementation enables the use of a simple password (plain text) or message digest (MD5) authentication.

RIP packet format

The RIP packet format is displayed in RIP packet format.

Figure 1. RIP packet format

A RIP packet consists of the following fields:

  • Command

    This field indicates whether the packet is a request or a response message. The request asks the responding system to send all or part of its routing table. The response may be sent in response to a request, or it may be an unsolicited routing update generated by the sender.

  • Version

    This field indicates the RIP version used. This field can signal different potentially incompatible versions.

  • Must be zero

    Not used in RIPv1. This field provides backward compatibility with pre-standard varieties of RIP. The default value is zero.

  • Address family identifier (AFI)

    This field indicates the type of address. RIP can carry routing information for several different protocols. Each entry in this field has an AFI to indicate the type of address being specified. The IP AFI is 2.

  • Address

    This field indicates the IP address for the packet.

  • Metric

    This field specifies the number of hops to the destination.

  • Mask

    This field specifies the IP address mask.

  • Next hop

    This field specifies the IP address of the next router along the path to the destination.

RIPv1 packet format

There can be between 1 and 25 (inclusive) RIP entries. RIPv1 packet format displays RIPv1 packet format.

Figure 2. RIPv1 packet format
RIPv2 packet format

The RIP packet format is displayed in RIPv2 packet format.

Figure 3. RIPv2 packet format

The RIPv2 packets include the following fields:

  • Subnet Mask

    The subnet mask for the entry. If this field is zero, no subnet mask has been specified for the entry.

  • Nexthop

    The IP address of the next hop to forward packets.

BFD monitoring of RIP neighbor liveliness

BFD can be used to monitor the liveliness of the RIP neighbors. If a BFD session, associated with a RIP neighbor fails, that RIP neighbor is declared down and all routes learned from that RIP neighbor are withdrawn from the associated route tables.

BFD is enabled for RIP by configuring the enable-bfd command within the RIP neighbor configuration context.

BFD must be also be enabled on the interface associated with the RIP neighbor. The bfd command sets the necessary transmit and receive intervals, as well as sets the optional multiplier.

RIPng

RIPng is the IPv6 form of the interior gateway protocol (IGP) Routing Information Protocol (RIP), originally implemented for IPv4 routing. This protocol is a distance vector routing protocol that periodically advertises IPv6 routing information to neighbors, typically through the use of UDP based multicast updates carrying a list of one or more entries, each containing an IPv6 prefix, prefix length, route metric and a possible route tag.

RIPng is supported in the base routing context and also as a PE-CE routing protocol within a VPRN context.

RIPng protocol

RIPng packets are sent using the UDP protocol and the protocol port number 521. Unsolicited updates messages are sent with 521 as both the source and destination port.

  • Source IP address

    The Link-Local IPv6 address of the interface sending the RIPng packet is used as the source IP address of any RIPng update sent.

  • Destination IP address

    The destination IP for any periodic or triggered update should be sent to the multicast group FF02::9, (all-rip-routers multicast group). When sending responses to an RIPng request, the RIPng response is sent to the unicast IP address of the requester.

Each route entry in an update message contains the following:

  • IPv6 prefix

  • prefix length

  • route metric

  • route tag (optional)

Common attributes

The following sections provide information about common RIP attributes.

Metrics

By default, RIP advertises all RIP routes to each peer every 30 seconds. RIP uses a hop count metric to determine the distance between the packet’s source and destination. The metric/cost values for a valid route is 1 through 15. A metric value of 16 (infinity) indicates that the route is no longer valid and should be removed from the router’s routing table.

Each router along the path increments the hop count value by 1. When a router receives a routing update with new or different destination information, the metric increments by one.

The maximum number of hops in a path is 15. If a router receives a routing update with a metric of 15 and contains a new or modified entry, increasing the metric value by one will cause the metric increment to 16 (infinity). Then, the destination is considered unreachable.

The router implementation of RIP uses split horizon with poison reverse to protect from such problems as ‟counting to infinity”. Split horizon with poison reverse means that routes learned from a neighbor through a specified interface are advertised in updates out of the same interface but with a metric of 16 (infinity).

Timers

RIP uses the following timers to determine the frequency of RIP updates and the duration that routes are maintained.

  • update

    Times the interval between periodic routing updates.

  • timeout

    This timer is initialized when a route is established and any time an update message is received for the route. When this timer expires, the route is no longer valid. It is retained in the table for a short time, so that neighbors can be notified that the route has been dropped.

  • flush

    When the flush timer expires, the route is removed from the tables.

Import and export policies

Routing policies can control the content of the routing tables, advertised routes, and the best route to reach a destination. Import route policies determine which routes are accepted from RIP neighbors. Export route policies determine which routes are exported from the route table to RIP. By default, RIP does not export learned routes to its neighbors.

There are no default routing policies. A policy must be created explicitly and applied to a RIP import or export command.

Hierarchical levels

The minimum RIP configuration must define one group and one neighbor. For more information about RIP hierarchy levels, see Basic RIP configuration.

Configuration notes

This section describes RIP configuration restrictions.

General

Before RIP neighbor parameters can be configured, router interfaces must be configured.

RIP must be explicitly created for each router interface. There are no default RIP instances on a router.

Configuring RIP with CLI

This section provides information to configure Routing Information Protocol (RIP) using the command line interface.

RIP and RIPng configuration overview

Preconfiguration requirements

Configure the following entities before beginning the RIP configuration:

Policy statements should be defined in the config>router>policy-options context (optional).

RIP hierarchy

RIP is configured in the config>router>rip context. RIP is not enabled by default.

Three hierarchical levels are included in RIP configurations:

  • global
  • group
  • neighbor

Commands and parameters configured at the global level are inherited by the group and neighbor levels. However, parameters configured at the group and neighbor levels take precedence over global configurations.

Basic RIP configuration

This section provides information to configure RIP and examples of common configuration tasks. For a router to accept RIP updates, in the config>router rip context, you must define at least one group and one neighbor. A router ignores updates received from routers on interfaces not configured for RIP. Configuring other RIP commands and parameters is optional.

By default, the local router imports all routes from this neighbor and does not advertise routes. The router receives both RIPv1 and RIPv2 update messages with 25 to 255 route entries per message.

The RIP configuration commands have three primary configuration levels:

  • rip for RIP global configurations
  • group group-name for RIP group configurations
  • neighbor ip-int-name for RIP neighbor configurations

Within these levels, the RIP configuration commands are identical. For repeated commands, the value most specific to the neighboring router is used. Therefore, a RIP group-specific command takes precedence over a global RIP command. A neighbor-specific configuration statement takes precedence over a global RIP and group-specific command. For example, if the user modifies a RIP neighbor-level command default, the new value takes precedence over group- and global-level settings.

At a minimum, the group- and neighbor-level RIP parameters must be configured in the config>router rip context.

The following example displays a basic RIP configuration:

ALA-A>config>router>rip# info
----------------------------------------------
group "RIP-ALA-A"
                neighbor "to-ALA-4"
                exit
exit
----------------------------------------------
ALA-A>config>router>rip#

Common configuration tasks

This section provides an overview of RIP configuration tasks and the CLI commands.

Configure RIP hierarchically using the global level (applies to all peers), the group level (applies to all peers in peer-group), or the neighbor level (only applies to the specified interface). By default, group members inherit the group’s configuration parameters; however, a parameter can be modified on a per-member basis without affecting the group-level parameters. For more information about the hierarchy of RIP configuration levels, see RIP hierarchy and Basic RIP configuration.

The user must explicitly create all RIP instances on each device. After the instances are created, RIP is administratively enabled.

To configure RIP, perform the following steps:

  1. Configure the interfaces.
  2. Optionally configure the policy statements.
  3. Enable the RIP.
  4. Configure the group parameters.
  5. Configure the neighbor parameters.

Configuring interfaces

The following command sequences create a logical IP interface. The logical interface can associate attributes like an IP address, port, Link Aggregation Group (LAG), or the system. For more information about configuring interfaces, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR Interface Configuration Guide.

The CLI syntax, to configure a network interface is shown below.

CLI syntax

config router
  interface ip-int-name
    address ip-addr{/mask-length | mask} [broadcast
       {all-ones | host-ones}]
    port port-id

The following example displays router interface configuration command usage.

Example

config>router> interface “to-ALA-4”
config>router>if$ address 10.10.12.1/24
config>router>if# port 1/1/1
config>router>if# exit

The following example displays the IP configuration output showing the interface information.

ALA-3>config>router# info
#------------------------------------------
echo "IP Configuration "
#------------------------------------------
        interface "system"
            address 10.10.10.103/32
        exit
        interface "to-ALA-4"
            address 10.10.12.1/24
            port 1/1/1
        exit
#------------------------------------------
ALA-3>config>router#

Configuring a route policy

Use the import route policy to filter routes imported by the local router from its neighbors. If no match is found, the local router does not import any routes.

Use the export route policy to determine which routes are exported from the route table to RIP. By default, RIP does not export learned routes to its neighbors. If no export policy is specified, non-RIP routes are not exported from the routing table manager to RIP.

If multiple policy names are specified, the policies are evaluated in the order they are specified. The first policy that matches is applied. If multiple export commands are issued, the last command entered overrides the previous command. A maximum of five policy names can be specified.

This section only provides brief instructions to configure route policies. For more details, see the Route policy configuration overview chapter.

To enter the mode to create or edit route policies, you must enter the begin keyword at the config>router>policy-options prompt. Other editing commands include:

  • the commit command saves and enables changes made to route policies during a session

  • the abort command discards changes that have been made to route policies during a session

Use the following CLI syntax to configure a policy to use for the RIP global, group, and neighbor import and export commands.

CLI syntax

config>router>policy-options
  begin
  commit
  abort
  policy-statement name
    description text
    default-action {accept|next-entry|nextpolicy|drop|reject}
    entry entry-id
      description text
      action {accept|next-entry|nextpolicy|drop|reject}
       from
       to

Use the following CLI syntax to enter the edit mode:

CLI syntax

config>router>policy-options
  begin

The following example displays some commands to configure a policy statement. Policy option commands are configured in the config>router context. Use the commit command to save the changes.

Example

config>router>policy-options# begin
policy-options# policy-statement “RIP policy”
policy-options>policy-statement$ description "this is a test RIP policy”
policy-options>policy-statement>default# entry 1
policy-options>policy-statement>entry$ action accept
policy-options>policy-statement>entry# exit
policy-options>policy-statement# default-action reject
policy-options>policy-statement# exit
policy-options# commit
ALA-A>config>router>policy-options# info
----------------------------------------------
policy-statement "RIP-policy"
description "this is a test RIP policy"
entry 1
action accept
exit
exit
default-action reject
exit
----------------------------------------------
ALA-A>config>router>policy-options>policy-statement#

Configuring RIP parameters

Use the CLI syntax described in this section to configure RIP parameters at the global, group, and neighbor level.

CLI syntax

config>router
  rip
  authentication-key [authentication-key | hash-key [hash|hash2|custom]
  authentication-type {none | password | message-digest | message-digest-20}
  check-zero {enable | disable}
  description string
  export policy-name [policy-name ...up to 5 max]
  import policy-name [policy-name ...up to 5 max]
  message-size number 
  metric-in metric
  metric-out metric
  preference number
  receive {both | none | version-1 | version-2}
  send {broadcast | multicast | none | version-1 | both}
  no shutdown
  split-horizon {enable | disable}
  timers update timeout flush 

  group group-name 
    authentication-key [authentication-key | hash-key [hash | hash2| custom]
    authentication-type {none | password | message-digest | message-digest-20}
    check-zero {enable | disable}
    description string
    export policy-name [policy-name ...up to 5 max]]
    import policy-name [policy-name ...up to 5 max]]
    message-size number 
    metric-in metric
    metric-out metric
    preference number
    receive {both | none | version-1 | version-2}
    send {broadcast | multicast | none | version-1}
    no shutdown
    split-horizon {enable | disable}
    timers update timeout flush

    neighbor ip-int-name 
      authentication-key [authentication-key | hash-key [hash | hash2| custom]
      authentication-type {none | password | message-digest | message-digest-20}
      check-zero {enable | disable}
      description string
      export policy-name [policy-name ...up to 5 max]]
      import policy-name [policy-name ...up to 5 max]]
      message-size number 
      metric-in metric
      metric-out metric
      preference number
      receive {both | none | version-1 | version-2}
      send {broadcast | multicast | none | version-1}
      split-horizon {enable | disable}
      timers update timeout flush
      no shutdown

Configuring global-level parameters

After the RIP protocol instance is created, the no shutdown command is not required because RIP is administratively enabled upon creation. To enable RIP on a router, at least one group and one neighbor must be configured. There are no default groups or neighbors. Each group and neighbor must be explicitly configured.

Note: Careful planning is essential to implement commands that can affect the behavior of global, group, and neighbor levels. Because the RIP commands are hierarchical, analyze the values that can disable features on a specific level.

Use the following CLI syntax to configure global-level RIP parameters.

CLI syntax

config>router
  rip
    authentication-key [authentication-key | hash-key [hash | hash2| custom]
    authentication-type {password | message-digest}
    check-zero {enable | disable}
    export policy-name [policy-name ...up to 5 max]
    import policy-name [policy-name ...up to 5 max]
    message-size number
    metric-in metric
    metric-out metric
    preference number
    receive {both | none | version-1 | version-2}
    send {broadcast | multicast | none | version-1 | both}
    no shutdown
    split-horizon {enable | disable}
    timers update timeout flush

The following example displays global RIP configuration command usage.

Example

config>router# rip
config>router>rip# authentication-type password
config>router>rip# authentication-key test123
config>router>rip# receive both
config>router>rip# split-horizon enable
config>router>rip# timers 300 600 600
config>router>rip>group# exit

The following example displays the RIP group configuration:

ALA-A>config>router>rip# info
----------------------------------------------
            authentication-type simple
            authentication-key "ac1865lvz1d" hash
            timers 300 600 600
----------------------------------------------
ALA-A>config>router>rip#

Configuring group-level parameters

A group is a collection of related RIP peers. The group name should be a descriptive name for the group. Follow your group, name, and ID naming conventions for consistency and to help when troubleshooting faults.

All parameters configured for a group are applied to the group and are inherited by each peer (neighbor), but a group parameter can be overridden on a specific neighbor-level basis. Use the following CLI syntax to configure a group.

CLI syntax

config>router# rip
  group group-name
    authentication-key[authentication-key|hash-key [hash|hash2|custom]
    authentication-type {password|message-digest}
    check-zero {enable|disable}
    description string
    export policy-name [policy-name …]
    import policy-name [policy-name …]
    message-size number
    metric-in metric
    metric-out metric
    preference number
    receive {both|none|version-1|version-2}
      send {broadcast|multicast|none|version-1|both}
      no shutdown
      split-horizon {enable|disable}
      timers update timeout flush

The following example displays group configuration command usage.

Example

config>router# rip
config>router>rip# group headquarters
config>router>rip>group$ description "Mt. View"
config>router>rip>group# no shutdown

The following example displays the RIP group configuration:

ALA-A>config>router>rip# info
----------------------------------------------
            authentication-type simple
            authentication-key "ac1865lvz1d" hash
            timers 300 600 600
            group "headquarters"
                description "Mt. View"
            exit
----------------------------------------------
ALA-A>config>router>rip#

Configuring neighbor-level parameters

After you create a group name and assign options, add neighbor interfaces within the same group. All parameters configured for the peer group level are applied to each neighbor, but a group parameter can be overridden on a specific neighbor basis.

Use the following CLI syntax to add a neighbor to a group and define options that override the same group-level command value.

CLI syntax

config>router# rip
  group group-name
    neighbor ip-int-name
      authentication-key [authentication-key|hash-key [hash|hash2|custom]
      authentication-type {password|message-digest}
      check-zero {enable|disable}
      description string
      export policy-name [policy-name …]
      import policy-name [policy-name …]
      message-size number
      metric-in metric
      metric-out metric
      preference number
      receive {both|none|version-1|version-2}
      send {broadcast|multicast|none|version-1}
      split-horizon {enable|disable}
      timers update timeout flush
      no shutdown

The following example displays neighbor configuration command usage.

Example

config>router# rip
config>router>rip# group headquarters1
config>router>rip>group# neighbor ferguson-274
config>router>rip>group>neighbor$ preference 255
config>router>rip>group>neighbor# send both
config>router>rip>group>neighbor# split-horizon enable
config>router>rip>group>neighbor# message-size 255

The following example displays the neighbor configured in group ‟headquarters”.

ALA-A>config>router>rip>group>neighbor# info
----------------------------------------------
                    message-size 255
                    preference 255
                    split-horizon enable
                    no timers
----------------------------------------------
ALA-A>config>router>rip>group>neighbor#

RIP configuration management tasks

This section provides information about RIP configuration management tasks.

Modifying RIP parameters

Modify, add or remove RIP parameters in the CLI. The changes are applied immediately. For the complete list of CLI commands, see the Configuring RIP parameters.

CLI syntax

config>router# rip
   group group-name
   ...
     neighbor ip-int-name
   ...

Example

config>router>rip# group "headquarters"
config>router>rip>group# neighbor "ferguson-274"
config>router>rip>group>neighbor# import RIPpolicy
config>router>rip>group>neighbor# message-size 150

The following example displays the updated parameters:

ALA-A>config>router>rip# info
----------------------------------------------
            authentication-type simple
            authentication-key "ac1865lvz1d" hash
            timers 300 600 600
            group "headquarters"
                description "Mt. View"
                neighbor "ferguson-274"
                    import "RIPpolicy"
                    message-size 150
                    preference 255
                    split-horizon enable
                    no timers
                exit
            exit
----------------------------------------------
ALA-A>config>router>rip#

Deleting a group

A group must be shut down before it can be deleted.

Use the following CLI syntax to shut down and then delete a group.

config>router# rip
  [no] group group-name
  shutdown

Command usage to shut down and delete a group

config>router# rip
config>router>rip# group "RIP-ALA-3"
config>router>rip>group# shutdown
config>router>rip>group# exit
config>router>rip# no group "RIP-ALA-33"

Deleting the group without first shutting it down displays the following message.

INFO: RIP #1204 group should be administratively down - virtual router index 1,group
RIP-ALA-4 

Deleting a neighbor

The neighbor must be shut down before it can be deleted.

Use the following CLI syntax to delete a neighbor.

CLI syntax

config>router# rip
  [no] group group-name
    [no] neighbor ip-int-name
    shutdown

Example

config>router# rip
config>router>rip# group "RIP-ALA-4"
config>router>rip>group# neighbor "to-ALA-3"
config>router>rip>group>neighbor# shutdown
config>router>rip>group>neighbor# exit
config>router>rip>group# no neighbor "to-ALA-3"

Deleting the neighbor without first shutting it down causes the following message to appear:

INFO: RIP #1101 neighbor should be administratively down - virtual router index