<?xml version="1.0" encoding="us-ascii"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!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://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4492 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4492.xml">
<!ENTITY RFC4513 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4513.xml">
<!ENTITY RFC5246 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC5288 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5288.xml">
<!ENTITY RFC5440 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5440.xml">
<!ENTITY RFC5088 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5088.xml">
<!ENTITY RFC5089 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5089.xml">
<!ENTITY RFC5280 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY RFC5746 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5746.xml">
<!ENTITY RFC5925 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5925.xml">
<!ENTITY RFC6066 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6066.xml">
<!ENTITY RFC6125 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6125.xml">
<!ENTITY RFC6460 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6460.xml">
<!ENTITY RFC6614 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6614.xml">
<!ENTITY RFC6952 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6952.xml">
<!ENTITY RFC6698 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6698.xml">
<!ENTITY RFC7420 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7420.xml">
<!ENTITY RFC7457 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7457.xml">
<!ENTITY RFC7525 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7525.xml">
<!ENTITY RFC7671 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7671.xml">
<!ENTITY RFC8174 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY I-D.ietf-pce-stateful-sync-optimizations SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-stateful-sync-optimizations.xml">
<!ENTITY I-D.ietf-pce-pcep-yang SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-pcep-yang.xml">
<!ENTITY I-D.wu-pce-dns-pce-discovery SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.wu-pce-dns-pce-discovery.xml">
<!ENTITY I-D.wu-pce-discovery-pceps-support SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.wu-pce-discovery-pceps-support.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. -->
<!-- <?rfc strict="yes" ?> -->
<?rfc toc="yes" ?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="no"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no"?>
<?rfc compact="yes" ?>
<?rfc iprnotified="Yes" ?>
<?rfc strict="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-pce-pceps-17" ipr="pre5378Trust200902" updates="5440">
  <!-- 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>
    <title>Secure Transport for PCEP</title>
    <author fullname="Diego R. Lopez" initials="D. R." surname="Lopez">
      <organization>Telefonica I+D</organization>
      <address>
        <postal>
          <street>Don Ramon de la Cruz, 82</street>
          <city>Madrid</city>
          <region></region>
          <code>28006</code>
          <country>Spain</country>
        </postal>
        <phone>+34 913 129 041</phone>
        <email>diego.r.lopez@telefonica.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Oscar Gonzalez de Dios" initials="O." surname="Gonzalez de Dios">
      <organization>Telefonica I+D</organization>
      <address>
        <postal>
          <street>Don Ramon de la Cruz, 82</street>
          <city>Madrid</city>
          <region></region>
          <code>28006</code>
          <country>Spain</country>
        </postal>
        <phone>+34 913 129 041</phone>
        <email>oscar.gonzalezdedios@telefonica.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>
          <city>Nanjing</city>
          <region>Jiangsu</region>
          <code>210012</code>
          <country>China</country>
        </postal>
        <email>sunseawq@huawei.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Dhruv Dhody" initials="D." surname="Dhody">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>Divyashree Techno Park, Whitefield</street>
          <city>Bangalore</city>
          <region>KA</region>
          <code>560066</code>
          <country>India</country>
        </postal>
        <email>dhruv.ietf@gmail.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <date year="2017"/>

    <!-- Meta-data Declarations -->
    <area>Routing</area>
    <workgroup>PCE Working Group</workgroup>
    <keyword>PCE, PCEP, PCEPS, security, authentication, encryption, TLS</keyword>

    <abstract>
        <t>The Path Computation Element Communication Protocol (PCEP) defines the mechanisms for the communication between a Path Computation Client (PCC) and a Path Computation Element (PCE), or among PCEs. This document describes the usage of Transport Layer Security (TLS) to enhance PCEP security, hence the PCEPS acronym proposed for it. The additional security mechanisms are provided by the transport protocol supporting PCEP, and therefore they do not affect the flexibility and extensibility of PCEP.</t>

        <t>This document updates RFC 5440 in regards to the PCEP initialization phase procedures. </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
    <t>The Path Computation Element Communication Protocol (PCEP) <xref target="RFC5440"/> defines the mechanisms for the communication between a Path Computation Client (PCC) and a Path Computation Element (PCE), or between two PCEs. These interactions include requests and replies that can be critical for a sustainable network operation and adequate resource allocation, and therefore appropriate security becomes a key element in the PCE infrastructure. As the applications of the PCE framework evolves, and more complex service patterns emerge, the definition of a secure mode of operation becomes more relevant.</t>
    <t><xref target="RFC5440"/> analyzes in its section on security considerations the potential threats to PCEP and their consequences, and discusses several mechanisms for protecting PCEP against security attacks, without making a specific recommendation on a particular one or defining their application in depth. Moreover, <xref target="RFC6952"/> remarks the importance of ensuring PCEP communication confidentiality, especially when PCEP communication endpoints do not reside in the same Autonomous System (AS), as the interception of PCEP messages could leak sensitive information related to computed paths and resources.</t>
    <t>Among the possible solutions mentioned in these documents, Transport Layer Security (TLS) <xref target="RFC5246"/> provides support for peer authentication, message encryption and integrity. TLS provides well-known mechanisms to support key configuration and exchange, as well as means to perform security checks on the results of PCE discovery procedures via Interior Gateway Protocol (IGP) (<xref target="RFC5088"/> and <xref target="RFC5089"/>).</t>
     <t>This document describes a security container for the transport of PCEP messages, and therefore it does not affect the flexibility and extensibility of PCEP.</t>
    <t>This document describes how to apply TLS to secure interactions with PCE, including initiation of the TLS procedures, the TLS handshake mechanism, the TLS methods for peer authentication, the applicable TLS ciphersuites for data exchange, and the handling of errors in the security checks.  In the rest of the document we will refer to this usage of TLS to provide a secure transport for PCEP as "PCEPS".</t>

    <t>Within this document, PCEP communications are described through PCC-PCE relationship. The PCE architecture also supports the PCE-PCE communication, this is achieved by  requesting PCE fill the role of a PCC, as usual. Thus, in this document, the PCC refers to a PCC or a PCE initiating the PCEP session 
    and acting as a client.</t>

    </section>

  <section title="Requirements Language">
        <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>
    </section>

    <section title="Applying PCEPS">
    <section title="Overview">
    <t>The steps involved in establishing a PCEPS session are as follows:</t>
    <t><list style="numbers">
   <t>Establishment of a TCP connection.</t>
   <t>Initiating the TLS procedures by the StartTLS message from PCE to
   PCC and from PCC to PCE.</t>
   <t>Negotiation and establishment of TLS connection.</t>
   <t>Start exchanging PCEP messages as per <xref target="RFC5440"/>.</t>
   </list>
   </t>
   <t>This document uses the standard StartTLS procedure in PCEP, instead of using a different port for the secured session. This is done to avoid requesting allocation of 
    another port number for the PCEPS. The StartTLS procedure makes more efficient use of scarce port numbers and allow simpler configuration of PCEP. </t>
   <t>Implementations SHOULD follow the best practices and recommendations for using TLS, as per <xref target="RFC7525"/>. </t>
   <t>It should be noted that this procedure updates what is defined in section
   4.2.1 and section 6.7 of <xref target="RFC5440"/> regarding the initialization phase and the processing of messages prior to
   the Open message. The details of processing, including backward compatibility,
   are discussed in the following sections.</t>
   </section>

   <section title="Initiating the TLS Procedures" anchor="init">
    <t>Since PCEP can operate either with or without TLS, it is necessary
    for a PCEP speaker to indicate whether it wants to set up a TLS
    connection or not.  For this purpose, this document specifies a new
    PCEP message called StartTLS. 
    Thus, the PCEP session is secured via TLS from the
   start before exchange of any other PCEP message (that includes the
   Open message). This document thus updates
   <xref target="RFC5440"/>, which required the
    Open message to be the first PCEP message that is exchanged. In the case of a PCEP
    session using TLS, the StartTLS message will be sent first. Also 
    a PCEP speaker that supports PCEPS MUST NOT start the OpenWait timer
    after the TCP establishment, instead it starts a StartTLSWait timer 
    as described in <xref target="start"/>. 
    </t>

    <t>The PCEP speaker MAY
    discover that the PCEP peer supports PCEPS or can be preconfigured
    to use PCEPS for a given peer (see <xref target="Discovery"/> for more
    details). 
    An existing PCEP session cannot be secured via TLS, the session
    MUST be closed and re-established with TLS as per the procedure described in
    this document.</t>

    <t>
    The StartTLS message is a PCEP message sent by a PCC to a PCE and by a
    PCE to a PCC in order to initiate the TLS procedure for PCEP. 
    The PCC initiates the use of TLS by sending a StartTLS message.
    The PCE agrees to the use of TLS by responding with its own
    StartTLS message. If the PCE is configured to only support TLS, it
    may send the StartTLS message immediately upon TCP connection
    establishment; otherwise it MUST wait for the PCC's first
    message to see whether it is an Open or a StartTLS message.
    The TLS negotiation 
    and establishment procedures are triggered once the PCEP speaker has sent and received
    the StartTLS message. The
    Message-Type field of the PCEP common header for the StartTLS message is
    set to [TBA1 by IANA].</t>

    <t>Once the TCP connection has been successfully established, the first
    message sent by the PCC to the PCE and by the PCE to the PCC MUST be
    a StartTLS message for the PCEPS. Note that, this is a significant change
    from <xref target="RFC5440"/>, where the first PCEP message is the Open message.</t>

    <t>A PCEP speaker receiving a StartTLS message, after any other PCEP
    exchange has taken place (by receiving or sending any other messages
    from either side) MUST treat it as an unexpected message and reply with a
    PCErr message with Error-Type set to [TBA2 by IANA] (PCEP StartTLS
    failure) and Error-value set to 1 (reception of StartTLS after any
    PCEP exchange), and MUST close the TCP connection.</t> 
    <t>Any message received prior to StartTLS or Open message MUST trigger a protocol
   error condition causing a PCErr message to be sent with Error-Type
    set to [TBA2 by IANA] (PCEP StartTLS failure) and
    Error-value set to 2 (reception of a message apart from StartTLS or Open) 
    and MUST close the TCP connection.</t>


    	<!--A PCEP speaker receiving
    any other message apart from  StartTLS or Open as the very first message, 
    MUST treat it as an unexpected message and reply with a PCErr message 
    with Error-Type set to [TBA2 by IANA] (PCEP StartTLS failure) and
    Error-value set to 2 (reception of any other message apart from 
    StartTLS or Open message), and MUST close the TCP connection.</t>-->

    <t>If the PCEP speaker that does not support PCEPS, receives a StartTLS
    message, it will behave according to the existing error mechanism
    described in section 6.2 of <xref target="RFC5440"/> (in
    case message is received prior to an Open message) or
    section 6.9 of <xref target="RFC5440"/> (for the case of reception of
    unknown message). See <xref target="Backward"/> for more details.</t>

    <t>If the PCEP speaker that only supports PCEPS connection (as a local policy), receives an Open
    message, it MUST treat it as an unexpected message and reply with a
    PCErr message with Error-Type set to 1 (PCEP session establishment failure) and
    Error-value set to 1 (reception of an invalid Open message or a non Open message), and MUST close the TCP connection.</t>

    <t>If a PCC supports PCEPS connections as well as allow non-PCEPS connection (as a local policy), 
      it MUST first try to establish PCEPS, by sending StartTLS message and in case it receives an PCErr message from the PCE,
      it MAY retry to establish connection without PCEPS by sending an Open message. If a PCE supports 
      PCEPS connections as well as allow non-PCEPS connection (as a local policy), it MUST wait to respond after TCP establishment, 
      based on the message received from the PCC. In case of StartTLS message, PCE MUST respond with sending a StartTLS message and moving to TLS 
      establishment procedures as described in this document. In case of Open message, PCE MUST respond with Open message and move to PCEP session establishment procedure as per <xref target="RFC5440"/>. If a PCE supports PCEPS connections only (as a local policy), it MAY send StartTLS message to PCC without waiting to receive a StartTLS message from PCC. </t>

    <!--<t>After the exchange of StartTLS messages, if a PCEP speaker cannot establish a TLS connection
    for some reason (e.g. the required mechanisms for certificate revocation
    checking are not available), it MUST return a PCErr message (in clear) with Error-Type
    set to [TBA2 by IANA] (PCEP StartTLS failure) and Error-value set to:</t>

    <t><list style="symbols">
      <t>3 (not without TLS) if it is not willing to exchange PCEP messages
        without the solicited TLS connection, and it MUST close the TCP
        session.</t>

      <t>4 (ok without TLS) if it is willing to exchange PCEP messages without
      the solicited TLS connection, and it MUST close the TCP session. The
      receiver MAY choose to attempt to re-establish the PCEP session
        without TLS next. The attempt to re-establish the PCEP session
        without TLS SHOULD be limited to only once. 
         </t>
    </list></t>    

    <t>Note that, the PCEP implementation MUST send the PCErr message once the TLS 
    	connection has been closed i.e. the TLS close_notify <xref target="RFC5246"/> has been received from the peer. 
    	As per <xref target="RFC5246"/>, if the data may be
   carried over the underlying transport after the TLS connection is
   closed, the TLS implementation must receive the responding
   close_notify alert before indicating to the application layer that
   the TLS connection has ended. </t>-->

   <t>If a PCEP speaker that is unwilling or unable to negotiate
   TLS receives a StartTLS messages, it 
   MUST return a PCErr message (in clear) with Error-Type set to [TBA2
   by IANA] (PCEP StartTLS failure) and Error-value set to:
   <list style="symbols">
   <t>3 (Failure, connection without TLS is not possible) if it is not willing to exchange PCEP messages
      without the solicited TLS connection, and it MUST close the TCP
      session.</t>

   <t>4 (Failure, connection without TLS is possible) if it is willing to exchange PCEP messages
      without the solicited TLS connection, and it MUST close the TCP
      session.  The receiver MAY choose to attempt to re-establish the
      PCEP session without TLS next.  The attempt to re-establish the
      PCEP session without TLS SHOULD be limited to only once.</t>
    </list></t>

    <t>If the PCEP speaker supports PCEPS and can establish a TLS connection it
    MUST start the TLS connection negotiation and establishment steps described in
    <xref target="Establishment"/> before the PCEP initialization procedure
    (section 4.2.1 of <xref target="RFC5440"/>).</t>

   <t>After the exchange of StartTLS messages, if the TLS negotiation
   fails for some reason (e.g. the required
   mechanisms for certificate revocation checking are not available),
   both peers SHOULD
   immediately close the connection. <!-- [EKR discuss: Since the initiator has no way to know
   if the peer is willing to accept PCEP connection without 
   TLS, based on the local policy, it MAY attempt to re-establish 
   the PCEP session without TLS. The attempt to re-establish the
      PCEP session without TLS SHOULD be limited to only once.--></t>

    <t>
    A PCEP speaker that does not support PCEPS sends the Open message
   directly, as per <xref target="RFC5440"/>. A PCEP speaker that 
   supports PCEPS, but has learned in the last exchange the
   peer's willingness to reestablish session without TLS, MAY send the Open
   message directly, as per <xref target="RFC5440"/>. The attempt to re-establish the PCEP session
   without TLS SHOULD be limited to only once.
    </t>

    <t>Given the asymmetric nature of TLS for connection establishment, it is
    relevant to identify the roles of each of the PCEP peers in it. The PCC
    SHALL act as TLS client, and the PCE SHALL act as TLS server as per
    <xref target="RFC5246"/>.</t>

    <!--<t>These procedures minimize the impact of PCEPS support in PCEP
    implementations without requiring additional dedicated ports for
    running PCEP with TLS.</t>-->

    <t>As per the recommendation from <xref target="RFC7525"/> to avoid 
    downgrade attacks, PCEP peers that support PCEPS, SHOULD default to 
    strict TLS configuration i.e. do not allow non-TLS PCEP sessions to 
    be established. PCEPS implementations MAY provide an option to allow 
    the operator to manually override strict TLS configuration and allow
    unsecured connections. Execution of this override SHOULD trigger a 
    warning about the security implications of permitting unsecured 
    connections.</t>
  </section>

      <section title="The StartTLS Message" anchor="start">
            <t>
   The StartTLS message is used to initiate the TLS procedure for a PCEPS
   session between the PCEP peers. A PCEP speaker sends the
   StartTLS message to request negotiation and establishment of TLS
   connection for PCEP. On receiving a StartTLS message from the PCEP peer (i.e.
   when the PCEP speaker has sent and received StartTLS message) it is ready to
   start the negotiation and establishment of TLS and move to steps described
   in <xref target="Establishment"/>.
   </t>
   <t>The collision resolution procedures described in <xref target="RFC5440"/>
   for the exchange of Open messages MUST be applied by the PCEP peers during
   the exchange of StartTLS messages.</t>
   <t>The format of a StartTLS message is as follows:</t>
             <figure>
            <artwork><![CDATA[

   <StartTLS Message>::= <Common Header>

            ]]></artwork>
          </figure>

   <t>The StartTLS message MUST contain only the PCEP common header with
   Message-Type field set to [TBA1 by IANA].</t>

   <t>Once the TCP connection has been successfully established, the 
    PCEP speaker MUST start a timer called
   StartTLSWait timer, after the expiration of which, if neither StartTLS
   message has been received, nor a PCErr/Open message (in case of failure
   and PCEPS not supported by the peer, respectively), it MUST send a PCErr message with Error-Type set to [TBA2 by IANA] and Error-value
   set to 5 (no StartTLS (nor PCErr/Open) message received before the expiration of the
   StartTLSWait timer) and it MUST release the
   TCP connection . A RECOMMENDED
   value for StartTLSWait timer is 60 seconds. The value of StartTLSWait timer MUST NOT be less than OpenWait timer.
</t>

             <figure title="Both PCEP Speaker supports PCEPS (strict)"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F1">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |
                 | StartTLS            |
                 | msg                 |
                 |-------              |
                 |       \   StartTLS  |
                 |        \  msg       |
                 |         \  ---------|
                 |          \/         |
                 |          /\         |
                 |         /  -------->|
                 |        /            |
                 |<------              |
                 |:::::::::TLS:::::::::|
                 |:::::Establishment:::|
                 |                     |
                 |                     |
                 |:::::::PCEP::::::::::|
                 |                     |
            ]]></artwork>
          </figure>

             <figure title="Both PCEP Speaker supports PCEPS (strict), but cannot establish TLS"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F2">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |
                 | StartTLS            |
                 | msg                 |
                 |-------              |
                 |       \   StartTLS  |
                 |        \  msg       |
                 |         \  ---------|
                 |          \/         |
                 |          /\         |
                 |         /  -------->|
                 |        /            |
                 |<------              |
                 |:::::::::TLS:::::::::| TLS Establishment
                 |:::::Establishment:::| Failure, Both 
                 |                     | peers close 
                                         session

            ]]></artwork>
          </figure>          

