DIGITAL TCP/IP Services for OpenVMS
Management


Previous Contents Index

B.16.2.2 Updating the Forwarding Table with the Routing Socket Interface

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:

B.16.3 Reading the Forwarding Table

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:

B.16.4 Reading the Interface List

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:

B.16.5 Reading Interface Physical Addresses

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:

B.16.8 Kernel Configuration Syntax


 
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,

B.16.9 Kernel Tracing Options

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):
  • routes

    Routes exchanged with the kernel, including Add/Delete/Change messages and Add/Delete/Change messages received from other processes.

  • redirect

    Redirect messages received from the kernel.

  • interface

    Interface status messages received from the kernel. These are only supported on systems with networking code derived from BSD 4.4.

  • other

    Other messages received from the kernel, including those mentioned in the info type above.

B.17 Control Statements

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.

B.17.2 Matching AS Paths

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:

B.17.2.4 AS Path Operators

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)

  1. aspath_term {m,n}
    a regular expression followed by {m,n} (where m and n are both non-negative integers and m <= n) means at least m and at most n repetitions.
  2. aspath_term {m}
    a regular expression followed by {m} (where m is a positive integer) means exactly m repetitions.
  3. aspath_term {m,}
    a regular expression followed by {m,} (where m is a positive integer) means m or more repetitions.
  4. aspath_term *
    an AS path term followed by * means zero or more repetitions. This is shorthand for {0,}.
  5. aspath_term +
    a regular expression followed by + means one or more repetitions. This is shorthand for {1,}.
  6. aspath_term ?
    a regular expression followed by ? means zero or one repetition. This is shorthand for {0,1}.
  7. aspath_term | aspath_term
    matches the AS term on the left, or the AS term on the right.


Previous Next Contents Index