rework interface metrics to invert perspective; other misc. fixes
[unix-history] / usr / src / sbin / routed / routed.8
CommitLineData
b0afce1a
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
438b45db 5.\" @(#)routed.8 6.3 (Berkeley) %G%
b0afce1a 6.\"
c7f51af8 7.TH ROUTED 8C ""
b0afce1a
KM
8.UC 5
9.SH NAME
10routed \- network routing daemon
11.SH SYNOPSIS
12.B /etc/routed
13[
dfc5a452
MK
14.B \-d
15] [
16.B \-g
17] [
b0afce1a
KM
18.B \-s
19] [
20.B \-q
21] [
22.B \-t
23] [
24.I logfile
25]
26.SH DESCRIPTION
27.I Routed
28is invoked at boot time to manage the network routing tables.
29The routing daemon uses a variant of the Xerox NS Routing
30Information Protocol in maintaining up to date kernel routing
31table entries.
dfc5a452
MK
32It used a generalized protocol capable of use with multiple
33address types, but is currently used only for Internet routing
34within a cluster of networks.
b0afce1a
KM
35.PP
36In normal operation
37.I routed
dfc5a452 38listens on the
b0afce1a 39.IR udp (4P)
dfc5a452
MK
40socket for the
41.I route
42service (see
43.IR services (5))
b0afce1a
KM
44for routing information packets. If the host is an
45internetwork router, it periodically supplies copies
46of its routing tables to any directly connected hosts
47and networks.
48.PP
49When
50.I routed
51is started, it uses the SIOCGIFCONF
52.I ioctl
53to find those
54directly connected interfaces configured into the
55system and marked ``up'' (the software loopback interface
56is ignored). If multiple interfaces
dfc5a452 57are present, it is assumed that the host will forward packets
b0afce1a
KM
58between networks.
59.I Routed
60then transmits a
61.I request
62packet on each interface (using a broadcast packet if
63the interface supports it) and enters a loop, listening
64for
65.I request
66and
67.I response
68packets from other hosts.
69.PP
70When a
71.I request
72packet is received,
73.I routed
74formulates a reply based on the information maintained in its
75internal tables. The
76.I response
77packet generated contains a list of known routes, each marked
78with a ``hop count'' metric (a count of 16, or greater, is
79considered ``infinite''). The metric associated with each
80route returned provides a metric
81.IR "relative to the sender" .
82.PP
83.I Response
84packets received by
85.I routed
86are used to update the routing tables if one of the following
87conditions is satisfied:
88.TP
89(1)
90No routing table entry exists for the destination network
91or host, and the metric indicates the destination is ``reachable''
92(i.e. the hop count is not infinite).
93.TP
94(2)
95The source host of the packet is the same as the router in the
96existing routing table entry. That is, updated information is
97being received from the very internetwork router through which
98packets for the destination are being routed.
99.TP
100(3)
101The existing entry in the routing table has not been updated for
102some time (defined to be 90 seconds) and the route is at least
103as cost effective as the current route.
104.TP
105(4)
106The new route describes a shorter route to the destination than
107the one currently stored in the routing tables; the metric of
108the new route is compared against the one stored in the table
109to decide this.
110.PP
111When an update is applied,
112.I routed
dfc5a452
MK
113records the change in its internal tables and updates the kernel
114routing table.
115The change is reflected in the next
b0afce1a 116.I response
dfc5a452 117packet sent.
b0afce1a
KM
118.PP
119In addition to processing incoming packets,
120.I routed
121also periodically checks the routing table entries.
122If an entry has not been updated for 3 minutes, the entry's metric
123is set to infinity and marked for deletion. Deletions are delayed
124an additional 60 seconds to insure the invalidation is propagated
dfc5a452 125throughout the local internet.
b0afce1a
KM
126.PP
127Hosts acting as internetwork routers gratuitously supply their
128routing tables every 30 seconds to all directly connected hosts
129and networks.
dfc5a452
MK
130The response is sent to the broadcast address on nets capable of that function,
131to the destination address on point-to-point links, and to the router's
132own address on other networks.
133The normal routing tables are bypassed when sending gratuitous responses.
134The reception of responses on each network is used to determine that the
135network and interface are functioning correctly.
136If no response is received on an interface, another route may be chosen
137to route around the interface, or the route may be dropped if no alternative
138is available.
b0afce1a 139.PP
dfc5a452
MK
140.I Routed supports several options:
141.TP
142.B \-d
143Enable additional debugging information to be logged,
144such as bad packets received.
145.TP
146.B \-g
147This flag is used on internetwork routers to offer a route
148to the ``default'' destination.
149This is typically used on a gateway to the Internet,
150or on a gateway that uses another routing protocol whose routes
151are not reported to other local routers.
152.TP
b0afce1a 153.B \-s
dfc5a452 154Supplying this
b0afce1a
KM
155option forces
156.I routed
157to supply routing information whether it is acting as an internetwork
158router or not.
dfc5a452
MK
159This is the default if multiple network interfaces are present,
160or if a point-to-point link is in use.
161.TP
b0afce1a 162.B \-q
dfc5a452
MK
163This
164is the opposite of the
b0afce1a 165.B \-s
dfc5a452
MK
166option.
167.TP
168.B \-t
169If the
b0afce1a
KM
170.B \-t
171option is specified, all packets sent or received are
172printed on the standard output. In addition,
173.I routed
174will not divorce itself from the controlling terminal
175so that interrupts from the keyboard will kill the process.
dfc5a452 176.PP
b0afce1a
KM
177Any other argument supplied is interpreted as the name
178of file in which
179.IR routed 's
180actions should be logged. This log contains information
dfc5a452
MK
181about any changes to the routing tables and, if not tracing all packets,
182a history of recent messages sent and received which are related to
b0afce1a
KM
183the changed route.
184.PP
185In addition to the facilities described above,
186.I routed
187supports the notion of ``distant''
188.I passive
189and
190.I active
191gateways. When
192.I routed
193is started up, it reads the file
194.I /etc/gateways
dfc5a452
MK
195to find gateways which may not be located using
196only information from the SIOGIFCONF
b0afce1a
KM
197.IR ioctl .
198Gateways specified in this manner should be marked passive
199if they are not expected to exchange routing information,
200while gateways marked active
201should be willing to exchange routing information (i.e.
202they should have a
203.I routed
204process running on the machine).
438b45db
MK
205Routes through passive gateways are installed in the
206kernel's routing tables once upon startup.
207Such routes are not included in
b0afce1a
KM
208any routing information transmitted.
209Active gateways are treated equally to network
210interfaces. Routing information is distributed
211to the gateway and if no routing information is
212received for a period of the time, the associated
213route is deleted.
438b45db
MK
214Gateways marked
215.I external
216are also passive, but are not placed in the kernel
dfc5a452
MK
217routing table nor are they included in routing updates.
218The function of external entries is to inform
219.I routed
220that another routing process
221will install such a route, and that alternate routes to that destination
222should not be installed.
223Such entries are only required when both routers may learn of routes
224to the same destination.
b0afce1a
KM
225.PP
226The
227.I /etc/gateways
228is comprised of a series of lines, each in
229the following format:
230.PP
231.nf
dfc5a452 232< \fBnet\fP | \fBhost\fP > \fIname1\fP \fBgateway\fP \fIname2\fP \fBmetric\fP \fIvalue\fP < \fBpassive\fP | \fBactive\fP | \fBexternal\fP >
b0afce1a
KM
233.fi
234.PP
235The
236.B net
237or
238.B host
239keyword indicates if the route is to a network or specific host.
240.PP
241.I Name1
242is the name of the destination network or host. This may be a
243symbolic name located in
244.I /etc/networks
245or
dfc5a452
MK
246.I /etc/hosts
247(or, if started after
248.IR named (8),
249known to the name server),
b0afce1a
KM
250or an Internet address specified in ``dot'' notation; see
251.IR inet (3N).
252.PP
253.I Name2
254is the name or address of the gateway to which messages should
255be forwarded.
256.PP
257.I Value
258is a metric indicating the hop count to the destination host
259or network.
260.PP
dfc5a452
MK
261One of the keywords
262.BR passive ,
b0afce1a 263.B active
dfc5a452
MK
264or
265.B external
b0afce1a
KM
266indicates if the gateway should be treated as
267.I passive
268or
269.I active
dfc5a452 270(as described above),
438b45db
MK
271or whether the gateway is
272.I external
273to the scope of the
dfc5a452
MK
274.I routed
275protocol.
276.PP
277Internetwork routers that are directly attached to the Arpanet or Milnet
278should use the Exterior Gateway Protocol (EGP) to gather routing information
279rather then using a static routing table of passive gateways.
280EGP is required in order to provide routes for local networks to the rest
281of the Internet system.
282Sites needing assistance with such configurations
283should contact the Computer Systems Research Group at Berkeley.
b0afce1a
KM
284.SH FILES
285.DT
286/etc/gateways for distant gateways
287.SH "SEE ALSO"
288``Internet Transport Protocols'', XSIS 028112, Xerox System Integration
289Standard.
290.br
438b45db 291udp(4P), icmp(4P), XNSrouted(8C), htable(8)
b0afce1a
KM
292.SH BUGS
293The kernel's routing tables may not correspond to those of
294.I routed
dfc5a452 295when redirects change or add routes.
438b45db
MK
296.I Routed
297should note any redirects received by reading
298the ICMP packets received via a raw socket.
b0afce1a
KM
299.PP
300.I Routed
dfc5a452
MK
301should incorporate other routing protocols,
302such as Xerox NS
303.RI ( XNSrouted (8C))
304and EGP.
305Using separate processes for each requires configuration options
306to avoid redundant or competing routes.
307.PP
308.I Routed
438b45db
MK
309should listen to intelligent interfaces, such as an IMP,
310to gather more information.
dfc5a452
MK
311It does not always detect unidirectional failures in network interfaces
312(e.g., when the output side fails).