<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std"
     docName="draft-ietf-ospf-encapsulation-cap-09" ipr="trust200902"
     obsoletes="" updates="" submissionType="IETF" xml:lang="en"
     tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true"
     version="3" number="0000" consensus="true">

<!--[rfced] updated by Sarah 06/06/20 -->
  <!-- xml2rfc v2v3 conversion 2.46.0 -->
  <front>
    <title abbrev="Tunnel Encapsulations RI">The Tunnel Encapsulations OSPF Router Information</title>
    <seriesInfo name="RFC" value="0000"/>
    <author fullname="Xiaohu Xu" initials="X.X." role="editor" surname="Xu">
      <organization>Huawei</organization>
      <address>
        <email>xuxiaohu@huawei.com</email>
      </address>
    </author>
    <author fullname="Bruno Decraene " initials="B.D." role="editor" surname="Decraene">
      <organization>Orange</organization>
      <address>
        <email>bruno.decraene@orange.com</email>
      </address>
    </author>
    <author fullname="Robert Raszuk" initials="R.R." surname="Raszuk">
      <organization>Bloomberg LP</organization>
      <address>
        <!--
       <postal>
         <street></street>
-->

        <!-- Reorder these if your country does things differently -->

        <!--
         <city>Soham</city>

         <region></region>

         <code></code>

         <country>UK</country>
       </postal>

       <phone>+44 7889 488 335</phone>
-->

        <email>robert@raszuk.net</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Luis M. Contreras" initials="L.C." surname="Contreras">
      <organization>Telefonica I+D</organization>
      <address>
        <email>luismiguel.contrerasmurillo@telefonica.com</email>
      </address>
    </author>
    <author fullname="Luay Jalil" initials="L.J." surname="Jalil">
      <organization>Verizon</organization>
      <address>
        <email>luay.jalil@verizon.com</email>
      </address>
    </author>
    <date year="2020" month="July"/>
    <area>Routing Area</area>
    <workgroup>OSPF Working Group</workgroup>
<!-- [rfced] Please insert any keywords (beyond those that appear in 
the title) for use on https://www.rfc-editor.org/search.
-->