<figure title="One PCEP Speaker (PCE) does not support PCEPS, while PCC supports both with or without PCEPS"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F3">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |  Does not support
                 | StartTLS            |  PCEPS and thus
                 | msg                 |  sends Open
                 |-------              |
                 |       \   Open      |
                 |        \  msg       |
                 |         \  ---------|
                 |          \/         |
                 |          /\         |
                 |         /  -------->|
                 |        /            |
                 |<------              |
                 |                     |
                 |<--------------------| Send Error
                 |       PCErr         | Type=1,Value=1
                 |                     | (non-Open message
                 |<--------------------|  received)
                 |       Close         |
                 ///////// TCP /////////
                 //////re-establish/////
       Send Open | Open                |
       this time | msg                 |
                 |-------              |
                 |       \   Open      |
                 |        \  msg       |
                 |         \  ---------|
                 |          \/         |
                 |          /\         |
                 |         /  -------->|
                 |        /            |
                 |<------              |


            ]]></artwork>
          </figure>          

          <figure title="Both PCEP Speaker supports PCEPS as well as without PCEPS"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F4">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |
                 | StartTLS            |
                 | msg                 | PCE waits 
                 |-------------------->| for PCC and
                 |            StartTLS | respond with   
                 |<--------------------| Start TLS
                 |                     |
                 |:::::::::TLS:::::::::|
                 |:::::Establishment:::|
                 |                     |
                 |                     |
                 |:::::::PCEP::::::::::|
                 |                     |
            ]]></artwork>
          </figure>

          <figure title="Both PCEP Speaker supports PCEPS as well as without PCEPS, but PCE cannot start TLS negotiation"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F5">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |
                 | StartTLS            |
                 | msg                 | PCE waits 
                 |-------------------->| for PCC 
                 |               PCErr | 
                 |<--------------------| Send Error
                 |                     | Type=TBA2,Value=3
                 |                     | (Failure, connection 
                 |<--------------------|  without TLS is not 
                 |       Close         |  possible)

                 
            ]]></artwork>
          </figure>

          <figure title="PCE supports PCEPS as well as without PCEPS, while PCC does not support PCEPS"
             suppress-title="false" align="left" alt="" width="" height="" anchor="F6">
            <artwork><![CDATA[

               +-+-+                 +-+-+
               |PCC|                 |PCE|
               +-+-+                 +-+-+
                 |                     |
                 | Open                |
                 | msg                 | PCE waits 
                 |-------------------->| for PCC and
                 |                Open | respond with   
                 |<--------------------| Open
                 |                     |
                 |:::::::PCEP::::::::::|
                 |                     |
            ]]></artwork>
          </figure>


            

      </section>



      <section title="TLS Connection Establishment" anchor="Establishment">
          <t>Once the establishment of TLS has been agreed by the PCEP peers, the connection establishment SHALL follow the following steps:</t>
               <t>
          <list style="numbers">
              <t>Immediately negotiate a TLS session according to <xref target="RFC5246"/>. The following restrictions apply:
              <list style="symbols">
                <t>Support for TLS v1.2 <xref target="RFC5246"/> or later is REQUIRED.</t>
                <t>Support for certificate-based mutual authentication is REQUIRED.</t>
                <!--<t>Negotiation of mutual authentication is REQUIRED.</t>-->
                <t>Negotiation of a ciphersuite providing for integrity protection is REQUIRED.</t>
                <t>Negotiation of a ciphersuite providing for confidentiality is RECOMMENDED.</t>
                <t>Support for and negotiation of compression is OPTIONAL.</t>
                <t>PCEPS implementations MUST, at a minimum, support negotiation of the TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 <xref target="RFC6460"/>, and SHOULD support TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 as well. Implementations SHOULD support the NIST P-256 (secp256r1) curve <xref target="RFC4492"/>. In addition, PCEPS implementations MUST support negotiation of the mandatory-to-implement ciphersuites required by the versions of TLS that they support from TLS 1.3 onwards.</t>
              </list></t>
            <t>Peer authentication can be performed in any of the following two REQUIRED operation models:
              <list style="symbols">
                <t>TLS with X.509 certificates using Public-Key Infrastructure Exchange (PKIX) trust models:
                  <list style="symbols">
                    <t>Implementations MUST allow the configuration of a list of trusted Certification Authorities (CAs) for incoming connections.</t>
                    <t>Certificate validation MUST include the verification rules as per <xref target="RFC5280"/>.</t>
                    <t>PCEPS implementations SHOULD incorporate revocation methods (CRL downloading, OCSP...) according to the trusted CA policies.</t>
                    <t>Implementations SHOULD indicate their trusted CAs. For TLS 1.2, this is done using <xref target="RFC5246"/>, Section 7.4.4, "certificate_authorities" (server side) and <xref target="RFC6066"/>, Section 6 "Trusted CA Indication" (client side).</t>
                    <t>Implementations MUST follow the rules and guidelines for peer validation as defined in <xref target="RFC6125"/>. If an expected DNS name or IP address for the peer is configured, then the implementations MUST check them against the values in the presented certificate. 
                    <!--They SHOULD include a check on whether the locally configured expected DNS name or IP address of the peer that is contacted matches its presented certificate.--> The DNS names and the IP addresses can be contained in the CN-ID <xref target="RFC6125"/> (Common Name Identifier) or the subjectAltName entries.  For verification, only one of these entries is considered. The following precedence applies: for DNS name validation, DNS-ID <xref target="RFC6125"/> has precedence over CN-ID; for IP address validation, subjectAltName:iPAddr has precedence over CN-ID.</t>
                    <t>Implementations MAY allow the configuration of a set of additional properties of the certificate to check for a peer's authorization to communicate (e.g., a set of allowed values in URI-ID <xref target="RFC6125"/> or a set of allowed X509v3 Certificate Policies). The definition of these properties are out of scope of this document.</t>
                  </list></t>
                <t>TLS with X.509 certificates using certificate fingerprints: Implementations MUST allow the configuration of a list of certificates that are trusted to identify peers, identified via fingerprint of the Distinguished Encoding Rules (DER) encoded certificate octets. Implementations MUST support SHA-256 as defined by <xref target="SHS"/> as the hash algorithm for the fingerprint, but a later revision may demand support for a stronger hash function.</t>
              </list></t>
            <t>Start exchanging PCEP messages.
            <list style="symbols">
              <t>Once the TLS connection has been successfully established, the PCEP speaker 
   MUST start the OpenWait timer <xref target="RFC5440"/>, after the
   expiration of which, if no Open message has been received, it sends a
   PCErr message and releases the TCP/TLS connection.</t>
            </list></t>    
          </list></t>
        <!--<t>To support TLS re-negotiation both peers MUST support the mechanism described in <xref target="RFC5746"/>. Any attempt to initiate a TLS handshake to establish new cryptographic parameters not aligned with <xref target="RFC5746"/> SHALL be considered a TLS negotiation failure.</t>-->
      </section>

      
