<?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="9013" consensus="true">

<!-- xml2rfc v2v3 conversion 2.46.0 -->

  <front>
    <title abbrev="Tunnel Encapsulations RI">OSPF Advertisement of Tunnel Encapsulations</title>
    <seriesInfo name="RFC" value="9013"/>
    <author fullname="Xiaohu Xu" initials="X" role="editor" surname="Xu">
      <organization>Capitalonline</organization>
      <address>
        <email>xiaohu.xu@capitalonline.net</email>
      </address>
    </author>
    <author fullname="Bruno Decraene" initials="B" role="editor" surname="Decraene">
      <organization>Orange</organization>
      <address>
        <email>bruno.decraene@orange.com</email>
      </address>
    </author>
    <author fullname="Robert Raszuk" initials="R" surname="Raszuk">
      <organization>NTT Network Innovations</organization>
      <address>
        <postal>
            <street>940 Stewart Dr</street>
            <city>Sunnyvale</city>
            <region>CA</region>
            <code>94085</code>
            <country>United States of America</country>
        </postal>
        <email>robert@raszuk.net</email>
      </address>
    </author>
    <author fullname="Luis M. Contreras" initials="L" surname="Contreras">
      <organization>Telefonica I+D</organization>
      <address>
        <email>luismiguel.contrerasmurillo@telefonica.com</email>
      </address>
    </author>
    <author fullname="Luay Jalil" initials="L" surname="Jalil">
      <organization>Verizon</organization>
      <address>
        <email>luay.jalil@verizon.com</email>
      </address>
    </author>
    <date year="2021" month="April"/>

    <keyword>BGP</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 that is supported by the tunnel decapsulator router. This document
      defines how to advertise, in OSPF Router Information Link State Advertisements (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 that is
      supported by the tunnel decapsulator router. This document
      defines how to advertise, in OSPF Router Information Link State Advertisements (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>
    <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>
        <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 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 TLV is 13, 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 TLVs <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 shown in <xref
      target="Tunnel_Sub-TLV"/>.</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="RFC9012" 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 Tunnel Parameter Sub-TLVs field.</dd>
        <dt>Tunnel Parameter Sub-TLVs (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 shown in <xref target="Tunnel_Parameter_Sub-TLV"/>.</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"
	(see <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. The following subsections
          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 semantics, 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, semantics, and usage of its
	Value field are defined in Section <xref target="RFC9012"
	sectionFormat="bare" section="3.2">"Encapsulation Sub-TLVs for
	Particular Tunnel Types"</xref> of <xref target="RFC9012"
	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, semantics, and usage of its
	Value field are defined in Section <xref target="RFC9012"
	sectionFormat="bare" section="3.4.1">"Protocol Type Sub-TLV"</xref> of
	<xref target="RFC9012" format="default"/>.</t>
      </section>
      <section anchor="EndpointTLV" numbered="true" toc="default">
        <name>Tunnel Egress Endpoint Sub-TLV</name>
        <t>The Tunnel Egress Endpoint Sub-TLV specifies the address of the egress endpoint of the tunnel -- that is, the address of the router that will decapsulate the payload.</t>
        <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 contains two subfields:
        </t>
        <ul spacing="normal">
          <li>a two-octet Address Family subfield</li>
          <li>an Address subfield, whose length depends upon the Address Family</li>
        </ul>
        <figure anchor="Endpoint_Sub-TLV">
          <name>Tunnel Egress 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 the Tunnel Egress Endpoint Sub-TLV <bcp14>MUST</bcp14> contain the value 6.</t>
        <t>If the Address Family subfield contains the value for IPv6, the
   address subfield <bcp14>MUST</bcp14> contain an IPv6 address (a /128 IPv6 prefix).
   In this case, the Length field of the Tunnel Egress 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 times 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 the Color
        Extended Community <xref target="RFC9012" 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 expresses 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, semantics, 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>DS Field Sub-TLV</name>
        <t>This sub-TLV type is 6. The syntax, semantics, and usage of its
	Value field are defined in Section <xref
	target="RFC9012" sectionFormat="bare"
	section="3.3.1">"DS Field"</xref>
        of <xref target="RFC9012" format="default"/>.</t>
      </section>
      <section anchor="UDP" numbered="true" toc="default">
        <name>UDP Destination Port Sub-TLV</name>
        <t>This sub-TLV type is 7. The syntax, semantics, and usage of its
	Value field are defined in Section <xref
	target="RFC9012" sectionFormat="bare"
	section="3.3.2">"UDP Destination Port"</xref> of <xref
	target="RFC9012" 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
      Tunnel Egress 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 (RI) TLVs Registry</name>
        <t>IANA has allocated the following new code point in the
        "OSPF Router Information (RI) TLVs" registry.

        </t>

<table anchor="encaps-router">
  <name>Addition to OSPF Router Information (RI) TLVs Registry</name>   
  <thead>
    <tr>
      <th>Value</th>
      <th>TLV Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>13</td>
      <td>Tunnel Encapsulations</td>
      <td>RFC 9013</td>
    </tr>
  </tbody>
</table>

      </section>
      <section anchor="ParameterRegistry" numbered="true" toc="default">
        <name>OSPF Tunnel Parameter Sub-TLVs Registry</name>
        <t>IANA has created a new subregistry called the "OSPF Tunnel
        Parameter Sub-TLVs" registry under the "Open Shortest Path
	First (OSPF) Parameters" registry. The registration procedures are as follows:</t>

        <ul spacing="normal">
          <li>The values in the range 1-34999 are to be allocated using the
            "Standards Action" registration procedure 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>

<t>The initial contents of the registry are as follows:</t>
<table anchor="sub-TLV-reg"> 
  <name>Initial Contents of OSPF Tunnel Parameter Sub-TLVs Registry</name> 
  <thead>
    <tr>
      <th>Value</th>
      <th>TLV Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>          
    <tr>
      <td>0</td>
      <td>Reserved</td>
      <td>RFC 9013</td>
    </tr>
    <tr>
      <td>1</td>
      <td>Encapsulation</td>
      <td>RFC 9013 &amp; RFC 9012</td>
    </tr>
    <tr>
      <td>2</td>
      <td>Protocol Type</td>
      <td>RFC 9013 &amp; RFC 9012</td>
    </tr>
    <tr>
      <td>3</td>
      <td>Endpoint</td>
      <td>RFC 9013</td>
    </tr>
    <tr>
      <td>4</td>
      <td>Color</td>
      <td>RFC 9013</td>
    </tr>
    <tr>
      <td>5</td>
      <td>Load-Balancing Block</td>
      <td>RFC 9013 &amp; RFC 5640</td>
    </tr>
    <tr>
      <td>6</td>
      <td>DS Field</td>
      <td>RFC 9013 &amp; RFC 9012</td>
    </tr>
    <tr>
      <td>7</td>
      <td>UDP Destination Port</td>
      <td>RFC 9013 &amp; RFC 9012</td>
    </tr>
    <tr>
      <td>8-65499</td>
      <td>Unassigned</td>
      <td></td>
    </tr>
    <tr>
      <td>65500-65534</td>
      <td>Experimental</td>
      <td>RFC 9013</td>
    </tr>
    <tr>
      <td>65535</td>
      <td>Reserved</td>
      <td>RFC 9013</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, choose a tunnel type, or
      choose a particular tunnel for a particular payload type, user data
      packets may end up getting misrouted, misdelivered, 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"/> forbids the establishment of a tunnel toward
      arbitrary destinations. It prohibits a destination outside of the OSPF
      domain. This prevents a third
      party that has gained access to an OSPF router from being 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>

  </middle>
  <back>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include
	    href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7770.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5640.xml"/>

<!-- draft-ietf-idr-tunnel-encaps-15 (RFC 9012) --> 
<reference anchor="RFC9012" target="https://www.rfc-editor.org/info/rfc9012">
<front>
<title>The BGP Tunnel Encapsulation Attribute</title>
<author initials='K' surname='Patel' >
  <organization/>
</author>
<author initials='G' surname='Van de Velde' >
  <organization/>
</author>
<author initials='S' surname='Sangli' >
  <organization/>
</author>
<author initials='J' surname='Scudder' >
  <organization/>
</author>
<date month='April' year='2021'/>
</front>
<seriesInfo name="RFC" value="9012"/>
<seriesInfo name="DOI" value="10.17487/RFC9012"/>
</reference>

      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2328.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5340.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5512.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5565.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7490.xml"/>
      </references>
    </references>
    <section anchor="Acknowledgements" numbered="false" 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"/>, and
      <contact fullname="Amanda Baber"/> for their Last Call reviews. The authors also thank
      <contact fullname="Spencer Dawkins"/>, <contact fullname="Mirja
      Kühlewind"/>, <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>

    <section numbered="false" toc="default">
      <name>Contributors</name>

<contact fullname="Uma Chunduri">
<organization>Huawei</organization>
<address>
<email>uma.chunduri@gmail.com</email>
</address>
</contact>

    </section>

  </back>
</rfc>
