routed

network routing daemon

Syntax:

routed [-d] [-g] [-q] [-s] [-t] [logfile]

Options:

-d
Log additional debugging information (e.g. log any bad packets received).
-g
This option, which is used on internetwork routers to offer a route to the “default” destination, is typically used on either of the following:
  • a gateway to the Internet
  • a gateway that uses another routing protocol whose routes aren't reported to other local routers
-q
Don't supply routing information (opposite of the -s option).
-s
Supply routing information whether or not routed is acting as an internetwork router. This is the default if multiple network interfaces are present, or if a point-to-point link is in use.
-t
On the standard output, print all packets sent or received. With -t, routed won't detach itself from the controlling terminal so you can kill the process via interrupts from the keyboard.
logfile
The name of file in which routed's actions are to be logged. This log contains information about any changes to the routing tables; if -t isn't specified to trace all packets, the log also maintains a history of recent messages sent and received that are related to the changed route.

Description:

The routed daemon is invoked at boot time to manage the network routing tables. The daemon uses a variant of the Xerox NS Routing Information Protocol in maintaining up-to-date routing table entries. While it uses a generalized protocol that can be applied to multiple address types, routed is currently used only for Internet routing within a cluster of networks.

In most cases, routed listens on the UDP socket for the route service (see the services file) for routing information packets. If the host is an internetwork router, routed periodically supplies copies of its routing tables to any directly connected hosts and networks.

When started, routed uses the SIOCGIFCONF ioctl() to find those directly connected interfaces that are configured into the system and marked “up” (the software loopback interface is ignored). If multiple interfaces are present, it's assumed that the host will forward packets between networks. The routed daemon then transmits a request packet on each interface (using a broadcast packet if the interface supports it) and enters a loop, listening for request and response packets from other hosts.

When it receives a request packet, routed formulates a reply based on the information maintained in its internal tables. The response packet generated contains a list of known routes, each marked with a “hop count” metric (a count of 16, or greater, is considered “infinite”). The metric associated with each route returned provides a metric relative to the sender.

With the response packets that it receives, routed updates the routing tables if one of the following conditions is satisfied:

When an update is applied, routed records the change in its internal tables and updates the routing table. The change is reflected in the next response packet that's sent.

In addition to processing incoming packets, routed also periodically checks the routing table entries. If an entry hasn't been updated for 3 minutes, the entry's metric is set to infinity and marked for deletion. Deletions are delayed an additional 60 seconds to ensure that the invalidation of this entry is propagated throughout the local internet.

Hosts acting as internetwork routers supply their routing tables every 30 seconds to all directly connected hosts and networks. The response is sent to the broadcast address on nets capable of that function, to the destination address on point-to-point links, and to the router's own address on other networks. The reception of responses on each network is used to determine that the network and interface are functioning correctly. If no response is received on an interface, another route may be chosen to route around the interface, or the route may be dropped if no alternative is available.

In addition to the facilities described above, routed supports the notion of “distant” passive and active gateways.

When started, routed reads the file /etc/gateways to find gateways that may not be located using only information from the SIOGIFCONF ioctl(). Gateways specified in this manner should be marked passive if they aren't expected to exchange routing information, while gateways marked active should be willing to exchange routing information (i.e. they should have a routed process running on the machine).

Routes through passive gateways are installed in the routing tables once upon startup. Such routes aren't included in any routing information transmitted. Active gateways are treated equally to network interfaces. Routing information is distributed to the gateway and if no routing information is received for a period of the time, the associated route is deleted. Gateways marked external are also passive, but aren't placed in the routing table nor are they included in routing updates.

The function of external entries is to inform routed that another routing process will install such a route, and that alternate routes to that destination shouldn't be installed. Such entries are required only when both routers may learn of routes to the same destination.

/etc/gateways

The /etc/gateways file comprises a series of lines, each in the following format:

<net | host> name1 gateway name2 metric value
    <passive | active | external>

where:

net | host
Indicates if the route is to a network or to a specific host.
name1
The name of the destination network or host. This may be a symbolic name located in /etc/networks or /etc/hosts (or, if started after named, a name known to the name server), or an Internet address specified in dot notation; see the inet() functions.
name2
The name or address of the gateway that messages should be forwarded to.
value
A metric indicating the hop count to the destination host or network.
passive | active | external
The passive and active keywords indicate whether the gateway should be treated as passive or active (as described above); the external keyword indicates that the gateway is external to the scope of the routed protocol.

Internetwork routers that are directly attached to the Arpanet or Milnet should use the Exterior Gateway Protocol (EGP) to gather routing information rather than use a static routing table of passive gateways. EGP is required to provide routes for local networks to the rest of the Internet system. Since gated supports EGP, you should it instead of routed.

Files:

/etc/gateways
List of accessible gateways on the local network.

Caveats:

The routing tables may not correspond to those of routed when redirects change or add routes. The routed daemon should note any redirects received by reading the ICMP packets received via a raw socket.

See also:

gated, udp and icmp protocols

Internet Transport Protocols, XSIS 028112, Xerox System Integration Standard.