respectively.
Attribute Value Type
aut-num <as-number> mandatory, single-valued, class key
as-name <object-name> mandatory, single-valued
member-of list of <as-set-names> optional, multi-valued
import see Section 6.1 optional, multi valued
export see Section 6.2 optional, multi valued
default see Section 6.5 optional, multi valued
Figure 23: aut-num Class Attributes
6.1 import Attribute: Import Policy Specification
In RPSL, an import policy is divided into import policy expressions.
Each import policy expression is specified using an import attribute.
The import attribute has the following syntax (we will extend this
syntax later in Sections 6.3 and 6.6):
import: from <peering-1> [action <action-1>]
. . .
from <peering-N> [action <action-N>]
accept <filter>
The action specification is optional. The semantics of an import
attribute is as follows: the set of routes that are matched by
<filter> are imported from all the peers in <peerings>; while
importing routes at <peering-M>, <action-M> is executed.
E.g.
aut-num: AS1
import: from AS2 action pref = 1; accept { 128.9.0.0/16 }
This example states that the route 128.9.0.0/16 is accepted from AS2
with preference 1. We already presented how peerings (see Section
5.6) and filters (see Section 5.4) are specified. We next present
how to specify actions.
6.1.1 Action Specification
Policy actions in RPSL either set or modify route attributes, such as
assigning a preference to a route, adding a BGP community to the BGP
community path attribute, or setting the MULTI-EXIT-DISCRIMINATOR
attribute. Policy actions can also instruct routers to perform
special operations, such as route flap damping.
The routing policy attributes whose values can be modified in policy
actions are specified in the RPSL dictionary. Please refer to
Section 7 for a list of these attributes. Each action in RPSL is
terminated by the semicolon character (';'). It is possible to form
composite policy actions by listing them one after the other. In a
composite policy action, the actions are executed left to right. For
example,
aut-num: AS1
import: from AS2
action pref = 10; med = 0; community.append(10250, 3561:10);
accept { 128.9.0.0/16 }
sets pref to 10, med to 0, and then appends 10250 and 3561:10 to the
BGP community path attribute. The pref attribute is the inverse of
the local-pref attribute (i.e. local-pref == 65535 - pref). A route
with a local-pref attribute is always preferred over a route without
one.
aut-num: AS1
import: from AS2 action pref = 1;
from AS3 action pref = 2;
accept AS4
The above example states that AS4's routes are accepted from AS2 with
preference 1, and from AS3 with preference 2 (routes with lower
integer preference values are preferred over routes with higher
integer preference values).
aut-num: AS1
import: from AS2 7.7.7.2 at 7.7.7.1 action pref = 1;
from AS2 action pref = 2;
accept AS4
The above example states that AS4's routes are accepted from AS2 on
peering 7.7.7.1-7.7.7.2 with preference 1, and on any other peering
with AS2 with preference 2.
6.2 export Attribute: Export Policy Specification
Similarly, an export policy expression is specified using an export
attribute. The export attribute has the following syntax:
export: to <peering-1> [action <action-1>]
. . .
to <peering-N> [action <action-N>]
announce <filter>
The action specification is optional. The semantics of an export
attribute is as follows: the set of routes that are matched by
<filter> are exported to all the peers specified in <peerings>; while
exporting routes at <peering-M>, <action-M> is executed.
E.g.
aut-num: AS1
export: to AS2 action med = 5; community .= { 70 };
announce AS4
In this example, AS4's routes are announced to AS2 with the med
attribute's value set to 5 and community 70 added to the community
list.
Example:
aut-num: AS1
export: to AS-FOO announce ANY
In this example, AS1 announces all of its routes to the ASes in the
set AS-FOO.
6.3 Other Routing Protocols, Multi-Protocol Routing Protocols, and
Injecting Routes Between Protocols
The more complete syntax of the import and export attributes are as
follows:
import: [protocol <protocol-1>] [into <protocol-2>]
from <peering-1> [action <action-1>]
. . .
from <peering-N> [action <action-N>]
accept <filter>
export: [protocol <protocol-1>] [into <protocol-2>]
to <peering-1> [action <action-1>]
. . .
to <peering-N> [action <action-N>]
announce <filter>
Where the optional protocol specifications can be used for specifying
policies for other routing protocols, or for injecting routes of one
protocol into another protocol, or for multi-protocol routing
policies. The valid protocol names are defined in the dictionary.
The <protocol-1> is the name of the protocol whose routes are being
exchanged. The <protocol-2> is the name of the protocol which is
receiving these routes. Both <protocol-1> and <protocol-2> default
to the Internet Exterior Gateway Protocol, currently BGP.
In the following example, all interAS routes are injected into RIP.
aut-num: AS1
import: from AS2 accept AS2
export: protocol BGP4 into RIP
to AS1 announce ANY
In the following example, AS1 accepts AS2's routes including any more
specifics of AS2's routes, but does not inject these extra more
specific routes into OSPF.
aut-num: AS1
import: from AS2 accept AS2^+
export: protocol BGP4 into OSPF
to AS1 announce AS2
In the following example, AS1 injects its static routes (routes which
are members of the set AS1:RS-STATIC-ROUTES) to the interAS routing
protocol and appends AS1 twice to their AS paths.
aut-num: AS1
import: protocol STATIC into BGP4
from AS1 action aspath.prepend(AS1, AS1);
accept AS1:RS-STATIC-ROUTES
In the following example, AS1 imports different set of unicast routes
for multicast reverse path forwarding from AS2:
aut-num: AS1
import: from AS2 accept AS2
import: protocol IDMR
from AS2 accept AS2:RS-RPF-ROUTES
6.4 Ambiguity Resolution
It is possible that the same peering can be covered by more that one
peering specification in a policy expression. For example:
aut-num: AS1
import: from AS2 7.7.7.2 at 7.7.7.1 action pref = 2;
from AS2 7.7.7.2 at 7.7.7.1 action pref = 1;
accept AS4
This is not an error, though definitely not desirable. To break the
ambiguity, the action corresponding to the first peering
specification is used. That is the routes are accepted with
preference 2. We call this rule as the specification-order rule.
Consider the example:
aut-num: AS1
import: from AS2 action pref = 2;
from AS2 7.7.7.2 at 7.7.7.1 action pref = 1; dpa = 5;
accept AS4
where both peering specifications cover the peering 7.7.7.1-7.7.7.2,
though the second one covers it more specifically. The specification
order rule still applies, and only the action "pref = 2" is executed.
In fact, the second peering-action pair has no use since the first
peering-action pair always covers it. If the intended policy was to
accept these routes with preference 1 on this particular peering and
with preference 2 in all other peerings, the user should have
specified:
aut-num: AS1
import: from AS2 7.7.7.2 at 7.7.7.1 action pref = 1; dpa = 5;
from AS2 action pref = 2;
accept AS4
It is also possible that more than one policy expression can cover
the same set of routes for the same peering. For example:
aut-num: AS1
import: from AS2 action pref = 2; accept AS4
import: from AS2 action pref = 1; accept AS4
In this case, the specification-order rule is still used. That is,
AS4's routes are accepted from AS2 with preference 2. If the filters
were overlapping but not exactly the same:
aut-num: AS1
import: from AS2 action pref = 2; accept AS4
import: from AS2 action pref = 1; accept AS4 OR AS5
the AS4's routes are accepted from AS2 with preference 2 and however
AS5's routes are also accepted, but with preference 1.
We next give the general specification order rule for the benefit of
the RPSL implementors. Consider two policy expressions:
aut-num: AS1
import: from peerings-1 action action-1 accept filter-1
import: from peerings-2 action action-2 accept filter-2
The above policy expressions are equivalent to the following three
expressions where there is no ambiguity:
aut-num: AS1
import: from peerings-1 action action-1 accept filter-1
import: from peerings-3 action action-2 accept filter-2 AND NOT filter-1
import: from peerings-4 action action-2 accept filter-2
where peerings-3 are those that are covered by both peerings-1 and
peerings-2, and peerings-4 are those that are covered by peerings-2
but not by peerings-1 ("filter-2 AND NOT filter-1" matches the routes
that are matched by filter-2 but not by filter-1).
Example:
aut-num: AS1
import: from AS2 7.7.7.2 at 7.7.7.1
action pref = 2;
accept {128.9.0.0/16}
import: from AS2
action pref = 1;
accept {128.9.0.0/16, 75.0.0.0/8}
Lets consider two peerings with AS2, 7.7.7.1-7.7.7.2 and 9.9.9.1-
9.9.9.2. Both policy expressions cover 7.7.7.1-7.7.7.2. On this
peering, the route 128.9.0.0/16 is accepted with preference 2, and
the route 75.0.0.0/8 is accepted with preference 1. The peering
9.9.9.1-9.9.9.2 is only covered by the second policy expressions.
Hence, both the route 128.9.0.0/16 and the route 75.0.0.0/8 are
accepted with preference 1 on peering 9.9.9.1-9.9.9.2.
Note that the same ambiguity resolution rules also apply to export
and default policy expressions.
6.5 default Attribute: Default Policy Specification
Default routing policies are specified using the default attribute.
The default attribute has the following syntax:
default: to <peering> [action <action>] [networks <filter>]
The <action> and <filter> specifications are optional. The semantics
are as follows: The <peering> specification indicates the AS (and
the router if present) is being defaulted to; the <action>
specification, if present, indicates various attributes of
defaulting, for example a relative preference if multiple defaults
are specified; and the <filter> specifications, if present, is a
policy filter. A router only uses the default policy if it received
the routes matched by <filter> from this peer.
In the following example, AS1 defaults to AS2 for routing.
aut-num: AS1
default: to AS2
In the following example, router 7.7.7.1 in AS1 defaults to router
7.7.7.2 in AS2.
aut-num: AS1
default: to AS2 7.7.7.2 at 7.7.7.1
In the following example, AS1 defaults to AS2 and AS3, but prefers
AS2 over AS3.
aut-num: AS1
default: to AS2 action pref = 1;
default: to AS3 action pref = 2;
In the following example, AS1 defaults to AS2 and uses 128.9.0.0/16
as the default network.
aut-num: AS1
default: to AS2 networks { 128.9.0.0/16 }
6.6 Structured Policy Specification
The import and export policies can be structured. We only reccomend
structured policies to advanced RPSL users. Please feel free to skip
this section.
The syntax for a structured policy specification is the following:
<import-factor> ::= from <peering-1> [action <action-1>]
. . .
from <peering-N> [action <action-N>]
accept <filter>;
<import-term> ::= <import-factor> |
LEFT-BRACE
<import-factor>
. . .
<import-factor>
RIGHT-BRACE
<import-expression> ::= <import-term> |
<import-term> EXCEPT <import-expression> |
<import-term> REFINE <import-expression>
import: [protocol <protocol1>] [into <protocol2>]
<import-expression>
Please note the semicolon at the end of an <import-factor>. If the
policy specification is not structured (as in all the examples in
other sections), this semicolon is optional. The syntax and
semantics for an <import-factor> is already defined in Section 6.1.
An <import-term> is either a sequence of <import-factor>'s enclosed
within matching braces (i.e. `{' and `}') or just a single <import-
factor>. The semantics of an <import-term> is the union of <import-
factor>'s using the specification order rule. An <import-expression>
is either a single <import-term> or an <import-term> followed by one
of the keywords "except" and "refine", followed by another <import-
expression>. Note that our definition allows nested expressions.
Hence there can be exceptions to exceptions, refinements to
refinements, or even refinements to exceptions, and so on.
The semantics for the except operator is as follows: The result of an
except operation is another <import-term>. The resulting policy set
contains the policies of the right hand side but their filters are
modified to only include the routes also matched by the left hand
side. The policies of the left hand side are included afterwards and
their filters are modified to exclude the routes matched by the right
hand side. Please note that the filters are modified during this
process but the actions are copied verbatim. When there are multiple
levels of nesting, the operations (both except and refine) are
performed right to left.
Consider the following example:
import: from AS1 action pref = 1; accept as-foo;
except {
from AS2 action pref = 2; accept AS226;
except {
from AS3 action pref = 3; accept {128.9.0.0/16};
}
}
where the route 128.9.0.0/16 is originated by AS226, and AS226 is a
member of the as set as-foo. In this example, the route 128.9.0.0/16
is accepted from AS3, any other route (not 128.9.0.0/16) originated
by AS226 is accepted from AS2, and any other ASes' routes in as-foo
is accepted from AS1.
We can come to the same conclusion using the algebra defined above.
Consider the inner exception specification:
from AS2 action pref = 2; accept AS226;
except {
from AS3 action pref = 3; accept {128.9.0.0/16};
}
is equivalent to
{
from AS3 action pref = 3; accept AS226 AND {128.9.0.0/16};
from AS2 action pref = 2; accept AS226 AND NOT {128.9.0.0/16};
}
Hence, the original expression is equivalent to:
import: from AS1 action pref = 1; accept as-foo;
except {
from AS3 action pref = 3; accept AS226 AND {128.9.0.0/16};
from AS2 action pref = 2; accept AS226 AND NOT {128.9.0.0/16};
}
which is equivalent to
import: {
from AS3 action pref = 3;
accept as-foo AND AS226 AND {128.9.0.0/16};
from AS2 action pref = 2;
accept as-foo AND AS226 AND NOT {128.9.0.0/16};
from AS1 action pref = 1;
accept as-foo AND NOT
(AS226 AND NOT {128.9.0.0/16} OR AS226 AND {128.9.0.0/16});
}
Since AS226 is in as-foo and 128.9.0.0/16 is in AS226, it simplifies
to:
import: {
from AS3 action pref = 3; accept {128.9.0.0/16};
from AS2 action pref = 2; accept AS226 AND NOT {128.9.0.0/16};
from AS1 action pref = 1; accept as-foo AND NOT AS226;
}
In the case of the refine operator, the resulting set is constructed
by taking the cartasian product of the two sides as follows: for
each policy l in the left hand side and for each policy r in the
right hand side, the peerings of the resulting policy are the
peerings common to both r and l; the filter of the resulting policy
is the intersection of l's filter and r's filter; and action of the
resulting policy is l's action followed by r's action. If there are
no common peerings, or if the intersection of filters is empty, a
resulting policy is not generated.
Consider the following example:
import: { from AS-ANY action pref = 1; accept community(3560:10);
from AS-ANY action pref = 2; accept community(3560:20);
} refine {
from AS1 accept AS1;
from AS2 accept AS2;
from AS3 accept AS3;
}
Here, any route with community 3560:10 is assigned a preference of 1
and any route with community 3560:20 is assigned a preference of 2
regardless of whom they are imported from. However, only AS1's
routes are imported from AS1, and only AS2's routes are imported from
AS2, and only AS3's routes are imported form AS3, and no routes are
imported from any other AS. We can reach the same conclusion using
the above algebra. That is, our example is equivalent to:
import: {
from AS1 action pref = 1; accept community(3560:10) AND AS1;
from AS1 action pref = 2; accept community(3560:20) AND AS1;
from AS2 action pref = 1; accept community(3560:10) AND AS2;
from AS2 action pref = 2; accept community(3560:20) AND AS2;
from AS3 action pref = 1; accept community(3560:10) AND AS3;
from AS3 action pref = 2; accept community(3560:20) AND AS3;
}
Note that the common peerings between "from AS1" and "from AS-ANY"
are those peerings in "from AS1". Even though we do not formally
define "common peerings", it is straight forward to deduce the
definition from the definitions of peerings (please see Section 5.6).
Consider the following example:
import: {
from AS-ANY action med = 0; accept {0.0.0.0/0^0-18};
} refine {
from AS1 at 7.7.7.1 action pref = 1; accept AS1;
from AS1 action pref = 2; accept AS1;
}
where only routes of length 0 to 18 are accepted and med's value is
set to 0 to disable med's effect for all peerings; In addition, from
AS1 only AS1's routes are imported, and AS1's routes imported at
7.7.7.1 are preferred over other peerings. This is equivalent to:
import: {
from AS1 at 7.7.7.1 action med=0; pref=1; accept {0.0.0.0/0^0-
18} AND AS1;
from AS1 action med=0; pref=2; accept {0.0.0.0/0^0-
18} AND AS1;
}
The above syntax and semantics also apply equally to structured
export policies with "from" replaced with "to" and "accept" is
replaced with "announce".
7 dictionary Class
The dictionary class provides extensibility to RPSL. Dictionary
objects define routing policy attributes, types, and routing
protocols. Routing policy attributes, henceforth called rp-
attributes, may correspond to actual protocol attributes, such as the
BGP path attributes (e.g. community, dpa, and AS-path), or they may
correspond to router features (e.g. BGP route flap damping). As new
protocols, new protocol attributes, or new router features are
introduced, the dictionary object is updated to include appropriate
rp-attribute and protocol definitions.
An rp-attribute is an abstract class; that is a data representation
is not available. Instead, they are accessed through access methods.
For example, the rp-attribute for the BGP AS-path attribute is called
aspath; and it has an access method called prepend which stuffs extra
AS numbers to the AS-path attributes. Access methods can take
arguments. Arguments are strongly typed. For example, the method
prepend above takes AS numbers as arguments.
Once an rp-attribute is defined in the dictionary, it can be used to
describe policy filters and actions. Policy analysis tools are
required to fetch the dictionary object and recognize newly defined
rp-attributes, types, and protocols. The analysis tools may
approximate policy analyses on rp-attributes that they do not
understand: a filter method may always match, and an action method
may always perform no-operation. Analysis tools may even download
code to perform appropriate operations using mechanisms outside the
scope of RPSL.
We next describe the syntax and semantics of the dictionary class.
This description is not essential for understanding dictionary
objects (but it is essential for creating one). Please feel free to
skip to the RPSL Initial Dictionary subsection (Section 7.1).
The attributes of the dictionary class are shown in Figure 24. The
dictionary attribute is the name of the dictionary object, obeying
the RPSL naming rules. There can be many dictionary objects, however
there is always one well-known dictionary object "RPSL". All tools
use this dictionary by default.
Attribute Value Type
dictionary <object-name> mandatory, single-valued,
class key
rp-attribute see description in text optional, multi valued
typedef see description in text optional, multi valued
protocol see description in text optional, multi valued
Figure 24: dictionary Class Attributes
The rp-attribute attribute has the following syntax:
rp-attribute: <name>
<method-1>(<type-1-1>, ..., <type-1-N1> [, "..."])
...
<method-M>(<type-M-1>, ..., <type-M-NM> [, "..."])
where <name> is the name of the rp-attribute; and <method-i> is the
name of an access method for the rp-attribute, taking Ni arguments
where the j-th argument is of type <type-i-j>. A method name is
either an RPSL name or one of the operators defined in Figure 25.
The operator methods with the exception of operator() and operator[]
can take only one argument.
operator= operator==
operator<<= operator<
operator>>= operator>
operator+= operator>=
operator-= operator<=
operator*= operator!=
operator/= operator()
operator.= operator[]
Figure 25: Operators
An rp-attribute can have many methods defined for it. Some of the
methods may even have the same name, in which case their arguments
are of different types. If the argument list is followed by "...",
the method takes a variable number of arguments. In this case, the
actual arguments after the Nth argument are of type <type-N>.
Arguments are strongly typed. A <type> in RPSL is either a
predefined type, a union type, a list type, or a dictionary defined
type. The predefined types are listed in Figure 26.
integer[lower, upper] ipv4_address
real[lower, upper] address_prefix
enum[name, name, ...] address_prefix_range
string dns_name
boolean filter
rpsl_word as_set_name
free_text route_set_name
email rtr_set_name
as_number filter_set_name
peering_set_name
Figure 26: Predefined Types
The integer and the real predefined types can be followed by a lower
and an upper bound to specify the set of valid values of the
argument. The range specification is optional. We use the ANSI C
language conventions for representing integer, real and string
values. The enum type is followed by a list of RPSL names which are
the valid values of the type. The boolean type can take the values
true or false. as_number, ipv4_address, address_prefix and dns_name
types are as in Section 2. filter type is a policy filter as in
Section 6. The value of filter type is suggested to be enclosed in
parenthesis.
The syntax of a union type is as follows:
union <type-1>, ... , <type-N>
where <type-i> is an RPSL type. The union type is either of the
types <type-1> through <type-N> (analogous to unions in C[14]).
The syntax of a list type is as follows:
list [<min_elems>:<max_elems>] of <type>
In this case, the list elements are of <type> and the list contains
at least <min_elems> and at most <max_elems> elements. The size
specification is optional. If it is not specified, there is no
restriction in the number of list elements. A value of a list type
is represented as a sequence of elements separated by the character
"," and enclosed by the characters "{" and "}".
The typedef attribute in the dictionary defines named types as
follows:
typedef: <name> <type>
where <name> is a name for type <type>. typedef attribute is
paticularly useful when the type defined is not a predefined type
(e.g. list of unions, list of lists, etc.).
A protocol attribute of the dictionary class defines a protocol and a
set of peering parameters for that protocol (which are used in inet-
rtr class in Section 9). Its syntax is as follows:
protocol: <name>
MANDATORY | OPTIONAL <parameter-1>(<type-1-1>,...,
<type-1-N1> [,"..."])
...
MANDATORY | OPTIONAL <parameter-M>(<type-M-1>,...,
<type-M-NM> [,"..."])
where <name> is the name of the protocol; MANDATORY and OPTIONAL are
keywords; and <parameter-i> is a peering parameter for this protocol,
taking Ni many arguments. The syntax and semantics of the arguments
are as in the rp-attribute. If the keyword MANDATORY is used, the
parameter is mandatory and needs to be specified for each peering of
this protocol. If the keyword OPTIONAL is used, the parameter can be
skipped.
7.1 Initial RPSL Dictionary and Example Policy Actions and Filters
dictionary: RPSL
rp-attribute: # preference, smaller values represent higher preferences
pref
operator=(integer[0, 65535])
rp-attribute: # BGP multi_exit_discriminator attribute
med
# to set med to 10: med = 10;
# to set med to the IGP metric: med = igp_cost;
operator=(union integer[0, 65535], enum[igp_cost])
rp-attribute: # BGP destination preference attribute (dpa)
dpa
operator=(integer[0, 65535])
rp-attribute: # BGP aspath attribute
aspath
# prepends AS numbers from last to first order
prepend(as_number, ...)
typedef: # a community value in RPSL is either
# - a 4 byte integer (ok to use 3561:70 notation)
# - internet, no_export, no_advertise (see RFC-1997)
community_elm union
integer[1, 4294967295],
enum[internet, no_export, no_advertise],
typedef: # list of community values { 40, no_export, 3561:70 }
community_list list of community_elm
rp-attribute: # BGP community attribute
community
# set to a list of communities
operator=(community_list)
# append community values
operator.=(community_list)
append(community_elm, ...)
# delete community values
delete(community_elm, ...)
# a filter: true if one of community values is contained
contains(community_elm, ...)
# shortcut to contains: community(no_export, 3561:70)
operator()(community_elm, ...)
# order independent equality comparison
operator==(community_list)
rp-attribute: # next hop router in a static route
next-hop
# to set to 7.7.7.7: next-hop = 7.7.7.7;
# to set to router's own address: next-hop = self;
operator=(union ipv4_address, enum[self])
rp-attribute: # cost of a static route
cost
operator=(integer[0, 65535])
protocol: BGP4
# as number of the peer router
MANDATORY asno(as_number)
# enable flap damping
OPTIONAL flap_damp()
OPTIONAL flap_damp(integer[0,65535],
# penalty per flap
integer[0,65535],
# penalty value for supression
integer[0,65535],
# penalty value for reuse
integer[0,65535],
# halflife in secs when up
integer[0,65535],
# halflife in secs when down
integer[0,65535])
# maximum penalty
protocol: OSPF
protocol: RIP
protocol: IGRP
protocol: IS-IS
protocol: STATIC
protocol: RIPng
protocol: DVMRP
protocol: PIM-DM
protocol: PIM-SM
protocol: CBT
protocol: MOSPF
Figure 27: RPSL Dictionary
Figure 27 shows the initial RPSL dictionary. It has seven rp-
attributes: pref to assign local preference to the routes accepted;
med to assign a value to the MULTI_EXIT_DISCRIMINATOR BGP attribute;
dpa to assign a value to the DPA BGP attribute; aspath to prepend a
value to the AS_PATH BGP attribute; community to assign a value to or
to check the value of the community BGP attribute; next-hop to assign
next hop routers to static routes; and cost to assign a cost to
static routes. The dictionary defines two types: community_elm and
community_list. community_elm type is either a 4-byte unsigned
integer, or one of the keywords internet, no_export or no_advertise
(defined in [9]). An integer can be specified using two 2-byte
integers seperated by ":" to partition the community number space so
that a provider can use its AS number as the first two bytes, and
assigns a semantics of its choice to the last two bytes.
The initial dictionary (Figure 27) defines only options for the
Border Gateway Protocol: asno and flap_damp. The mandatory asno
option is the AS number of the peer router. The optional flap_damp
option instructs the router to damp route flaps [21] when importing
routes from the peer router.
It can be specified with or without parameters. If parameters are
missing, they default to:
flap_damp(1000, 2000, 750, 900, 900, 20000)
That is, a penalty of 1000 is assigned at each route flap, the route
is suppressed when penalty reaches 2000. The penalty is reduced in
half after 15 minutes (900 seconds) of stability regardless of
whether the route is up or down. A supressed route is reused when
the penalty falls below 750. The maximum penalty a route can be
assigned is 20,000 (i.e. the maximum suppress time after a route
becomes stable is about 75 minutes). These parameters are consistent
with the default flap damping parameters in several routers.
Policy Actions and Filters Using RP-Attributes
The syntax of a policy action or a filter using an rp-attribute x is
as follows:
x.method(arguments)
x "op" argument
where method is a method and "op" is an operator method of the rp-
attribute x. If an operator method is used in specifying a composite
policy filter, it evaluates earlier than the composite policy filter
operators (i.e. AND, OR, NOT, and implicit or operator).
The pref rp-attribute can be assigned a positive integer as follows:
pref = 10;
The med rp-attribute can be assigned either a positive integer or the
word "igp_cost" as follows:
med = 0;
med = igp_cost;
The dpa rp-attribute can be assigned a positive integer as follows:
dpa = 100;
The BGP community attribute is list-valued, that is it is a list of
4-byte integers each representing a "community". The following
examples demonstrate how to add communities to this rp-attribute:
community .= { 100 };
community .= { NO_EXPORT };
community .= { 3561:10 };
In the last case, a 4-byte integer is constructed where the more
significant two bytes equal 3561 and the less significant two bytes
equal 10. The following examples demonstrate how to delete
communities from the community rp-attribute:
community.delete(100, NO_EXPORT, 3561:10);
Filters that use the community rp-attribute can be defined as
demonstrated by the following examples:
community.contains(100, NO_EXPORT, 3561:10);
community(100, NO_EXPORT, 3561:10); # shortcut
The community rp-attribute can be set to a list of communities as
follows:
community = {100, NO_EXPORT, 3561:10, 200};
community = {};
In this first case, the community rp-attribute contains the
communities 100, NO_EXPORT, 3561:10, and 200. In the latter case,
the community rp-attribute is cleared. The community rp-attribute
can be compared against a list of communities as follows:
community == {100, NO_EXPORT, 3561:10, 200}; # exact match
To influence the route selection, the BGP as_path rp-attribute can be
made longer by prepending AS numbers to it as follows:
aspath.prepend(AS1);
aspath.prepend(AS1, AS1, AS1);
The following examples are invalid:
med = -50; # -50 is not in the range
med = igp; # igp is not one of the enum values
med.assign(10); # method assign is not defined
community.append(AS3561:20); # the first argument should be 3561
Figure 28 shows a more advanced example using the rp-attribute
community. In this example, AS3561 bases its route selection
preference on the community attribute. Other ASes may indirectly
affect AS3561's route selection by including the appropriate
communities in their route announcements.
aut-num: AS1
export: to AS2 action community.={3561:90};
to AS3 action community.={3561:80};
announce AS1
as-set: AS3561:AS-PEERS
members: AS2, AS3
aut-num: AS3561
import: from AS3561:AS-PEERS
action pref = 10;
accept community(3561:90)
import: from AS3561:AS-PEERS
action pref = 20;
accept community(3561:80)
import: from AS3561:AS-PEERS
action pref = 20;
accept community(3561:70)
import: from AS3561:AS-PEERS
action pref = 0;
accept ANY
Figure 28: Policy example using the community rp-attribute.
8 Advanced route Class
8.1 Specifying Aggregate Routes
The components, aggr-bndry, aggr-mtd, export-comps, inject, and holes
attributes are used for specifying aggregate routes [11]. A route
object specifies an aggregate route if any of these attributes, with
the exception of inject, is specified. The origin attribute for an
aggregate route is the AS performing the aggregation, i.e. the
aggregator AS. In this section, we used the term "aggregate" to refer
to the route generated, the term "component" to refer to the routes
used to generate the path attributes of the aggregate, and the term
"more specifics" to refer to any route which is a more specific of
the aggregate regardless of whether it was used to form the path
attributes.
The components attribute defines what component routes are used to
form the aggregate. Its syntax is as follows:
components: [ATOMIC] [[<filter>] [protocol <protocol> <filter> ...]]
where <protocol> is a routing protocol name such as BGP4, OSPF or RIP
(valid names are defined in the dictionary) and <filter> is a policy
expression. The routes that match one of these filters and are
learned from the corresponding protocol are used to form the
aggregate. If <protocol> is omitted, it defaults to any protocol.
<filter> implicitly contains an "AND" term with the more specifics of
the aggregate so that only the component routes are selected. If the
keyword ATOMIC is used, the aggregation is done atomically [11]. If
a <filter> is not specified it defaults to more specifics. If the
components attribute is missing, all more specifics without the
ATOMIC keyword is used.
route: 128.8.0.0/15
origin: AS1
components: <^AS2>
route: 128.8.0.0/15
origin: AS1
components: protocol BGP4 {128.8.0.0/16^+}
protocol OSPF {128.9.0.0/16^+}
Figure 29: Two aggregate route objects.
Figure 29 shows two route objects. In the first example, more
specifics of 128.8.0.0/15 with AS paths starting with AS2 are
aggregated. In the second example, some routes learned from BGP and
some routes learned form OSPF are aggregated.
The aggr-bndry attribute is an AS expression over AS numbers and sets
(see Section 5.6). The result defines the set of ASes which form the
aggregation boundary. If the aggr-bndry attribute is missing, the
origin AS is the sole aggregation boundary. Outside the aggregation
boundary, only the aggregate is exported and more specifics are
suppressed. However, within the boundary, the more specifics are
also exchanged.
The aggr-mtd attribute specifies how the aggregate is generated. Its
syntax is as follows:
aggr-mtd: inbound
| outbound [<as-expression>]
where <as-expression> is an expression over AS numbers and sets (see
Section 5.6). If <as-expression> is missing, it defaults to AS-ANY.
If outbound aggregation is specified, the more specifics of the
aggregate will be present within the AS and the aggregate will be
formed at all inter-AS boundaries with ASes in <as-expression> before
export, except for ASes that are within the aggregating boundary
(i.e. aggr-bndry is enforced regardless of <as-expression>). If
inbound aggregation is specified, the aggregate is formed at all
inter-AS boundaries prior to importing routes into the aggregator AS.
Note that <as-expression> can not be specified with inbound
aggregation. If aggr-mtd attribute is missing, it defaults to
"outbound AS-ANY".
route: 128.8.0.0/15 route: 128.8.0.0/15
origin: AS1 origin: AS2
components: {128.8.0.0/15^-} components: {128.8.0.0/15^-}
aggr-bndry: AS1 OR AS2 aggr-bndry: AS1 OR AS2
aggr-mtd: outbound AS-ANY aggr-mtd: outbound AS-ANY
Figure 30: Outbound multi-AS aggregation example.
Figure 30 shows an example of an outbound aggregation. In this
example, AS1 and AS2 are coordinating aggregation and announcing only
the less specific 128.8.0.0/15 to outside world, but exchanging more
specifics between each other. This form of aggregation is useful
when some of the components are within AS1 and some are within AS2.
When a set of routes are aggregated, the intent is to export only the
aggregate route and suppress exporting of the more specifics outside
the aggregation boundary. However, to satisfy certain policy and
topology constraints (e.g. a multi-homed component), it is often
required to export some of the components. The export-comps
attribute equals an RPSL filter that matches the more specifics that
need to be exported outside the aggregation boundary. If this
attribute is missing, more specifics are not exported outside the
aggregation boundary. Note that, the export-comps filter contains an
implicit "AND" term with the more specifics of the aggregate.
Figure 31 shows an example of an outbound aggregation. In this
example, the more specific 128.8.8.0/24 is exported outside AS1 in
addition to the aggregate. This is useful, when 128.8.8.0/24 is
multi-homed site to AS1 with some other AS.
route: 128.8.0.0/15
origin: AS1
components: {128.8.0.0/15^-}
aggr-mtd: outbound AS-ANY
export-comps: {128.8.8.0/24}
Figure 31: Outbound aggregation with export exception.
The inject attribute specifies which routers perform the aggregation
and when they perform it. Its syntax is as follow:
inject: [at <router-expression>] ...
[action <action>]
[upon <condition>]
where <action> is an action specification (see Section 6.1.1),
<condition> is a boolean expression described below, and <router-
expression> is as described in Section 5.6.
All routers in <router-expression> and in the aggregator AS perform
the aggregation. If a <router-expression> is not specified, all
routers inside the aggregator AS perform the aggregation. The
<action> specification may set path attributes of the aggregate, such
as assign a preferences to the aggregate.
The upon clause is a boolean condition. The aggregate is generated
if and only if this condition is true. <condition> is a boolean
expression using the logical operators AND and OR (i.e. operator NOT
is not allowed) over:
HAVE-COMPONENTS { list of prefixes }
EXCLUDE { list of prefixes }
STATIC
The list of prefixes in HAVE-COMPONENTS can only be more specifics of
the aggregate. It evaluates to true when all the prefixes listed are
present in the routing table of the aggregating router. The list can
also include prefix ranges (i.e. using operators ^-, ^+, ^n, and ^n-
m). In this case, at least one prefix from each prefix range needs
to be present in the routing table for the condition to be true. The
list of prefixes in EXCLUDE can be arbitrary. It evaluates to true
when none of the prefixes listed is present in the routing table.
The list can also include prefix ranges, and no prefix in that range
should be present in the routing table. The keyword static always
evaluates to true. If no upon clause is specified the aggregate is
generated if an only if there is a component in the routing table
(i.e. a more specific that matches the filter in the components
attribute).
route: 128.8.0.0/15
origin: AS1
components: {128.8.0.0/15^-}
aggr-mtd: outbound AS-ANY
inject: at 1.1.1.1 action dpa = 100;
inject: at 1.1.1.2 action dpa = 110;
route: 128.8.0.0/15
origin: AS1
components: {128.8.0.0/15^-}
aggr-mtd: outbound AS-ANY
inject: upon HAVE-COMPONENTS {128.8.0.0/16, 128.9.0.0/16}
holes: 128.8.8.0/24
Figure 32: Examples of inject.
Figure 32 shows two examples. In the first case, the aggregate is
injected at two routers each one setting the dpa path attribute
differently. In the second case, the aggregate is generated only if
both 128.8.0.0/16 and 128.9.0.0/16 are present in the routing table,
as opposed to the first case where the presence of just one of them
is sufficient for injection.
The holes attribute lists the component address prefixes which are
not reachable through the aggregate route (perhaps that part of the
address space is unallocated). The holes attribute is useful for
diagnosis purposes. In Figure 32, the second example has a hole,
namely 128.8.8.0/24. This may be due to a customer changing
providers and taking this part of the address space with it.
8.1.1 Interaction with policies in aut-num class
An aggregate formed is announced to other ASes only if the export
policies of the AS allows exporting the aggregate. When the
aggregate is formed, the more specifics are suppressed from being
exported except to the ASes in aggr-bndry and except the components
in export-comps. For such exceptions to happen, the export policies
of the AS should explicitly allow exporting of these exceptions.
If an aggregate is not formed (due to the upon clause), then the more
specifics of the aggregate can be exported to other ASes, but only if
the export policies of the AS allows it. In other words, before a
route (aggregate or more specific) is exported it is filtered twice,
once based on the route objects, and once based on the export
policies of the AS.
route: 128.8.0.0/16
origin: AS1
route: 128.9.0.0/16
origin: AS1
route: 128.8.0.0/15
origin: AS1
aggr-bndry: AS1 or AS2 or AS3
aggr-mtd: outbound AS3 or AS4 or AS5
components: {128.8.0.0/16, 128.9.0.0/16}
inject: upon HAVE-COMPONENTS {128.9.0.0/16, 128.8.0.0/16}
aut-num: AS1
export: to AS2 announce AS1
export: to AS3 announce AS1 and not {128.9.0.0/16}
export: to AS4 announce AS1
export: to AS5 announce AS1
export: to AS6 announce AS1
Figure 33: Interaction with policies in aut-num class.
In Figure 33 shows an interaction example. By examining the route
objects, the more specifics 128.8.0.0/16 and 128.9.0.0/16 should be
exchanged between AS1, AS2 and AS3 (i.e. the aggregation boundary).
Outbound aggregation is done to AS4 and AS5 and not to AS3, since AS3
is in the aggregation boundary. The aut-num object allows exporting
both components to AS2, but only the component 128.8.0.0/16 to AS3.
The aggregate can only be formed if both components are available.
In this case, only the aggregate is announced to AS4 and AS5.
However, if one of the components is not available the aggregate will
not be formed, and any available component or more specific will be
exported to AS4 and AS5. Regardless of aggregation is performed or
not, only the more specifics will be exported to AS6 (it is not
listed in the aggr-mtd attribute).
When doing an inbound aggregation, configuration generators may
eliminating the aggregation statements on routers where import policy
of the AS prohibits importing of any more specifics.
8.1.2 Ambiguity resolution with overlapping aggregates
When several aggregate routes are specified and they overlap, i.e.
one is less specific of the other, they must be evaluated more
specific to less specific order. When an outbound aggregation is
performed for a peer, the aggregate and the components listed in the
export-comps attribute for that peer are available for generating the
next less specific aggregate. The components that are not specified
in the export-comps attribute are not available. A route is
exportable to an AS if it is the least specific aggregate exportable
to that AS or it is listed in the export-comps attribute of an
exportable route. Note that this is a recursive definition.
route: 128.8.0.0/15
origin: AS1
aggr-bndry: AS1 or AS2
aggr-mtd: outbound
inject: upon HAVE-COMPONENTS {128.8.0.0/16, 128.9.0.0/16}
route: 128.10.0.0/15
origin: AS1
aggr-bndry: AS1 or AS3
aggr-mtd: outbound
inject: upon HAVE-COMPONENTS {128.10.0.0/16, 128.11.0.0/16}
export-comps: {128.11.0.0/16}
route: 128.8.0.0/14
origin: AS1
aggr-bndry: AS1 or AS2 or AS3
aggr-mtd: outbound
inject: upon HAVE-COMPONENTS {128.8.0.0/15, 128.10.0.0/15}
export-comps: {128.10.0.0/15}
Figure 34: Overlapping aggregations.
In Figure 34, AS1 together with AS2 aggregates 128.8.0.0/16 and
128.9.0.0/16 into 128.8.0.0/15. Together with AS3, AS1 aggregates
128.10.0.0/16 and 128.11.0.0/16 into 128.10.0.0/15. But altogether
they aggregate these four routes into 128.8.0.0/14. Assuming all
four components are available, a router in AS1 for an outside AS, say
AS4, will first generate 128.8.0.0/15 and 128.10.0.0/15. This will
make 128.8.0.0/15, 128.10.0.0/15 and its exception 128.11.0.0/16
available for generating 128.8.0.0/14. The router will then generate
128.8.0.0/14 from these three routes. Hence for AS4, 128.8.0.0/14
and its exception 128.10.0.0/15 and its exception 128.11.0.0/16 will
be exportable.
For AS2, a router in AS1 will only generate 128.10.0.0/15. Hence,
128.10.0.0/15 and its exception 128.11.0.0/16 will be exportable.
Note that 128.8.0.0/16 and 128.9.0.0/16 are also exportable since
they did not participate in an aggregate exportable to AS2.
Similarly, for AS3, a router in AS1 will only generate 128.8.0.0/15.
In this case 128.8.0.0/15, 128.10.0.0/16, 128.11.0.0/16 are
exportable.
8.2 Specifying Static Routes
The inject attribute can be used to specify static routes by using
"upon static" as the condition:
inject: [at <router-expression>] ...
[action <action>]
upon static
In this case, the routers in <router-expression> executes the
<action> and injects the route to the interAS routing system
statically. <action> may set certain route attributes such as a
next-hop router or a cost.
In the following example, the router 7.7.7.1 injects the route
128.7.0.0/16. The next-hop routers (in this example, there are two
next-hop routers) for this route are 7.7.7.2 and 7.7.7.3 and the
route has a cost of 10 over 7.7.7.2 and 20 over 7.7.7.3.
route: 128.7.0.0/16
origin: AS1
inject: at 7.7.7.1 action next-hop = 7.7.7.2; cost = 10; upon static
inject: at 7.7.7.1 action next-hop = 7.7.7.3; cost = 20; upon static
9 inet-rtr Class
Routers are specified using the inet-rtr class. The attributes of the
inet-rtr class are shown in Figure 35. The inet-rtr attribute is a valid
DNS name of the router described. Each alias attribute, if present, is a
canonical DNS name for the router. The local-as attribute specifies the AS
number of the AS which owns/operates this router.
Attribute Value Type
inet-rtr <dns-name> mandatory, single-valued, class key
alias <dns-name> optional, multi-valued
local-as <as-number> mandatory, single-valued
ifaddr see description in text mandatory, multi-valued
peer see description in text optional, multi-valued
member-of list of <rtr-set-names> optional, multi-valued
Figure 35: inet-rtr Class Attributes
The value of an ifaddr attribute has the following syntax:
<ipv4-address> masklen <integer> [action <action>]
The IP address and the mask length are mandatory for each interface.
Optionally an action can be specified to set other parameters of this
interface.
Figure 36 presents an example inet-rtr object. The name of the
router is "amsterdam.ripe.net". "amsterdam1.ripe.net" is a canonical
name for the router. The router is connected to 4 networks. Its IP
addresses and mask lengths in those networks are specified in the
ifaddr attributes.
inet-rtr: Amsterdam.ripe.net
alias: amsterdam1.ripe.net
local-as: AS3333
ifaddr: 192.87.45.190 masklen 24
ifaddr: 192.87.4.28 masklen 24
ifaddr: 193.0.0.222 masklen 27