<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.7 -->
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc-ext html-pretty-print="prettyprint https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"?>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext"
     category="std"
     docName="draft-ietf-httpbis-cdn-loop-00"
     ipr="trust200902"
     submissionType="IETF">
   <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22\&amp;amp;body=%3c{ref}%3e:"/>
   <front>
      <title>CDN Loop Prevention</title>
      <author fullname="Stephen Ludin" initials="S." surname="Ludin">
         <organization>Akamai Technologies</organization>
         <address>
            <email>sludin@akamai.com</email>
         </address>
      </author>
      <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
         <organization>Fastly</organization>
         <address>
            <email>mnot@fastly.com</email>
         </address>
      </author>
      <author fullname="Nick Sullivan" initials="N." surname="Sullivan">
         <organization>Cloudflare</organization>
         <address>
            <email>nick@cloudflare.com</email>
         </address>
      </author>
      <date day="16" month="August" year="2018"/>
      <area>General</area>
      <workgroup>HTTP Working Group</workgroup>
      <keyword>Internet-Draft</keyword>
      <abstract>
         <t>This specification defines the CDN-Loop request header field for HTTP.</t>
      </abstract>
   </front>
   <middle>
      <section anchor="introduction" title="Introduction">
         <t>In modern deployments of HTTP servers, it is common to interpose Content Delivery Networks (CDNs) to improve end-user perceived latency, reduce operational costs, and improve scalability and reliability of services.</t>
         <t>Often, more than one CDN is in use by any one server; this happens for a variety of reasons, such as cost savings, arranging for failover should one CDN have issues, or to directly compare their services.</t>
         <t>As a result, it is not unknown for CDNs to be configured in a “loop” accidentally; because routing is achieved through a combination of DNS and forwarding rules, and site configurations are sometimes complex and managed by several parties.</t>
         <t>When this happens, it is difficult to debug. Additionally, it sometimes isn’t accidental; loops between multiple CDNs be used as an attack vector (e.g., see <xref target="loop-attack"/>), especially if one CDN unintentionally strips the loop detection headers of another.</t>
         <t>HTTP defines the Via header field in <xref target="RFC7230" x:fmt="," x:sec="5.7.1"/> for “tracking message forwards, avoiding request loops, and identifying the protocol capabilities of senders along the request/response chain.”</t>
         <t>In theory, Via could be used to identify these loops. However, in practice it is not used in this fashion, because some HTTP servers use Via for other purposes – in particular, some implementations disable some HTTP/1.1 features when the Via header is present.</t>
         <t>This specification defines the CDN-Loop request header field for HTTP, to address this shortcoming.</t>
      </section>
      <section anchor="conventions-and-definitions"
               title="Conventions and Definitions">
         <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 target="RFC2119"/>
            <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
         <t>This specification uses the Augmented Backus-Naur Form (ABNF) notation of <xref target="RFC5234"/> with a list extension, defined in <xref target="RFC7230" x:fmt="of" x:sec="7"/>, that allows for compact definition of comma-separated lists using a ‘#’ operator (similar to how the ‘*’ operator indicates repetition). Additionally, it uses the OWS rule from <xref target="RFC7230"/> and the parameter rule from <xref target="RFC7231"/>.</t>
      </section>
      <section anchor="the-cdn-loop-request-header-field"
               title="The CDN-Loop Request Header Field">
         <t>The CDN-Loop request header field is intended to help a Content Delivery Network identify when an incoming request has already passed through that CDN’s servers, to prevent loops.</t>
         <figure>
            <artwork type="abnf">
CDN-Loop = #cdn-id
cdn-id   = token *( OWS ";" OWS parameter )
</artwork>
         </figure>
         <t>Conforming Content Delivery Networks SHOULD add a value to this header field to all requests they generate or forward (creating the header if necessary).</t>
         <t>The token identifies the CDN as a whole. Chosen token values SHOULD be unique enough that a collision with other CDNs is unlikely. Optionally, the token can have semicolon-separated key/value parameters, to accommodate additional information for the CDN’s use.</t>
         <t>As with all HTTP headers defined using the “#” rule, the CDN-Loop header can be added to by comma-separating values, or by creating a new header field with the desired value.</t>
         <t>For example:</t>
         <figure>
            <artwork type="example">
