<?xml version='1.0'?>
    <!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
        <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
        <!ENTITY rfc4271 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml'>
        <!ENTITY rfc4272 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4272.xml'>
        <!ENTITY rfc4486 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4486.xml'>
        <!ENTITY rfc4760 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4760.xml'>
        <!ENTITY rfc5492 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5492.xml'>
        <!ENTITY rfc6286 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6286.xml'>
        <!ENTITY rfc7454 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7454.xml'>
        <!ENTITY rfc8174 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml'>
        <!ENTITY rfc9000 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.9000.xml'>
        <!ENTITY I-D.chen-idr-bgp-over-quic PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml-ids/reference.I-D.draft-chen-idr-bgp-over-quic-00.xml'>
        <!ENTITY I-D.ietf-idr-bgp-multisession PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml-ids/reference.I-D.draft-ietf-idr-bgp-multisession-07.xml'>
        ]>
<?rfc toc="yes"?>
<?rfc tocompact="no"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes" ?>
<rfc category="std" ipr="trust200902" docName="draft-retana-idr-bgp-quic-stream-02">
  <!-- ***** FRONT MATTER ***** -->
  <front>
    <title abbrev="BGP QUIC Streams">Use of Streams in BGP over QUIC</title>

    <author initials="A" surname="Retana"
    fullname="Alvaro Retana">
      <organization>Futurewei Technologies, Inc.</organization>

      <address>
        <postal>
          <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <region>CA</region>
          <code>95050</code>
          <country>USA</country>
        </postal>
       <email>aretana@futurewei.com</email>
      </address>
    </author>

    <author fullname="Yingzhen Qu" initials="Y" surname="Qu">
      <organization>Futurewei Technologies, Inc.</organization>
      <address>
        <postal>
          <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <region>CA</region>
          <code>95050</code>
          <country>USA</country>
        </postal>
        <phone></phone>
        <email>yingzhen.qu@futurewei.com</email>
      </address>
    </author>

    <author fullname="Jeff Tantsura" initials="J" surname="Tantsura">
      <organization>Microsoft</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>jefftant.ietf@gmail.com</email>
      </address>
    </author>

    <date/>
    <area>Routing</area>
    <workgroup>IDR Workgroup</workgroup>
    <abstract>
      <t>
        This document specifies the use of QUIC Streams to support multiple BGP
        sessions over one connection in order to achieve high resiliency.
      </t>
    </abstract>
  </front>

  <!-- ***** MIDDLE MATTER ***** -->

  <middle>
    <section title="Introduction">
	  <t>
	    The Border Gateway Protocol (BGP) <xref target="RFC4271"/> uses TCP as
	    its transport protocol.  BGP establishes peer relationships between
      routers using a TCP session on port 179. TCP also provides reliable packet
	    communication.
    </t>
    <t>
      Multiprotocol Extensions for BGP-4 (MP-BGP) <xref target="RFC4760"/>
      allow BGP to carry information for multiple Network Layer protocols.
      However, only a single TCP connection can reach the Established state
      between a pair of peers <xref target="RFC4271"/>.
    </t>
    <t>
      As pointed out by <xref target="I-D.ietf-idr-bgp-multisession"/>, there
      are some disadvantages of using a single BGP session:
    <list style="empty">
      <t>
        A common criticism of BGP is the fact that most malformed messages
        cause the session to be terminated.  While this behavior is necessary
        for protocol correctness, one may observe that the protocol machinery
        of a given implementation may only be defective with respect to a
        given AFI/SAFI.  Thus, it would be desirable to allow the session
        related to that family to be terminated while leaving other AFI/SAFI
        unaffected.  As BGP is commonly deployed, this is not possible.
      </t>
      <t>
        A second criticism of BGP is that it is difficult or in some cases
        impossible to manage control plane resource contention when BGP is
        used to support diverse services over a single session.  In contrast,
        if a single BGP session carries only information for a single service
        (or related set of services) it may be easier to manage such
        contention.
      </t>
    </list></t>
    <t>
      QUIC <xref target="RFC9000"/> is a UDP-based multiplexed and secure
      transport protocol. QUIC can provide low latency and encrypted transport
      with resilient connections.  <xref target="I-D.chen-idr-bgp-over-quic"/>
      specifies the procedure to use BGP over QUIC. Complementary to it, this
      document specifies a mechanism to support multiple BGP sessions using
      QUIC streams.
	  </t>
    <t>
      Each BGP session operates independently. Thus, an error on one session has
      no impact on any other session.  The Network Layer protocol(s) negotiated
      in the BGP OPEN message distinguish the sessions.
    </t>

    <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>


    <section title="Multiple BGP Sessions">
      <section title="Multiple QUIC Streams">
        <t>QUIC <xref target="RFC9000"/> is a UDP-based
          secure transport protocol that provides connection-oriented and
          stateful interaction between
          a client and server. It integrates TLS and allows the exchange
          of application data as soon as possible.</t>

        <t>In QUIC, application protocols exchange information via streams,
          and multiple streams can be multiplexed onto an underlying
          connection. Each stream is a separate unidirectional or
          bidirectional channel of "order stream of bytes."
          Moreover, each stream has flow control which limits bytes sent on a
          stream, together with flow control of the connection.</t>
      </section>
      <section title="Multiple BGP Sessions Using QUIC Streams">
        <t>
          BGP over QUIC <xref target="I-D.chen-idr-bgp-over-quic"/> proposes
          different options to map streams.  This document specifies a
          complementary and backward compatible mechanism to establish
          multiple BGP sessions using QUIC streams.  An implementation can
          assign one or more Network Layer protocols to a BGP session.
        </t>
        <t>A QUIC stream is created by sending a BGP OPEN message, and
          each stream MUST be bidirectional as described in Section 2.1
          of <xref target="RFC9000"/>.  In addition, the corresponding stream
          MUST end (clean termination) as described in Section 2.4 of
          <xref target="RFC9000"/> when a BGP session is terminated.
        </t>
        <t>
          <xref target="connection"/> describes the Connection Collision
          Detection procedure to be used with streams.  Each BGP session
          operates independently, which means critical conditions (such
          as a malformed message) in one session won't affect others.
        </t>
      </section>
    </section>

    <section anchor="MSC" title="MultiStream Capability">
      <t>
       The MultiStream Capability (MSC) is defined to indicate that a BGP
       speaker supports multiple sessions as specified in this document.
       The capability <xref target="RFC5492"/> is defined as follows:

        <list style="empty">
          <t>Capability code (1 octet): TBD1</t>
          <t>Capability length (1 octet): 1</t>
          <t>Capability value (1 octet): flag field reserved.</t>
        </list></t>
        <figure title="" suppress-title="false" align="left" alt="" width="" height="">
        <artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
   0 1 2 3 4 5 6 7
  +-+-+-+-+-+-+-+-+
  |   Reserved    |
  +-+-+-+-+-+-+-+-+

        </artwork>
        </figure>
        <t>Flags: bitfield - MUST be set to zero and ignored by the receiver.
        </t>
        <t>
          The MSC only applies when using BGP over QUIC
          <xref target="I-D.chen-idr-bgp-over-quic"/>.  It MUST be
          included in all OPEN messages.  It MUST be ignored otherwise.
        </t>
        <t>
          This specification applies only if both peers advertise the MSC
          during the establishment of the "initial session."
          Otherwise, the processes specified in
          <xref target="I-D.chen-idr-bgp-over-quic"/> MUST be followed.  In
          particular, if a peer that advertises the MSC doesn't receive an OPEN
          message with the MSC from its peer, it SHOULD NOT terminate the
          session.
        </t>
        <t>
          Using the MSC allows peers to establish multiple BGP sessions, one
          per QUIC stream.  Each new BGP session is established using a separate
          OPEN message <xref target="RFC4271"/> and MUST include the MSC.  If
          both peers exchange the MSC in the "initial session," they MUST
          include it when establishing other sessions.  Otherwise, the new
          session MUST be terminated, and the Error Subcode MUST be set to
          MultiStream Conflict (TBD2), defined in
          <xref target="notifications"/>.
        </t>
        <t>
          Once a BGP session is established, it follows the procedures
          specified in <xref target="RFC4271"/>.</t>
    </section>

    <section anchor="notifications" title="Error Handling">
      <t>
        OPEN message error handling is defined in section 6.2 of
        <xref target="RFC4271"/>. This document introduces the following
        OPEN Message Error subcodes:
      <list style="empty">
        <t>
          TBD2 - MultiSession Conflict - Used if the MSC is exchanged by both
          peers in the "initial session" but is not present when establishing
          a new session.
        </t>
        <t>
          TBD3 - Session Capability Mismatch -  Used if a BGP speaker
          terminates a session in the case where it sends an OPEN message with
          the MSC but receives an OPEN message without it.
        </t>
        <t>
          TBD4 - Network Layer Protocol Mismatch - Used if a BGP session has
          already been established for a signaled Network Layer Protocol,
          either individually or as part of a set.
        </t>
      </list></t>
      <t>
        <xref target="MSC"/> recommends not terminating a session when only one
        peer supports the MSC.  If such a BGP speaker does terminate the
        session, the Error Subcode MUST be set to Session Capability Mismatch
        (TBD3).
      </t>
      <t>
        Any individual BGP session can be terminated as specified in
        <xref target="RFC4486"/>.  If multiple sessions are to be terminated,
        then the procedure MUST be followed for each one.
      </t>
    </section>

    <section anchor="connection" title="BGP Session Establishment and Collision Avoidance">

         <t>
         Before creating a new session, a BGP speaker should check that no
         session exists for the same Network Layer protocol(s).  If a session
         already exists, the BGP speaker SHOULD NOT attempt to create a new one.
         </t>
         <t>
         If a pair of BGP speakers try to establish a BGP session with each
         other simultaneously, then two parallel sessions will be formed. In
         the case of BGP over QUIC, the IP addresses of the connection cannot
         be used to resolve collisions when using multiple streams.
         </t>
         <t>
         To avoid connection collisions, a session is
         identified by the My Autonomous System and BGP Identifier fields pair
         in the OPEN message.  In this context, a connection collision is
         the attempt to open a BGP session for which the set of
         Network Layer protocols is the same.  One of the connections MUST be
         closed.
         </t>
         <t>
         The connection collision is resolved using the extension specified in
         <xref target="RFC6286"/>.  In other words, the session with the
         higher-valued BGP Identifier is preserved <xref target="RFC4271"/>.
         If the BGP Identifiers are identical, then the session with the larger
         ASN is preserved <xref target="RFC6286"/>.
         </t>
         <t>
         Upon receiving an OPEN message, the local system MUST examine all of
         its sessions in the OpenConfirm state. A BGP speaker MAY
         also examine sessions in an OpenSent state if it knows the BGP
         Identifier of the peer by means outside of the protocol.  If among
         these sessions, there is one to a remote BGP speaker whose BGP
         Identifier and ASN pair equals the one in the OPEN message, and this
         session collides with the connection over which the OPEN message is
         received, then the local system performs the following collision
         resolution procedure:
         <list style="empty">
         <t>
            1) The BGP Identifier of the local system is compared to the BGP
               Identifier of the remote system (as specified in the OPEN
               message).  Comparing BGP Identifiers is done by converting them
               to host byte order and treating them as 4-octet unsigned
               integers.
               </t>
               <t>
            2) If the value of the local BGP Identifier is less than the
               remote one, the local system closes the BGP connection that
               already exists (the one that is already in the OpenConfirm
               state) and accepts the BGP connection initiated by the remote
               system.
               </t>
               <t>
            2a) Otherwise, the local system closes the newly created BGP
               connection (the one associated with the recently received OPEN
               message) and continues to use the existing one (the one that
               is already in the OpenConfirm state).
               </t>
               <t>
            3) If the BGP Identifiers of the peers involved in the connection
               collision are identical, then the session initiated by the BGP
               speaker with the larger AS number is preserved.
               </t>
            </list></t>
         <t>
         Unless allowed via configuration, a connection collision with an
         existing BGP session in the Established state causes the
         closing of the newly created session.
         </t>
         <t>
         Closing the BGP session (that results from the collision resolution
         procedure) is accomplished by sending the NOTIFICATION message with
         the Error Code Cease, Subcode Connection Collision Resolution (7)
         <xref target="RFC4486"/>.
         </t>
         <t>
         The remainder of the process is as specified in
         <xref target="RFC4271"/>.
         </t>
    </section>

    <section title="Modifications to FSM">
      <t>
        The modifications to BGP FSM is described in section 4.4 of 
        <xref target="I-D.chen-idr-bgp-over-quic"/>. For simplicity
        and security reason, it is suggested that 1-RTT is used.
      </t>
      <t>
        This specification does not modify BGP FSM, but the collision
        handling procedure should be replaced with the procedure described
        in this document.
      </t>

    </section>

    <section title="Operational Considerations">
      <section title="Backward Compatibility">
        <t>
          A BGP speaker that doesn't understand the MSC will ignore it
          <xref target="RFC5492"/>.  <xref target="MSC"/> recommends not
          terminating a session when only one peer supports the MSC.  Instead,
          the operation will continue as specified in
          <xref target="I-D.chen-idr-bgp-over-quic"/>.
        </t>
      </section>

      <section title="Session Prioritization">
        <t>
          One of the drawbacks of a single BGP session is that control
          plane messages for all supported Network Layer protocols use the same
          connection, which may cause resource contention.
        </t>
        <t>
          QUIC <xref target="RFC9000"/> does not provide a mechanism for
          exchanging prioritization information. Instead, it recommends that
          implementations provide ways for an application to indicate the
          relative priority of streams, in this case, mapped to BGP sessions.
          An operator should prioritize BGP sessions (streams) that carry
          critical control plane information if the functionality is available.
          The definition of this functionality and the determination of the
          importance of a BGP session are both outside the scope of this
          document.
        </t>
        <t>An example implementation is to have four priority (0-3) defined,
          and smaller number means higher priority. Each AFI/SAFI should be
          assigned a default priority and optional configuration to modify
          the default value. For example, IPv4 and IPv6 unicast AFI/SAFI 
          (1/1 and 2/1) may have priority of 1, while BGP-LS (16388/71 and
          16388/72) may have a priority of 3, and BGP FlowSpec (1/133 and
          1/134) may have a priority of 4.</t>
      </section>

      <section title="Other Considerations">
      <t>A configuration command SHOULD be implemented to allow grouping
        of some AFI/SAFIs into one session.</t>
      </section>
    </section>
    <section title="Security Considerations">
      <t>
        This document specifies how to establish multiple BGP sessions over a
        single QUIC connection.  The general operation of BGP is not changed,
        nor is its security model.  The security considerations of
        <xref target="I-D.chen-idr-bgp-over-quic"/> apply.  Also, the
        non-TCP-related considerations of <xref target="RFC4271"/>,
        <xref target="RFC4272"/>, and <xref target="RFC7454"/> apply
        to the specification in this document.
      </t>
      <t>
        By separating the control plane traffic over multiple sessions, the
        effect of a session-based vulnerability is reduced; only a single
        session is affected and not the whole connection.  The result is
        increased resiliency.
      </t>
      <t>
        On the other hand, a high number of BGP sessions may result in higher
        resource utilization and the risk of depletion.  Also, more sessions
        may imply additional configuration and operational complexity.
        However, this risk is mitigated by the fact that BGP sessions typically
        require explicit configuration by the operator.
      </t>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <t>
        IANA is asked to assign a new Capability Code for the MultiStream
        Capability (<xref target="MSC"/>) as follows:
      </t>
        <texttable title="MultiStream Capability">
          <ttcol>Value</ttcol>
          <ttcol>Description</ttcol>
          <ttcol>Reference</ttcol>
          <ttcol>Change Controller</ttcol>
          <c>TBD1</c>
          <c>MultiStream Capability</c>
          <c>[This Document]</c>
          <c>IETF</c>
        </texttable>
      <t>
        IANA is asked to assign three values from the OPEN Message Error
        subcodes registry as follows:
      </t>
      <texttable>
        <ttcol>Value</ttcol>
        <ttcol>Name</ttcol>
        <ttcol>Reference</ttcol>
        <c>TBD2</c> <c>MultiSession Conflicty</c> <c>[This Document]</c>
        <c>TBD3</c> <c>Session Capability Mismatch</c> <c>[This Document]</c>
        <c>TBD4</c> <c>Network Layer Protocol Mismatch</c><c>[This Document]</c>
      </texttable>
    </section>

    <section title="Acknowledgement">
      <t>This document references the text and procedures defined in
        <xref target="I-D.ietf-idr-bgp-multisession"/>, and we are grateful
        for their contributions.</t>
      <t>
      The authors would like to thank xx for review and comments.
      </t>
    </section>

</middle>

  <!--  *****BACK MATTER ***** -->

<back>
    <references title="Normative References">
        &rfc2119;
        &rfc4271;
        &rfc4486;
        &rfc5492;
        &rfc6286;
        &rfc8174;
        &rfc9000;
        &I-D.chen-idr-bgp-over-quic;
    </references>
    <references title="Informative References">
        &I-D.ietf-idr-bgp-multisession;
        &rfc4272;
        &rfc4760;
        &rfc7454;
    </references>

</back>
</rfc>
