Generalized RPSL External Reference
Randy Bush
IIJ Research & Arrcus
5147 Crystal Springs
Bainbridge Island
Washington
98110
United States of America
randy@psg.com
Tom Harrison
Asia Pacific Network Information Centre
6 Cordelia St
South Brisbane
4101
Australia
QLD
tomh@apnic.net
The Routing Policy Specification Language (RPSL), which has operationally evolved since it was standardized in 1999, has recently added a geofeed: attribute to the innet[6]num: class to reference data external to RPSL. There is now a proposal add another attribute referencing external data, prefixlen:. This document describes a more general and extensible mechanism for external references. It also tries to anticipate the RIRs evolving from RPSL to Registration Data Access Protocol (RDAP).

Introduction
The Routing Policy Specification Language (RPSL), which has operationally evolved since standardization in [RFC2622], has recently added a geofeed: attribute [RFC9632] to the inetnum: [INETNUM] and inet6num: [INET6NUM] classes to reference data external to RPSL. There is now a proposal add another attribute, prefixlen: [I-D.gasser-opsawg-prefix-lengths] referencing external data.
This document describes a more general and extensible mechanism for external references to augment the RPSL inetnum: class [INETNUM] to refer to external data. In all places inetnum:, [INETNUM], is used, inet6num:, [INET6NUM], should also be assumed.
It also tries to anticipate the RIRs evolving from RPSL to Registration Data Access Protocol (RDAP), [RFC7480], see Section 4.

Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Existing External References
RPSL, [RFC2622], as used by the Regional Internet Registries (RIRs), has been augmented with the inetnum: [INETNUM] and the inet6num: [INET6NUM] classes; each of which describes an IP address range and its attributes.
Ongoing work has added and/or proposes to add multiple attributes to RPSL to reference objects external to RPSL.
[RFC9632] descrbes how to reference geofeed files ([RFC8805]) from an RPSL inetnum: class. It is widely deployed.
[I-D.gasser-opsawg-prefix-lengths] proposes to refrence prefixlen files from an RPSL inetnum: class.
This way lies chaos. Where there are two, there will be more. This will cause continuing problems for work such as [I-D.ietf-regext-rdap-geofeed].

inetnum: Class
This document describes a generalized mechanism for external references. RPSL would be augmented to define a new RPSL extref: attribute in the inetnum: class. For example, given the two sub-types described above:

    inetnum: 192.0.2.0/24 # example
    extref: Geofeed https://example.com/geofeed
    extref: Prefixlen https://example.com/prefixlen

Any particular inetnum: class MAY have at most one extref: of a particular sub-type.
inetnum: classes form a hierarchy, see [INETNUM] Section 4.2.4.1, Hierarchy of INETNUM Objects. extref references SHOULD be at the lowest applicable inetnum: class. When fetching, the most specific inetnum: class with an extref reference of a particular sub-type MUST be used.
When extref: references are provided by multiple inetnum: classes which have identical address ranges, then the extref: reference on the inetnum: with the most recent last-modified: attribute SHOULD be preferred.

Registration Data Access Protocol
The Registration Data Access Protocol (RDAP) [RFC7480] is used by the RIRs and other Internet Number Registries to provide access to IP address registration data. In RDAP, the object that corresponds to the RPSL inetnum/inet6num object is the "ip network" object. This type of object may contain a set of links, with each link based on the structure defined in RFC 5988. For example:

{
    "objectClassName": "ip network",
    "startAddress": "192.0.2.0",
    "endAddress": "192.0.2.127",
    ...
    "links": [
	{
	    "href":  "https://rdap.example.net/ip/192.0.2.0/25",
	    "rel":   "self",
	    "type":  "application/rdap+json",
	    "value": "https://rdap.example.net/ip/192.0.2.0/25"
	},
	{
	    "href":  "https://rdap.example.net/ip/192.0.2.0/24",
	    "rel":   "up",
	    "type":  "application/rdap+json",
	    "value": "https://rdap.example.net/ip/192.0.2.0/25"
	},
	...
    ],
    ...
}

Instances of external reference types defined in accordance with this document may be included in RDAP "ip network" objects in reliance on the existing link structure and syntax defined in RDAP.
In RDAP, the only mandatory members of a link object are "value", "rel", and "href". "value" is the link context, and "href" is the link target, so those members are trivial to include, but "rel" is the link relation type, describing the relationship between the link context and the link target. While it would be possible to use a very generic link relation type, such as "related", for all external reference instances, using a more specific link relation type helps clients to find relevant links more quickly and easily. External reference subtype specifications SHOULD document the link relation type to be used for RDAP links for those references.
"type" is a link object member for the media type of the link target. It is not mandatory, but it is very common for it to be present. Similarly to link relation types, external reference subtype specifications SHOULD document the media type (or types) to be used for RDAP links for those references.
RDAP defines an extension model that can be used to add new functionality to servers, or to add new members to existing object types, among other things. While it is not necessary to define an RDAP extension simply to make use of a new link relation type or media type in a link object in an RDAP response, an extension identifier can be used to signal to clients that an RDAP server has that data, and will make it available where it exists. External reference subtype specification authors SHOULD consider registering an RDAP extension for the subtype, in order to signal related behaviour to clients.

Operational Considerations
To create the needed inetnum: classes, an operator wishing to register extref: attributes needs to coordinate with their RIR/NIR and/or any provider LIR which has assigned prefixes to them. RIRs/NIRs provide means for assignees to create and maintain inetnum: classes. They also provide means of [sub-]assigning IP address resources and allowing the assignee to create whois data, including inetnum: classes, and thereby using extref: attributes.
For a particular sub-type, the RFC defining it SHOULD specify the transport over which the reference SHOULD or MUST be fetched.
Multiple inetnum: classes MAY refer to the same external resource.

Security Considerations
It would be generally prudent for a consumer of extref data to also use other sources to cross-validate the data. All of the Security Considerations of the RFC defining a sub-type apply here as well.
Many RPSL repositories have weak if any authentication. This would allow spoofing of inetnum: classes pointing to malicious extref files.
If an inetnum: for a wide prefix (e.g. a /16) points to an external file, a customer or attacker could publish an equal or narrower (e.g. a /24) inetnum: in a whois registry which has weak authorization.
The RPSL providers have had to throttle fetching from their servers due to too-frequent queries. Usually they throttle by the querying IP address or block. Similar defenses will likely need to be deployed by extref file servers.
Directing users and programs to external data has legal and technical risk exposure. Hence adding to the IANA SubTypee registry requires an RFC. One should still be cautious following links to or using external data.
IF RDAP is used, the Security Considerations in [RFC7480] and therefore [RFC7481] should be considered.

IANA Considerations
The IANA is requested to create an "rpsl-extref-subtype: registry as follows:

	  SubType   MIME Type                 Reference
	  -------   ------------------------  ---------
	  Geofeed   application/geofeed+csv   RFC9632

Registration of new SubTypes is by RFC per [RFC8126] Section 4.

Acknowledgements
Thanks to the authors of [RFC8805], [RFC9092], and [RFC9632] and the folk they acknowledge from whom ideas and text have been liberally expropriated. George Michaelson also contributed.

Normative References
[INETNUM]

Description of the INETNUM Object
RIPE
[INET6NUM]

Description of the INET6NUM Object
RIPE

Informative References
[RFC2622]
[RFC9632]
[I-D.gasser-opsawg-prefix-lengths]
[RFC7480]
[RFC2119]
[RFC8174]
[RFC8805]
[I-D.ietf-regext-rdap-geofeed]
[RFC7481]
[RFC8126]
[RFC9092]