6

Dynamic Routing Protocols



6.1    Introduction

When a networking utility needs routing information, it searches the system's routing table. You can set up and manage this table manually (from the command line). However, if the network environment is constantly in flux, the information in a static routing table could quickly become obsolete. To update the routing table dynamically, VxWorks supports RIP (Routing Information Protocol).

RIP comes bundled with VxWorks and is intended for small to medium-sized networks. RIP is a distance-vector protocol, which means that it contains a vector of distances (a hop count). Each router uses these distance-vectors to update its routing tables.



6.2    RIP, Routing Information Protocol

RIP maintains routing information within small internetworks. You can use RIP only in networks where the largest number of hops is 15. Although 15 hops can encompass a very large network, many networks already exceed this limit.1

RIP is based on work done in the Internet community, and its algorithmic base goes back to the ARPANET circa 1969. It is based on the distance-vector algorithm, also called Bellman-Ford, which is described in "Dynamic Programming," from Princeton University by R. E. Bellman. This paper was published in 1957.

The RIP server provided with VxWorks is based on the BSD 4.4 routed program. There are several relevant RFCs; the two most important are RFC 1058, in which RIP version 1 was first documented, and RFC 1388, in which the version 2 extensions are documented.

The VxWorks RIP server supports three modes of operation:

  • Version 1 RIP

This mode of operation follows RFC 1058. It uses subnet broadcasting to communicate with other routers and sends out only a gateway and metric for each subnet.

  • Version 2 RIP with Broadcasting

This mode is the same as Version 2 RIP with multicasting (see below), except that it uses broadcasting instead of multicasting. This mode is backward compatible with RIP Version 1 and is the mode recommended in RFC 1388.

  • Version 2 RIP with Multicasting

In this mode, the server not only knows about routers but can also describe routes based on their subnet mask and can designate a gateway that is not the router that sends the updates. Thus, the machine that hosts the RIP server does not necessarily have to be the gateway. Because this mode uses multicasting to communicate, only interested nodes in the network see routing information and updates.

6.2.1   VxWorks Debugging Routines for RIP

The RIP server provides several routines that make debugging easier. The most often used is ripLogLevelBump( ), which enables tracing of packets and routing changes. Keep in mind that bumping the log level several times prints large amounts of data to the console. Another routine is ripRouteShow( ), which prints the router's internal tables to the console. The printed message provides the following information:

  • the route being advertised
  • the router that routes the packets
  • a subnet mask
  • the time out on the route (in seconds)2

Table 6-1 :   Flag Constants for ripRouteShow( )   


Constant
Meaning

RTS_CHANGED
Route has changed recently (within the last 30 seconds).
RTS_EXTERNAL
Route should not propagate to other routers.
RTS_INTERNAL
Route is internal, used to implement border gateway filtering.
RTS_PASSIVE
Route is on a passive interface (loopback).
RTS_INTERFACE
Route is on a directly connected interface.
RTS_REMOTE
Route is on a point to point link.
RTS_SUBNET
Route is to a subnet (not a host).
RTS_OTHER
Route belongs to some other (non-RIP) protocol.
RTS_PRIMARY
Route is a primary route. If this flag is set, the RTS_OTHER flag must also be set.

RIP periodically pushes routing information into the VxWorks routing table. Between updates, the two tables can diverge, but updating only periodically avoids route thrashing (pushing transient routes into the system route table but then removing them immediately).

6.2.2   Configuring RIP

To include the RIP server, reconfigure the image. The relevant configuration parameter is INCLUDE_RIP.


*      
NOTE: If you exclude RIP, but include SNMP, a separately purchasable option, you might want to edit snmpMib2.mib to exclude RIP MIB objects. Including these objects does no harm, but it makes the image larger unnecessarily.

Compile-Time Configuration

The RIP server starts up when the network initialization code calls ripLibInit( ). This routine takes several parameters. You set the value of these parameters by adjusting the following configuration parameters:

BSD 4.3 Compatible Sockets -- BSD43_COMPATIBLE

RIP Supplier Flag -- RIP_SUPPLIER, default: 0

RIP Gateway Flag -- RIP_GATEWAY, default: 0


*      
WARNING: Do not set RIP_GATEWAY to 1 unless this really is the general gateway. Setting this to 1 configures the RIP server to ignore any advertisements for default routers received from other RIP peers.

RIP Multicast Flag -- RIP_MULTICAST, default: 0

RIP Version Number -- RIP_VERSION, default: 1

RIP Timer Rate -- RIP_TIMER_RATE, default: 1 second

RIP Supply Interval -- RIP_SUPPLY_INTERVAL, default: 30 seconds

RIP Expire Time -- RIP_EXPIRE_TIME, default: 180 seconds

RIP Garbage Time -- RIP_GARBAGE_TIME, default: 120 seconds

RIP Authentication Type -- RIP_AUTH_TYPE, default: 1 (no authentication)



*      
CAUTION: The RIP server does not support separate routing domains. Only routing domain 0, the default, is supported.

Run-Time Configuration

In addition to setting the defines shown above, there are two alternate methods you can use to configure RIP:

  • Use the m2Rip routines to configure RIP. These routines are documented in the reference entries. The parameters to these routines are also described in RFC-1389.

  • Use an SNMP agent to configure RIP.

RIP Task Priority and User Protection Domains

RIP tasks run at a priority of 100 and 101. If you are using your own protection domain, make sure that the task priority range for the protection domain spans the above two values.

6.2.3   Creating an Interface Exclusion List for RIP

By default, RIP runs on all interfaces active when RIP is initialized. If you do not want to run RIP on a particular interface, you can name the interface on a RIP exclusion list. However, you must put the interface on the exclusion list before RIP is initialized. If that is not possible, you can add the interface to the list and then call ripIfReset( ).


*      
NOTE: Calling ripIfReset( ) clears the RIP interface settings for the interface. This means you lose the interface hooks, the interface MIB2 settings, and all other such information associated with the interface.

If RIP is already running on an interface, simply putting an interface on the exclusion list does not automatically shut down RIP on that interface.

To manage an interface exclusion list, ripLib provides the following functions:

ripIfExcludeListAdd( ) -- add an interface to the RIP exclusion list

ripIfExcludeListDelete( ) -- remove an interface from the RIP exclusion list

ripIfExcludeListShow( ) -- show the interfaces on the RIP exclusion list

For more information on these functions, see the relevant ripLib reference entries.


1:  A packet takes a hop every time it crosses a subnet. If a packet leaves machine Q and must pass through two subnet routers before it reaches its destination on machine N, the number of hops is two.

2:  The time out is the length of time for which the route remains current. If a route is not updated within 3 minutes, it is flushed from the routing table.