8.2 Routing Daemons

Having covered the first step in any network operation finding out the address for the desired host it is now time to turn to the second prerequisite: determining how to get there. The routing needs of many sites can be handled by installing routers and setting up default gateways and static routes on client systems (as we saw in Section 5.2). However, some situations call for more sophisticated routing services. This section provides an introduction to the daemons that provide them. The processes and algorithms described here are also used by dedicated routers.

Routing daemons dynamically select the best route from among the multiple paths to a given packet's destination. More precisely, what is determined is the best next step along the path toward the destination, because the ultimate target may be far beyond their field of vision.

Routers cache routing information that they learn in the course of their operation, and the routers and daemons within a network use various schemes to exchange routing information.

There are two routing daemons provided by Unix systems: routed and gated. routed (pronounced "route-D") is the older and simpler of the two and is infrequently used these days. gated (pronounced "gate-D") is a general purpose routing daemon, and it is the preferred choice for most sites.

For detailed information about the topics and daemons discussed in this section, see TCP-IP Network Administration by Craig Hunt (O'Reilly & Associates).

8.2.1 Routing Concepts and Protocols

As we noted, many sites need only minimal routing (specifying a default gateway on every system) or static routing (defining some static routes as needed). These approaches work well for networks that are fairly simple (there are not many alternate paths to destinations), are relatively stable (routers do not go down very often), and have ample network bandwidth (routing efficiency is not a major factor in network traffic).

However, complex networks require the use of dynamic routing, which includes the following characteristics:

  • Selecting the best route among multiple routes to a destination based on current network conditions.

  • Maintaining and updating the routing table based on information received via routing protocols.

In other words, both the route selection and the data on which the selection is made are updated continuously to reflect the current network state. The data about what routes exist and are operational are known as reachability information.

Routing protocols specify the methods for determining the best route to a destination and the means by which information is exchanged between and distributed among distinct routing daemons. They are subdivided two different ways:

By usage context: interior versus exterior protocols

Interior protocols are used for internal routing inside an autonomous system: a network under the control of a single administrative entity (typically corresponding to a site). Exterior protocols are designed for routing between autonomous systems.

By algorithm: distance-vector versus link-state protocols

Distance-vector protocols use a measure of the distance to a destination to determine the best route (for example, a route with fewer hops is preferred over one requiring more hops). In contrast, link-state protocols compute each possible route based on a current map of the network topology. These maps are continuously maintained and updated by each router based on information it receives from neighboring routers.

Distance-vector protocols are simple and minimize the amount of data that must be exchanged between routers, but they can take an unacceptably long time to adapt to changes in the network (e.g., router availability). Link-state protocols react to changes more quickly, but they require significantly more CPU and memory resources on the router.

There are a variety of routing protocols in use. For interior routing, there are two that predominate, RIP and OSPF.

The Routing Information Protocol (RIP) is a simple distance-vector protocol. Each router periodically broadcasts the contents of its routing table, specifically, the addresses of the destinations it knows about and the number of hops required to get to them. Routing information is also broadcast in response to update requests from other RIP routers and daemons in more recent versions of RIP. A given router or daemon uses the information provided by its neighbors (adjacent routers, one hop away) to determine the cost of each potential route, ultimately selecting the shortest one.

The maximum distance considered is 15 hops; destinations farther away are all considered to be infinitely distant. In addition to this limited range, RIP's other main disadvantage is its slow convergence in the face of changing network conditions. Long timeout periods and default update intervals in combination with the algorithm it uses to recompute routes mean that routing information can remain out of date for unacceptably long periods of time (many minutes). While routing information is out of date, affected destination hosts are unreachable. There are extensions to RIP (and the follow-on version, RIP-2) that ameliorate this behavior, but not all RIP implementations include them.

The Open Shortest Path First (OSPF) protocol is a link-state protocol. OSPF routers build and maintain a link-state database, which is a directed-graph representation of the entire network from the perspective of that router. This data is then shared with its neighbor routers, and all of their maps are then updated accordingly. OSPF routers choose the best route to a destination by computing the shortest distance route from its current information.

OSPF allows large networks to be subdivided into areas to reduce the computational requirements of computing and storing the network topology data. Routing between areas is handled by designated area border routers. When areas are in use, the backbone is a special area to which all other areas are attached (without areas, the entire site is the backbone).

The routed daemon uses the RIP protocol, while the gated daemon can use several different protocols, including both RIP and OSPF. Note that only one of these daemons should be run at a time. Configuring routed

Although it runs only RIP, routed is available on almost all Unix systems, and it is extremely simple to administer. This daemon has two modes, server mode and quiet mode, selected with the -s and -q command-line options (respectively). Quiet-mode daemons listen for RIP updates but do not broadcast data themselves. Most systems operate in this manner. Only routers and host systems functioning as routers (via multiple network interfaces) should operate in server mode.

routed can optionally load a list of known gateways from the /etc/gateways configuration file when it starts up, but this is seldom necessary because the RIP protocol quickly discovers its neighbors. Otherwise, there is no other configuration necessary for routed itself.

The daemon is generally started at boot time in one of the system boot scripts. Here are the specifics for the various operating systems we are considering:


Started by /etc/rc.tcpip.

Enabled by removing # from the commands in rc.tcpip.


Started in /etc/rc.network.

Enabled in /etc/rc.conf and/or /etc/rc.conf.local:

router_enable="YES", router="routed" router_flags="named-args"

Not supplied; use gated (see below).

Red Hat Linux

Started in /etc/init.d/routed.

Configured in /etc/sysconfig/routed:

SuSE Linux

Started in /etc/init.d/routed.

Enabled in /etc/rc.config (SuSE 7 only):


Started in /etc/init.d/inetinit.


Started in /sbin/init.d/route.

Configured in /etc/rc.config:

ROUTED="yes"; ROUTED_FLAGS="args";

Note that Solaris names this daemon in.routed. Configuring gated

gated is a more sophisticated routing daemon capable of supporting multiple routing protocols (both interior and exterior). It is provided by AIX, HP-UX, and Tru64.

The software was originally free, but it was later taken over by the Merit GateD Consortium, and subsequent versions that it produced were available primarily to consortium members. Current versions are available as commercial software from NextHop Technologies (http://www.nexthop.com). The last free[14] version was 3.6, but this is quite adequate for most sites' needs. It is easy to find on the Internet: e.g., http://freshmeat.net/projects/gated/.

[14] Version 3.6 is free, but making and distributing changes may be technically prohibited (Freshmeat describes the license as "free to use but restricted"). The last unrestricted version seems to be 3.5.10.

gated's configuration file is /etc/gated.conf . This file has a specified format that must be followed, with this general layout: options, interface definitions, protocol selection and configuration, static route, and route importing and exporting. Here is an example of the first two sections:

options syslog upto info ;               Global options. interfaces {                             Declare an interface for later use.   interface ; } ; router-id ;               Required for OSPF.

The options statement specifies that logging should go to the syslog facility and include all messages of info severity and higher. This setting is actually the default and is included only to illustrate the options statement (which is in fact not needed at all in many cases).

The second statement defines a network interface for gated. This is required only if the interface will be referred to later in the configuration file.

Next come the protocol selections and their configuration. For example, the following statement enables the RIP protocol:

# enable RIP rip yes {                                Use RIP.   nobroadcast ;                          Equivalent to routed -q.   interface {     version 2 ;                          Use RIP-2.     authentication simple "a-password" ;   } ;  } ;

This statement says to use RIP-2 in quiet mode and specifies an authentication password included in and expected for all valid updates. It provides some minimal protection against malicious routing data. MD5 passwords are also supported.

If you wanted to disable RIP, you'd use this statement:

rip no ;

Here is a simple configuration statement for the OSPF protocol:

ospf yes {    backbone {      interface {        priority 5 ;        authentication simple "another-pass" ;      } ;    } ; } ;

This statement enables OSPF. It indicates that the system is part of the backbone area and specifies the interface through which the system is attached, along with an authentication mechanism to use with other routers in this area. The priority value is used when various OSPF routers are trying to select a designated router for an area, where higher values mean less likelihood of being selected (the default is 10).

This statement could contain additional area substatements if the system has multiple interfaces connected to different areas, enabling it to function as an area border router. These lines follow the same syntax as the backbone configuration except that they are introduced by a line of the form:

  area name

As we've noted, additional sections of the configuration file define static routes and what route information to advertise to external routers. We won't consider them in this brief introduction. Vendor specifics

gated is provided byAIX, HP-UX, and Tru64 (presumably, IBM, HP and DEC/Compaq were members of the consortium). Here are the specifics for these systems:


Started by /etc/rc.tcpip.

Enabled by removing # from the commands in rc.tcpip.


Started by /sbin/init.d/gated.


Started in /sbin/init.d/gateway.

Configured in /etc/rc.config:

GATED="yes"; GATED_FLAGS="args";

You can obtain or build gated for any of the other systems discussed in this book. For example, there is a FreeBSD version in the ports collection, and many Linux distributions include it as an optional component.

Essential System Administration
Essential System Administration, Third Edition
ISBN: 0596003439
EAN: 2147483647
Year: 2002
Pages: 162

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net