<keyword>example</keyword>

    <abstract>
      <t>Networks use tunnels for a variety of reasons. A large variety of
      tunnel types are defined and the tunnel encapsulator router needs to select a
      type of tunnel which is supported by the tunnel decapsulator router. This document
      defines how to advertise, in OSPF Router Information Link State Advertisement (LSAs),
      the list of tunnel encapsulations supported by the tunnel decapsulator.</t>
    </abstract>

  </front>
  <middle>
    <section anchor="Introduction" numbered="true" toc="default">
      <name>Introduction</name>
      <t>Networks use tunnels for a variety of reasons, such as:</t>
      <ul spacing="normal">
        <li>Partial deployment of IPv6 in IPv4 networks or IPv4 in IPv6
          networks as described in <xref target="RFC5565" format="default"/>, where IPvx
          tunnels are used between IPvx-enabled routers so as to traverse
          non-IPvx routers.</li>
        <li>Remote Loop-Free Alternate (RLFA) repair tunnels as described in
          <xref target="RFC7490" format="default"/>, where tunnels are used between the Point
          of Local Repair and the selected PQ node.</li>
      </ul>
      <t>The tunnel encapsulator router needs to select a type of tunnel which is
      supported by the tunnel decapsulator router. This document
      defines how to advertise, in OSPF Router Information Link State Advertisement (LSAs),
      the list of tunnel encapsulations supported by the tunnel decapsulator.
      In this document, OSPF refers to both OSPFv2
      <xref target="RFC2328" format="default"/> and OSPFv3 <xref target="RFC5340" format="default"/>.</t>
    <section>
      <name>Requirements Language</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>

    </section>

    </section>
    <section anchor="Terminology" numbered="true" toc="default">
      <name>Terminology</name>
      <t>This memo makes use of the terms defined in <xref target="RFC7770" format="default"/>.</t>
    </section>
    <section anchor="RI" numbered="true" toc="default">
      <name>Tunnel Encapsulations TLV</name>
      <t>Routers advertise their supported tunnel encapsulation type(s) by
      advertising a new TLV of the OSPF Router Information (RI) Opaque LSA
      <xref target="RFC7770" format="default"/>, referred to as the Tunnel Encapsulations TLV.
      This TLV is applicable to both OSPFv2 and OSPFv3.</t>
      <t>The Type code of the Tunnel Encapsulations is TBD1, the
      Length value is variable, and the Value field contains one or more
      Tunnel Sub-TLVs as defined in <xref target="TunnelType" format="default"/>.
      Each Tunnel Sub-TLV indicates a particular encapsulation
      format that the advertising router supports along with the parameters
	  corresponding to the tunnel type.</t>
      <t>The Tunnel Encapsulations TLV <bcp14>MAY</bcp14> appear more than once
      within a given OSPF Router Information (RI) Opaque LSA. If the Tunnel
      Encapsulations TLV appears more than once in an OSPF Router
      Information LSA, the set of all Tunnel Sub-TLVs from all Tunnel Encapsulations TLV <bcp14>SHOULD</bcp14> be considered. The scope of the advertisement depends on the
      application but it is recommended that it <bcp14>SHOULD</bcp14> be domain-wide.</t>
    </section>
    <section anchor="TunnelType" numbered="true" toc="default">
      <name>Tunnel Sub-TLV</name>
      <t>The Tunnel Sub-TLV is structured as follows:</t>
      <figure anchor="Tunnel_Sub-TLV">
        <name>Tunnel Sub-TLV</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[ 
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Tunnel Type (2 Octets)     |        Length (2 Octets)      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |               Tunnel Parameter Sub-TLVs                      |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
      </figure>
      <dl newline="false">
        <dt>Tunnel Type (2 octets):</dt><dd>Identifies the type of tunneling
          technology signaled. Tunnel types are shared with the BGP
          extension <xref target="I-D.ietf-idr-tunnel-encaps" format="default"/> and hence are
          defined in the IANA registry "BGP Tunnel Encapsulation Attribute
          Tunnel Types". Unknown Tunnel types are to be ignored upon
          receipt.</dd>
        <dt>Length (2 octets):</dt><dd>Unsigned 16-bit integer indicating the total
          number of octets of the value field.</dd>
        <dt>Value (variable):</dt><dd>Zero or more Tunnel Parameter
          Sub-TLVs as defined in <xref target="ParameterTLVs" format="default"/>.</dd>
      </dl>
      <t>If a Tunnel Sub-TLV is invalid, it <bcp14>MUST</bcp14> be ignored and skipped. However,
      other Tunnel Sub-TLVs <bcp14>MUST</bcp14> be considered</t>
    </section>
    <section anchor="ParameterTLVs" numbered="true" toc="default">
      <name>Tunnel Parameter Sub-TLVs</name>
      <t>A Tunnel Parameter Sub-TLV is structured as follows:</t>

      <figure anchor="Tunnel_Parameter_Sub-TLV">
        <name>Tunnel Parameter Sub-TLV</name>
        <artwork name="" type="" align="left"                                                    
alt=""><![CDATA[
           +---------------------------------------------+
           |   Tunnel Parameter Sub-Type (2 Octets)      |
           +---------------------------------------------+
           |   Tunnel Parameter Length (2 Octets)        |
           +---------------------------------------------+
           |   Tunnel Parameter Value (Variable)         |
           |                                             |
           +---------------------------------------------+
        ]]></artwork>
      </figure>
      <dl newline="false">
        <dt>Tunnel Parameter Sub-Type (2 octets):</dt><dd>Each sub-type defines a 
          parameter of the Tunnel Sub-TLV. Sub-Types are
          registered in the IANA registry "OSPF Tunnel Parameter Sub-TLVs" <xref target="ParameterRegistry" format="default"/>.</dd>
        <dt>Tunnel Parameter Length (2 octets):</dt><dd>Unsigned 16-bit integer indicating the
          total number of octets of the Tunnel Parameter Value field.</dd>
        <dt>Tunnel Parameter Value (variable):</dt><dd>Encodings of the value field depend on
          the Sub-TLV type as enumerated above. The following sub-sections
          define the encoding in detail.</dd>
      </dl>
      <t>Any unknown Tunnel Parameter Sub-Type <bcp14>MUST</bcp14> be ignored and skipped upon receipt. When a reserved
      value (See <xref target="ParameterRegistry" format="default"/>) is seen in an LSA, it
      <bcp14>MUST</bcp14> be treated as an invalid Tunnel Parameter Sub-TLV. When a Tunnel Parameter Value has an incorrect syntax or semantic, it <bcp14>MUST</bcp14> be treated as an invalid Tunnel Parameter Sub-TLV. If a Tunnel Parameter Sub-TLV is invalid, its
      Tunnel Sub-TLV <bcp14>MUST</bcp14> be ignored. However,
      other Tunnel Sub-TLVs <bcp14>MUST</bcp14> be considered.</t>
      <section anchor="EncapsulationTLV" numbered="true" toc="default">
        <name>Encapsulation Sub-TLV</name>
        <t>This Sub-TLV type is 1. The syntax, semantic, and usage of its
	value field are defined in Section <xref target="I-D.ietf-idr-tunnel-encaps"
	sectionFormat="bare" section="3.2">"Encapsulation Sub-TLVs for
	Particular Tunnel Types"</xref> of <xref target="I-D.ietf-idr-tunnel-encaps"
	format="default"/>.</t>
      </section>
      <section anchor="ProtocolTLV" numbered="true" toc="default">
        <name>Protocol Type Sub-TLV</name>
        <t>This Sub-TLV type is 2. The syntax, semantic, and usage of its
	value field are defined in Section <xref target="I-D.ietf-idr-tunnel-encaps"
	sectionFormat="bare" section="3.4.1">"Protocol Type sub-TLV"</xref> of
	<xref target="I-D.ietf-idr-tunnel-encaps" format="default"/>.</t>
      </section>
      <section anchor="EndpointTLV" numbered="true" toc="default">
        <name>Endpoint Sub-TLV</name>
        <t>This Sub-TLV type is 3. It <bcp14>MUST</bcp14> be present once and only once in a given Tunnel Sub-TLV. The value field contain two sub-fields:
        </t>
        <ul spacing="normal">
          <li>a two-octet Address Family sub-field</li>
          <li>an Address sub-field, whose length depends upon the Address Family.</li>
        </ul>
        <figure anchor="Endpoint_Sub-TLV">
          <name>Endpoint Sub-TLV</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[ 
      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |      Address Family           |           Address             ~
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
     ~                     (Variable length)                         ~
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
        </figure>
        <t>The Address Family subfield contains a value from IANA's "Address
   Family Numbers" registry.  In this document, we assume that the
   Address Family is either IPv4 or IPv6; use of other address families
   is outside the scope of this document.</t>
        <t>If the Address Family subfield contains the value for IPv4, the
   address subfield <bcp14>MUST</bcp14> contain an IPv4 address (a /32 IPv4 prefix).
   In this case, the length field of Remote Endpoint sub-TLV <bcp14>MUST</bcp14> contain the value 6.</t>
        <t>If the Address Family subfield contains the value for IPv6, the
   address sub-field <bcp14>MUST</bcp14> contain an IPv6 address (a /128 IPv6 prefix).
   In this case, the length field of Remote Endpoint sub-TLV <bcp14>MUST</bcp14>
   contain the value 18 (0x12).  IPv6 link local addresses are not valid
   values of the IP address field.</t>
      </section>
      <section anchor="ColorTLV" numbered="true" toc="default">
        <name>Color Sub-TLV</name>
        <t>This Sub-TLV type is 4. It may appear zero or more time in a given Tunnel Sub-TLV. The value field is a 4-octet opaque unsigned
        integer.</t>
        <t>The color value is user-defined and configured locally on the
        advertising routers. It may be used by service providers to define
        policies on the tunnel encapsulator routers, for example, to control the
        selection of the tunnel to use.</t>
        <t>This color value can be referenced by BGP routes carrying Color
        Extended Community <xref target="I-D.ietf-idr-tunnel-encaps" format="default"/>. If the
        tunnel is used to reach the BGP Next-Hop of BGP routes, then attaching
        a Color Extended Community to those routes express the
        willingness of the BGP speaker to use a tunnel of the same color.</t>
      </section>
      <section anchor="Load-Balancing" numbered="true" toc="default">
        <name>Load-Balancing Block Sub-TLV</name>
        <t>This Sub-TLV type is 5. The syntax, semantic, and usage of its value field are defined in <xref target="RFC5640" format="default"/>.</t>
      </section>
      <section anchor="IP.QoS" numbered="true" toc="default">
        <name>IP QoS Field</name>
        <t>This Sub-TLV type is 6. The syntax, semantic, and usage of its
	value field are defined in Section <xref
	target="I-D.ietf-idr-tunnel-encaps" sectionFormat="bare"
	section="3.3.1">"IPv4 DS Field"</xref>
        of <xref target="I-D.ietf-idr-tunnel-encaps" format="default"/>.</t>
      </section>
      <section anchor="UDP" numbered="true" toc="default">
        <name>UDP Destination Port</name>
        <t>This Sub-TLV type is 7. The syntax, semantic, and usage of its
	value field are defined in Section <xref
	target="I-D.ietf-idr-tunnel-encaps" sectionFormat="bare"
	section="3.3.2">"UDP Destination Port"</xref> of <xref
	target="I-D.ietf-idr-tunnel-encaps" format="default"/>.</t>
      </section>
    </section>
    <section anchor="Operation" numbered="true" toc="default">
      <name>Operation</name>
      <t>The advertisement of a Tunnel Encapsulations Sub-TLV indicates that the advertising router
      supports a particular tunnel decapsulation along with the parameters to
      be used for the tunnel. The decision to use that tunnel is driven by the
      capability of the tunnel encapsulator router to support the encapsulation type and
      the policy on the tunnel encapsulator router. The Color Sub-TLV (See <xref target="ColorTLV" format="default"/>) may be used as an input to this policy. Note that
      some tunnel types may require the execution of an explicit tunnel setup
      protocol before they can be used to transit data.</t>
      <t>  A tunnel <bcp14>MUST NOT</bcp14> be
      used if there is no route toward the IP address specified in the
      Endpoint Sub-TLV (See <xref target="EndpointTLV" format="default"/>) or if the route is
      not advertised in the same OSPF domain.</t>
    </section>
    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="IANA.RI" numbered="true" toc="default">
        <name>OSPF Router Information</name>
        <t>This document requests IANA to allocate a new code point from the
        OSPF Router Information (RI) registry.

        </t>

<table anchor="encaps-router">
  <name>Tunnel Encapsulation Router Information</name>   
  <thead>
    <tr>
      <th>Value</th>
      <th>TLV Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>TBD1</td>
      <td>Tunnel Encapsulations</td>
      <td>RFC 0000</td>
    </tr>
  </tbody>
</table>

      </section>
      <section anchor="ParameterRegistry" numbered="true" toc="default">
        <name>Tunnel Parameter Sub-TLVs Registry</name>
        <t>This document requests IANA to create, under "Open Shortest Path First (OSPF) Parameters", a new registry "OSPF Tunnel
        Parameter Sub-TLVs" with the following registration procedure:</t>
        <ul spacing="normal">
          <li>The values in the range 1-34999 are to be allocated using the
            "Standards Action" registration procedure as defined in <xref target="RFC8126" format="default"/>.</li>
          <li>The values in the range 35000-65499 are to be allocated using the
            "First Come, First Served" registration procedure.</li>
        </ul>

<table anchor="sub-TLV-reg"> 
  <name>OSPF Tunnel Parameter Sub-TLVs Registry</name> 
  <thead>
    <tr>
      <th>Value</th>
      <th>Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>0</td>
      <td>Reserved</td>
      <td>RFC 0000</td>
    </tr>
    <tr>
      <td>1</td>
      <td>Encapsulation</td>
      <td>RFC 0000 &amp; <xref target="I-D.ietf-idr-tunnel-encaps"/></td>
    </tr>
    <tr>
      <td>2</td>
      <td>Protocol Type</td>
      <td>RFC 0000 &amp; <xref target="I-D.ietf-idr-tunnel-encaps"/></td>
    </tr>
    <tr>
      <td>3</td>
      <td>Endpoint</td>
      <td>RFC 0000</td>
    </tr>
    <tr>
      <td>4</td>
      <td>Color</td>
      <td>RFC 0000</td>
    </tr>
    <tr>
      <td>5</td>
      <td>Load-Balancing Block</td>
      <td>RFC 0000 &amp; <xref target="RFC5640" /></td>
    </tr>
    <tr>
      <td>6</td>
      <td>IP QoS</td>
      <td>RFC 0000 &amp; <xref target="I-D.ietf-idr-tunnel-encaps"/></td>
    </tr>
    <tr>
      <td>7</td>
      <td>UDP Destination Port</td>
      <td>RFC 0000 &amp; <xref target="I-D.ietf-idr-tunnel-encaps"/></td>
    </tr>
    <tr>
      <td>8-65499</td>
      <td>Unassigned</td>
      <td></td>
    </tr>
    <tr>
      <td>65500-65534</td>
      <td>Experimental</td>
      <td>RFC 0000</td>
    </tr>
    <tr>
      <td>65535</td>
      <td>Reserved</td>
      <td>RFC 0000</td>
    </tr>

  </tbody>
</table>

      </section>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>Security considerations applicable to softwires can be found in the
      mesh framework <xref target="RFC5565" format="default"/>. In general, security issues of
      the tunnel protocols signaled through this OSPF capability extension are
      inherited.</t>
      <t>If a third-party is able to modify any of the information that is
      used to form encapsulation headers, to choose a tunnel type, or to
      choose a particular tunnel for a particular payload type, user data
      packets may end up getting misrouted, mis-delivered, and/or dropped.
      However, since an OSPF routing domain is usually a well-controlled network
      under a single administrative domain, the possibility of the above attack is very low.</t>
      <t>We note that the last paragraph of <xref target="Operation" format="default"/> forbid the establishment of a tunnel toward arbitrary destinations. It prohibits a destination outside of the OSPF domain. This avoid that a third-party gaining access to an OSPF router be able to send the traffic to other destinations, e.g., for inspection purposes.</t>
      <t>Security considerations for the base OSPF protocol are covered in
      <xref target="RFC2328" format="default"/> and <xref target="RFC5340" format="default"/>.</t>
    </section>
    <section numbered="true" toc="default">
      <name>Contributors</name>
<contact fullname="Uma Chunduri">
<organization>Huawei</organization>
<address>
<email>uma.chunduri@gmail.com</email>
</address>
</contact>
    </section>
    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>This document is partially inspired by <xref target="RFC5512"
      format="default"/>.</t>
      <t>The authors would like to thank <contact fullname="Greg Mirsky"/>,
      <contact fullname="John E Drake"/>, <contact fullname="Carlos
      Pignataro"/> and <contact fullname="Karsten Thomann"/> for their
      valuable comments on this
      document. Special thanks should be given to <contact fullname="Acee
      Lindem"/> for his multiple
      detailed reviews of this document and help. The authors would like to
      thank <contact fullname="Pete Resnick"/>, <contact fullname="Joe
      Touch"/>, <contact fullname="David Mandelberg"/>, <contact
      fullname="Sabrina Tanamal"/>, <contact fullname="Tim Wicinski"/>,
      <contact fullname="Amanda Baber"/> for their Last Call reviews and thank
      <contact fullname="Spencer Dawkins"/>, <contact fullname="Mirja
      Kuehlewind"/>, <contact fullname="Ben Campbell"/>, <contact
      fullname="Benoit Claise"/>, <contact fullname="Alvaro Retana"/>,
      <contact fullname="Adam Roach"/> and <contact fullname="Suresh
      Krishnan"/> for their AD reviews.</t>
      <!---->
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include
	    href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7770.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5640.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-idr-tunnel-encaps-15.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2328.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5340.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5512.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5565.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7490.xml"/>
      </references>
    </references>
  </back>
</rfc>
