<?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://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC4271 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC5065 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml">
<!ENTITY RFC4486 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4486.xml">
<!ENTITY RFC4724 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4724.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. -->
<!-- Below are generally applicable Processing Instructions (PIs) that
    most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-idr-bgp-gr-notification-07.txt"
ipr="trust200902">
  <!-- 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 MATTER ***** -->

  <front>

    <title abbrev="Notification support for BGP GR">
    Notification Message support for BGP Graceful Restart</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Keyur Patel" initials="K.P."
            surname="Patel">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

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

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>keyupate@cisco.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Rex Fernando" initials="R.F."
            surname="Fernando">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

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

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>rex@cisco.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="John Scudder" initials="J.S."
            surname="Scudder">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>1194 N. Mathilda Ave</street>

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

          <city>Sunnyvale</city>

          <region>CA</region>

          <code>94089</code>

          <country>USA</country>
        </postal>

        <email>jgs@juniper.net</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>


    <author fullname="Jeff Haas" initials="J.H."
            surname="Haas">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>1194 N. Mathilda Ave</street>

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

          <city>Sunnyvale</city>

          <region>CA</region>

          <code>94089</code>

          <country>USA</country>
        </postal>

        <email>jhaas@juniper.net</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date/>

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>IDR</keyword>

    <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

<abstract>
<t>
The current BGP Graceful Restart mechanism limits the usage of BGP
Graceful Restart to BGP protocol messages other than a BGP NOTIFICATION
message. This document defines an extension to
the BGP Graceful Restart that permits the Graceful Restart procedures to
be performed when the BGP speaker receives a BGP NOTIFICATION Message or the Hold Time expires.
This document also defines a new BGP NOTIFICATION Cease Error subcode
to prevent BGP speakers supporting the extension defined in this
document from performing a Graceful Restart.
</t>
</abstract>

  </front>

  <middle>

<section anchor="introduction" title="Introduction">
<t>
For many classes of errors, the BGP protocol must send a NOTIFICATION
message and reset the peering session to handle the error condition.  The
BGP Graceful Restart extension defined in <xref target="RFC4724"></xref> 
requires that normal BGP procedures defined in <xref target="RFC4271"></xref> 
be followed when a NOTIFICATION message is sent or received.
This document defines an extension to BGP Graceful Restart that permits the
Graceful Restart procedures to be performed when the BGP speaker receives a
NOTIFICATION message or the Hold Time expires.  This permits the BGP speaker to avoid flapping
reachability and continue forwarding while the BGP speaker restarts the
session to handle errors detected in the BGP protocol.
</t>
<t>
At a high level, this document can be summed up as follows. When a
BGP session is reset, both speakers operate as "Receiving Speakers"
according to <xref target="RFC4724"/>, meaning they retain each
other's routes. This is also true for HOLDTIME expiration. The
functionality can be defeated using a "Hard Reset" subcode for the
BGP NOTIFICATION Cease Error code. If a Hard Reset is used, a full
session reset is performed.
</t>
      <section title="Requirements Language">
        <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 <xref
        target="RFC2119">RFC 2119</xref>.</t>
      </section>
    </section> <!-- for Introductions section -->

<section title="Modifications to BGP Graceful Restart Capability">
<t>
The BGP Graceful Restart Capability is augmented to signal the Graceful Restart
support for BGP NOTIFICATION messages. In particular, the Restart flags field and
the Flags field for Address Family are augmented as follows:
</t>

<t>
      <figure align="center">
        <artwork align="left"><![CDATA[
         +--------------------------------------------------+
         | Restart Flags (4 bits)                           |
         +--------------------------------------------------+
         | Restart Time in seconds (12 bits)                |
         +--------------------------------------------------+
         | Address Family Identifier (16 bits)              |
         +--------------------------------------------------+
         | Subsequent Address Family Identifier (8 bits)    |
         +--------------------------------------------------+
         | Flags for Address Family (8 bits)                |
         +--------------------------------------------------+
         | ...                                              |
         +--------------------------------------------------+
         | Address Family Identifier (16 bits)              |
         +--------------------------------------------------+
         | Subsequent Address Family Identifier (8 bits)    |
         +--------------------------------------------------+
         | Flags for Address Family (8 bits)                |
         +--------------------------------------------------+

            ]]></artwork>
      </figure>
</t>
<t>
      <figure align="center">
        <artwork align="left"><![CDATA[
 Restart Flags:

         This field contains bit flags relating to restart.
            ]]></artwork>
      </figure>
</t>
<t>
      <figure align="center">
        <artwork align="left"><![CDATA[
             0 1 2 3 
            +-+-+-+-+
            |R|N|   |
            +-+-+-+-+
            ]]></artwork>
      </figure>
</t>
<t>
The second most significant bit ("N") is defined as the BGP Graceful
Notification bit, which is used to indicate Graceful Restart support
for BGP NOTIFICATION messages. A BGP speaker indicates support for
the procedures of this document, by advertising a Graceful Restart
Capability with its Graceful NOTIFICATION bit set (value 1). This
also implies support for the format for a BGP NOTIFICATION Cease
message defined in <xref target= "RFC4486"/>.
</t>

<t>
      <figure align="center">
        <artwork align="left"><![CDATA[
 Flags for Address Family:

         This field contains bit flags relating to routes that were
         advertised with the given AFI and SAFI.
            ]]></artwork>
      </figure>
</t>
<t>
      <figure align="center">
        <artwork align="left"><![CDATA[
             0 1 2 3 4 5 6 7
            +-+-+-+-+-+-+-+-+
            |F|N| Reserved  |
            +-+-+-+-+-+-+-+-+
            ]]></artwork>
      </figure>
