4.4BSD/usr/share/man/cat8/routed.0
ROUTED(8) BSD System Manager's Manual ROUTED(8)
NNAAMMEE
rroouutteedd - network routing daemon
SSYYNNOOPPSSIISS
rroouutteedd [--dd] [--gg] [--qq] [--ss] [--tt] [_l_o_g_f_i_l_e]
DDEESSCCRRIIPPTTIIOONN
RRoouutteedd is invoked at boot time to manage the network routing tables. The
routing daemon uses a variant of the Xerox NS Routing Information Proto-
col in maintaining up to date kernel routing table entries. It used a
generalized protocol capable of use with multiple address types, but is
currently used only for Internet routing within a cluster of networks.
In normal operation rroouutteedd listens on the udp(4) socket for the route(8)
service (see services(5)) for routing information packets. If the host
is an internetwork router, it periodically supplies copies of its routing
tables to any directly connected hosts and networks.
When rroouutteedd is started, it uses the SIOCGIFCONF ioctl(2) to find those
directly connected interfaces configured into the system and marked
``up'' (the software loopback interface is ignored). If multiple inter-
faces are present, it is assumed that the host will forward packets be-
tween networks. RRoouutteedd then transmits a _r_e_q_u_e_s_t packet on each interface
(using a broadcast packet if the interface supports it) and enters a
loop, listening for _r_e_q_u_e_s_t and _r_e_s_p_o_n_s_e packets from other hosts.
When a _r_e_q_u_e_s_t packet is received, rroouutteedd formulates a reply based on the
information maintained in its internal tables. The _r_e_s_p_o_n_s_e packet gen-
erated contains a list of known routes, each marked with a ``hop count''
metric (a count of 16, or greater, is considered ``infinite''). The met-
ric associated with each route returned provides a metric _r_e_l_a_t_i_v_e _t_o _t_h_e
_s_e_n_d_e_r.
_R_e_s_p_o_n_s_e packets received by rroouutteedd are used to update the routing tables
if one of the following conditions is satisfied:
1. No routing table entry exists for the destination network or host,
and the metric indicates the destination is ``reachable'' (i.e. the
hop count is not infinite).
2. The source host of the packet is the same as the router in the ex-
isting routing table entry. That is, updated information is being
received from the very internetwork router through which packets for
the destination are being routed.
3. The existing entry in the routing table has not been updated for
some time (defined to be 90 seconds) and the route is at least as
cost effective as the current route.
4. The new route describes a shorter route to the destination than the
one currently stored in the routing tables; the metric of the new
route is compared against the one stored in the table to decide
this.
When an update is applied, rroouutteedd records the change in its internal ta-
bles and updates the kernel routing table. The change is reflected in
the next _r_e_s_p_o_n_s_e packet sent.
In addition to processing incoming packets, rroouutteedd also periodically
checks the routing table entries. If an entry has not 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 insure the invalidation
is propagated throughout the local internet.
Hosts acting as internetwork routers gratuitously 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 normal routing tables are
bypassed when sending gratuitous responses. 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, an-
other route may be chosen to route around the interface, or the route may
be dropped if no alternative is available.
Options supported by rroouutteedd:
--dd Enable additional debugging information to be logged, such as bad
packets received.
--gg This flag is used on internetwork routers to offer a route to the
``default'' destination. This is typically used on a gateway to
the Internet, or on a gateway that uses another routing protocol
whose routes are not reported to other local routers.
--ss Supplying this option forces rroouutteedd to supply routing information
whether it is acting as an internetwork router or not. This is
the default if multiple network interfaces are present, or if a
point-to-point link is in use.
--qq This is the opposite of the --ss option.
--tt If the --tt option is specified, all packets sent or received are
printed on the standard output. In addition, rroouutteedd will not di-
vorce itself from the controlling terminal so that interrupts
from the keyboard will kill the process.
Any other argument supplied is interpreted as the name of file in which
rroouutteedd's actions should be logged. This log contains information about
any changes to the routing tables and, if not tracing all packets, a his-
tory of recent messages sent and received which are related to the
changed route.
In addition to the facilities described above, rroouutteedd supports the notion
of ``distant'' _p_a_s_s_i_v_e and _a_c_t_i_v_e gateways. When rroouutteedd is started up,
it reads the file _/_e_t_c_/_g_a_t_e_w_a_y_s to find gateways which may not be located
using only information from the SIOGIFCONF ioctl(2). Gateways specified
in this manner should be marked passive if they are not expected to ex-
change routing information, while gateways marked active should be will-
ing to exchange routing information (i.e. they should have a rroouutteedd pro-
cess running on the machine). Routes through passive gateways are in-
stalled in the kernel's routing tables once upon startup. Such routes
are not included in any routing information transmitted. Active gateways
are treated equally to network interfaces. Routing information is dis-
tributed to the gateway and if no routing information is received for a
period of the time, the associated route is deleted. Gateways marked
_e_x_t_e_r_n_a_l are also passive, but are not placed in the kernel routing table
nor are they included in routing updates. The function of external en-
tries is to inform rroouutteedd that another routing process will install such
a route, and that alternate routes to that destination should not be in-
stalled. Such entries are only required when both routers may learn of
routes to the same destination.
The _/_e_t_c_/_g_a_t_e_w_a_y_s is comprised of a series of lines, each in the follow-
ing format:
<nneett | hhoosstt> _n_a_m_e_1 ggaatteewwaayy _n_a_m_e_2 mmeettrriicc _v_a_l_u_e <ppaassssiivvee | aaccttiivvee |
eexxtteerrnnaall>
The nneett or hhoosstt keyword indicates if the route is to a network or specif-
ic host.
_N_a_m_e_1 is the name of the destination network or host. This may be a sym-
bolic name located in _/_e_t_c_/_n_e_t_w_o_r_k_s or _/_e_t_c_/_h_o_s_t_s (or, if started after
named(8), known to the name server), or an Internet address specified in
``dot'' notation; see inet(3).
_N_a_m_e_2 is the name or address of the gateway to which messages should be
forwarded.
_V_a_l_u_e is a metric indicating the hop count to the destination host or
network.
One of the keywords ppaassssiivvee, aaccttiivvee or eexxtteerrnnaall indicates if the gateway
should be treated as _p_a_s_s_i_v_e or _a_c_t_i_v_e (as described above), or whether
the gateway is _e_x_t_e_r_n_a_l to the scope of the rroouutteedd protocol.
Internetwork routers that are directly attached to the Arpanet or Milnet
should use the Exterior Gateway Protocol (EGP) to gather routing informa-
tion rather then using a static routing table of passive gateways. EGP
is required in order to provide routes for local networks to the rest of
the Internet system. Sites needing assistance with such configurations
should contact the Computer Systems Research Group at Berkeley.
FFIILLEESS
/etc/gateways for distant gateways
SSEEEE AALLSSOO
udp(4), icmp(4), XNSrouted(8), htable(8)
_I_n_t_e_r_n_e_t _T_r_a_n_s_p_o_r_t _P_r_o_t_o_c_o_l_s, XSIS 028112, Xerox System Integration
Standard.
BBUUGGSS
The kernel's routing tables may not correspond to those of rroouutteedd when
redirects change or add routes. RRoouutteedd should note any redirects re-
ceived by reading the ICMP packets received via a raw socket.
RRoouutteedd should incorporate other routing protocols, such as Xerox NS
(XNSrouted(8)) and EGP. Using separate processes for each requires con-
figuration options to avoid redundant or competing routes.
RRoouutteedd should listen to intelligent interfaces, such as an IMP, to gather
more information. It does not always detect unidirectional failures in
network interfaces (e.g., when the output side fails).
HHIISSTTOORRYY
The rroouutteedd command appeared in 4.2BSD.
4.2 Berkeley Distribution June 5, 1993 3