<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc [
    <!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
    <!ENTITY RFC2622 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2622.xml">
    <!ENTITY RFC2725 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2725.xml">
    <!ENTITY RFC3629 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3629.xml">
    <!ENTITY RFC3779 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3779.xml">
    <!ENTITY RFC4012 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4012.xml">
    <!ENTITY RFC4648 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml">
    <!ENTITY RFC5280 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
    <!ENTITY RFC5652 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5652.xml">
    <!ENTITY RFC8174 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
    <!ENTITY RFC6481 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6481.xml">
    <!ENTITY RFC6487 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6487.xml">
    <!ENTITY RFC6488 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6488.xml">
    <!ENTITY RFC8805 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8805.xml">
    <!ENTITY RFC8933 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8933.xml">
    <!ENTITY RFC9110 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml">
    <!ENTITY RFC9286 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9286.xml">
    <!ENTITY RFC0959 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0959.xml">
    <!ENTITY RFC3912 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3912.xml">
    <!ENTITY RFC4632 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4632.xml">
    <!ENTITY RFC5485 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5485.xml">
    <!ENTITY RFC7234 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7234.xml">
    <!ENTITY RFC7480 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7480.xml">
    <!ENTITY RFC7481 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7481.xml">
    <!ENTITY RFC7485 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7485.xml">
    <!ENTITY RFC7909 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7909.xml">
    <!ENTITY RFC8126 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml">
    <!ENTITY RFC9082 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9082.xml">
    <!ENTITY RFC9092 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9092.xml">
    <!ENTITY RFC9632 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9632.xml">
    <!ENTITY I-D.ietf-regext-rdap-geofeed SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-regext-rdap-geofeed.xml">
    <!ENTITY I-D.gasser-opsawg-prefix-lengths SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.gasser-opsawg-prefix-lengths.xml">
    ]>
