<?xml version="1.0" encoding="US-ASCII"?>
<!-- used xml2rfc v2 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [


<!ENTITY RFC2119 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY RFC2460 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2460.xml'>
<!ENTITY RFC2780 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2780.xml'>
<!ENTITY RFC5533 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5533.xml'>
<!ENTITY RFC6564 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6564.xml'>
<!ENTITY RFC5095 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5095.xml'>
<!ENTITY RFC4302 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4302.xml'>
<!ENTITY RFC4303 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4303.xml'>
<!ENTITY RFC5201 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5201.xml'>
<!ENTITY RFC6275 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6275.xml'>
<!ENTITY RFC6554 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6554.xml'>
<!ENTITY RFC4727 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4727.xml'>
<!ENTITY RFC3692 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3692.xml'>
<!ENTITY RFC5226 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml'>








]>

<?rfc rfcedstyle="yes"?>
<?rfc toc="yes"?>            
<?rfc symrefs="yes"?>       
<?rfc sortrefs="yes"?>       
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc ipr="trust200902" number="7045" submissionType="IETF" category="std" consensus="yes" updates="2460, 2780" >

<front>
<title abbrev="IPv6 Extension Header Transmission">Transmission and Processing of IPv6 Extension Headers</title>


<author initials="B. E." surname="Carpenter" fullname="Brian Carpenter">
    <organization abbrev="Univ. of Auckland"></organization>
    <address>
      <postal>
        <street>Department of Computer Science</street>
        <street>University of Auckland</street>
        <street>PB 92019</street>
        <city>Auckland</city>
        <region></region>
        <code>1142</code>
        <country>New Zealand</country>
      </postal>
      
      <email>brian.e.carpenter@gmail.com</email>
    </address>
</author>




   <author fullname="Sheng Jiang" initials="S." surname="Jiang">
      <organization>Huawei Technologies Co., Ltd.</organization>
      <address>
        <postal>
          <street>Q14, Huawei Campus</street>
          <street>No. 156 Beiqing Road</street>
          <city>Hai-Dian District, Beijing</city>
          <code>100095</code>
          <country>P.R. China</country>
        </postal>
        <email>jiangsheng@huawei.com</email>
      </address>
    </author>


 <date month="December" year="2013" />

<area>Internet</area>
<workgroup>6man</workgroup>

<keyword>example</keyword>

<abstract>

<t>Various IPv6 extension headers have been standardised since the IPv6 standard was first published. This document
updates RFC 2460 to clarify how intermediate nodes should deal with such extension headers and with any that
are defined in the future. It also specifies how extension headers should be registered by IANA,
with a corresponding minor update to RFC 2780.
</t>
    
</abstract>
</front>

<middle>
<section anchor="intro" title="Introduction and Problem Statement">

<t>In IPv6, an extension header is any header that follows the
initial 40 bytes of the packet and precedes the upper-layer header
(which might be a transport header, an ICMPv6 header, or a notional
"No Next Header"). </t>

<t>An initial set of IPv6 extension headers was defined by <xref target="RFC2460"/>,
which also described how they should be handled by intermediate nodes,
with the exception of the Hop-by-Hop Options header:

<list>
<t>...extension headers are not examined or processed
by any node along a packet's delivery path, until the packet reaches
the node (or each of the set of nodes, in the case of multicast)
identified in the Destination Address field of the IPv6 header.</t>
</list>
</t>

<t>This provision meant that forwarding nodes should be completely
transparent to extension headers. There was no provision for
forwarding nodes to modify them, remove them, insert them, or use them
to affect forwarding behaviour.  Thus, new extension headers could be
introduced progressively and used only by hosts that have been updated
to create and interpret them <xref target="RFC6564"/>. The extension
header mechanism is an important part of the IPv6 architecture, and
several new extension headers have been standardised since RFC
2460 was published.</t>

<t>Today, IPv6 packets are not always forwarded by straightforward IP
routing based on their first 40 bytes. Some routers, and a
variety of intermediate nodes often referred to as middleboxes, such
as firewalls, load balancers, or packet classifiers, might inspect other
parts of each packet. Indeed, such middlebox functions are often embedded in routers. 
However, experience has shown that as a result,
the network is not transparent to IPv6 extension headers. 
Contrary to Section 4 of RFC 2460, middleboxes sometimes examine and process the 
entire IPv6 packet before making a decision to either forward or discard the packet.
This means that they need to traverse the chain of extension
headers, if present, until they find the transport header (or an encrypted payload). 
Unfortunately, because not all IPv6 extension headers follow a uniform TLV format, 
this process is clumsy and requires knowledge of each extension header's format. 
A separate problem is that the header chain may even be fragmented
<xref target="HEADER-CHAIN"/>.</t>

