<?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 I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<!-- <?xml-stylesheet type='text/xsl' ?> --> 
<!-- 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="info" docName="draft-ancp-restart-01" ipr="trust200811"> 
  <!-- 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>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

         <title abbrev="Graceful ANCP restarts">Graceful ANCP restarts on NAS </title>

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

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

    <author fullname="Shridhara Rao" initials="Rao" surname="Shridhara">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>Cessna Business Park</street>
          <!-- Reorder these if your country does things differently -->
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560 087</code>
          <country>India</country>
        </postal>
        <phone>+91 80 4426 0220</phone>
        <email>shrirao@cisco.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Alexandre Cassen" initials="Cassen" surname="Alexandre">
      <organization>Free</organization>
      <address>
        <postal>
                <street>
              8, Rue de la Ville l Eveque
                </street>
          <!-- Reorder these if your country does things differently -->
          <city>Paris</city>
          <region></region>
          <code>75008</code>
          <country>France</country>
        </postal>
        <email>acassen@freebox.fr</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date day="18" month="October" year="2009" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
     in the current day and month for you. If the year is not the current one, it is 
     necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
     purpose of calculating the expiry date).  With drafts it is normally sufficient to 
     specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>ANCP</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
     If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>template</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> This document describes proposed extensions to the ANCP protocol to allow a graceful recovery of an ANCP session and associated information after an existing session is reset. Such a reset may be  due to a NAS restart , or a loss of connectivity between the NAS and the AN.
            </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
            <t> This draft describes a set of mechanisms to optimize the detection of ANCP adjacency loss, the re-establishment of an ANCP adjacency and the recovery of the associated ANCP information.
            </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>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <?rfc needLines="8" ?>
    <section title="Problem Statement">
        <t> The ANCP base protocol, defined in<xref target="draft-ietf-ancp-protocol-06.txt"></xref>, does not currently describe in any detail a mechanisms for detecting and recovering from the loss of an ANCP adjacency between the AN and the NAS.
            </t>
    <section title="Detecting the loss of ANCP adjacency">
        <t> The ANCP protocol currently relies on a keep-alive timer for detecting the loss of an adjacency. Since the keep-alive timer defaults to 10 seconds and the adjacency loss is triggered over a period spanning multiple times of the keep-alive timer(3 times by default), the achieved detection time is much longer than the time to detect the failure or closure of the TCP transport connection used by ANCP. If instead (or in addition to) the failure or closure of the underlying TCP connection is used as trigger for loss of ANCP adjacency, the ANCP reaction time can be much shorter. 
        </t>
        </section>
        <section title="Loss of topological information">
    <t> As per the behavior currently specified in the ANCP base protocol [draft-ancp], the AN sends topology information through Port-Up messages to a NAS after an adjacency is established. Such messages are however understood to be sent only for ports that actively change state, in terms of their modem train rate or operational status, after the establishment of the ANCP adjacency. In the event that the NAS looses topology information state (e.g due to a reload), or that the topology changes occur during the time the ANCP adjacency is down, this will result in the NAS holding an inaccurate view of the topological information and unable to apply the desired policies. Currently, ANCP does not provide for a mechanism by which the NAS can recover from this situation.
        </t>
        </section> 
        <section title="Loss of multicast information">
    <t> The ANCP multicast extensions draft [draft-ietf-ancp-mc-extensions-00.txt] describes a number of ANCP messages used for the control, authorization and reporting of multicast traffic on the AN. The loss of an ANCP adjacency, is also likely to lead to an inconsistency in the multicast information shared by the NAS and AN in the event that any of the devices lost or changed multicast information state during that time. More specifically, any multicast replication membership state that has been installed via ANCP may no longer be valid after the ANCP adjacency is recovered. This may be due to either the AN or NAS resetting or changes of policy during the time the ANCP adjacency is down. This issue also clearly affects the correct operation of the system, likely leading to incorrect policy decisions and also multicast replication state.
        </t>
        </section> 
        </section> <!-- end of Problem Statement -->

    <section title="Proposed solutions">
    <section title="Speeding up the detection of ANCP Adjacency loss">
        <t> Based on the inherent binding of ANCP to the TCP transport, by using the TCP socket state it is possible for the AN to detect a failure in transport of the ANCP adjacency before the ANCP keepalive timer expires.  As such we propose that ANCP implementations monitor the TCP socket state and on detecting an active ANCP transport socket transitioning to the CLOSED state they reset the ANCP adjacency state for the node corresponding to the TCP socket.  The following figure shows an exemplary sequence of events along with TCP socket states.

The following figure shows an exemplary sequence of events along with TCP socket states. 

             <figure align="center" anchor="Detecting TCP close">
<artwork align="center"> <![CDATA[
   _____                                                     _____
   |     |                                                   |     |
   | AN  |                                                   | NAS |
   |_____|                                                   |_____|
      ^                                                         ^
      |--->--->--->-------------- SYN -------------->--->--->---|
   SYN-SENT
      |---<---<---<------------ SYN/ACK ------------<---<---<---|
                                                          SYN-RCVD
      |--->--->--->-------------- ACK -------------->--->--->---|
  ESTD                                                       ESTD
      |<--------------------- ANCP ESTAB ---------------------> |
      |                           ...                           |
      |                                     system restart ---> ^
      |                                                         |
      |--->--->--->-------------- PSH -------------->--->--->---|
                                                             (Abort)
      |---<---<---<-------------- RST --------------<---<---<---|
   CLOSED
      |                                                         |
        
        ]]> </artwork>
    </figure>
    </t>
    <t>