<section title="Peer Identity" anchor="Identity">
<t>
   Depending on the peer authentication method in use, PCEPS supports
   different operation modes to establish peer's identity and whether it
   is entitled to perform requests or can be considered authoritative in
   its replies.  PCEPS implementations SHOULD provide mechanisms for
   associating peer identities with different levels of access and/or
   authoritativeness, and they MUST provide a mechanism for establishing a
   default level for properly identified peers.  Any connection
   established with a peer that cannot be properly identified SHALL be
   terminated before any PCEP exchange takes place.
</t>
      
        <t>In TLS-X.509 mode using fingerprints, a peer is uniquely identified by the fingerprint of the presented certificate.</t>
      
        <t>There are numerous trust models in PKIX environments, and it is beyond the scope of this document to define how a particular deployment determines whether a peer is trustworthy. Implementations that want to support a wide variety of trust models should expose as many details of the presented certificate to the administrator as possible so that the trust model can be implemented by the administrator. 
        At least the following parameters of the X.509 certificate SHOULD be exposed:</t>
          <t><list style="symbols">
            <t>Peer's IP address</t>
            <t>Peer's fully qualified domain name (FQDN)</t>
            <t>Certificate Fingerprint</t>
            <t>Issuer</t>
            <t>Subject</t>
            <t>All X509v3 Extended Key Usage</t>
            <t>All X509v3 Subject Alternative Name</t>
            <t>All X509v3 Certificate Policies</t>
          </list></t>
          <t>Note that the remote IP address used for the TCP session establishment is also exposed.</t>
        <t><xref target="I-D.ietf-pce-stateful-sync-optimizations"/> specify a Speaker Entity Identifier TLV (SPEAKER-ENTITY-ID), as an optional
   TLV that is included in the OPEN Object. It contains a unique identifier for the
   node that does not change during the lifetime of the PCEP speaker. An implementation would thus expose the speaker entity identifier as part of the X509v3 certificate's subjectAltName:otherName, so that
   an implementation could use this identifier for the peer identification trust model.</t>
        <t>In addition, a PCC MAY apply the procedures described in <xref target="RFC6698"/> DNS-Based Authentication of Named Entities (DANE) to verify its peer identity when using DNS discovery. See section <xref target="DANE"/> for further details.</t>
      </section>

      <section title="Connection Establishment Failure">
        <t>In case the initial TLS negotiation or the peer identity check fails, according to the procedures listed in this document, both peers SHOULD immediately
   close the connection.<!--the peer MUST first send a PCErr message as per <xref target="init"/> and then terminate the session. In case of PCErr with Error-Type set to [TBA2 by IANA] (PCEP StartTLS failure) and Error-value set to 4 (ok without TLS),
        the receiver MAY choose to attempt to re-establish the PCEP session without TLS next.  This SHOULD be attempt only once.--></t> 
        <t>The initiator SHOULD follow the procedure listed in <xref target="RFC5440"/> to retry session setup as per the exponential back-off session establishment retry procedure.</t>
      </section>

    </section>

  <section anchor="Discovery" title="Discovery Mechanisms">
    <t>This document does not specify any discovery mechanism for support of PCEPS. Other documents, <xref target="I-D.wu-pce-discovery-pceps-support"/>
    and <xref target="I-D.wu-pce-dns-pce-discovery"/> have made proposals:
    <list style="symbols">

    <t>A PCE can advertise its capability to support PCEPS using the IGP's advertisement mechanism of the PCE discovery information. The PCE-CAP-FLAGS sub-TLV is an optional sub-TLV used to advertise PCE capabilities. It is present within the PCE Discovery (PCED) sub-TLV carried by OSPF or IS-IS. <xref target="RFC5088"/> and <xref target="RFC5089"/> provide the description and processing rules for this sub-TLV when carried within OSPF and IS-IS, respectively. PCE capability bits are defined in <xref target="RFC5088"/>. A new capability flag bit for the PCE-CAP-FLAGS sub-TLV that can be announced as an attribute to distribute PCEP security support information is proposed in <xref target="I-D.wu-pce-discovery-pceps-support"/>.</t>

    <t>A PCE can advertise its capability to support PCEPS using the DNS <xref target="I-D.wu-pce-dns-pce-discovery"/> by identifying the support of TLS.</t>

    <!--When DNS is used by a PCC willing to use PCEPS to locate an appropriate PCE as per <xref target="I-D.wu-pce-dns-pce-discovery"/>, the PCC 
    chooses at least one of the returned FQDNs to resolve, which it does by performing DNS "A" or "AAAA" lookups on the FQDN. This will eventually result in an IPv4 or IPv6 address. As per the proposal, the PCC use the IP address(es) from the successfully resolved FQDN to initiate session. If the PCC fails to connect using an IP address but the "A" or "AAAA" lookups returned more than one IP address, then the PCC could use the next resolved IP address for that FQDN as the connection address. If the PCC fails to connect using all resolved IP addresses for a given FQDN, then it would repeat the process of resolution and connection for the next FQDN returned by the SRV lookup based on the priority and weight. If the PCC receives a response to its SRV query but it is not able to establish a PCEPS connection using the data received in the response, as initiating entity it could fall back to lookup a PCE that uses TCP as transport.</t>-->