<t>The process is potentially slow as well as clumsy, possibly
precluding its use in nodes attempting to process packets at line
speed. The present document does not intend to solve this problem,
which is caused by the fundamental architecture of IPv6 extension
headers.  This document focuses on clarifying how the header chain
should be handled in the current IPv6 architecture. </t>

<t>If they encounter an unrecognised extension header type, some
firewalls treat the packet as suspect and drop it. Unfortunately, it
is an established fact that several widely used firewalls do not
recognise some or all of the extension headers standardised since RFC
2460 was published. It has also been observed that certain firewalls do not even
handle all the extension headers standardised in RFC 2460, including
the fragment header <xref target="FRAGDROP"/>, causing fundamental
problems of end&nbhy;to&nbhy;end connectivity. This applies in particular to
firewalls that attempt to inspect packets at very high speed, since
they cannot take the time to reassemble fragmented packets, especially
when under a denial-of-service attack. </t>

<t>Other types of middleboxes, such as load balancers or packet
classifiers, might also fail in the presence of extension headers that
they do not recognise. </t> 

<t>A contributory factor to this problem is that because extension headers
are numbered out of the existing IP Protocol Number space, there is no collected
list of them. For this reason, it is hard for an implementor to quickly identify
the full set of standard extension headers. An implementor who consults only RFC 2460
will miss all extension headers defined subsequently.  </t>

<t>This combination of circumstances creates a "Catch-22" situation
<xref target="Heller"/> for the deployment of any newly standardised
extension header except for local use. It cannot be widely deployed
because existing middleboxes will drop it on many paths through the
Internet. However, most middleboxes will not be updated to allow the
new header to pass until it has been proved safe and useful on the
open Internet, which is impossible until the middleboxes have been
updated. </t>

<t>The uniform TLV format now defined for extension headers <xref
target="RFC6564"/> will improve the situation, but only for future
extensions. Some tricky and potentially malicious cases will be
avoided by forbidding very long chains of extension headers that need
to be fragmented <xref target="HEADER-CHAIN"/>.  This will alleviate
concerns that stateless firewalls cannot locate a complete header
chain as required by the present document. </t>

<t>However, these changes are insufficient to correct the underlying problem. 
The present document clarifies that the above requirement from
RFC 2460 applies to all types of nodes that forward IPv6 packets and to
all extension headers standardised now and in the future. It also requests that
IANA create a subsidiary registry that clearly identifies extension header types
and updates RFC 2780 accordingly. Fundamental changes to the IPv6
extension header architecture are out of scope for this document. </t>

<t>Also, hop-by-hop options are not handled by many high-speed routers or are
processed only on a slow path. This document also updates the requirements for
processing the Hop-by-Hop Options header to make them more realistic. </t>

<section title="Terminology">
<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"/>.</t>

<t>In the remainder of this document, the term "forwarding node" refers to any router,
firewall, load balancer, prefix translator, or any other device or middlebox that forwards IPv6
packets with or without examining the packet in any way. </t>

<t>In this document, "standard" IPv6 extension headers are those
specified in detail by IETF Standards Actions <xref target="RFC5226"/>.  
"Experimental"
extension headers include those defined by any Experimental RFC and
the header values 253 and 254 defined by <xref target="RFC3692"/> and
<xref target="RFC4727"/> when used as experimental extension headers.
"Defined" extension headers are the "standard" extension headers plus
the "experimental" ones. </t>
</section>
</section> <!-- intro -->

<section anchor="reqt" title="Requirement to Transmit Extension Headers">

<section anchor="all" title="All Extension Headers">

<t>As mentioned above, forwarding nodes that discard packets
containing extension headers are known to cause connectivity failures
and deployment problems. Therefore, it is important that forwarding
nodes that inspect IPv6 headers be able to parse all defined extension
headers and deal with them appropriately, as specified in this
section. </t>

<t>Any forwarding node along an IPv6 packet's path, which forwards the
packet for any reason, SHOULD do so regardless of any extension
headers that are present, as required by RFC 2460.  Exceptionally, if
a forwarding node is designed to examine extension headers for any
reason, such as firewalling, it MUST recognise and deal appropriately
with all standard IPv6 extension header types and SHOULD recognise and
deal appropriately with experimental IPv6 extension header types.  The
list of standard and experimental extension header types is maintained
by IANA (see <xref target="iana"/>), and implementors are advised to
check this list regularly for updates. </t>