</t>
<t>
The usage of second most significant bit "N" (which was defined in a
previous draft version of this specification) is deprecated. This bit MUST
be advertised as 0 and MUST be ignored upon receipt.
</t>
</section>

<section title="BGP Hard Reset Subcode">
<t>
A new BGP NOTIFICATION Cease message subcode is defined known as the BGP
Hard Reset Subcode. The value of this subcode is discussed in <xref
target="IANA"/>. We refer to a BGP NOTIFICATION Cease message with
the Hard Reset subcode as a Hard Reset message, or just a Hard Reset.
</t>

<section title="Sending a Hard Reset">
<t>
  A Hard Reset message is used to indicate to a peer with which the
  Graceful Notification flag has been exchanged, that the session is to
  be fully terminated.
</t>

<t>
  When sending a Hard Reset, the data portion of the NOTIFICATION
  is encoded as follows:
</t>

<figure align="left">
  <artwork align="left"><![CDATA[
    +--------+--------+--------
    | ErrCode| Subcode| Data
    +--------+--------+--------
  ]]></artwork>
</figure>

<t>
  ErrCode is a BGP Error Code (as documented in the IANA BGP Error 
  Codes registry) that indicates the reason for the hard reset.
  Subcode is a BGP Error Subcode (as documented in the IANA BGP
  Error Subcodes registry) as appropriate for the ErrCode. 
  Similarly, Data is as appropriate for the ErrCode and Subcode.
</t>
</section>

<section title="Receiving a Hard Reset">
<t>
Whenever a BGP speaker receives a Hard Reset, the speaker MUST
terminate the BGP session following the standard procedures in <xref
target="RFC4271"/>.
</t>
</section>
</section>

<section title="Operation">
<t>
A BGP speaker that is willing to receive and send BGP NOTIFICATION messages
in Graceful mode MUST advertise the BGP Graceful Notification "N" bit using
the Graceful Restart Capability as defined in 
<xref target ="RFC4724"></xref>.
</t>

<t>
When such a BGP speaker has received the "N" bit from its peer,
and receives from that peer a BGP NOTIFICATION message other than a
Hard Reset, it MUST follow the rules for the Receiving
Speaker mentioned in <xref target ="receiving_speaker"/>. The BGP
speaker generating the BGP NOTIFICATION message MUST also follow the
rules for the Receiving Speaker.
</t>

<t>
When a BGP speaker resets its session due to a HOLDTIME expiry, it
should generate the relevant BGP NOTIFICATION message as mentioned
in <xref target="RFC4271"/>, but subsequently it MUST follow the
rules for the Receiving Speaker mentioned in <xref target
="receiving_speaker"/>.
</t>

<t>
A BGP speaker SHOULD NOT send a Hard Reset to a peer from which it has
not received the "N" bit. We note, however, that if it did so the effect
would be as desired in any case, since according to <xref
target="RFC4271"/> and <xref target="RFC4724"/> any NOTIFICATION
message, whether recognized or not, results in a session reset. Thus the
only negative effect to be expected from sending the Hard Reset to a
peer that hasn't advertised compliance to this specification would be
that the peer would be unable to properly log the associated information.
</t>

<t>
Once the session is re-established, both BGP speakers SHOULD set
their "Forwarding State" bit to 1. If the "Forwarding State" bit is
not set, then according to the procedures of <xref target
="RFC4724"/> S. 4.2, the relevant routes will be flushed, defeating
the goals of this specification.
</t>

<section anchor="receiving_speaker" 
         title="Rules for the Receiving Speaker">
<t>
<xref target="RFC4724"/> S. 4.2 defines rules for the Receiving
Speaker. These are modified as follows.
</t>
<t>
As part of this extension, routes from the peer previously marked as
stale MUST NOT be deleted, until and unless the timer mentioned in
the final paragraph of <xref target="RFC4724"/> S. 4.2 expires, or
unless a Hard Reset is performed. This supersedes the "consecutive
restarts" requirement of <xref target="RFC4724"/> S. 4.2. 
</t>
<t>
In addition to the rules already specified in <xref
target="RFC4724"/> S. 4.2 for how variations in the received
Graceful Restart Capability should be interpreted (the paragraph
that begins "Once the session is re-established..."), if the
Graceful Notification ("N") bit is not set in the newly received
Graceful Restart Capability, no new actions are triggered on the 
Receiving Speaker -- in particular, a clear "N" bit does not 
trigger deletion of stale routes.
</t>
<t>
Other than these modifications, the rules for the Receiving Speaker
are as specified in <xref target="RFC4724"/> S. 4.2.
</t>
</section>
</section>

<section anchor="Acknowledgements" title="Acknowledgements">
<t>
The authors would like to thank Jim Uttaro for the suggestion, and Bruno
Decraene, Chris Hall, Paul Mattes and Robert Raszuk for their review and
comments.
</t>
</section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
<t>
IANA is requested to assign a new subcode in the "BGP Cease
NOTIFICATION message subcodes" registry. The suggested name for the
code point is "Hard Reset". The suggested value is 9. 
</t>
    </section>

    <section anchor="Security" title="Security Considerations">
<t>
This extension to BGP does not change the underlying security issues
inherent in the existing <xref target="RFC4724"/> and <xref
target="RFC4271"/>.
</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629;
        here (as shown)
    2. simply use a PI
        "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds:
          include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included
    files in the same directory as the including file. You can also define
    the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be
    either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include=
      "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;

      &RFC4271;

      &RFC4724;

      &RFC4486;
    </references>
    <!-- Change Log

v00 2008-10-01  KP    Initial version
    -->
  </back>
</rfc>