</list></t>

      <section anchor="DANE" title="DANE Applicability">
        <t>DANE <xref target="RFC6698"/> defines a secure method to associate the certificate that is obtained from a TLS server with a domain name using DNS, i.e., using the TLSA DNS resource record (RR) to associate a TLS server certificate or public key with the domain name where the record is found, thus forming a "TLSA certificate association". The DNS information needs to be protected by DNS Security (DNSSEC). A PCC willing to apply DANE to verify server identity MUST conform to the rules defined in section 4 of <xref target="RFC6698"/>. The implementation MUST support Service certificate constraint (TLSA Certificate Usages type 1) with Matching type 2 (SHA2-256) as described in <xref target="RFC6698"/><xref target="RFC7671"/>. The server's domain name must be authorized separately, as TLSA does not provide any useful authorization guarantees.</t>
      </section>

    </section>

  <section anchor="Backward" title="Backward Compatibility">
      <t>The procedures described in this document define a security container
   for the transport of PCEP requests and replies carried by a TLS
   connection initiated by means of a specific extended message
   (StartTLS) that does not interfere with PCEP speaker implementations
   not supporting it.</t>
   
    <t>A PCC that does not support PCEPS will send Open message as the first message on TCP establishment. A PCE that supports PCEPS only, will send StartTLS message on TCP establishment.
    On receiving StartTLS message, PCC would consider it as an error and behave according to the existing error 
    mechanism of <xref target="RFC5440"/> and send PCErr message with Error-Type 1 (PCEP session establishment failure) and Error-Value 1 (reception of an invalid Open message or
    a non Open message) and close the session.</t>
    <t>A PCC that support PCEPS will send StartTLS message as the first message on TCP establishment. A PCE that does not supports PCEPS, would consider receiving StartTLS message as an error and respond with PCErr message (with Error-Type 1 and Error-Value 1) and close the session.</t> 
    <t>If a StartTLS message is received at any other time by a PCEP speaker that does not implement PCEPS, it would consider it as an unknown message and would behave according to the existing error 
    mechanism of <xref target="RFC5440"/> and send PCErr message with Error-Type 2 (Capability not supported) and close the session.</t>
    
   <t>An existing PCEP session cannot be upgraded to PCEPS, the session needs to be terminated and reestablished as per the procedure described in 
   	this document. During the incremental upgrade, the PCEP speaker SHOULD allow session establishment with and without TLS. Once both PCEP speakers are upgraded to support PCEPS, the PCEP session is re-established with TLS, otherwise PCEP session without TLS is setup. A redundant PCE MAY also be used during the incremental deployment to take over the PCE undergoing upgrade. Once the upgrade is completed, support for unsecured version SHOULD be removed.</t>

    <t>A PCE that accepts connections with or without PCEPS, it would respond based on the message received from PCC. A PCC that supports connection with or without PCEPS, it would
    	first attempt to connect with PCEPS and in case of error, it MAY retry to establish connection without PCEPS. For successful TLS operations with PCEP, both PCEP peers in the network would need to be
   upgraded to support this document.</t>

   	   <t>Note that, a PCEP implementation that support PCEPS would respond with PCErr message with Error-Type set to [TBA2 by IANA]
   (PCEP StartTLS failure) and Error-value set to 2  if any other message is sent before StartTLS or Open. If the sender of the invalid message is a PCEP implementation that does not support PCEPS, it will not
   be able to understand this error. A PCEPS implementation could also send the PCErr message as per <xref target="RFC5440"/> with Error-Type
   "PCEP session establishment failure" and Error-value "reception of an invalid Open message or a non Open message" before closing the session.</t>

  </section>

  <section anchor="IANA" title="IANA Considerations">
  <section title="New PCEP Message">
  <t>IANA is requested to allocate new message types within the "PCEP
   Messages" sub-registry of the PCEP Numbers registry, as follows:</t>
             <figure>
            <artwork><![CDATA[
   Value  Description                             Reference
    TBA1  The Start TLS Message (StartTLS)        This document
            ]]></artwork>
          </figure>
        </section>
        <section title="New Error-Values">
   <t>IANA is requested to allocate new Error Types and Error Values within
   the " PCEP-ERROR Object Error Types and Values" sub-registry of the
   PCEP Numbers registry, as follows:</t>
             <figure>
            <artwork><![CDATA[
Error-
Type    Meaning               Error-value             Reference

TBA2    PCEP StartTLS         0:Unassigned            This document
        failure               1:Reception of          This document
                              StartTLS after
                              any PCEP exchange
                              2:Reception of          This document
                              any other message
                              apart from StartTLS,
                              Open or PCErr
                              3:Failure, connection   This document
                              without TLS is not
                              possible
                              4:Failure, connection   This document
                              without TLS is 
                              possible
                              5:No StartTLS message   This document
                              (nor PCErr/Open) 
                              before StartTLSWait
                              timer expiry
 ]]></artwork>
          </figure>
  </section>
  </section>

  <section title="Security Considerations">
    <t>While the application of TLS satisfies the requirement on confidentiality as well as fine-grained, policy-based peer authentication, there are security threats that it cannot address.  It may be advisable to apply additional protection measures, in particular in what relates to attacks specifically addressed to forging the TCP connection underpinning TLS, especially in the case of long-lived connections. One of these measures is the application of TCP-AO (TCP Authentication Option <xref target="RFC5925"/>), which is fully compatible with and deemed as complementary to TLS. The mechanisms to configure the requirements to use TCP-AO and other lower-layer protection measures with a particular peer are outside the scope of this document.</t>
    <t>Since computational resources required by TLS handshake and ciphersuite are higher than unencrypted TCP, clients connecting to a PCEPS server can more easily create high load conditions and a malicious client might create a Denial-of-Service attack more easily.</t>
    <t>Some TLS ciphersuites only provide integrity validation of their payload, and provide no encryption, such ciphersuites SHOULD NOT be used by default. Administrators MAY allow the usage of these ciphersuites after careful weighting of the risk of relevant internal data leakage, that can occur in such a case, as explicitly stated by <xref target="RFC6952"/>.</t>
    <t>When using certificate fingerprints to identify PCEPS peers, any two certificates that produce the same hash value will be considered the same peer. Therefore, it is important to make sure that the hash function used is cryptographically uncompromised, so that attackers are very unlikely to be able to produce a hash collision with a certificate of their choice. This document mandates support for SHA-256 as defined by <xref target="SHS"/>, but a later revision may demand support for stronger functions if suitable attacks on it are known.</t>
    <t>PCEPS implementations that continue to accept connections without TLS are susceptible to downgrade attacks as described in <xref target="RFC7457"/>. 
   An attacker could attempt to remove the use of StartTLS message 
   that request the use of TLS as it pass on the wire in clear, and further inject a PCErr message that suggest to attempt PCEP connection without TLS.
     </t>
    <t>The guidance given in <xref target="RFC7525"/> SHOULD be followed to avoid attacks on TLS.</t>
  </section>