<t>RFC 2460 requires destination hosts to discard packets containing
unrecognised extension headers.  However, intermediate forwarding
nodes SHOULD NOT do this, since that might cause them to inadvertently
discard traffic using a recently standardised extension header not yet
recognised by the intermediate node. The exceptions to this rule are
discussed next. </t>

<t>If a forwarding node
discards a packet containing a standard IPv6 extension header, it MUST be
the result of a configurable policy and not just the result of a failure to
recognise such a header. This means that the discard policy for each
standard type of extension header MUST be individually configurable. The default configuration
SHOULD allow all standard extension headers. </t>

<t>Experimental IPv6 extension headers SHOULD be treated
in the same way as standard extension headers, including an individually configurable
discard policy. However, the default configuration MAY drop experimental extension headers. 
</t>

<t>Forwarding nodes MUST be configurable to allow packets
containing unrecognised extension headers, but the default configuration MAY drop such packets. </t>

<t>The IPv6 Routing Header Types 0 and 1 have been deprecated.
Note that Type 0 was deprecated by <xref target="RFC5095"/>.  
However, this does not mean that the IPv6 Routing
Header can be unconditionally dropped by forwarding nodes.  Packets
containing standardised and undeprecated Routing Headers SHOULD be
forwarded by default.  At the time of writing, these include Type 2
<xref target="RFC6275"/>, Type 3 <xref target="RFC6554"/>, and the
experimental Routing Header Types 253 and 254 <xref
target="RFC4727"/>.  Others may be defined in the future. </t>
</section>

<section title="Hop-by-Hop Options">
<t>The IPv6 Hop-by-Hop Options header SHOULD be processed by intermediate forwarding nodes
as described in <xref target="RFC2460"/>.
However, it is to be expected that high-performance routers will either
ignore it or assign packets containing it to a slow processing path. Designers
planning to use a hop-by-hop option need to be aware of this likely behaviour. </t>

<t>As a reminder, in RFC 2460, it is stated that the Hop-by-Hop Options header, if present,
must be first. </t>
</section>

</section> <!-- reqt -->



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

<t>Forwarding nodes that operate as firewalls MUST conform to the requirements in the
previous section in order to respect the IPv6 extension header architecture.
In particular, packets containing standard extension headers are only to be discarded
as a result of an intentionally configured policy. </t>

<t>These changes do not affect a firewall's ability to filter out
traffic containing unwanted or suspect extension headers, if
configured to do so. However, the changes do require firewalls to be
capable of permitting any or all extension headers, if configured to
do so. The default configurations are intended to allow normal use of
any standard extension header, avoiding the connectivity issues
described in Sections <xref target="intro" format="counter" /> and
<xref target="all" format="counter"/>. </t>

<t>As noted above, the default configuration might drop packets containing
experimental extension headers. There is no header length field in an IPv6 header, and 
header types 253 and 254 might be used either for experimental
extension headers or for experimental payload types. Therefore, there is no
generic algorithm by which a firewall can distinguish these two cases and analyze the
remainder of the packet. This should be considered when deciding on the appropriate
default action for header types 253 and 254. </t>

<t>When new extension headers are standardised in the future, those implementing and configuring
forwarding nodes, including firewalls, will need to take them into account. 
A newly defined header will exercise new code paths in a host that does recognise it,
so caution may be required. Additional security issues with experimental values or new
extension headers are to be found in <xref target="RFC4727"/> and <xref target="RFC6564"/>.
As a result, it is to be expected that the deployment
process will be slow and will depend on satisfactory operational experience.
Until deployment is complete, the new extension will fail in some parts of the Internet.
This aspect needs to be considered when deciding to standardise a new extension. 
Specific security considerations for each new extension should be documented
in the document that defines it. </t>
 
</section> <!-- security -->


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

<t>IANA has added an extra column titled "IPv6 Extension Header" to the
"Assigned Internet Protocol Numbers" registry to clearly mark those values that
are also IPv6 extension header types defined by an IETF Standards Action or 
IESG Approval (see list below).  This also applies to
IPv6 extension header types defined in the future. </t>

<t>Additionally, IANA has closed the existing empty "Next Header Types"
registry to new entries and is redirecting its users to a new "IPv6 Extension
Header Types" registry. This registry contains only those
protocol numbers that are also marked as IPv6 Extension Header types in the "Assigned 
Internet Protocol Numbers" registry. Experimental values will be marked as such.
The initial list will be as follows: 

