<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced.
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-sweet-uri-zoneid-01" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->

    <title abbrev="An IPvFuture Syntax for IPv6">An IPvFuture Syntax for IPv6 Link-Local Addresses</title>

    <author fullname="Michael Sweet" initials="M." role="editor" surname="Sweet">
      <organization>Apple Inc.</organization>
      <address>
        <postal>
          <street>1 Infinite Loop</street>
          <city>Cupertino</city>
          <region>California</region>
          <code>95014</code>
          <country>United States</country>
        </postal>
        <email>msweet@apple.com</email>
      </address>
    </author>

    <date year="2013" />
    <area>Internet</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <keyword>IPv6 Link-Local URI</keyword>
    <abstract>
      <t>This document describes how the zone identifier of an IPv6 scoped address, defined as &lt;zone_id&gt; in the IPv6 Scoped Address Architecture (RFC 4007), can be represented in a literal IPv6 address and in a Uniform Resource Identifier that includes such a literal address. It documents a long-standing usage of the IPvFuture extension point provided in the <xref target="RFC3986">Uniform Resource Identifier (URI) syntax specification</xref>.</t>
      <t>[ Editor's note: This draft documents the IPvFuture format originally defined in [LITERAL-ZONE] and used by CUPS since 2005. A separate, incompatible format was defined and published in RFC 6874. ]</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The <xref target="RFC3986">Uniform Resource Identifier (URI) syntax specification</xref> defines how a literal IPv6 address can be represented in the "host" part of a URI. However, it does not define how zone identifiers (see <xref target="RFC4007">IPv6 Scoped Address Architecture specification</xref>) are represented, which has lead to the development and deployment of two incompatible URI syntax extensions. The first syntax, <xref target="LITERAL-ZONE">"A Format for IPv6 Scope Zone Identifiers in Literal URIs" </xref>, was originally proposed in 2005 and used the IPvFuture rule that was defined for future address extensions in URIs. While this draft was ultimately never published, the syntax was adopted by the <xref target="CUPS">CUPS</xref> software in 2005 and is now widely deployed in clients and printers. The second syntax, <xref target="RFC6874">"Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers"</xref>, was published in February 2013 and incompatibly extends the URI syntax with a new IPv6addrz rule. This document describes the first syntax and provides additional implementation guidelines for its use.</t>
      <t>[ Editor's note: Would it be appropriate to provide adoption numbers here (hundreds of millions of devices)? ]</t>
      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">"Key words for use in RFCs to Indicate Requirement Levels"</xref>.</t>
      </section>
    </section>

    <section title="Specification">
      <t>According to <xref target="RFC4007">IPv6 Scoped Address syntax</xref>, a zone identifier is attached to the textual representation of an IPv6 address by concatenating "%" followed by &lt;zone_id&gt;, where &lt;zone_id&gt; is a string identifying the zone of the address. However, the IPv6 Scoped Address Architecture specification gives no precise definition of the character set allowed in &lt;zone_id&gt;. There are no rules or de facto standards for this. For example, the first Ethernet interface in a host might be called %0, %1, %en1, %eth0, or whatever the implementer happened to choose.</t>
      <t>In a URI, a literal IPv6 address is always embedded between "[" and "]". This document specifies how a &lt;zone_id&gt; can be appended to the address. According to URI syntax [RFC3986], "%" is always treated as an escape character in a URI, so, according to the established URI syntax [RFC3986] any occurrences of literal "%" symbols in a URI MUST be percent-encoded and represented in the form "%25". Thus, the scoped address fe80::a%en1 would appear in a URI as http://[fe80::a%25en1].</t>
      <t>However, since parsers based on the <xref target="RFC5234">ABNF</xref> in the <xref target="RFC3986">URI syntax specification</xref> will not allow a URI of that form, an <xref target="LITERAL-ZONE">alternate format based on the IPvFuture rule</xref> can be used where the address is prefixed with "v1." and the "+" character is used as the separator between the address and &lt;zone_id&gt;. Thus, the alternate form of the scoped address fe80::a%en1 would appear in a URI as http://[v1.fe80::a+en1].</t>
      <t>A &lt;zone_id&gt; SHOULD contain only ASCII characters classified as <xref target="RFC3986">"unreserved" for use in URIs</xref>. This excludes characters such as "]" or even "%" that would complicate parsing. However, the syntax described below does allow such characters to be percent-encoded, for compatibility with existing devices that use them.</t>
      <t>If an operating system uses any other characters in zone or interface identifiers that are not in the "unreserved" character set, they MUST be represented using <xref target="RFC3986">percent encoding</xref>.</t>
      <t>We now present the necessary formal syntax.</t>
      <t>The <xref target="RFC3986">URI syntax specification</xref> formally defined the IPv6 literal format in <xref target="RFC5234">ABNF</xref> by the following rule:</t>
      <figure>
        <artwork><![CDATA[
IP-literal = "[" ( IPv6address / IPvFuture  ) "]"
	]]></artwork>
      </figure>
      <t>To provide support for a zone identifier, the existing syntax of IPv6address is retained, and a zone identifier may be added optionally to any literal address. This syntax allows flexibility for unknown future uses. The rule quoted above from the <xref target="RFC3986">previous URI syntax specification</xref> is replaced by three rules:</t>
      <figure>
        <artwork><![CDATA[
IP-literal = "[" ( IPv6address / IPvFuture /
                   "v1." IPv6address "+" ZoneID ) "]"

ZoneID = 1*( unreserved / pct-encoded )
	]]></artwork>
      </figure>
      <t>This syntax fills the gap that is described at the end of Section 11.7 of the <xref target="RFC4007">IPv6 Scoped Address Architecture specification</xref>. </t>
      <t>The established rules for <xref target="RFC5952">textual representation of IPv6 addresses</xref> SHOULD be applied in producing URIs.</t>
      <t>The <xref target="RFC3986">URI syntax specification</xref> states that URIs have a global scope, but that in some cases their interpretation depends on the end-user's context. URIs including a ZoneID are to be interpreted only in the context of the host at which they originate, since the ZoneID is of local significance only.</t>
      <t>The <xref target="RFC4007">IPv6 Scoped Address Architecture specification</xref> offers guidance on how the ZoneID affects interface/address selection inside the IPv6 stack. Note that the behaviour of an IPv6 stack, if it is passed a non-null zone index for an address other than link-local, is undefined.</t>
    </section>

    <section title="HTTP Requirements">
      <t>The <xref target="RFC2616">Hypertext Transfer Protocol -- HTTP/1.1</xref> requires the client to supply the host and URI used to access the server. While a ZoneID is only significant to the HTTP client, many HTTP server solutions, including <xref target="RFC2911">IPP</xref>, generate absolute URIs to server-resident resources in response to a client's request. If the client's ZoneID is not sent to the server, the server will not be able to provide absolute URIs that can be directly used by the client. However, the server cannot use the provided ZoneID for any local address comparisons since the client and server likely have different ZoneID's for the same IPv6 link-local address.</t>
      <t>HTTP clients SHOULD include the client-specific ZoneID in the HTTP Host: header and (if applicable) the HTTP Request-URI.</t>
      <t>HTTP servers MUST support Host: and Request-URI values containing client-specific ZoneID's, MUST use the full address (including ZoneID) when generating absolute URIs for a response to the client, and MUST NOT use the ZoneID in any local (server) address comparisons.</t>
    </section>

    <section title="Security Consideration">
      <t>The security considerations from the URI syntax specification [RFC3986] and the IPv6 Scoped Address Architecture specification [RFC4007] apply. In particular, this URI format creates a specific pathway by which a deceitful zone index might be communicated, as mentioned in the final security consideration of the Scoped Address Architecture specification. It is emphasised that the format is intended only for local access purposes, but of course this intention does not prevent misuse.</t>
      <t>To limit this risk, implementations MUST NOT allow use of this format except for well-defined usages, such as sending to link-local addresses under prefix fe80::/10. At the time of writing, this is the only well-defined usage known.</t>
    </section>
  </middle>

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search. These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <?rfc include="reference.RFC.2119.xml"?>
      <?rfc include="reference.RFC.2616.xml"?>
      <?rfc include="reference.RFC.2911.xml"?>
      <?rfc include="reference.RFC.3986.xml"?>
      <?rfc include="reference.RFC.4007.xml"?>
      <?rfc include="reference.RFC.5234.xml"?>
      <?rfc include="reference.RFC.5952.xml"?>
    </references>

    <references title="Informative References">
      <reference anchor="CUPS">
        <front>
          <title>CUPS software</title>
          <author initials="M." surname="Sweet">
            <organization>Apple Inc.</organization>
          </author>
          <date year="2005" month="October" day="21" />
        </front>
      </reference>
      <reference anchor="LITERAL-ZONE">
        <front>
          <title>A Format for IPv6 Scope Zone Identifiers in Literal URIs</title>
          <author initials="B." surname="Fenner">
            <organization>AT&amp;T Labs -- Research</organization>
          </author>
          <author initials="M." surname="Duerst">
            <organization>World Wide Web Consortium</organization>
          </author>
          <date year="2005" month="October" day="21" />
        </front>
      </reference>
      <?rfc include="reference.RFC.3493.xml"?>
      <?rfc include="reference.RFC.4001.xml"?>
      <?rfc include="reference.RFC.6874.xml"?>
    </references>

    <section title="Change History">
      <t>[ RFC Editor: This section to be deleted before RFC publication ]</t>
      <t>November 22, 2013 - draft-sweet-uri-zoneid-01</t>
      <t>
        <list style="symbols">
          <t>Changed to informative draft to document what CUPS has been using since 2005.</t>
          <t>Section 1: Rewritten to document the two incompatible syntaxes.</t>
          <t>Section 2: Dropped 6874 syntax and added the v1. syntax to the main address rule.</t>
          <t>Section 3: Changed to HTTP Requirements, explained why this is necessary, provided conformance requirements.</t>
          <t>Section 4: Cleaned up now that we are no longer obsoleting 6874.</t>
          <t>Deleted unused sections/appendices</t>
        </list>
      </t>
      <t>August 27, 2013 - draft-sweet-uri-zoneid-00</t>
      <t>[ Changes are from published RFC 6874 text ]</t>
      <t>
        <list style="symbols">
          <t>Abstract: Added editor's note explaining why we need to update RFC 6874</t>
          <t>Section 1: Update to talk about having two formats.</t>
          <t>Section 2: Provide example and define IPvFuture format as an alternate, RFC 3986-compatible encoding.</t>
          <t>Section 3: Reword to encourage browsers to retain the ZoneID as an aid for getting usable server-generated URIs.</t>
          <t>Section 4: Change conformance to MUST NOT remove ZoneID.</t>
          <t>Section 6.2: Add reference to CUPS.</t>
          <t>Appendix A: Put the IPvFuture example at the end, make it match the correct IPvFuture format, and note it at the alternate syntax.</t>
        </list>
      </t>
    </section>
  </back>
</rfc>