<?rfc sortrefs="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="3"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc category="std" docName="draft-ymbk-opsawg-rpsl-extref-02"
     submissionType="IETF" consensus="true" ipr="trust200902">

  <front>

    <title abbrev="Generalized RPSL External Reference">Generalized RPSL External Reference</title>

    <author fullname="Randy Bush" initials="R." surname="Bush">
      <organization>IIJ Research &amp; Arrcus</organization>
      <address>
        <postal>
          <street>5147 Crystal Springs</street>
          <city>Bainbridge Island</city>
          <region>Washington</region>
          <code>98110</code>
          <country>United States of America</country>
        </postal>
        <email>randy@psg.com</email>
      </address>
    </author>

    <author initials="T." surname="Harrison" fullname="Tom Harrison">
        <organization abbrev="APNIC">Asia Pacific Network Information Centre</organization>
        <address>
            <postal>
                <street>6 Cordelia St</street>
                <city>South Brisbane</city>
                <code>4101</code>
                <country>Australia</country>
                <region>QLD</region>
            </postal>
            <email>tomh@apnic.net</email>
        </address>
    </author>

    <date />

    <abstract>

      <t>
        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).
      </t>

    </abstract>

  </front>

  <middle>

    <section title="Introduction" anchor="intro">

      <t>
        The Routing Policy Specification Language (RPSL), which has
        operationally evolved since standardization in <xref
        target="RFC2622"/>, has recently added a geofeed: attribute
        <xref target="RFC9632"/> to the inetnum: <xref
        target="INETNUM"/> and inet6num: <xref target="INET6NUM"/>
        classes to reference data external to RPSL.  There is now a
        proposal add another attribute, prefixlen: <xref
        target="I-D.gasser-opsawg-prefix-lengths"/> referencing external
        data.
      </t>

      <t>
	This document describes a more general and extensible mechanism
	for external references to augment the RPSL inetnum: class <xref
	target="INETNUM"/> to refer to external data.  In all places
	inetnum:, <xref target="INETNUM"/>, is used, inet6num:, <xref
	target="INET6NUM"/>, should also be assumed.
      </t>

      <t>
	It also tries to anticipate the RIRs evolving from RPSL to
	Registration Data Access Protocol (RDAP), <xref
	target="RFC7480"/>, see <xref target="rdap"/>.
      </t>

      <section title="Requirements Language">

        <t>
          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 <xref format="default" pageno="false"
          target="RFC2119"/> <xref format="default" pageno="false"
          target="RFC8174"/> when, and only when, they appear in all
          capitals, as shown here.
        </t>

      </section>

    </section>

    <section title="Existing External References" anchor="existing">

      <t>
        RPSL, <xref target="RFC2622"/>, as used by the Regional Internet
        Registries (RIRs), has been augmented with the inetnum: <xref
        target="INETNUM"/> and the inet6num: <xref target="INET6NUM"/>
        classes; each of which describes an IP address range and its
        attributes.
      </t>

      <t>
	Ongoing work has added and/or proposes to add multiple
	attributes to RPSL to reference objects external to RPSL.
      </t>

      <t>
        <xref target="RFC9632"/> descrbes how to reference geofeed files
        (<xref target="RFC8805"/>) from an RPSL inetnum: class.  It is
        widely deployed.
      </t>

      <t>
        <xref target="I-D.gasser-opsawg-prefix-lengths"/> proposes to
        refrence prefixlen files from an RPSL inetnum: class.
      </t>
	
      <t>
        This way lies chaos.  Where there are two, there will be more.
        This will cause continuing problems for work such as <xref
        target="I-D.ietf-regext-rdap-geofeed"/>.
      </t>

    </section>

    <section title="inetnum: Class" anchor="inetnum">

      <t>
        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:
      </t>
      <figure>
        <artwork>
    inetnum: 192.0.2.0/24 # example
    extref: Geofeed https://example.com/geofeed
    extref: Prefixlen https://example.com/prefixlen
        </artwork>
      </figure>
      <t>
	Any particular inetnum: class MAY have at most one extref: of a
	particular sub-type.
      </t>

      <t>
	inetnum: classes form a hierarchy, see <xref target="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.
      </t>

      <t>
	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.
      </t>

    </section>

    <section title="Registration Data Access Protocol" anchor="rdap">
      <t>
	The Registration Data Access Protocol (RDAP) <xref
	target="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:
      </t>
      <figure>
        <artwork>
{
    "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"
	},
	...
    ],
    ...
}
        </artwork>
      </figure>

      <t>
	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.
      </t>

      <t>
        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.
      </t>

      <t>
        "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.
      </t>

      <t>
	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.
      </t>

    </section>

    <section title="Operational Considerations" anchor="ops">

      <t>
	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.
      </t>

      <t>
        For a particular sub-type, the RFC defining it SHOULD specify
        the transport over which the reference SHOULD or MUST be
        fetched.
      </t>

      <t>
        Multiple inetnum: classes MAY refer to the same external
        resource.
      </t>

    </section>

    <section title="Security Considerations" anchor="seccons">

      <t>
        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.
      </t>

      <t>
        Many RPSL repositories have weak if any authentication.  This
        would allow spoofing of inetnum: classes pointing to malicious
        extref files.
      </t>

      <t>
	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.
      </t>

      <t>
	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.
      </t>

      <t>
	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.
      </t>

      <t>
	IF RDAP is used, the Security Considerations in <xref
	target="RFC7480"/> and therefore <xref
	target="RFC7481"/> should be considered.
      </t>

    </section>

    <section title="IANA Considerations" anchor="iana">

      <t>
        The IANA is requested to create an "rpsl-extref-subtype:
        registry as follows:
      </t>
      <figure>
        <artwork>	  
	  SubType   MIME Type                 Reference
	  -------   ------------------------  ---------
	  Geofeed   application/geofeed+csv   RFC9632
        </artwork>
      </figure>
      <t>
	Registration of new SubTypes is by RFC per <xref
	target="RFC8126"/> Section 4.
      </t>
	
    </section>

    <section title="Acknowledgements" anchor="ack">

      <t>
        Thanks to the authors of <xref target="RFC8805"/>, <xref
        target="RFC9092"/>, and <xref target="RFC9632"/> and the folk
        they acknowledge from whom ideas and text have been liberally
        expropriated.  George Michaelson also contributed.
      </t>

    </section>

  </middle>

  <back>

    <references title="Normative References">
      &RFC2119;
      &RFC8174;
      &RFC2622;
      &RFC8126;
      &RFC7480;
      &RFC7481;
      &I-D.gasser-opsawg-prefix-lengths;

      <reference anchor="INETNUM" target="https://docs.db.ripe.net/RPSL-Object-Types/Descriptions-of-Primary-Objects/#description-of-the-inetnum-object">
        <front>
          <title>Description of the INETNUM Object</title>
          <author><organization>RIPE</organization></author>
          <date/>
        </front>
      </reference>

      <reference anchor="INET6NUM" target="https://docs.db.ripe.net/RPSL-Object-Types/Descriptions-of-Primary-Objects/#description-of-the-inet6num-object">
        <front>
          <title>Description of the INET6NUM Object</title>
          <author><organization>RIPE</organization></author>
          <date/>
        </front>
      </reference>

    </references>

    <references title="Informative References">
      &RFC8805;
      &RFC9092;
      &RFC9632;
      &I-D.ietf-regext-rdap-geofeed;
    </references>

  </back>

</rfc>