<list style="symbols">

<t>0, IPv6 Hop-by-Hop Option, <xref target="RFC2460"/> </t>
<t>43, Routing Header for IPv6, <xref target="RFC2460"/>, <xref target="RFC5095"/>  </t> 
<t>44, Fragment Header for IPv6, <xref target="RFC2460"/> </t>
<t>50, Encapsulating Security Payload, <xref target="RFC4303"/> </t>
<t>51, Authentication Header, <xref target="RFC4302"/> </t>
<t>60, Destination Options for IPv6, <xref target="RFC2460"/> </t>
<t>135, Mobility Header, <xref target="RFC6275"/> </t>
<t>139, Experimental use, Host Identity Protocol <xref target="RFC5201"/> </t> 
<t>140, Shim6 Protocol, <xref target="RFC5533"/> </t>
<t>253, Use for experimentation and testing, <xref target="RFC3692"/>, <xref target="RFC4727"/> </t>
<t>254, Use for experimentation and testing, <xref target="RFC3692"/>, <xref target="RFC4727"/> </t>
</list> 
</t>

<t>This list excludes type 59, No Next Header, <xref target="RFC2460"/>,
which is not an extension header as such. </t>

<t>The references to the IPv6 Next Header field in <xref target="RFC2780"/> are to be 
interpreted as also applying to the IPv6 Extension Header field, and the "IPv6 Extension Header Types"
registry will be managed accordingly. </t>


</section> <!-- iana -->




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

<t>
This document was triggered by mailing list discussions including
John Leslie, Stefan Marksteiner, and others.

Valuable comments and contributions were made by
Dominique Barthel,
Tim Chown,
Lorenzo Colitti, 
Fernando Gont,
C. M. Heard,
Bob Hinden,
Ray Hunter,
Suresh Krishnan,
Marc Lampo,
Sandra Murphy,
Michael Richardson,
Dan Romascanu,
Dave Thaler,
Joe Touch,
Bjoern Zeeb,
and others.
 </t>

<t>Brian Carpenter was a visitor at the Computer Laboratory at Cambridge University during part of this work. </t>

</section> <!-- ack -->


</middle>

<back>

<references title="Normative References">

&RFC2119;
&RFC2460;
&RFC2780;
&RFC6564;
&RFC4727;
&RFC3692;



</references>

<references title="Informative References">

&RFC4302;
&RFC4303;
&RFC5095;
&RFC5201;
&RFC5226;
&RFC5533;
&RFC6275;
&RFC6554;

<!--I-D.ietf-6man-oversized-header-chain-08.xml, Active-->
<reference anchor='HEADER-CHAIN'>
<front>
<title>Implications of Oversized IPv6 Header Chains</title>

<author initials='F' surname='Gont' fullname='Fernando Gont'>
    <organization />
</author>

<author initials='V' surname='Manral' fullname='Vishwas Manral'>
    <organization />
</author>

<author initials='R' surname='Bonica' fullname='Ron Bonica'>
    <organization />
</author>

<date month='October' year='2013' />

</front>

<seriesInfo name='Work in' value='Progress' />
</reference>


<!--I-D.taylor-v6ops-fragdrop.xml, Active-->
<reference anchor='FRAGDROP'>
<front>
<title>Why Operators Filter Fragments and What It Implies</title>

<author initials='J' surname='Jaeggli' fullname='Joel Jaeggli'>
    <organization />
</author>

<author initials='L' surname='Colitti' fullname='Lorenzo Colitti'>
    <organization />
</author>

<author initials='W' surname='Kumari' fullname='Warren Kumari'>
    <organization />
</author>

<author initials='E' surname='Vyncke' fullname='Eric Vyncke'>
    <organization />
</author>

<author initials='M' surname='Kaeo' fullname='Merike Kaeo'>
    <organization />
</author>

<author initials='T' surname='Taylor' fullname='Tom Taylor'>
    <organization />
</author>

<date month='June' year='2013' />

</front>

<seriesInfo name='Work in' value='Progress' />
</reference>


<reference anchor='Heller'>
<front>
<title>Catch-22</title>
<author initials="J." surname="Heller" fullname="Joseph Heller">
<organization></organization></author>
<date month='November' year='1961'/>
</front>
 <seriesInfo name='Simon and' value='Schuster'/>
</reference>

</references>



</back>
</rfc>