Following the AN reaching the CLOSED TCP socket state, the corresponding ANCP adjacency is to be reset by the AN and an attempt to re- establish the TCP connection initiated. In other words, the CLOSED TCP socket state is to be interpreted as an ANCP link down event.  
            </t>
    </section>
    <section title="Recovering topological information">
        <t> In order to minimize the need for protocol changes, including new capabilities, we propose the following solution.  Each time ANCP establishes or re-establishes an adjacency, the AN MUST send Port-Up messages for all ports that are currently active on the AN.

             <figure align="center" anchor="Initial port-up">
<artwork align="center"> <![CDATA[
            Initial Port_UP messages
        (Derived from all active ports)
        <-------------
1.  NAS --------------------------- Access
                      Node
        ]]> </artwork>
    </figure>
    The above behavior of the AN is proposed to be mandated as part of the ANCP protocol specification. 
    </t>
            
    </section> <!-- end of recovering topological information -->

    <section title="Multicast use case">
        <t> When ANCP adjacency goes down due to NAS restarts, NAS is no longer synchronized with AN multicast membership.  Reconciling multicast information consistency is a bit more complicated due to the fact that both the AN and NAS are in their own ways producers and consumers of  such information. The mechanism to reconcile authorization and configuration state (e.g delegated bandwidth) on the AN needs further study.

In terms of reconciling active multicast group membership on the AN, we propose that upon the re-establishment of the ANCP adjacency, the NAS issues an all port Multicast flow report query to the AN to obtain a picture of the multicast flow membership state present on the AN. Based on the then received multicast flow report the NAS would, when configured to do so, re-run any conditional access policy checks in order to determine whether the reported flows are still in line with the active policies. For any flows that are found to be in violation of such policies, the NAS would then issue a Multicast-Replication-Ctrl message requesting the deletion of the flow by the AN.
This reconciliation process is illustrated in Figure 3 and does not appear to require protocol modifications beyond what is specified in [draft-ietf-ancp-mc-extensions-00.txt].

             <figure align="center" anchor="Multicast">
        <artwork align="center"> <![CDATA[
            Reconciling Multicast data
       _____                                                   _____
      |     |                                                 |     |
      | AN  |                                                 | NAS |
      |_____|                                                 |_____|
         ^                                                        ^
         |                                                        |
         |<--------------------- ANCP ESTAB --------------------->|
         |                           ...                          |
         |                     system restart (loss of synch) --> ^
         |                                                        |
         |<--------------------- ANCP ESTAB --------------------->|
         |                                                        |
         |---<---<---<- Multicast Flow Report Request -<---<---<--|
         |                                                        |
         |--->--->--->- Multicast Flow Report Response ->--->-->--|
         |                                                        |
         |                          Conditional Access check -->(*)
         |                           ...                          |
         |---<---<---<--  Multicast-Replication-Crl --<---<---<---|
         |                  (Target,delete,Flow 1)                |
         |                           ...                          |

         (*) NAS performs a conditional access and admission 
         control checks. If flow reported is no longer allowed 
         for target then NAS send a Multicast-Replication-Crl 
         delete message to AN (Flow 1 in figure 3).
        ]]> </artwork>
</figure>

    Based on the above description the following functional requirement may be laid down to describe the expected NAS and AN behaviors:

      Following the establishment or re-establishment of an ANCP adjacency with transactional multicast capability, the NAS MUST issue a Multicast Flow Report request message requesting the status for all ports. Upon receiving the multicast flow report response from the AN, NAS MUST perform a conditional access check on the reported multicast flows and use the outcome to drive an flow deletion requests by means of Multicast Replication Control messages (0x01).
            </t>
    </section>
    </section>
    <section title="Sections TBD">
            <t>
                    The following procedure needs to be described:
    1. The case when AN has the Multicast Bandwidth Delegation control enabled, and either NAS or AN restarts (or ANCP adjacency restarts). How to reconcile the bandwidth usage by each flow needs to be described.
    </t>
    </section>
    <section anchor="Acknowledgements" title="Acknowledgements">
            <t>The authors would like to acknowledge Wojciech Dec and Francois Le Faucheur for providing inputs and guiding them in editing this document, Aniruddha A for his feedback.
             </t>
    </section>

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

    <section anchor="IANA" title="IANA Considerations">
      <t>This memo includes no request to IANA.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>All drafts are required to have a security considerations section.
      See <xref target="RFC3552">RFC 3552</xref> for a guide.</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;
        <reference anchor="draft-ietf-ancp-protocol-06.txt">
              <front>
                      <title>
            Protocol for Access Node Control Mechanism in Broadband Networks
                      </title>
                      <author initials="S" surname="Wadhwa, et al.">
                              <organization> </organization>
                      </author>
          <date year="2009" />
              </front>
    </reference>
    <reference anchor="draft-ietf-ancp-mc-extensions-00.txt">
              <front>
                      <title>
      Additional Multicast Control Extensions for ANCP
                      </title>
                      <author initials="F" surname="Le Faucheur, et al.">
                              <organization> </organization>
                      </author>
          <date year="2009" />
              </front>
    </reference>
    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->


      &RFC3552;

      <!--  &I-D.narten-iana-considerations-rfc2434bis; -->

      <!-- A reference written by by an organization not a person. -->

    </references>

    <section anchor="app-additional" title="Additional Stuff">
      <t>This becomes the Appendix.</t>
    </section>

  </back>
</rfc>