<section title="Manageability Considerations" toc="default">
      <t>All manageability requirements and considerations listed in <xref target="RFC5440"/> apply to PCEP protocol extensions defined in this document. In addition, requirements and considerations listed in this section apply.</t>
      <section title="Control of Function and Policy" toc="default">
    <t>A PCE or PCC implementation SHOULD allow configuring the PCEP security via TLS capabilities as described in this document. </t>
      <t>A PCE or PCC implementation supporting PCEP security via TLS MUST support general TLS configuration as per <xref target="RFC5246"/>. At least the configuration of one of the trust models and its corresponding parameters, as  described in <xref target="Establishment"/> and <xref target="Identity"/>, MUST be supported by the implementation.</t>
      <t>A PCEP implementation SHOULD allow configuring the StartTLSWait timer value.
   <!--<list style="symbols">
   <t>StartTLSWait timer value</t>
   </list>-->
   </t>
   <t>PCEPS implementations MAY provide an option to allow the operator to 
   manually override strict TLS configuration and allow unsecure 
   connections. Execution of this override SHOULD trigger a warning about
   the security implications of permitting unsecure connections.</t>
   <t>Further, the operator needs to develop suitable security policies 
   around PCEP within his network. The PCEP peers SHOULD provide 
   ways for the operator to complete the following tasks in regards to a PCEP session:
   <list style="symbols">
      <t>Determine if a session is protected via PCEPS.</t>
      <t>Determine the version of TLS, the mechanism used for authentication, 
      and the ciphersuite in use.</t>
      <t>Determine if the certificate could not be verified, and the reason 
      for this circumstance.</t>
      <t>Inspect the certificate offered by the PCEP peer.</t>
      <t>Be warned if StartTLS procedure fails for the PCEP peers, that are
      known to support PCEPS via configurations or capability 
      advertisements.</t>
   </list></t>
