<?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 RFC3654 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3654.xml">
<!ENTITY RFC3746 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3746.xml">
<!ENTITY RFC5657 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5657.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
<!ENTITY RFC5812 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5812.xml">
<!ENTITY RFC5810 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5810.xml">
<!ENTITY RFC5811 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5811.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" ?>
<!-- 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-ietf-forces-protoextension-01" 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>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="ForCES Protocol Extensions">ForCES Protocol Extensions</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->
    <!-- Another author who claims to be an editor -->

	<author fullname="Jamal Hadi Salim" initials="J." surname="Hadi Salim">
		<organization>Mojatatu Networks</organization>
		<address>
			<postal>
				<street>Suite 400, 303 Moodie Dr.</street>
				<city>Ottawa</city>
				<code>K2H 9R4</code>
				<region>Ontario</region>
				<country>Canada</country>
			</postal>
			<email>hadi@mojatatu.com</email>
			<!-- uri and facsimile elements may also be added -->
		</address>
	</author>
      
    <!-- 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 -->
    <date year="2014" />

    <area>Routing</area>

    <workgroup>Internet Engineering Task Force</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>ForCES</keyword>
    <keyword>Protocol</keyword>
    <keyword>Extension</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>
	Experience in implementing and deploying ForCES architecture
	has demonstrated need for a few small extensions both to ease
	programmability and to improve wire efficiency of some transactions.
	This document describes extensions to 
	the ForCES Protocol Specification[RFC 5810]
	<!--
	<xref target="RFC5810">the ForCES Protocol Specification</xref>
-->
	semantics to achieve that end goal.
      </t>

    </abstract>
  </front>

  <middle>
    <section title="Terminology and Conventions">
      <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"></xref>.</t>
      </section>

 <section title="Definitions">
	<t> This document reiterates the terminology defined by the ForCES
	architecture in various documents for the sake of clarity.</t>
  
      <t><list style="hanging">
      
<t>
FE Model - The FE model is designed to model the logical processing
functions of an FE. The FE model proposed in this document
includes three components; the LFB modeling of individual Logical
Functional Block (LFB model), the logical interconnection between
LFBs (LFB topology), and the FE-level attributes, including FE
capabilities. The FE model provides the basis to define the
information elements exchanged between the CE and the FE in the
<xref target="RFC5810">ForCES protocol</xref>.
</t>
<t>
LFB (Logical Functional Block) Class (or type) - A template that
represents a fine-grained, logically separable aspect of FE
processing. Most LFBs relate to packet processing in the data
path. LFB classes are the basic building blocks of the FE model.
</t>
<t>
LFB Instance - As a packet flows through an FE along a data path, it
flows through one or multiple LFB instances, where each LFB is an
instance of a specific LFB class. Multiple instances of the same
LFB class can be present in an FE's data path. Note that we often
refer to LFBs without distinguishing between an LFB class and LFB
instance when we believe the implied reference is obvious for the
given context.
</t>
<t>
LFB Model - The LFB model describes the content and structures in an
LFB, plus the associated data definition. XML is used to provide
a formal definition of the necessary structures for the modeling.
Four types of information are defined in the LFB model. The core
part of the LFB model is the LFB class definitions; the other
three types of information define constructs associated with and
used by the class definition. These are reusable data types,
supported frame (packet) formats, and metadata.
</t>
<t>
LFB Metadata - Metadata is used to communicate per-packet state from
one LFB to another, but is not sent across the network. The FE
model defines how such metadata is identified, produced, and
consumed by the LFBs, but not how the per-packet state is
implemented within actual hardware. Metadata is sent between the
FE and the CE on redirect packets.
</t>
<t>ForCES Component - A ForCES Component is a well-defined, uniquely
identifiable and addressable ForCES model building block. A
component has a 32-bit ID, name, type, and an optional synopsis
description. These are often referred to simply as components.
</t>
<t>
LFB Component - An LFB component is a ForCES component that defines
the Operational parameters of the LFBs that must be visible to the
CEs.
</t>
<t>
	ForCES Protocol - Protocol that runs in the Fp reference points in 
	<xref target="RFC3746">the ForCES Framework</xref>.
</t>
<t>
	ForCES Protocol Layer (ForCES PL) - 
	A layer in the ForCES protocol architecture that defines the ForCES
	protocol messages, the protocol state transfer scheme, and the ForCES
	protocol architecture itself as defined in 
	<xref target="RFC5810">the ForCES Protocol Specification</xref>.