CDN-Loop: FooCDN, barcdn; host="foo123.bar.cdn"
CDN-Loop: baz-cdn; abc="123"; def="456", anotherCDN
</artwork>
         </figure>
         <t>Note that the token syntax does not allow whitespace, DQUOTE or any of the characters “(),/:;&lt;=&gt;?@[]{}”. See <xref target="RFC7230" x:fmt="," x:sec="3.2.6"/>. Likewise, note the rules for when parameter values need to be quoted in <xref target="RFC7231" x:fmt="," x:sec="3.1.1"/>.</t>
         <t>To be effective, intermediaries – including Content Delivery Networks – MUST NOT remove this header field, or allow it to be removed (e.g., through configuration) and servers (including intermediaries) SHOULD NOT use it for other purposes.</t>
      </section>
      <section anchor="security-considerations" title="Security Considerations">
         <t>The CDN-Loop header field can be generated by any client, and therefore its contents cannot be trusted. CDNs who modify their behaviour based upon its contents should assure that this does not become an attack vector (e.g., for Denial-of-Service).</t>
         <t>It is possible to sign the contents of the header (either by putting the signature directly into the field’s content, or using another header field), but such use is not defined (or required) by this specification.</t>
      </section>
      <section anchor="iana-considerations" title="IANA Considerations">
         <t>This document registers the “CDN-Loop” header field in the Permanent Message Header Field Names registry.</t>
         <t>
            <list style="symbols">
               <t>Header Field Name: CDN-Loop</t>
               <t>Protocol: http</t>
               <t>Status: standard</t>
               <t>Reference: (this document)</t>
            </list>
         </t>
      </section>
   </middle>
   <back>
      <references title="Normative References">
         <reference anchor="RFC2119">
            <front>
               <title>Key words for use in RFCs to Indicate Requirement Levels</title>
               <author fullname="S. Bradner" initials="S." surname="Bradner"/>
               <date month="March" year="1997"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="2119"/>
            <seriesInfo name="DOI" value="10.17487/RFC2119"/>
         </reference>
         <reference anchor="RFC7230">
            <front>
               <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
               <author fullname="R. Fielding"
                       initials="R."
                       role="editor"
                       surname="Fielding"/>
               <author fullname="J. Reschke"
                       initials="J."
                       role="editor"
                       surname="Reschke"/>
               <date month="June" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7230"/>
            <seriesInfo name="DOI" value="10.17487/RFC7230"/>
         </reference>
         <reference anchor="RFC8174">
            <front>
               <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <date month="May" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
         </reference>
         <reference anchor="RFC5234">
            <front>
               <title>Augmented BNF for Syntax Specifications: ABNF</title>
               <author fullname="D. Crocker"
                       initials="D."
                       role="editor"
                       surname="Crocker"/>
               <author fullname="P. Overell" initials="P." surname="Overell"/>
               <date month="January" year="2008"/>
            </front>
            <seriesInfo name="STD" value="68"/>
            <seriesInfo name="RFC" value="5234"/>
            <seriesInfo name="DOI" value="10.17487/RFC5234"/>
         </reference>
         <reference anchor="RFC7231">
            <front>
               <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
               <author fullname="R. Fielding"
                       initials="R."
                       role="editor"
                       surname="Fielding"/>
               <author fullname="J. Reschke"
                       initials="J."
                       role="editor"
                       surname="Reschke"/>
               <date month="June" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7231"/>
            <seriesInfo name="DOI" value="10.17487/RFC7231"/>
         </reference>
      </references>
      <references title="Informative References">
         <reference anchor="loop-attack"
                    target="http://www.icir.org/vern/papers/cdn-loops.NDSS16.pdf">
            <front>
               <title>Forwarding-Loop Attacks in Content Delivery Networks</title>
               <author fullname="Jianjun Chen" initials="J." surname="Chen"/>
               <author fullname="Jian Jiang" initials="J." surname="Jiang"/>
               <author fullname="Xiaofeng Zheng" initials="X." surname="Zheng"/>
               <author fullname="Haixin Duan" initials="H." surname="Duan"/>
               <author fullname="Jinjin Liang" initials="J." surname="Liang"/>
               <author fullname="Kang Li" initials="K." surname="Li"/>
               <author fullname="Tao Wan" initials="T." surname="Wan"/>
               <author fullname="Vern Paxson" initials="V." surname="Paxson"/>
               <date month="February" year="2016"/>
            </front>
            <seriesInfo name="ISBN" value="1-891562-41-X"/>
            <seriesInfo name="DOI" value="10.14722/ndss.2016.23442"/>
         </reference>
      </references>
   </back>
</rfc>
