gated.conf.4 (2010 09)
g
gated.conf(4) gated.conf(4)
no longer needs to monitor ICMP messages to learn about redirects. Plus, there is an indica-
tion of whether the kernel processed the redirect, GateD can safely ignore redirect messages
that the kernel did not process.
Updates visible
Changes to the routing table by other processes, including the route command are received via
the routing socket. This allows GateD to insure that the kernel forwarding table is in sync with
the routing table. Plus it allows the system administrator the ability to do some operations
with the route command while gated is running.
Changes supported
There is a functioning change message that allows routes in the kernel to be atomically
changed. Some early versions of the routing socket code had bugs in the change message pro-
cessing. There are compilation time and configuration time options that cause delete and add
sequences to be used in lieu of change messages.
Expandable
New levels of kernel/GateD communications may be added by adding new message types.
Reading the Forwarding Table
When GateD starts up it reads the kernel forwarding table and installs corresponding routes in the rout-
ing table. These routes are called remnants and are timed out after a configured interval (which defaults
to 3 minutes), or as soon as a more attractive route is learned. This allows forwarding to occur during the
time it takes the routing protocols to start learning routes.
There are three main methods for reading the forwarding table from the kernel.
Reading forwarding table via kmem
On many systems, especially those based on BSD 4.3, GateD must have knowledge of the kernel data
structures and can go into the kernel to read the current state of forwarding table. This method is slow
and subject to error if the kernel forwarding table is updated while GateD is in the middle of reading it.
This can happen if the system administrator uses the route command, or an ICMP redirect message is
received while GateD is starting up.
Due to an oversight some systems, such as OSF/1, which are based on BSD 4.3 Reno or later, do not have
the getkerninfo() system call described below which allows GateD to read routes from the kernel
without know about kernel internal structures. On these systems it is necessary to read the kernel radix
tree from the kernel by poking around in kernel memory. This is even more error prone than reading the
hash based forwarding table.
Reading the forwarding table via getkerninfo/sysctl
Besides the routing socket, BSD 4.3 Reno introduced the getkerninfo() system call. This call allows a
user process (of which GateD is one) to read various information from the kernel without knowledge of
the kernel data structures. In the case of the forwarding table, it is returned to gated atomically as a
series of routing socket messages. This prevents the problem associated with the forwarding table chang-
ing while GateD is in the process of reading it.
BSD 4.4 changed the getkerninfo() interface into the sysctl() interface, which takes different
parameters, but otherwise functions identically.
Reading the forwarding table via OS specific methods
Some operating systems, for example SunOS 5, define their own method of reading the kernel forwarding
table. The SunOS 5 version is similar in concept to the getkerninfo() method.
Reading the interface list
The kernel support subsystem of GateD is responsible for reading the status of the kernel physical and
protocol interfaces periodically. GateD detects changes in the interface list and notifies the protocols so
they can start or stop instances or peers. The interface list is read one of two ways:
Reading the interface list with SIOCGIFCONF
On systems based on BSD 4.3, 4.3 Reno and 4.3 Net/2 the
SIOCGIFCONF ioctl interface is used to
read the kernel interface list. Using this method a list of interfaces and some basic information about
them is returned by the SIOCGIFCONF call. Other information must be learned by issuing other ioctls to
learn the interface network mask, flags, MTU, metric, destination address (for point-to-point interfaces)
and broadcast address (for broadcast capable interfaces).
HP-UX 11i Version 3: September 2010 − 37 − Hewlett-Packard Company 37