</t>
<t>
	ForCES Protocol Transport Mapping Layer (ForCES TML) -
	A layer in ForCES protocol architecture that uses the capabilities of
	existing transport protocols to specifically address protocol message
	transportation issues, such as how the protocol messages are mapped
	 to different transport media (like TCP, IP, ATM, Ethernet, etc.), and
	how to achieve and implement reliability, ordering, etc.

	<xref target="RFC5811">the ForCES SCTP TML</xref> describes a TML
	that is mandated for ForCES.
</t>
	</list></t>
    </section>

    </section>

<section title="Introduction">
      <t>
	Experience in implementing and deploying ForCES architecture
	has demonstrated need for a few small extensions both to ease
	programmability and to improve wire efficiency of some transactions.
	This document describes a few extensions to
	<xref target="RFC5810">the ForCES Protocol Specification</xref>
	semantics to achieve that end goal.
      </t>
    <t> 
	    This document describes and justifies the need for 2 small
	    extensions which are backward compatible. The document also
	    clarifies on top of <xref target="RFC5810"></xref> how dumping of
	    large components is achieved.
        <list style="numbers">
	    <t>
		    A table range operation to allow a controller or
		    control application to request an arbitrary
		    range of table rows.
	    </t>
	    <t>
		    Improved Error codes returned to the controller
		    (or control application) to improve granularity
		    of existing defined error codes.
	    </t>
	    <t>
		    FE response to a GET request (example to a large table)
		    may not fit in one PL message, for example due to limited
		    TLV space.
	    </t>
        </list>
   </t>
  </section>

<section title="Problem Overview" anchor="issues">
<t>
In this section we present sample use cases to illustrate
the challenge being addressed.
</t>

  <section title="Table Ranges">
   <t>
   Consider, for the sake of illustration, an FE table with
   1 million reasonably sized table rows which are sparsely populated. 
   Assume, again for the sake of illustration, that there are 2000 table
   rows sparsely populated between the row indices 23-10023.
   </t>

   <t>
   ForCES GET and DEL requests sent from a controller (or control app) are
   prepended with a path to a component and sent to the FE. In the case
   of indexed tables, the component path can either be to a table or a
   table row index. The approaches for retrieving or deleting a sizeable 
   number of table rows is at the programmatically level (from an application
   point of view) unfriendly, tedious, and abusive of both compute and bandwidth
   resources.
   </t>
   <t>
   As an example, a control application attempting to retrieve the first
   2000 table rows appearing between row indices 23 and 10023 can achieve
   its goal in one of:
   <list style="symbols">
    <t>
    Dump the whole table and filter for the needed 2000 table rows.
    </t>
    <t>
    Send upto 10000 ForCES PL requests with monotonically
    incrementing indices and stop when the needed 2000 
    entries are retrieved.
    </t>
    <t>
    If the application had knowledge of which table rows existed
    (not unreasonable given the controller is supposed to be aware of
    state within an NE), then the application could take advantage of
    ForCES batching to send fewer large messages
    (each with different path entries for a total of two thousand).
    </t>
   </list>
   As argued, while the above options exist - all are tedious.
   </t>

  </section>

  <section title="Error codes">
  <t>
	  <xref target="RFC5810"></xref> has defined a generic set of error codes
	  that are to be returned to the CE from an FE. Deployment experience
	  has shown that it would be useful to have more fine grained error
	  codes. As an example, the error code E_NOT_SUPPORTED could be mapped
	  to many FE error source possibilities that need to be then interpreted by
	  the caller based on some understanding of the nature of the sent
	  request. This makes debugging more time consuming.
  </t>
    </section>

</section>

  <section title="Protocol Update Proposal">
   <t>
   This section describes proposals to update the protocol for issues discussed in 
   <xref target="issues"></xref>
   </t>
   <section title="Table Ranges">
    <t>
    We propose to add a Table-range TLV (type ID 0x117) that will be 
    associated with the PATH-DATA TLV in the same manner the KEYINFO-TLV is.
    </t>

    <t>
