| Document revision date: 28 June 1999 | |
![]() |
|
|
|
| Previous | Contents | Index |
The routing socket interface to the kernel forwarding table was introduced in BSD 4.3 Reno, widely distributed in BSD 4.3 Net/2 and improved in BSD 4.4. This interface is simply a socket, similar to a UDP socket, on which the kernel and GATED exchange messages. It has several advatages over the ioctl() interface:
When GATED starts up it reads the kernel forwarding table and installs corresponding routes in the routing 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:
The kernel support subsystem of GATED is resposible for reading the status of the kernel's physical and protocl 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:
Later version of the getkerninfo() and sysctl() interfaces return the interface physical addresses as part of the interface information. On most systems where this information is not returned, GATED scans the kernel physical interface list for this information for interfaces with IFF_BROADCAST set, assuming that their drivers are handled the same as Ethernet drivers. On some systems, system specific interfaces are used to learn this information.
The interface physical addresses are useful for IS-IS, for IP
protocols, they are not currently used, but may be in the future.
B.16.6 Reading Kernel Variables
At startup, GATED reads some special variables out of the kernel. This is usually done with the nlist (or kvm_nlist) system call, but some systems use different methods.
The variables read include the status of UDP checksum creation and
generation, IP forwarding and kernel version (for informational
purposes). On systems where the routing table is read directly from
kernel memory, the root of the hash table or radix tree routing table
is read. On systems where interface physical addresses are not supplied
by other means, the root of the interface list is read.
B.16.7 Special Route Flags
The later BSD based kernel support the special route flags described here:
kernel {
options
[ nochange ]
[ noflushatexit ]
[ remnantholdtime time]
;
routes number ;
flash
[ limit number ]
[ type interface | interior | all ]
;
background
[ limit number ]
[ priority flash | higher | lower ]
;
traceoptions trace_options ;
} ;
|
Here,
| nochange | On systems supporting the routing socket this insures that changes operations will not be performed, only deletes and adds. This is useful on early versions of the routing socket code where the change operation was broken. |
| noflushatexit |
During normal shutdown processing GATED deletes all routes from the
kernel forwarding table that do not have a retain indication. The
noflushatexit option prevents route deletions at shutdown.
Instead, routes are changed and added to make sure that all the routes
marked with retain get installed.
This is handy on systems with thousands of routes. Upon startup GATED will notice which routes are in the kernel forwarding table and not have add them back. |
| remnantholddimte time | Normally remnant routes read from the kernel forwarding table at startup are timed out in three minutes or as soon as they are overridden. This option allows the interval to be configured to a value between zero and 15 minutes. Setting it to zero causes these routes to be deleted immediately. |
| limit number | Specifies the maximum number of routes which may be processed during one flash update. The default is 20. A value of -1 will cause all pending route changes of the specified type to be processed during the flash update. |
| type interface | interior | all |
Specifies the type of routes that will be processed during a flash
update. Interior specifies that interior routes (See the definition of
interior gateway protocols) will also be installed. All specifies the
inclusion of exterior routes (See the definition of exterior gateway
protocols) as well. The default is interface which specifies that only
interface routes will be installed during a flash update.
Specifying flash limit -1 all causes all routes to be installed during the flash update; this mimics the behavior of previous versions of GATED. |
| limit | Specifies the number of route which may be processed at during one batch. The default is 120. |
| priority | Specifies the priority of the processing of batches of kernel updates in relationship to the flash update processing. The default is lower which means that flash updates are processed first. To process kernel updates at the same priority as flash updates, specify flash; to process them at a lower priority, use lower. |
While the kernel interface isn't technically a routing protocol, in many cases it is handled as one. The following two symbols make sense when entered from the command line since the code that uses them is executed before the trace file is parsed.
| symbols | Symbols read from the kernel, by nlist() or similar interface. |
| iflist | Interface list scan. This option is useful when entered from the command line as the first interface list scan is performed before the configuration file is parsed. |
The following tracing options may only be specified in the configuration file. They are not valid from the command line.
| remnants | Routes read from the kernel when GATED starts. |
| request | Requests by GATED to Add/Delete/Change routes in the kernel forwarding table. |
The following general option and packet-tracing options only apply on systems that use the routing socket to exchange routing information with the kernel. They do not apply on systems that use the old BSD4.3 ioctl() interface to the kernel.
| info |
Informational messages received from the routing socket, such as TCP
lossage, routing lookup failure, and route resolution requests. GATED
does not currently do processing on these messages, just logs the
information if requested. Packet tracing options (which may be modified
with detail, send and recv):
|
B.17.1 Route Filtering
Routes are filtered by specifying configuration language that will
match a certain set of routes by destination, or by destination and
mask. Among other places, route filters are used on martians, import
and export statements.
The action taken when no match is found is dependent on the context, for instance import and export route filters assume an all reject ; at the end a list.
A route will match the most specific filter that applies. Specifying more than one filter with the same destination, mask and modifiers will generate an error.
Filtering syntax
network [ exact | refines ]
network mask mask [ exact | refines ]
network masklen number [ exact | refines ]
all
default
host host
|
These are all the possible formats for a route filter. Not all of these formats are available in all places, for instance the host and default formats are not valid for martians.
In most cases it is possible to specify additional parameters relevent to the context of the filter. For example, on a martian statement it is possible to specify the allow keyword, on an import statement you can specify a preference, and on a export you can specify a metric.
| exact | This parameter specifies that the mask of the destination must match the supplied mask exactly. This is used to match a network, but no subnets or hosts of that network. |
| refines | Specifies that the mask of the destination must be more specified (i.e. longer) than the filter mask. This is used to match subnets and/or hosts of a network, but not the network. |
0.0.0.0 mask 0.0.0.0
|
0.0.0.0 mask 0.0.0.0 exact
|
host mask 255.255.255 exact
|
An AS path is a list of autonomous_systems that routing information has passed through to get to this router, and an indicator of the origin of the AS path. This information can be used to prefer one path to a destination network over another. The primary method for doing this with GATED is to specify a list of patterns to be applied to AS paths when importing and exporting routes.
Each autonomous system that a route passed through prepends it's AS number to the beginning of the AS path.
The origin information details the completeness of AS path information. An origin of igp indicates the route was learned from an interior routing protocol and is most likely complete. An origin of egp indicates the route was learned from an exterior routing protocol that does not support AS paths (EGP for example) and the path is most likely not complete. When the path information is definitely not complete, an origin of incomplete is used.
AS path regular expressions are defined in RFC 1164 section 4.2.
B.17.2.1 AS Path-Matching Syntax
An AS path is matched using the following syntax.
aspath aspath_regexp origin any | ( [ igp ] [egp ] [ incomplete ] ) |
This specifies that an AS matching the aspath_regexp with the specified
origin is matched.
B.17.2.2 AS Path Regular Expressions
Technically, an AS path regular expression is a regular expression with
the alphabet being the set of AS numbers. An AS path regular expression
is composed of one or more AS paths expressions. An AS path expressions
is composed of AS path terms and AS path operators.
B.17.2.3 AS Path Terms
An AS path term is one of the following three objects:
An AS path operator is one of the following:
aspath_term {m,n}(1)
aspath_term {m}(2)
aspath_term {m,}(3)
aspath_term *(4)
aspath_term +(5)
aspath_term ?(6)
aspath_term | aspath_term(7)
|
| Previous | Next | Contents | Index |
|
| privacy and legal statement | ||
| 6526PROFILE_035.HTML | ||