</section>
      <section title="Information and Data Models" toc="default">
        <t>The PCEP MIB module is defined in <xref target="RFC7420"/>. The MIB module could be extended to include the ability to view the PCEPS capability, TLS related information as well as TLS status for each PCEP peer.</t>
        <t>Further, to allow the operator to configure the PCEPS capability and various TLS related parameters as well as to view the current TLS 
   status for a PCEP session, the PCEP YANG module
   <xref target="I-D.ietf-pce-pcep-yang"/> is extended to include TLS related information.</t>
      </section>
      <section title="Liveness Detection and Monitoring" toc="default">
        <t>Mechanisms defined in this document do not imply any new liveness detection and monitoring requirements in addition to those already listed in <xref target="RFC5440"/> and <xref target="RFC5246"/>.</t>
      </section>
      <section title="Verifying Correct Operations" toc="default">
        <t>A PCEPS implementation SHOULD log error events and provide PCEPS failure statistics with reasons.</t>
      </section>
      <section title="Requirements on Other Protocols" toc="default">
        <t>Mechanisms defined in this document do not imply any new requirements on other protocols. Note that, <xref target="Discovery"/> list possible 
        discovery mechanism for support of PCEPS.</t>
      </section>
      <section title="Impact on Network Operation" toc="default">
        <t>Mechanisms defined in this document do not have any significant impact on network operations in addition to those already listed in <xref target="RFC5440"/>, and the policy and management implications discussed above.</t>        
      </section>
    </section>
  <section title="Acknowledgements">
    <t>This specification relies on the analysis and profiling of TLS included in <xref target="RFC6614"/> and the procedures described for the STARTTLS command in <xref target="RFC4513"/>.</t>
    <t>We would like to thank Joe Touch for his suggestions and support regarding the StartTLS mechanisms.</t>
    <t>Thanks to Daniel King for reminding the authors about manageability considerations.</t>
    <t>Thanks to Cyril Margaria for shepherding this document.</t>
    <t>Thanks to David Mandelberg for early SECDIR review comments as well as re-reviewing during IETF last call.</t>
    <t>Thanks to Dan Frost for the RTGDIR review and comments.</t>
    <t>Thanks to Dale Worley for the Gen-ART review and comments.</t>
    <t>Also thanks to Tianran Zhou for OPSDIR review.</t>
    <t>Thanks to Deborah Brungard for being the responsible AD and guiding
   the authors as needed.</t>
   <t>Thanks to Mirja Kuhlewind, Eric Rescorla, Warren Kumari, Kathleen Moriarty, Suresh Krishnan, Ben Campbell and Alexey Melnikov for the IESG review and comments.</t>
  </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC2119;
      
      &RFC5246;
      &RFC5280;
      <!--&RFC5288;-->
      &RFC5440;
      <!--&RFC5746;-->
      &RFC6066;
      &RFC6125;
      
      &RFC6698;
      &RFC7525;
      &RFC7671;
      &RFC8174;
      <reference anchor="SHS" target="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">
        <front>
          <title>Secure Hash Standard (SHS), FIPS PUB 180-4</title>
          <author>
            <organization>National Institute of Standards and Technology</organization>
          </author>
            <date year="2015" month="August"/>
        </front>
        <seriesInfo name="DOI" value="10.6028/NIST.FIPS.180-4"/>
      </reference>
    </references>
    <references title="Informative References">
    &RFC4492;
        &RFC4513;
      &RFC5088;
      &RFC5089;
      &RFC5925;
      &RFC6460;
      &RFC6614;
      &RFC6952;
      &RFC7420;
      &RFC7457;
      &I-D.ietf-pce-stateful-sync-optimizations;
      &I-D.ietf-pce-pcep-yang;
      &I-D.wu-pce-dns-pce-discovery;
      &I-D.wu-pce-discovery-pceps-support;
      
    </references>
  </back>
</rfc>