<figure title="ForCES table range request Layout" align="left" anchor="figy">
   <artwork><![CDATA[
   +---------------------+---------------------+
   |  Type (0x117)       |       Length        |
   +---------------------+---------------------+
   |                Start Index                |
   +-------------------------------------------+
   |                 End Index                 |
   +-------------------------------------------+
    ]]></artwork>
   </figure>
    </t>
    <t>
    <xref target="figy"></xref> shows how this new TLV is constructed.
    </t>

    <t>
   <figure title="ForCES table range request" align="left" anchor="figx">
   <artwork><![CDATA[
   OPER = GET
          PATH-DATA:
            flags = F_SELTABRANGE,  IDCount = 2, IDs = {1,6}
            TABLERANGE-TLV content = {11,23}
    ]]></artwork>
   </figure>
    </t>
    <t>
    <xref target="figx"></xref> illustrates a GET request for a
    range of rows 11 to 23 of a table with component 
    path of "1/6".
    </t>
    <t>
    Path flag of F_SELTABRANGE (0x2 i.e bit 1, where bit 0 is F_SELKEY
    as defined in RFC 5810) is set to indicate the 
    presence of the TABLERANGE-TLV. The pathflag bit F_SELTABRANGE
    can only be used in a GET or DEL and is mutually exclusive with F_SELKEY.
    The FE MUST enforce those constraints and reject a request with
    an error code of E_INVALID_TFLAGS with a description of 
    what the problem is (refer to <xref target="errc"></xref>).
    </t>

    <t>
    The TABLERANGE-TLV contents constitute:
    <list style="symbols">
      <t>
	      A 32 bit start index. An index of 0 implies the 
	      beggining of the table row.
      </t>
      <t>
	      A 32 bit end index. A value of 0xFFFFFFFFFFFFFFFF implies
	      the last entry.
      </t>
    </list>
     
    </t>

    <t>
    The response for a table range query will either be:
    <list style="symbols">
    <t>
    The requested table data returned (when at least one referenced row is
    available); in such a case, a response with
    a path pointing to the table and whose data content 
    contain the row(s) will be sent to the CE. The data content
    MUST be encapsulated in  sparsedata TLV. The sparse data TLV content
    will have the "I" (in ILV) for each table row indicating the table indices.
    </t>
    <t>
    An EXTENDEDRESULT-TLV (refer to <xref target="etlv"></xref>) when:
    <list style="symbols">
    <t>
	    Response is to a range delete request. The Result will either be:
	    <list style="symbols">
		    <t>
		    A success if any of the requested-for rows is deleted
		    </t>
		    <t>
		    A proper error code if none of the requested for rows can
		    be deleted
		    </t>
	    </list>
    </t>
    <t>
    data is absent where the result code of E_EMPTY 
    with an optional content string describing the nature of the error
    (refer to <xref target="errc"></xref>).
    </t>
    <t>
    When both a path key and path table range are reflected on the
    the pathflags, an error code of E_INVALID_TFLAGS 
    with an optional content string describing the nature of the 
    error (refer to <xref target="errc"></xref>).
    </t>
    <t>
    other standard ForCES errors (such as ACL constraints trying to retrieve
    contents of an unreadable table), accessing unknown components etc.
    </t>
    </list>
    </t>

    </list>
    </t>
  </section>

    <section title="Error Codes" anchor="errc">
     <t>
	     We propose several things:
	     <list style="numbers">
	     <t>
		     A new set of error codes.
	     </t>
	     <t>
		     Allocating currently reserved codes for vendor use.
	     </t>
	     <t>
		    A new TLV, EXTENDEDRESULT-TLV (0x118) that will carry
		    a code (which will be a superset of what is currently 
		    specified in RFC 5812) but also an optional cause content.
		    This is illustrated in <xref target="fig2"></xref>.
	     </t>
	     </list>
     </t>

  <section title="New Codes" anchor="ncodes ">
  <t>
	  EXTENDEDRESULT-TLV Result Value is 32 bits and is
	  a superset of RFC 5810 Result TLV Result Value. The new version
	  code space is 32 bits as opposed to the RFC 5810 code size
	  of 8 bits.
  </t>
  <texttable anchor="table_codes" title="New codes">
      <ttcol align='left' width='20%'>Code</ttcol>
      <ttcol align='left' width='30%'>Mnemonic</ttcol>
      <ttcol align='left' width='50%'>Details</ttcol>
      <c>0x100</c> <c>E_EMPTY</c><c>Table is empty</c>
      <c>0x101</c> <c>E_INVALID_TFLAGS</c><c>Invalid table flags</c>
      <c>0x102</c> <c>E_INVALID_OP</c><c>Requested operation is invalid</c>
      <c>0x103</c> <c>E_CONGEST_NT</c><c>Node Congestion notification</c>
      <c>0x104</c> <c>E_COMPONENT_NOT_A_TABLE</c><c>Component not a table</c>
      <c>0x105</c> <c>E_PERM</c><c>Operation not permitted</c>
      <c>0x107</c> <c>E_BUSY</c><c>System is Busy</c>
      <c>0x108</c> <c>E_TIMED_OUT</c><c>A time out occured while processing the message</c>
      <c>0x106</c> <c>E_UNKNOWN</c><c>A generic catch all error code. Carries a string to further extrapolate what the error implies.</c>
  </texttable>

  </section>
  <section title="Vendor Codes" anchor="vcodes ">
  <t>
   Codes 0x18-0xFE are reserved for use as vendor codes. Since
   these are freely available it is expected that the FE and CE
   side will both understand/interpret the semantics of any used codes.
  </t>
  </section>
  <!--
