Network Working Group C. Alaettinoglu Request for Comments: 2622 USC/Information Sciences Institute Obsoletes: 2280 C. Villamizar Category: Standards Track Avici Systems E. Gerich At Home Network D. Kessens Qwest Communications D. Meyer University of Oregon T. Bates Cisco Systems D. Karrenberg RIPE NCC M. Terpstra Bay Networks June 1999 Routing Policy Specification Language (RPSL) Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. Copyright Notice Copyright (C) The Internet Society (1999). All Rights Reserved.Abstract
RPSL allows a network operator to be able to specify routing policies at various levels in the Internet hierarchy; for example at the Autonomous System (AS) level. At the same time, policies can be specified with sufficient detail in RPSL so that low level router configurations can be generated from them. RPSL is extensible; new routing protocols and new protocol features can be introduced at any time.
Table of Contents
1 Introduction 3 2 RPSL Names, Reserved Words, and Representation 4 3 Contact Information 7 3.1 mntner Class . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 person Class . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3 role Class . . . . . . . . . . . . . . . . . . . . . . . . . 11 4 route Class 12 5 Set Classes 13 5.1 as-set Class . . . . . . . . . . . . . . . . . . . . . . . . 14 5.2 route-set Class. . . . . . . . . . . . . . . . . . . . . . . 15 5.3 Predefined Set Objects . . . . . . . . . . . . . . . . . . . 17 5.4 Filters and filter-set Class . . . . . . . . . . . . . . . . 17 5.5 rtr-set Class. . . . . . . . . . . . . . . . . . . . . . . . 22 5.6 Peerings and peering-set Class . . . . . . . . . . . . . . . 24 6 aut-num Class 27 6.1 import Attribute: Import Policy Specification . . . . . . . 27 6.1.1 Action Specification . . . . . . . . . . . . . . . . . . 28 6.2 export Attribute: Export Policy Specification . . . . . . . 29 6.3 Other Routing Protocols, Multi-Protocol Routing Protocols, and Injecting Routes Between Protocols . . . . . . . . . . . . 29 6.4 Ambiguity Resolution . . . . . . . . . . . . . . . . . . . . 31 6.5 default Attribute: Default Policy Specification . . . . . . 33 6.6 Structured Policy Specification. . . . . . . . . . . . . . . 33 7 dictionary Class 37 7.1 Initial RPSL Dictionary and Example Policy Actions and Filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 8 Advanced route Class 45 8.1 Specifying Aggregate Routes. . . . . . . . . . . . . . . . . 45 8.1.1 Interaction with policies in aut-num class . . . . . . . 49 8.1.2 Ambiguity resolution with overlapping aggregates . . . . 50 8.2 Specifying Static Routes . . . . . . . . . . . . . . . . . . 52 9 inet-rtr Class 52 10 Extending RPSL 54 10.1 Extensions by changing the dictionary class . . . . . . . . 54 10.2 Extensions by adding new attributes to existing classes . . 55 10.3 Extensions by adding new classes . . . . . . . . . . . . . 55 10.4 Extensions by changing the syntax of existing RPSL attributes. . . . . . . . . . . . . . . . . . . . . . . . . . 55 11 Security Considerations 56 12 Acknowledgements 56 References 56 A. Routing Registry Sites 59 B. Grammar Rules 59 C. Changes from RFC 2280 67 D. Authors' Addresses 68 Full Copyright Statement 69
1 Introduction
This memo is the reference document for the Routing Policy Specification Language (RPSL). RPSL allows a network operator to be able to specify routing policies at various levels in the Internet hierarchy; for example at the Autonomous System (AS) level. At the same time, policies can be specified with sufficient detail in RPSL so that low level router configurations can be generated from them. RPSL is extensible; new routing protocols and new protocol features can be introduced at any time. RPSL is a replacement for the current Internet policy specification language known as RIPE-181 [6] or RFC-1786 [7]. RIPE-81 [8] was the first language deployed in the Internet for specifying routing policies. It was later replaced by RIPE-181 [6]. Through operational use of RIPE-181 it has become apparent that certain policies cannot be specified and a need for an enhanced and more generalized language is needed. RPSL addresses RIPE-181's limitations. RPSL was designed so that a view of the global routing policy can be contained in a single cooperatively maintained distributed database to improve the integrity of Internet's routing. RPSL is not designed to be a router configuration language. RPSL is designed so that router configurations can be generated from the description of the policy for one autonomous system (aut-num class) combined with the description of a router (inet-rtr class), mainly providing router ID, autonomous system number of the router, interfaces and peers of the router, and combined with a global database mappings from AS sets to ASes (as-set class), and from origin ASes and route sets to route prefixes (route and route-set classes). The accurate population of the RPSL database can help contribute toward such goals as router configurations that protect against accidental (or malicious) distribution of inaccurate routing information, verification of Internet's routing, and aggregation boundaries beyond a single AS. RPSL is object oriented; that is, objects contain pieces of policy and administrative information. These objects are registered in the Internet Routing Registry (IRR) by the authorized organizations. The registration process is beyond the scope of this document. Please refer to [1, 17, 4] for more details on the IRR. In the following sections, we present the classes that are used to define various policy and administrative objects. The "mntner" class defines entities authorized to add, delete and modify a set of objects. The "person" and "role" classes describes technical and administrative contact personnel. Autonomous systems (ASes) are specified using the "aut-num" class. Routes are specified using the
"route" class. Sets of objects can be defined using the "as-set", "route-set", "filter-set", "peering-set", and "rtr-set" classes. The "dictionary" class provides the extensibility to the language. The "inet-rtr" class is used to specify routers. Many of these classes were originally defined in earlier documents [6, 13, 16, 12, 5] and have all been enhanced. This document is self-contained. However, the reader is encouraged to read RIPE-181 [7] and the associated documents [13, 16, 12, 5] as they provide significant background as to the motivation and underlying principles behind RIPE-181 and consequently, RPSL. For a tutorial on RPSL, the reader should read the RPSL applications document [4].2 RPSL Names, Reserved Words, and Representation
Each class has a set of attributes which store a piece of information about the objects of the class. Attributes can be mandatory or optional: A mandatory attribute has to be defined for all objects of the class; optional attributes can be skipped. Attributes can also be single or multiple valued. Each object is uniquely identified by a set of attributes, referred to as the class "key". The value of an attribute has a type. The following types are most widely used. Note that RPSL is case insensitive and only the characters from the ASCII character set can be used. <object-name> Many objects in RPSL have a name. An <object-name> is made up of letters, digits, the character underscore "_", and the character hyphen "-"; the first character of a name must be a letter, and the last character of a name must be a letter or a digit. The following words are reserved by RPSL, and they can not be used as names: any as-any rs-any peeras and or not atomic from to at action accept announce except refine networks into inbound outbound Names starting with certain prefixes are reserved for certain object types. Names starting with "as-" are reserved for as set names. Names starting with "rs-" are reserved for route set names. Names starting with "rtrs-" are reserved for router set names. Names starting with "fltr-" are reserved for filter set names. Names starting with "prng-" are reserved for peering set names.
<as-number> An AS number x is represented as the string "ASx". That is, the AS 226 is represented as AS226. <ipv4-address> An IPv4 address is represented as a sequence of four integers in the range from 0 to 255 separated by the character dot ".". For example, 128.9.128.5 represents a valid IPv4 address. In the rest of this document, we may refer to IPv4 addresses as IP addresses. <address-prefix> An address prefix is represented as an IPv4 address followed by the character slash "/" followed by an integer in the range from 0 to 32. The following are valid address prefixes: 128.9.128.5/32, 128.9.0.0/16, 0.0.0.0/0; and the following address prefixes are invalid: 0/0, 128.9/16 since 0 or 128.9 are not strings containing four integers. <address-prefix-range> An address prefix range is an address prefix followed by an optional range operator. The range operators are: ^- is the exclusive more specifics operator; it stands for the more specifics of the address prefix excluding the address prefix itself. For example, 128.9.0.0/16^- contains all the more specifics of 128.9.0.0/16 excluding 128.9.0.0/16. ^+ is the inclusive more specifics operator; it stands for the more specifics of the address prefix including the address prefix itself. For example, 5.0.0.0/8^+ contains all the more specifics of 5.0.0.0/8 including 5.0.0.0/8. ^n where n is an integer, stands for all the length n specifics of the address prefix. For example, 30.0.0.0/8^16 contains all the more specifics of 30.0.0.0/8 which are of length 16 such as 30.9.0.0/16. ^n-m where n and m are integers, stands for all the length n to length m specifics of the address prefix. For example, 30.0.0.0/8^24-32 contains all the more specifics of 30.0.0.0/8 which are of length 24 to 32 such as 30.9.9.96/28. Range operators can also be applied to address prefix sets. In this case, they distribute over the members of the set. For example, for a route-set (defined later) rs-foo, rs-foo^+ contains all the inclusive more specifics of all the prefixes in rs-foo. It is an error to follow a range operator with another one (e.g. 30.0.0.0/8^24-28^+ is an error). However, a range operator can be applied to an address prefix set that has address prefix ranges in it (e.g. {30.0.0.0/8^24-28}^27-30 is not an error). In this case, the
outer operator ^n-m distributes over the inner operator ^k-l and becomes the operator ^max(n,k)-m if m is greater than or equal to max(n,k), or otherwise, the prefix is deleted from the set. Note that the operator ^n is equivalent to ^n-n; prefix/l^+ is equivalent to prefix/l^l-32; prefix/l^- is equivalent to prefix/l^(l+1)-32; {prefix/l^n-m}^+ is equivalent to {prefix/l^n-32}; and {prefix/l^n- m}^- is equivalent to {prefix/l^(n+1)-32}. For example, {128.9.0.0/16^+}^- == {128.9.0.0/16^-} {128.9.0.0/16^-}^+ == {128.9.0.0/16^-} {128.9.0.0/16^17}^24 == {128.9.0.0/16^24} {128.9.0.0/16^20-24}^26-28 == {128.9.0.0/16^26-28} {128.9.0.0/16^20-24}^22-28 == {128.9.0.0/16^22-28} {128.9.0.0/16^20-24}^18-28 == {128.9.0.0/16^20-28} {128.9.0.0/16^20-24}^18-22 == {128.9.0.0/16^20-22} {128.9.0.0/16^20-24}^18-19 == {} <date> A date is represented as an eight digit integer of the form YYYYMMDD where YYYY represents the year, MM represents the month of the year (01 through 12), and DD represents the day of the month (01 through 31). All dates are in UTC unless otherwise specified. For example, June 24, 1996 is represented as 19960624. <email-address>is as described in RFC-822 [10]. <dns-name>is as described in RFC-1034 [17]. <nic-handle> is a uniquely assigned identifier word used by routing, address allocation, and other registries to unambiguously refer to contact information. Person and role classes map NIC handles to actual person names, and contact information. <free-form>is a sequence of ASCII characters. <X-name> is a name of an object of type X. That is <mntner-name> is a name of a mntner object. <registry-name> is a name of an IRR registry. The routing registries are listed in Appendix A. A value of an attribute may also be a list of one of these types. A list is represented by separating the list members by commas ",". For example, "AS1, AS2, AS3, AS4" is a list of AS numbers. Note that being list valued and being multiple valued are orthogonal. A multiple valued attribute has more than one value, each of which may or may not be a list. On the other hand a single valued attribute may have a list value.
An RPSL object is textually represented as a list of attribute-value pairs. Each attribute-value pair is written on a separate line. The attribute name starts at column 0, followed by character ":" and followed by the value of the attribute. The attribute which has the same name as the object's class should be specified first. The object's representation ends when a blank line is encountered. An attribute's value can be split over multiple lines, by having a space, a tab or a plus ('+') character as the first character of the continuation lines. The character "+" for line continuation allows attribute values to contain blank lines. More spaces may optionally be used after the continuation character to increase readability. The order of attribute-value pairs is significant. An object's description may contain comments. A comment can be anywhere in an object's definition, it starts at the first "#" character on a line and ends at the first end-of-line character. White space characters can be used to improve readability. An integer can be specified using (1) the C programming language notation (e.g. 1, 12345); (2) sequence of four 1-octet integers (in the range from 0 to 255) separated by the character dot "." (e.g. 1.1.1.1, 255.255.0.0), in this case a 4-octet integer is formed by concatenating these 1-octet integers in the most significant to least significant order; (3) sequence of two 2-octet integers (in the range from 0 to 65535) separated by the character colon ":" (e.g. 3561:70, 3582:10), in this case a 4-octet integer is formed by concatenating these 2-octet integers in the most significant to least significant order.3 Contact Information
The mntner, person and role classes, admin-c, tech-c, mnt-by, changed, and source attributes of all classes describe contact information. The mntner class also specifies authenticaiton information required to create, delete and update other objects. These classes do not specify routing policies and each registry may have different or additional requirements on them. Here we present the common denominator for completeness which is the RIPE database implementation [16]. Please consult your routing registry for the latest specification of these classes and attributes. The "Routing Policy System Security" document [20] describes the authenticaiton and authorization model in more detail.3.1 mntner Class
The mntner class specifies authenticaiton information required to create, delete and update RPSL objects. A provider, before he/she can create RPSL objects, first needs to create a mntner object. The
attributes of the mntner class are shown in Figure 1. The mntner class was first described in [13]. The mntner attribute is mandatory and is the class key. Its value is an RPSL name. The auth attribute specifies the scheme that will be used to identify and authenticate update requests from this maintainer. It has the following syntax: auth: <scheme-id> <auth-info> E.g. auth: NONE Attribute Value Type mntner <object-name> mandatory, single-valued, class key descr <free-form> mandatory, single-valued auth see description in text mandatory, multi-valued upd-to <email-address> mandatory, multi-valued mnt-nfy <email-address> optional, multi-valued tech-c <nic-handle> mandatory, multi-valued admin-c <nic-handle> optional, multi-valued remarks <free-form> optional, multi-valued notify <email-address> optional, multi-valued mnt-by list of <mntner-name> mandatory, multi-valued changed <email-address> <date> mandatory, multi-valued source <registry-name> mandatory, single-valued Figure 1: mntner Class Attributes auth: CRYPT-PW dhjsdfhruewf auth: MAIL-FROM .*@ripe\.net The <scheme-id>'s currently defined are: NONE, MAIL-FROM, PGP-KEY and CRYPT-PW. The <auth-info> is additional information required by a particular scheme: in the case of MAIL-FROM, it is a regular expression matching valid email addresses; in the case of CRYPT-PW, it is a password in UNIX crypt format; and in the case of PGP-KEY, it is a pointer to key-certif object [22] containing the PGP public key of the user. If multiple auth attributes are specified, an update request satisfying any one of them is authenticated to be from the maintainer. The upd-to attribute is an email address. On an unauthorized update attempt of an object maintained by this maintainer, an email message will be sent to this address. The mnt-nfy attribute is an email address. A notification message will be forwarded to this email
address whenever an object maintained by this maintainer is added, changed or deleted. The descr attribute is a short, free-form textual description of the object. The tech-c attribute is a technical contact NIC handle. This is someone to be contacted for technical problems such as misconfiguration. The admin-c attribute is an administrative contact NIC handle. The remarks attribute is a free text explanation or clarification. The notify attribute is an email address to which notifications of changes to this object should be sent. The mnt-by attribute is a list of mntner object names. The authorization for changes to this object is governed by any of the maintainer objects referenced. The changed attribute documents who last changed this object, and when this change was made. Its syntax has the following form: changed: <email-address> <YYYYMMDD> E.g. changed: johndoe@terabit-labs.nn 19900401 The <email-address> identifies the person who made the last change. <YYYYMMDD> is the date of the change. The source attribute specifies the registry where the object is registered. Figure 2 shows an example mntner object. In the example, UNIX crypt format password authentication is used. mntner: RIPE-NCC-MNT descr: RIPE-NCC Maintainer admin-c: DK58 tech-c: OPS4-RIPE upd-to: ops@ripe.net mnt-nfy: ops-fyi@ripe.net auth: CRYPT-PW lz1A7/JnfkTtI mnt-by: RIPE-NCC-MNT changed: ripe-dbm@ripe.net 19970820 source: RIPE Figure 2: An example mntner object. The descr, tech-c, admin-c, remarks, notify, mnt-by, changed and source attributes are attributes of all RPSL classes. Their syntax, semantics, and mandatory, optional, multi-valued, or single-valued status are the same for for all RPSL classes. Only exception to this is the admin-c attribute which is mandatory for the aut-num class. We do not further discuss them in other sections.
3.2 person Class
A person class is used to describe information about people. Even though it does not describe routing policy, we still describe it here briefly since many policy objects make reference to person objects. The person class was first described in [15]. The attributes of the person class are shown in Figure 3. The person attribute is the full name of the person. The phone and the fax-no attributes have the following syntax: phone: +<country-code> <city> <subscriber> [ext. <extension>] E.g.: phone: +31 20 12334676 Attribute Value Type person <free-form> mandatory, single-valued nic-hdl <nic-handle> mandatory, single-valued, class key address <free-form> mandatory, multi-valued phone see description in text mandatory, multi-valued fax-no same as phone optional, multi-valued e-mail <email-address> mandatory, multi-valued Figure 3: person Class Attributes phone: +44 123 987654 ext. 4711 Figure 4 shows an example person object. person: Daniel Karrenberg address: RIPE Network Coordination Centre (NCC) address: Singel 258 address: NL-1016 AB Amsterdam address: Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 e-mail: Daniel.Karrenberg@ripe.net nic-hdl: DK58 changed: Daniel.Karrenberg@ripe.net 19970616 source: RIPE Figure 4: An example person object.
3.3 role Class
The role class is similar to the person object. However, instead of describing a human being, it describes a role performed by one or more human beings. Examples include help desks, network monitoring centers, system administrators, etc. Role object is particularly useful since often a person performing a role may change, however the role itself remains. The attributes of the role class are shown in Figure 5. The nic-hdl attributes of the person and role classes share the same name space. The trouble attribute of role object may contain additional contact information to be used when a problem arises in any object that references this role object. Figure 6 shows an example role object. Attribute Value Type role <free-form> mandatory, single-valued nic-hdl <nic-handle> mandatory, single-valued, class key trouble <free-form> optional, multi-valued address <free-form> mandatory, multi-valued phone see description in text mandatory, multi-valued fax-no same as phone optional, multi-valued e-mail <email-address> mandatory, multi-valued Figure 5: role Class Attributes role: RIPE NCC Operations trouble: address: Singel 258 address: 1016 AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 545 4445 e-mail: ops@ripe.net admin-c: CO19-RIPE tech-c: RW488-RIPE tech-c: JLSD1-RIPE nic-hdl: OPS4-RIPE notify: ops@ripe.net changed: roderik@ripe.net 19970926 source: RIPE Figure 6: An example role object.
4 route Class
Each interAS route (also referred to as an interdomain route) originated by an AS is specified using a route object. The attributes of the route class are shown in Figure 7. The route attribute is the address prefix of the route and the origin attribute is the AS number of the AS that originates the route into the interAS routing system. The route and origin attribute pair is the class key. Figure 8 shows examples of four route objects (we do not include contact attributes such as admin-c, tech-c for brevity). Note that the last two route objects have the same address prefix, namely 128.8.0.0/16. However, they are different route objects since they are originated by different ASes (i.e. they have different keys). Attribute Value Type route <address-prefix> mandatory, single-valued, class key origin <as-number> mandatory, single-valued, class key member-of list of <route-set-names> optional, multi-valued see Section 5 inject see Section 8 optional, multi-valued components see Section 8 optional, single-valued aggr-bndry see Section 8 optional, single-valued aggr-mtd see Section 8 optional, single-valued export-comps see Section 8 optional, single-valued holes see Section 8 optional, multi-valued Figure 7: route Class Attributes route: 128.9.0.0/16 origin: AS226 route: 128.99.0.0/16 origin: AS226 route: 128.8.0.0/16 origin: AS1 route: 128.8.0.0/16 origin: AS2 Figure 8: Route Objects
5 Set Classes
To specify policies, it is often useful to define sets of objects. For this purpose we define as-set, route-set, rtr-set, filter-set, and peering-set classes. These classes define a named set. The members of these sets can be specified either directly by listing them in the sets' definition, or indirectly by having member objects refer to the sets' names, or a combination of both methods. A set's name is an rpsl word with the following restrictions: All as-set names start with prefix "as-". All route-set names start with prefix "rs-". All rtr-set names start with prefix "rtrs-". All filter-set names start with prefix "fltr-". All peering-set names start with prefix "prng-". For example, as-foo is a valid as-set name. Set names can also be hierarchical. A hierarchical set name is a sequence of set names and AS numbers separated by colons ":". At least one component of such a name must be an actual set name (i.e. start with one of the prefixes above). All the set name components of an hierarchical name has to be of the same type. For example, the following names are valid: AS1:AS-CUSTOMERS, AS1:RS-EXPORT:AS2, RS- EXCEPTIONS:RS-BOGUS. The purpose of an hierarchical set name is to partition the set name space so that the maintainers of the set X1 controls the whole set name space underneath, i.e. X1:...:Xn-1. Thus, a set object with name X1:...:Xn-1:Xn can only be created by the maintainer of the object with name X1:...:Xn-1. That is, only the maintainer of AS1 can create a set with name AS1:AS-FOO; and only the maintainer of AS1:AS-FOO can create a set with name AS1:AS-FOO:AS-BAR. Please see RPS Security Document [20] for details.
5.1 as-set Class
The attributes of the as-set class are shown in Figure 9. The as-set attribute defines the name of the set. It is an RPSL name that starts with "as-". The members attribute lists the members of the set. The members attribute is a list of AS numbers, or other as-set names. Attribute Value Type as-set <object-name> mandatory, single-valued, class key members list of <as-numbers> or optional, multi-valued <as-set-names> mbrs-by-ref list of <mntner-names> optional, multi-valued Figure 9: as-set Class Attributes Figure 10 presents two as-set objects. The set as-foo contains two ASes, namely AS1 and AS2. The set as-bar contains the members of the set as-foo and AS3, that is it contains AS1, AS2, AS3. The set as- empty contains no members. as-set: as-foo as-set: as-bar as-set: as-empty members: AS1, AS2 members: AS3, as-foo Figure 10: as-set objects. The mbrs-by-ref attribute is a list of maintainer names or the keyword ANY. If this attribute is used, the AS set also includes ASes whose aut-num objects are registered by one of these maintainers and whose member-of attribute refers to the name of this AS set. If the value of a mbrs-by-ref attribute is ANY, any AS object referring to the AS set is a member of the set. If the mbrs-by-ref attribute is missing, only the ASes listed in the members attribute are members of the set. as-set: as-foo members: AS1, AS2 mbrs-by-ref: MNTR-ME aut-num: AS3 aut-num: AS4 member-of: as-foo member-of: as-foo mnt-by: MNTR-ME mnt-by: MNTR-OTHER Figure 11: as-set objects.
Figure 11 presents an example as-set object that uses the mbrs-by-ref attribute. The set as-foo contains AS1, AS2 and AS3. AS4 is not a member of the set as-foo even though the aut-num object references as-foo. This is because MNTR-OTHER is not listed in the as-foo's mbrs-by-ref attribute.5.2 route-set Class
The attributes of the route-set class are shown in Figure 12. The route-set attribute defines the name of the set. It is an RPSL name that starts with "rs-". The members attribute lists the members of the set. The members attribute is a list of address prefixes or other route-set names. Note that, the route-set class is a set of route prefixes, not of RPSL route objects. Attribute Value Type route-set <object-name> mandatory, single-valued, class key members list of <address-prefix-range> or optional, multi-valued <route-set-name> or <route-set-name><range-operator> mbrs-by-ref list of <mntner-names> optional, multi-valued Figure 12: route-set Class Attributes Figure 13 presents some example route-set objects. The set rs-foo contains two address prefixes, namely 128.9.0.0/16 and 128.9.0.0/24. The set rs-bar contains the members of the set rs-foo and the address prefix 128.7.0.0/16. An address prefix or a route-set name in a members attribute can be optionally followed by a range operator. For example, the following set: route-set: rs-foo members: 128.9.0.0/16, 128.9.0.0/24 route-set: rs-bar members: 128.7.0.0/16, rs-foo Figure 13: route-set Objects
route-set: rs-bar members: 5.0.0.0/8^+, 30.0.0.0/8^24-32, rs-foo^+ contains all the more specifics of 5.0.0.0/8 including 5.0.0.0/8, all the more specifics of 30.0.0.0/8 which are of length 24 to 32 such as 30.9.9.96/28, and all the more specifics of address prefixes in route set rs-foo. The mbrs-by-ref attribute is a list of maintainer names or the keyword ANY. If this attribute is used, the route set also includes address prefixes whose route objects are registered by one of these maintainers and whose member-of attribute refers to the name of this route set. If the value of a mbrs-by-ref attribute is ANY, any route object referring to the route set name is a member. If the mbrs-by- ref attribute is missing, only the address prefixes listed in the members attribute are members of the set. route-set: rs-foo mbrs-by-ref: MNTR-ME, MNTR-YOU route-set: rs-bar members: 128.7.0.0/16 mbrs-by-ref: MNTR-YOU route: 128.9.0.0/16 origin: AS1 member-of: rs-foo mnt-by: MNTR-ME route: 128.8.0.0/16 origin: AS2 member-of: rs-foo, rs-bar mnt-by: MNTR-YOU Figure 14: route-set objects. Figure 14 presents example route-set objects that use the mbrs-by-ref attribute. The set rs-foo contains two address prefixes, namely 128.8.0.0/16 and 128.9.0.0/16 since the route objects for 128.8.0.0/16 and 128.9.0.0/16 refer to the set name rs-foo in their member-of attribute. The set rs-bar contains the address prefixes 128.7.0.0/16 and 128.8.0.0/16. The route 128.7.0.0/16 is explicitly listed in the members attribute of rs-bar, and the route object for 128.8.0.0/16 refer to the set name rs-bar in its member-of attribute.
Note that, if an address prefix is listed in a members attribute of a route set, it is a member of that route set. The route object corresponding to this address prefix does not need to contain a member-of attribute referring to this set name. The member-of attribute of the route class is an additional mechanism for specifying the members indirectly.5.3 Predefined Set Objects
In a context that expects a route set (e.g. members attribute of the route-set class), an AS number ASx defines the set of routes that are originated by ASx; and an as-set AS-X defines the set of routes that are originated by the ASes in AS-X. A route p is said to be originated by ASx if there is a route object for p with ASx as the value of the origin attribute. For example, in Figure 15, the route set rs-special contains 128.9.0.0/16, routes of AS1 and AS2, and routes of the ASes in AS set AS-FOO. route-set: rs-special members: 128.9.0.0/16, AS1, AS2, AS-FOO Figure 15: Use of AS numbers and AS sets in route sets. The set rs-any contains all routes registered in IRR. The set as-any contains all ASes registered in IRR.5.4 Filters and filter-set Class
The attributes of the filter-set class are shown in Figure 16. A filter-set object defines a set of routes that are matched by its filter. The filter-set attribute defines the name of the filter. It is an RPSL name that starts with "fltr-". Attribute Value Type filter-set <object-name> mandatory, single-valued, class key filter <filter> mandatory, single-valued Figure 16: filter Class Attributes filter-set: fltr-foo filter: { 5.0.0.0/8, 6.0.0.0/8 } filter-set: fltr-bar filter: (AS1 or fltr-foo) and <AS2> Figure 17: filter-set objects.
The filter attribute defines the set's policy filter. A policy filter is a logical expression which when applied to a set of routes returns a subset of these routes. We say that the policy filter matches the subset returned. The policy filter can match routes using any BGP path attribute, such as the destination address prefix (or NLRI), AS-path, or community attributes. The policy filters can be composite by using the operators AND, OR, and NOT. The following policy filters can be used to select a subset of routes: ANY The keyword ANY matches all routes. Address-Prefix Set This is an explicit list of address prefixes enclosed in braces '{' and '}'. The policy filter matches the set of routes whose destination address-prefix is in the set. For example: { 0.0.0.0/0 } { 128.9.0.0/16, 128.8.0.0/16, 128.7.128.0/17, 5.0.0.0/8 } { } An address prefix can be optionally followed by a range operator (i.e. { 5.0.0.0/8^+, 128.9.0.0/16^-, 30.0.0.0/8^16, 30.0.0.0/8^24-32 } contains all the more specifics of 5.0.0.0/8 including 5.0.0.0/8, all the more specifics of 128.9.0.0/16 excluding 128.9.0.0/16, all the more specifics of 30.0.0.0/8 which are of length 16 such as 30.9.0.0/16, and all the more specifics of 30.0.0.0/8 which are of length 24 to 32 such as 30.9.9.96/28. Route Set Name A route set name matches the set of routes that are members of the set. A route set name may be a name of a route-set object, an AS number, or a name of an as-set object (AS numbers and as-set names implicitly define route sets; please see Section 5.3). For example: aut-num: AS1 import: from AS2 accept AS2 import: from AS2 accept AS-FOO import: from AS2 accept RS-FOO
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.
[...] 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.
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.
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
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.
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 connected to the same exchange point peer with each other and exchange routing information. That is, 7.7.7.1, 7.7.7.2 and 7.7.7.3 peer with each other; 9.9.9.1, 9.9.9.2 and 9.9.9.3 peer with each other. The syntax of a peering specification is: <as-expression> [<router-expression-1>] [at <router-expression-2>] | <peering-set-name>
where <as-expression> is an expression over AS numbers and AS sets using operators AND, OR, and EXCEPT, and <router-expression-1> and <router-expression-2> are expressions over router IP addresses, inet-rtr names, and rtr-set names using operators AND, OR, and EXCEPT. The binary "EXCEPT" operator is the set subtraction operator and has the same precedence as the operator AND (it is semantically equivalent to "AND NOT" combination). That is "(AS1 OR AS2) EXCEPT AS2" equals "AS1". This form identifies all the peerings between any local router in <router-expression-2> to any of their peer routers in <router- expression-1> in the ASes in <as-expression>. If <router- expression-2> is not specified, it defaults to all routers of the local AS that peer with ASes in <as-expression>. If <router- expression-1> is not specified, it defaults to all routers of the peer ASes in <as-expression> that peer with the local AS. If a <peering-set-name> is used, the peerings are listed in the corresponding peering-set object. Note that the peering-set objects can be recursive. Many special forms of this general peering specification is possible. The following examples illustrate the most common cases, using the import attribute of the aut-num class. In the following example 7.7.7.1 imports 128.9.0.0/16 from 7.7.7.2. (1) aut-num: AS1 import: from AS2 7.7.7.2 at 7.7.7.1 accept { 128.9.0.0/16 } In the following example 7.7.7.1 imports 128.9.0.0/16 from 7.7.7.2 and 7.7.7.3. (2) aut-num: AS1 import: from AS2 at 7.7.7.1 accept { 128.9.0.0/16 } In the following example 7.7.7.1 imports 128.9.0.0/16 from 7.7.7.2 and 7.7.7.3, and 9.9.9.1 imports 128.9.0.0/16 from 9.9.9.2. (3) aut-num: AS1 import: from AS2 accept { 128.9.0.0/16 } In the following example 9.9.9.1 imports 128.9.0.0/16 from 9.9.9.2 and 9.9.9.3.
(4) as-set: AS-FOO members: AS2, AS3 aut-num: AS1 import: from AS-FOO at 9.9.9.1 accept { 128.9.0.0/16 } In the following example 9.9.9.1 imports 128.9.0.0/16 from 9.9.9.2 and 9.9.9.3, and 7.7.7.1 imports 128.9.0.0/16 from 7.7.7.2 and 7.7.7.3. (5) aut-num: AS1 import: from AS-FOO accept { 128.9.0.0/16 } In the following example AS1 imports 128.9.0.0/16 from AS3 at router 9.9.9.1 (6) aut-num: AS1 import: from AS-FOO and not AS2 at not 7.7.7.1 accept { 128.9.0.0/16 } This is because "AS-FOO and not AS2" equals AS3 and "not 7.7.7.1" equals 9.9.9.1. In the following example 9.9.9.1 imports 128.9.0.0/16 from 9.9.9.2 and 9.9.9.3. (7) peering-set: prng-bar peering: AS1 at 9.9.9.1 peering-set: prng-foo peering: prng-bar peering: AS2 at 9.9.9.1 aut-num: AS1 import: from prng-foo accept { 128.9.0.0/16 }