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.
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.
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.
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.
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.
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 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:
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
In addition to setting the defines shown above, there are two alternate methods you can use to configure 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( ).
|
|
|||||||||||||||||||
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.