<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!DOCTYPE rfc [
<!ENTITY nbsp "&#160;">
<!ENTITY zwsp "&#8203;">
<!ENTITY nbhy "&#8209;">
<!ENTITY wj "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-netconf-over-quic-06" category="std" consensus="true" ipr="trust200902" obsoletes="" updates="" xml:lang="en" symRefs="true" sortRefs="false" tocInclude="true" version="3">
  <front>
    <title>NETCONF over QUIC</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-netconf-over-quic-06"/>
    <author initials="J." surname="Dai" fullname="Jinyou Dai">
      <organization abbrev="CICT">China Information Communication Technologies Group.</organization>
      <address>
        <postal>
          <street>Gaoxin 4th Road 6#</street>
          <street>Wuhan, Hubei 430079</street>
          <country>China</country>
        </postal>
        <email>djy@fiberhome.com</email>
      </address>
    </author>
    <author initials="S." surname="Yu" fullname="Shaohua Yu">
      <organization abbrev="PCL">China PCL.</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>yush@cae.cn</email>
      </address>
    </author>
    <author initials="W." surname="Cheng" fullname="Weiqiang Cheng">
      <organization abbrev="China Mobile">China Mobile</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>
    <author initials="M." surname="Blanchet" fullname="Marc Blanchet">
      <organization abbrev="Viagenie">Viagenie</organization>
      <address>
        <postal>
          <country>Canada</country>
        </postal>
        <email>marc.blanchet@viagenie.ca</email>
      </address>
    </author>
    <author initials="P." surname="Andersson" fullname="Per Andersson">
      <organization>Ionio Systems</organization>
      <address>
        <postal>
          <country>Sweden</country>
        </postal>
        <email>per.ietf@ionio.se</email>
      </address>
    </author>
    <abstract>
      <t>This document specifies how to use QUIC as a secure transport for
      exchanging Network Configuration Protocol (NETCONF) messages.
      NETCONF over QUIC allows to take advantage of QUIC streams, for
      example, to eliminate some TCP head-of-line blocking issues.
      NETCONF over QUIC provides security properties similar to NETCONF
      over TLS.</t>
      <t>This document also defines a YANG module which augments the
      ietf-netconf-client and ietf-netconf-server YANG modules.</t>
    </abstract>

    <note>
      <name>Editorial note (to be removed by the RFC Editor</name>
      <t>This draft contains placeholder values that need to be replaced
        with finalized values at the time of publication. This note summarizes
        all of the substitutions that are needed. No other RFC Editor
        instructions are specified elsewhere in this document.</t>
      <t>Artwork in this document contains shorthand references to drafts in
          progress.  Please apply the following replacements:</t>
      <ul>
        <li><tt>AAAA</tt> --&gt; the assigned RFC value for this draft</li>
        <li><tt>BBBB</tt> --&gt; the assigned RFC value for draft-ietf-netconf-netconf-client-server</li>
        <li><tt>CCCC</tt> --&gt; the assigned RFC value for draft-ietf-netconf-quic-client-server</li>
      </ul>
    </note>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>The Network Configuration Protocol (NETCONF) <xref target="RFC6241" format="default"/> defines a mechanism through which the configuration of network devices can be installed, manipulated, and deleted.</t>
      <t>NETCONF can be conceptually partitioned into four layers: content, operation, message and security transport layers.</t>
      <t>The Secure Transport layer provides a communication path between the client and server.  NETCONF can be layered over any transport protocol that provides a set of basic requirements, such as:</t>
      <ol>
        <li>NETCONF is connection-oriented, requiring a persistent connection between peers. This connection MUST provide reliable and sequenced data delivery.  NETCONF connections are long-lived, persisting between protocol operations.</li>
        <li>NETCONF connections MUST provide authentication, data integrity, confidentiality, and replay protection.  NETCONF depends on the transport protocol for this capability.</li>
      </ol>
      <t>The NETCONF protocol is not bound to any particular transport protocol, but allows a mapping to define how it can be implemented over any specific protocol. </t>
      <t>However, because of the connection-oriented feature, almost all of the current secure transport protocols used by NETCONF are TCP based. As is well known, TCP has some shortcomings such as head-of-line blocking.</t>
      <t>QUIC (<xref target="RFC9000"/><xref target="RFC9001"/>) conforms to the above requirements, therefore is also an appropriate transport protocol for NETCONF. Moreover, QUIC provides the following additional benefits not present in the other NETCONF transports:</t>
      <ul>
        <li>Single connection can be long lived and support multiple NETCONF RPC calls and responses within the same connection, using streams. This is very useful for a network management control station who is regularly monitoring devices and therefore having a long lived connection requires way less resources on both peers.</li>
        <li>1 RTT initial handshake that includes TLS.</li>
        <li>Adaptable to more difficult environments such as those with long delays (<xref target="I-D.many-tiptop-usecase"/>, <xref target="I-D.many-tiptop-quic-profile"/> .</li>
      </ul>
      <t>Therefore, QUIC is a proper transport protocol for the secure transport layer of NETCONF. This document specifies how to use QUIC as the secure transport protocol for NETCONF.</t>
    </section>
    <section>
      <name>Terminology and Definitions</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.</t>
    </section>
    <section>
      <name>Connection Management</name>
      <section>
        <name>Connection establishment</name>
        <t>QUIC connections are established as described in
        <xref target="RFC9000"/>. During connection establishment, support is
        indicated by selecting the ALPN token registered for NETCONF over QUIC
        (see <xref target="IANA"/>) in the cryptographic handshake.</t>
        <section>
            <name>Early data</name>
            <t>
                The QUIC protocol uses TLS 1.3 messages to secure the transport.
                This means that Early data (aka 0-RTT data) is supported.
                <xref target="RFC9001"/>
            </t>
            <t>
                Early data (aka 0-RTT data) is a mechanism defined in TLS 1.3
                <xref target="I-D.ietf-tls-rfc8446bis"/> that allows a client
                to send data ("early data") as part of the first flight of
                messages to a server. Note that TLS 1.3 can be used without
                early data as per Appendix F.5 of
                <xref target="I-D.ietf-tls-rfc8446bis"/>. In fact, early data is
                permitted by TLS 1.3 only when the client and server share a
                Pre-Shared Key (PSK), either obtained externally or via a
                previous handshake. The client uses the PSK to authenticate the
                server and to encrypt the early data.
            </t>
            <t>
                As noted in Section 2.3 of
                <xref target="I-D.ietf-tls-rfc8446bis"/>, the security
                properties for early data are weaker than those for subsequent
                TLS-protected data. In particular, early data is not forward
                secret, and there is no protection against the replay of early
                data between connections. Appendix E.5 of
                <xref target="I-D.ietf-tls-rfc8446bis"/> requires applications
                not use early data without a profile that defines its use. This
                document specifies that NETCONF over QUIC implementations MUST
                NOT use early data.
            </t>
        </section>
      </section>
      <section>
        <name>Connection Termination</name>
        <section>
          <name>QUIC Connection Termination Process</name>
          <t>The typical QUIC connection termination process is described in <xref target="RFC9000"/></t>
        </section>
        <section>
          <name>Considerations for Connection Termination</name>
          <t>When a NETCONF session is implemented based on a QUIC connection, the idle timeout should be set appropriately in order to keep the QUIC connection persistent even if the NETCONF session is idle. In some cases, disabling it may be a possible option.</t>
          <t>When a NETCONF server receives a &lt;close-session&gt; request, it will gracefully close the NETCONF session. The server SHOULD close the associated QUIC connection.</t>
          <t>When a NETCONF entity receives a &lt;kill-session&gt; request for an open session, it SHOULD close the associated QUIC connection.</t>
          <t>When a NETCONF entity is detecting the interruption of the QUIC connection, it SHOULD send a &lt;close-session&gt; request to the peer NETCONF entity.</t>
          <t>When a stateless reset event occurs, nothing needs to be done by either the client or the server.</t>
        </section>
      </section>
    </section>
    <section>
      <name>Stream mapping and usage</name>
      <t>The NETCONF protocol layers specified in <xref target="RFC6241"/> are
      presented in Figure 1.</t>
      <figure anchor="netconf-protocol-layers-figure" align="left" suppress-title="false" pn="figure-1">
        <name>NETCONF Protocol Layers</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
Layer                 Example
       +-------------+      +-----------------+      +----------------+
   (4) |   Content   |      |  Configuration  |      |  Notification  |
       |             |      |      data       |      |      data      |
       +-------------+      +-----------------+      +----------------+
              |                       |                      |
       +-------------+      +-----------------+              |
   (3) | Operations  |      |  <edit-config>  |              |
       |             |      |                 |              |
       +-------------+      +-----------------+              |
              |                       |                      |
       +-------------+      +-----------------+      +----------------+
   (2) |  Messages   |      |     <rpc>,      |      | <notification> |
       |             |      |   <rpc-reply>   |      |                |
       +-------------+      +-----------------+      +----------------+
              |                       |                      |
       +-------------+      +-----------------------------------------+
   (1) |   Secure    |      |               SSH, TLS, ...             |
       |  Transport  |      |                                         |
       +-------------+      +-----------------------------------------+
]]></artwork>
      </figure>
      <t><xref target="netconf-protocol-layers-figure"/> shows that there are two kinds of main data flow exchanged between client and server:</t>
      <ul>
        <li>Configuration data from client to server.</li>
        <li>Notification data from server to client.</li>
      </ul>
      <t>The two kinds of data flow need to be mapped into QUIC streams.</t>
      <t>QUIC Streams provide a lightweight, ordered byte-stream abstraction to an application. Streams can be unidirectional or bidirectional meanwhile streams can be initiated by either the client or the server. Unidirectional streams carry data in one direction: from the initiator  of the stream to its peer.  Bidirectional streams allow for data to be sent in both directions.</t>
      <t>QUIC uses Stream ID to identify the stream. The least significant bit (0x1) of the stream ID identifies the initiator of the stream. The second least significant bit (0x2) of the stream ID distinguishes between bidirectional streams (with the bit set to 0) and unidirectional streams. There are four types of streams which are described in <xref target="RFC9000"/>. And Table 1 also describes the four types of streams</t>
      <table anchor="tab-stream-id-types" align="center">
        <name>Stream Acronym Types</name>
        <thead>
          <tr>
            <th align="left"> Acronym</th>
            <th align="left"> Stream Type</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">C-BD</td>
            <td align="left">Client-Initiated, Bidirectional</td>
          </tr>
          <tr>
            <td align="left">S-BD</td>
            <td align="left">Server-Initiated, Bidirectional</td>
          </tr>
          <tr>
            <td align="left">C-UN</td>
            <td align="left">Client-Initiated, Unidirectional</td>
          </tr>
          <tr>
            <td align="left">S-UN</td>
            <td align="left">Server-Initiated, Unidirectional</td>
          </tr>
        </tbody>
      </table>
      <section>
	    <name>Bidirectional Stream Between client and server</name>
        <t>NETCONF protocol uses an RPC-based communication model. Configuration data from client to server is exchanged based on '&lt;rpc&gt;' (the client initiating) and '&lt;rpc-reply&gt;' (sent by the server) and so on.</t>
		<t>The messages used to exchange configuration data MUST be mapped into one bidirectional stream whose acronym is 'C-BD' according to Table 1. Since RPC processing is serialized and ordered within a session (<xref target="RFC6241"/> section 4.5), a bidirectional stream MUST be used for each NETCONF session.</t>        
	  </section>
      <section>
        <name>Unidirectional Stream from server to client</name>
        <t>There are some notification data exchanged between the client and the server.  Notification is an server initiated message indicating that a certain event has been recognized by the server.</t>
        <t>Notification messages are initiated by the server and no reply is needed from the client.  So the messages used to exchange notification data MUST be mapped into one unidirectional stream whose acronym is 'S-UN' according to Table 1.</t>
      </section>
      <section>
        <name>Mapping of QUIC connection, QUIC stream, and NETCONF session</name>
        <t>The relationship among NETCONF sessions, QUIC streams and QUIC
        connections is illustrted as follows.</t>
        <ul>
          <li>One NETCONF session is allowed per QUIC connection.</li>
          <li>The NETCONF sessions, except subscriptions, runs over a QUIC
              bidi-stream.</li>
          <li>NETCONF Notifications and Subscribed Notifications runs over one
              QUIC uni-stream per subscription.</li>
        </ul>
		<t>The notifications refer to messages corresonding to a subscription from server to client after the subscription process is over.</t>
      </section>     
    </section>
    <section>
     <name>Call home considerations</name>
	 <section>
          <name>protocol-layering perspective</name>
          <t>The following diagram illustrates call home from a protocol-layering perspective based on QUIC:</t>
          <figure anchor="call-home-NoQ" align="left" suppress-title="false" pn="figure-2">
           <name>Call Home Sequence Diagram based on QUIC</name>
           <artwork name="" type="" align="left" alt=""><![CDATA[
               Server                              Client
                 |                                               |
                 |         1. QUIC                          |
                 |----------------------------------->|
                 |                                               |
                 |                                               |
                 |         2. NETCONF over QUIC  |
                 |<-----------------------------------|
                 |                                               |
                 |                                               |
                 |         3. NETCONF/RESTCONF |
                 |<-----------------------------------|
                 |                                               |
		          Note: Arrows point from the "client" to
                  the "server" at each protocol layer.        
]]>        </artwork>
      </figure>   
		<t> This diagram makes the following points:</t> 
		<ul>
          <li>The NETCONF/RESTCONF server begins by initiating a QUIC connection to the NETCONF/RESTCONF client.</li>
          <li>Using this QUIC connection, the NETCONF/RESTCONF client initiates a NETCONF/RESTCONF session to the NETCONF/RESTCONF server.</li>          
        </ul>
     </section>
	 <section>
          <name>RFC8071 Call Home Specific Case</name>
          <t>In the case of <xref target="RFC8071"/> Call home feature, where the NETCONF server initiates the transport connection to the NETCONF client, <xref target="tab-stream-id-types"/> will be used as follows: - the Client, referred in the Table, means the QUIC initiating party, therefore the NETCONF server and - the Server means the QUIC receiving party, therefore the NETCONF client.</t>
     </section>
	</section>	
	<section>
      <name>Endpoint Authentication</name>
      <t>
        Since QUIC uses TLS 1.3 this is used to verify server identity and
        client identity.
      </t>
      <section>
        <name>Server Identity</name>
        <t>
          A server's identity MUST be verified according to
          <xref target="RFC7589" section="6"/>.
        </t>
      </section>
      <section>
        <name>Client Identity</name>
        <t>
          A client's identity MUST be verified according to
          <xref target="RFC7589" section="7"/>.
        </t>
      </section>
    </section>
    <section>
      <name>Framing</name>
      <t>
          In order to mitigate delimiter injection attacks chunked framing as
          defined in <xref target="RFC6242"/> is required for NETCONF over
          QUIC.
      </t>
	  <t>
          The &lt;hello&gt; message MUST be followed by the character sequence 
   RFC 5539 assumes that the end-of-message (EOM) sequence, ]]&gt;]]&gt;>.  Upon reception of the &lt;hello&gt; message, the receiving peer's
   QUIC layer conceptually passes the &lt;hello&gt; message to the Messages layer.  If the :base:1.1 capability is advertised by both peers, the chunked framing mechanism defined in Section 4.2 of [<xref target="RFC6242"/>] is used for the remainder of the NETCONF session.  Otherwise, the old end-of-message-based mechanism (see Section 4.3 of [<xref target="RFC6242"/>]) is used.
      </t>
    </section>
    <section>
      <name>Overview of YANG Module</name>
      <t>This document defines one YANG module that augments the NETCONF
        YANG groupings <xref target="I-D.ietf-netconf-netconf-client-server"/>
        with the QUIC transport YANG groupings
        <xref target="I-D.ietf-netconf-quic-client-server"/>. This section
        presents an overview of the YANG Module.</t>
      <section>
        <name>The "netconf-client" augmentation</name>
        <t>The following tree diagram <xref target="RFC8340"/> illustrates the
          augmentation of the QUIC client grouping into the NETCONF client
          container:</t>
        <figure>
          <artwork><![CDATA[
              INSERT_TEXT_FROM_FILE(refs/tree-ietf-netconf-quic-client-augment.txt)
]]></artwork>
        </figure>
        <t>Comments:</t>
        <ul>
          <li>This augmentation to the "ncc:transport" container in
            "ietf-netconf-client.yang" adds a "quic" case with a "quic"
            container which uses the "quicc:quic-client" grouping.</li>
          <li>Note that the if-feature "quic-initiate" conditions if the "quic"
            container is available in the schema.</li>
        </ul>
      </section>
      <section>
        <name>The "netconf-server" augmentation</name>
        <t>The following tree diagram <xref target="RFC8340"/> illustrates the
          augmentation of the QUIC server grouping into the NETCONF server
          container:</t>
        <figure>
          <artwork><![CDATA[
              INSERT_TEXT_FROM_FILE(refs/tree-ietf-netconf-quic-server-augment.txt)
]]></artwork>
        </figure>
        <t>Comments:</t>
        <ul>
          <li>This augmentation to the "ncs:transport" container in
            "ietf-netconf-server.yang" adds a "quic" case with a "quic"
            container which uses the "quics:quic-server" grouping.</li>
          <li>Note that the if-feature "quic-listen" conditions if the "quic"
            container is available in the schema.</li>
        </ul>
      </section>
    </section>
    <section>
      <name>YANG Module</name>
      <t>This YANG module has normative references to
        <xref target="I-D.ietf-netconf-netconf-client-server"/> and
        <xref target="I-D.ietf-netconf-quic-client-server"/>.</t>
      <t>&lt;CODE BEGINS&gt; file "ietf-netconf-quic@YYYY-MM-DD.yang"</t>
      <figure>
        <artwork><![CDATA[
INSERT_TEXT_FROM_FILE(ietf-netconf-quic@YYYY-MM-DD.yang)
]]></artwork>
      </figure>
      <t>&lt;CODE ENDS&gt;</t>
    </section>
   <section>
      <name>Error codes</name>
	  <section>
        <name>Transport Error Codes</name>
      <t>
         Error codes of secure transport layer are specified in [<xref target="RFC9000"/>]. There are not new transport Error Codes defined for NETCONF over QUIC. 		  
      </t>
	  </section>
      <section> 
	   <name>Application Error Codes</name>
      <t>
        According to [<xref target="RFC9000"/>], management of application error codes is left to application protocols. and application error codes can be used by RESET_STREAM Frame and STOP_SENDING Frame. Application error codes for NETCONF over QUIC are listed as follows:</t>
       <ul>
          <li>NO_NETCONF PROTOCOL ERROR (0x00):  no NETCONF errors happens.</li>
          <li>NETCONF CLOSE SESSION_ERROR (0x01):  The peer tries to close a session which is not initiated by it.</li>
		  <li> NETCONF CLOSE STREAM ERROR (0x02):  The peer tries to close a bidirectional stream when the NETCONF session is active.</li>
        </ul>
	  </section>
    </section>
    <section>
      <name>Security Considerations</name>
      <t>
          The security considerations described throughout
          <xref target="RFC8446"/> and <xref target="RFC6241"/> apply here as
          well. This document requires verification of server identity and
          client identity according to <xref target="RFC7589"/>.
      </t>      
      <t>If invalid data or malformed messages are encountered, a robust implementation of this document MUST silently discard the message without further processing and then stop the NETCONF session.</t>
    </section>
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This document creates a new registration for the identification of NETCONF over QUIC in the "Application Layer Protocol Negotiation (ALPN) Protocol IDs registry established in <xref target="RFC7301"/>.</t>
      <t>The "noq" string identifies NETCONF over QUIC:</t>
      <ul>
        <li>Protocol: NETCONF over QUIC</li>
        <li>Identification Sequence: 0x6e 0x6f 0x71 ("noq")</li>
        <li>Specification: This document</li>
      </ul>
      <t>This document also requests IANA to reserve a UDP port for 'NETCONF over QUIC':</t>
      <ul>
          <li>Service Name: netconf-quic</li>
          <li>Transport Protocol(s): UDP</li>
          <li>Assignee: IESG iesg@ietf.org</li>
          <li>Contact: IETF Chair chair@ietf.org</li>
          <li>Description: NETCONF protocol over QUIC transport</li>
          <li>Reference: RFC AAAA</li>
          <li>Port number: 831</li>
          <li>Assignment Notes: Port 831 is currently assigned to netconf-beep,
              but a de-assignment is requested in
              <xref target="I-D.ietf-netconf-port-numbers"/>.</li>
      </ul>
	  <ul>
          <li>Service Name: netconf-ch-quic</li>
          <li>Transport Protocol(s): UDP</li>
          <li>Assignee: IESG iesg@ietf.org</li>
          <li>Contact: IETF Chair chair@ietf.org</li>
          <li>Description: NETCONF Call Home (QUIC)</li>
          <li>Reference: RFC AAAA</li>
          <li>Port number: 4335</li>         
      </ul>
    </section>
    <section>
      <name>Acknowledgements</name>
      <t>The authors would like to acknowledge the contributors Yang Kou,
         Xueshun Wang, Kent Watsen, Jeffrey Haas, Balázs Lengyel, Robert Wilton,
         Huaimo Chen, Lifen Zhou, Andy Bierman, Sean Turner, and Joe Clarke for their
         beneficial comments.</t>
      <t>The authors would like to acknowledge the very useful feedback from an early implementor: Adolfo Ochagavia.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-netconf-client-server.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-quic-client-server.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9001.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-port-numbers.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7301.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7589.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8071.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.many-tiptop-usecase.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.many-tiptop-quic-profile.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-rfc8446bis.xml"/>
      </references>
    </references>
  </back>
</rfc>