-->
  <section title="Extended Result TLV" anchor="etlv">

  <t>
   <figure title="EXTENDEDRESULT-TLV" align="left" anchor="fig2">
  <artwork><![CDATA[
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Type = EXTENDEDRESULT-TLV   |              Length           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        Result Value                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                    Optional Cause content                     |
    .                                                               .
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  ]]></artwork>
   </figure>
   </t>

   <t>
    <list style="symbols">
   <t>
    Like all other ForCES TLVs, the EXTENDEDRESULT-TLV is expected to be
    32 bit aligned.
   </t>
   <t>
   The Result Value derives and extends from the same current namespace
   as specified in RFC 5810, section 7.1.7. The main difference is that
   we now have 32 bit result value (as opposed to the old 8 bit).
   </t>
   <t>
   The optional result content is defined to further disambiguate the
   result value. It is expected Utf-8 values to be used. However, 
   vendor specific error codes may choose to specify different contents.
   Additionally, future codes may specify cause contents to be of types
   other than string..
   
   </t>
   <t>
    It is recommended that the maximum size of the cause string should
    not exceed 32 bytes. We do not propose the cause string be standardized.
   </t>
   </list>
   </t>

   <t>
   XXX: Backward compatibility may require that we add a FEPO
   capability to advertise ability to do extended results so that
   the CE is able to interpret the results and a FEPO compatibility
   flag to define what TLV setting would be used. Alternatively,
   the backward compatibility can be made a configuration option
   (which helps reduce clutter on FEPO LFB given that it is expected
   that in the future it makes sense for implementations to support
   only EXTENDEDRESULT-TLVs).
   </t>
    </section>
  </section>

 <section title="Large Object Dumping" anchor="largeobj">
    <t>
	    Imagine a GET request to a path that is a table i.e a table dump.
	    Such a request is sent to the FE with a specific correlator, say X.
	    Imagine this table to have a large number of entries at the FE.
	    For the sake of illustration, lets say millions of rows.
	    This requires that the FE delivers the response over multiple messages, 
	    all using the same correlator X.
    </t>
    <t>
	    RFC 5810 does not describe how a GET response is to indicate 
	    "I have more messages coming for this correlator".
    </t>
    <t>
	    Implementation experience indicates we can use the transaction flags
	    to indicate that a GET response is the beginning, middle or end of
	    a multi-part message. In other words we mirror the effect of an
	    atomic transaction sent by a CE to an FE.
    </t>
    <t>
	    XXX: Add in the next update diagram and details of how
	    this takes place.
    </t>
 </section>
  </section>

  <section anchor="Acknowledgements" title="Acknowledgements">
	  <t>
		  TBA
	  </t>
  </section>
<!--
-->

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

    <section anchor="IANA" title="IANA Considerations">
    <t>
    This document registers two new top Level TLVs and two new
    path flags.
    </t>

    <t>
	    The following new TLVs are defined:
    <list style="symbols">
	<t>
		TABLERANGE-TLV (type ID 0x117)
	</t>
	<t>
		EXTENDEDRESULT-TLV (type ID 0x118)
	</t>
    </list>
    </t>

    <t>
	    The following new path flags are defined:
    <list style="symbols">
	<t>
		F_SELTABRANGE (value 0x2 i.e bit 1)
	</t>
    </list>
    </t>

    <t>
	   The Defined Result Values are changed:
    <list style="symbols">
	<t>
		codes 0x18-0xFE are reserved for vendor use.
	</t>
	<t>
		codes 0x100-102 are defined by this document.
	</t>
    </list>
    </t>

    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD</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"?-->
      &RFC3746;
      &RFC5810;
      &RFC5811;
      &RFC5812;

    </references>

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

    &RFC2119;
    </references>

    <!-- Change Log

v00 2009-02-17  EH   Initial version
  -->
  </back>
</rfc>
