📄 rfc2622.txt
字号:
aut-num: AS1
import: from AS2 accept AS2
import: from AS2 accept AS-FOO
import: from AS2 accept RS-FOO
Alaettinoglu, et al. Standards Track [Page 18]
RFC 2622 RPSL June 1999
The keyword PeerAS can be used instead of the AS number of the peer
AS. PeerAS is particularly useful when the peering is specified
using an AS expression. For example:
as-set: AS-FOO
members: AS2, AS3
aut-num: AS1
import: from AS-FOO accept PeerAS
is same as:
aut-num: AS1
import: from AS2 accept AS2
import: from AS3 accept AS3
A route set name can also be followed by one of the operators '^-',
'^+', example, { 5.0.0.0/8, 6.0.0.0/8 }^+ equals { 5.0.0.0/8^+,
6.0.0.0/8^+ }, and AS1^- equals all the exclusive more specifics of
routes originated by AS1.
AS Path Regular Expressions
An AS-path regular expression can be used as a policy filter by
enclosing the expression in `<' and `>'. An AS-path policy filter
matches the set of routes which traverses a sequence of ASes
matched by the AS-path regular expression. A router can check
this using the AS_PATH attribute in the Border Gateway Protocol
[19], or the RD_PATH attribute in the Inter-Domain Routing
Protocol [18].
AS-path Regular Expressions are POSIX compliant regular
expressions over the alphabet of AS numbers. The regular
expression constructs are as follows:
ASN
where ASN is an AS number. ASN matches the AS-path that is of
length 1 and contains the corresponding AS number (e.g. AS-path
regular expression AS1 matches the AS-path "1").
The keyword PeerAS can be used instead of the AS number of the
peer AS.
AS-set
where AS-set is an AS set name. AS-set matches the AS-paths that
is matched by one of the ASes in the AS-set.
.
matches the AS-paths matched by any AS number.
Alaettinoglu, et al. Standards Track [Page 19]
RFC 2622 RPSL June 1999
[...]
is an AS number set. It matches the AS-paths matched by the AS
numbers listed between the brackets. The AS numbers in the set
are separated by white space characters. If a `-' is used between
two AS numbers in this set, all AS numbers between the two AS
numbers are included in the set. If an as-set name is listed, all
AS numbers in the as-set are included.
[^...]
is a complemented AS number set. It matches any AS-path which is
not matched by the AS numbers in the set.
^
Matches the empty string at the beginning of an AS-path.
$
Matches the empty string at the end of an AS-path.
We next list the regular expression operators in the decreasing order
of evaluation. These operators are left associative, i.e. performed
left to right.
Unary postfix operators * + ? {m} {m,n} {m,}
For a regular expression A, A* matches zero or more occurrences of
A; A+ matches one or more occurrences of A; A? matches zero or
one occurrence of A; A{m} matches m occurrence of A; A{m,n}
matches m to n occurrence of A; A{m,} matches m or more occurrence
of A. For example, [AS1 AS2]{2} matches AS1 AS1, AS1 AS2, AS2 AS1,
and AS2 AS2.
Unary postfix operators ~* ~+ ~{m} ~{m,n} ~{m,}
These operators have similar functionality as the corresponding
operators listed above, but all occurrences of the regular
expression has to match the same pattern. For example, [AS1
AS2]~{2} matches AS1 AS1 and AS2 AS2, but it does not match AS1
AS2 and AS2 AS1.
Binary catenation operator
This is an implicit operator and exists between two regular
expressions A and B when no other explicit operator is specified.
The resulting expression A B matches an AS-path if A matches some
prefix of the AS-path and B matches the rest of the AS-path.
Binary alternative (or) operator |
For a regular expressions A and B, A | B matches any AS-path that
is matched by A or B.
Alaettinoglu, et al. Standards Track [Page 20]
RFC 2622 RPSL June 1999
Parenthesis can be used to override the default order of evaluation.
White spaces can be used to increase readability.
The following are examples of AS-path filters:
<AS3>
<^AS1>
<AS2$>
<^AS1 AS2 AS3$>
<^AS1 .* AS2$>.
The first example matches any route whose AS-path contains AS3, the
second matches routes whose AS-path starts with AS1, the third
matches routes whose AS-path ends with AS2, the fourth matches routes
whose AS-path is exactly "1 2 3", and the fifth matches routes whose
AS-path starts with AS1 and ends in AS2 with any number of AS numbers
in between.
Composite Policy Filters The following operators (in decreasing order
of evaluation) can be used to form composite policy filters:
NOT Given a policy filter x, NOT x matches the set of routes that
are not matched by x. That is it is the negation of policy
filter x.
AND Given two policy filters x and y, x AND y matches the intersection
of the routes that are matched by x and that are matched by y.
OR Given two policy filters x and y, x OR y matches the union of the
routes that are matched by x and that are matched by y.
Note that an OR operator can be implicit, that is `x y' is equivalent
to `x OR y'.
E.g.
NOT {128.9.0.0/16, 128.8.0.0/16}
AS226 AS227 OR AS228
AS226 AND NOT {128.9.0.0/16}
AS226 AND {0.0.0.0/0^0-18}
The first example matches any route except 128.9.0.0/16 and
128.8.0.0/16. The second example matches the routes of AS226, AS227
and AS228. The third example matches the routes of AS226 except
128.9.0.0/16. The fourth example matches the routes of AS226 whose
length are not longer than 18.
Alaettinoglu, et al. Standards Track [Page 21]
RFC 2622 RPSL June 1999
Routing Policy Attributes Policy filters can also use the values of
other attributes for comparison. The attributes whose values can be
used in policy filters are specified in the RPSL dictionary. Please
refer to Section 7 for details. An example using the the BGP
community attribute is shown below:
aut-num: AS1
export: to AS2 announce AS1 AND NOT community(NO_EXPORT)
Filters using the routing policy attributes defined in the dictionary
are evaluated before evaluating the operators AND, OR and NOT.
Filter Set Name
A filter set name matches the set of routes that are matched by
its filter attribute. Note that the filter attribute of a filter
set, can recursively refer to other filter set names. For example
in Figure 17, fltr-foo matches { 5.0.0.0/8, 6.0.0.0/8 }, and
fltr-bar matches AS1'S routes or { 5.0.0.0/8, 6.0.0.0/8 } if their
as path contained AS2.
5.5 rtr-set Class
The attributes of the rtr-set class are shown in Figure 18. The
rtr-set attribute defines the name of the set. It is an RPSL name
that starts with "rtrs-". The members attribute lists the members of
the set. The members attribute is a list of inet-rtr names,
ipv4_addresses or other rtr-set names.
Attribute Value Type
rtr-set <object-name> mandatory, single-valued,
class key
members list of <inet-rtr-names> or optional, multi-valued
<rtr-set-names>
or <ipv4_addresses>
mbrs-by-ref list of <mntner-names> optional, multi-valued
Figure 18: rtr-set Class Attributes
Alaettinoglu, et al. Standards Track [Page 22]
RFC 2622 RPSL June 1999
Figure 19 presents two rtr-set objects. The set rtrs-foo contains
two routers, namely rtr1.isp.net and rtr2.isp.net. The set rtrs-bar
contains the members of the set rtrs-foo and rtr3.isp.net, that is it
contains rtr1.isp.net, rtr2.isp.net, rtr3.isp.net.
rtr-set: rtrs-foo rtr-set: rtrs-bar
members: rtr1.isp.net, rtr2.isp.net members: rtr3.isp.net, rtrs-foo
Figure 19: rtr-set objects.
The mbrs-by-ref attribute is a list of maintainer names or the
keyword ANY. If this attribute is used, the router set also includes
routers whose inet-rtr objects are registered by one of these
maintainers and whose member-of attribute refers to the name of this
router set. If the value of a mbrs-by-ref attribute is ANY, any
inet-rtr object referring to the router set is a member of the set.
If the mbrs-by-ref attribute is missing, only the routers listed in
the members attribute are members of the set.
rtr-set: rtrs-foo
members: rtr1.isp.net, rtr2.isp.net
mbrs-by-ref: MNTR-ME
inet-rtr: rtr3.isp.net
local-as: as1
ifaddr: 1.1.1.1 masklen 30
member-of: rtrs-foo
mnt-by: MNTR-ME
Figure 20: rtr-set objects.
Figure 20 presents an example rtr-set object that uses the mbrs-by-
ref attribute. The set rtrs-foo contains rtr1.isp.net, rtr2.isp.net
and rtr3.isp.net.
Alaettinoglu, et al. Standards Track [Page 23]
RFC 2622 RPSL June 1999
5.6 Peerings and peering-set Class
The attributes of the peering-set class are shown in Figure 21. A
peering-set object defines a set of peerings that are listed in its
peering attributes. The peering-set attribute defines the name of
the set. It is an RPSL name that starts with "prng-".
Attribute Value Type
peering-set <object-name> mandatory, single-valued, class key
peering <peering> mandatory, multi-valued
Figure 21: filter Class Attributes
The peering attribute defines a peering that can be used for
importing or
---------------------- ----------------------
| 7.7.7.1 |-------| |-------| 7.7.7.2 |
| | ======== | |
| AS1 | EX1 |-------| 7.7.7.3 AS2 |
| | | |
| 9.9.9.1 |------ ------| 9.9.9.2 |
---------------------- | | ----------------------
===========
| EX2
---------------------- |
| 9.9.9.3 |---------
| |
| AS3 |
----------------------
Figure 22: Example topology consisting of three ASes, AS1, AS2, and
AS3; two exchange points, EX1 and EX2; and six routers.
exporting routes.
In describing peerings, we are going to use the topology of Figure
22. In this topology, there are three ASes, AS1, AS2, and AS3;
two exchange points, EX1 and EX2; and six routers. Routers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -