<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  ]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<rfc category="std" ipr="trust200902"
     docName="draft-ietf-manet-dlep-da-credit-extension-03">

<front>
<title abbrev="DLEP DA Credit Extension">DLEP DiffServ Aware Credit Windowing
Extension</title>
   <author initials='B.' surname="Cheng" fullname='Bow-Nan Cheng'>
    <organization>Lincoln Laboratory</organization>
    <address>
      <postal>
        <street>Massachusetts Institute of Technology</street>
        <street>244 Wood Street</street>
        <city>Lexington</city>
        <region>MA</region>
        <code>02421-6426</code>
      </postal>
       <email>bcheng@ll.mit.edu</email>
    </address>
    </author>
   <author initials='D.' surname="Wiggins" fullname='David Wiggins'>
    <organization>Lincoln Laboratory</organization>
    <address>
      <postal>
        <street>Massachusetts Institute of Technology</street>
        <street>244 Wood Street</street>
        <city>Lexington</city>
        <region>MA</region>
        <code>02421-6426</code>
      </postal>
       <email>David.Wiggins@ll.mit.edu</email>
    </address>
    </author>
   <author initials='L.' surname="Berger" fullname='Lou Berger'>
    <organization>LabN Consulting, L.L.C.</organization>
    <address>
       <email>lberger@labn.net</email>
    </address>
    </author>

  <date/>
  <abstract>
<t>
  This document defines an extension to the DLEP protocol that enables a
  DiffServ aware credit-windowing scheme for destination-specific and
  shared flow control.
</t>
</abstract>
</front>

<middle>
<section anchor="sec-1" title="Introduction">
<t>
  The Dynamic Link Event Protocol (DLEP) is defined in <xref
  target="RFC8175"/>.  It provides the exchange of link
  related control information between DLEP peers.  DLEP peers are
  comprised of a modem and a router.  DLEP defines a base set of
  mechanisms as well as support for possible extensions.  This
  document defines one such extension.
</t>
<t>
  The base DLEP specification does not include any flow control
  capability.  There are various flow control theoretically possible
  with DLEP.  For example, a credit-windowing scheme for
  destination-specific flow control which provides aggregate flow
  control for both modem and routers has been proposed in <xref
  target="I-D.ietf-manet-credit-window"/>.
</t>
<t>
  This document defines a DLEP extension which provides an alternate
  flow control mechanism for traffic sent from a router to a modem. Flow
  control is provide using one or more logical "Credit Windows", each of
  which will typically be supported by an associated virtual or physical
  queue.  Traffic sent by a router will use traffic classification
  information provided by the modem to identify which traffic is
  associated with each credit window.  (For general background on
  traffic classification see <xref target="RFC2475"/> Section 2.3.) This
  document supports traffic classification based on DLEP destination and
  DiffServ <xref target="RFC2475"/> DSCPs (differentiated services
  codepoints).  Credit windows may be shared or dedicated on a per
  {destination, DSCP} tuple basis.  Said another way, the defined
  mechanism allows for credit windows to be shared across traffic sent
  to multiple DLEP destinations and DSCPs, or used exclusively for
  traffic sent to a particular destination and/or DSCP.  The extension
  also supports the "wildcard" matching of any DSCP.
</t>
<t>
  The extension defined in this document is referred to as "DiffServ
  Aware Credit Windowing" or, more simply, the "DA Credit" extension.
  The extension is structured to allow for reuse of the defined credit
  window based flow control with traffic classification techniques other
  than DiffServ, e.g., IEEE 802.1 Q priority code points or even 5-tuple
  IP flows.
</t>
<t>
  This document defines a new DLEP Extension Type Value in <xref
  target="sec-ext-type"/> which is used to indicate the use of the
  extension.  Two new messages are defined in <xref
  target="sec-msgs"/>, and six new DLEP Data Items in <xref
  target="sec-data-items"/>.
</t>
<section anchor="sec-1.1" title="Key Words">
  <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 anchor="sec-theory" title="Extension Overview">
  <t>
    The DA Credit extension can be used to support credit based flow
    control of traffic sent from a router to a modem.  The extension can
    be used to support DiffServ and non-DiffServ based flow control.
    Both types of DLEP endpoints, i.e., a router and a modem, negotiate
    the use of extension during session initialization, see Section 5.2
    <xref target="RFC8175"/>.  When using this extension,
    data traffic is allowed to be sent by the router to the modem only when
    there are credits available.
  </t>
  <t>
    Credits are managed on a per logical "Credit Windows" basis.  Each
    credit window can be thought of as corresponding to a queue within a
    modem.  Modems pass to the router information on its credit windows
    and identify each via a "Credit Window Identifier", or "CID".  In
    addition to the CID, credit window information includes an initial
    credit window size, as well as the maximum size of the logical queue
    associated with each CID.  The maximum size is included for
    informative and, potential, future uses.
  </t>
  <t>
    As mentioned above, traffic classification supported by this
    document is performed on a per {destination, DSCP} tuple basis.
    This means that, routers need the combination of the DLEP identified
    destination and DSCP associated with a CID in
    order to match traffic it sends to specific credit
    windows.  Modems provide the mapping of DSCPs to CIDs in sets, each
    of which is identified via a "Traffic Classification Identifier" or
    "TID".  When a destination becomes reachable, a modem "Associates"
    (identifies) the TID to be used for traffic sent by the router to
    that destination.  This use of CIDs, TIDs and association of a TID
    to a DLEP destination enables modem to share or dedicate resources
    as needed to match the specifics of its implementation and its
    attached transmission technology.
  </t>
  <t>
    Modems provide an initial credit window size at the time of "Credit
    Window Initialization".  Such initialization can take place during
    session initiation or any point thereafter.  It can also take place
    when rate information changes.  Additional "Credit Grants", i.e.,
    increments to Credit Window size, are provided using a Destination
    Up or the new "Credit Control" Message.  A router provides its view
    of the Credit Window, which is known as "Status", in Destination Up
    Response and the new "Credit Control Response" Messages.  Routers
    can also request credits using the new "Credit Control" Message.
  </t>
  <t>
    When modems provide credits to a router, they will need to take into
    account any overhead of their attached transmission technology and
    map it into the credit semantics defined in this document.  In
    particular, the credit window is defined below to include per frame
    (packet) MAC headers and this may not match the actual overhead of
    the modem attached transmission technology.  In that case a
    direct mapping or an approximation will need to be made by the modem
    to provide appropriate credit values.
  </t>
<t>
</t>
</section>
<section anchor="sec-ext-type" title="Extension Usage and Identification">
<t>
   The use of the extension defined in this document SHOULD be
   configurable.  To indicate that the DiffServ Aware Credit Windowing
   Extension is to be used, an implementation MUST include the DiffServ
   Aware Credit Windowing Type Value in the Extensions Supported Data
   Item.  The Extensions Supported Data Item is sent and processed
   according to <xref target="RFC8175"/>.
</t>
<t>
  The DiffServ Aware Credit Windowing Extension Type Value is TBA1, see
  <xref target="sec-iana"/>.
</t>
</section>
<section anchor="data-plane" title="Data Plane Considerations">
  <t>
  When the use of the extension defined in this document is agreed upon
  per standard DLEP processing, see <xref target="sec-ext-type"/>, a
  router MUST NOT send data traffic to a modem for forwarding when there are no
  credits available in the associated Credit Window.
  This document defines credit windows in octets.  A credit window value
  MUST be larger than the number of octets contained in a packet,
  including any MAC headers used between the router and the modem, in
  order for the router to send the packet to a modem for forwarding.
  The credit window is decremented by the number of sent octets.
  </t>
  <t>
    A router MUST identify the credit window associated with traffic
    sent to a modem based on the traffic classification information
    provided in the data items defined in this document.  The
    definitions support identification based on DLEP destination and, at
    the modem's discretion, DSCPs. Note that routers will typically view
    a DLEP destination as the next hop.
  </t>
</section>

<section anchor="sec-msgs" title="Extension Messages">
  <t>
    Two new messages are defined by this extension: the Credit Control
    and the Credit Control Response Message.  Sending and receiving both
    message types MUST be supported by any implementation that
    advertises use of this extension per <xref target="sec-ext-type"/>.
  </t>
  <section anchor="sec-cc-msg" title="Credit Control Message">
    <t>
      Credit Control Messages are sent by modems and routers. Each
      sender is only permitted to have one message
      outstanding at one time.  That is, a sender (modem or router) MUST
      NOT send a second (or any subsequent) Credit Control Message
      until a Credit Control Response Message is received
      from its peer (router or modem).
    </t>
    <t>
      Credit Control Messages are sent by modems to provide credit
      window increases.  Modems send credit increases when there is
      transmission or local queue availability that exceeds the credit
      window value previous provided to the router. Modems will need to
      balance the load generated by sending and processing frequent credit
      window increases against a router having data traffic available to send,
      but no credits available.
    </t>
    <t>
      Credit Control Messages MAY be sent by routers to request
      credits and provide window status. Routers will need to
      balance the load generated by sending and processing frequent credit
      window requests against a having data traffic available to send,
      but no credits available.
    </t>
    <t>
      The Message Type value in the DLEP Message Header is set to TBA2.
    </t>
    <t>
      A message sent by a modem, MUST contain one or more
      Credit Window Grant Data Items as defined below in <xref
      target="sec-di-grant"/>.  A router receiving this message MUST
      respond with a Credit Control Response Message.
    </t>
    <t>
      A message sent by a router, MUST contain one or more Credit Window
      Request Data Items defined below in <xref
      target="sec-di-request"/> and SHOULD contain a Credit Window
      Status Data Item, defined in <xref target="sec-di-status"/>,
      corresponding to each credit window request. A modem receiving
      this message MUST respond with a Credit Control Response
      Message based on the received message and data item and the
      processing defined below, which will typically result in credit
      window increments being provided.
    </t>
    <t>
      Specific processing associated with each Credit Data Item is
      provided below.
    </t>
  </section>
  <section anchor="sec-ccr-msg" title="Credit Control Response Message">
    <t>
      Credit Control Response Messages are sent by
      routers to report the current Credit Window for a destination.
      A message sent by a router, MUST contain one or more
      Credit Window Status Data Items as defined below in <xref
      target="sec-di-status"/>.
      Specific receive processing associated with the Credit Window
      Window Status Data Item is provided below.
    </t>
    <t>
      Credit Control Response Messages sent by modems MUST contain one
      or more Credit Window Credit Grant Data Items. A data item
      for every Credit Window Request data item contained in the
      for Credit Control Response Message sent by the router MUST be
      included.  Each Grant Data Item MAY provide zero or more additional
      credits based on a the modem;s transmission or local queue
      availability.
      Specific receive processing associated with each Grant Data Item
      is provided below.
    </t>
    <t>
      The Message Type value in the DLEP Message Header is set to TBA3.
    </t>
  </section>
</section>

<section anchor="sec-data-items" title="Extension Data Items">
<t>
   Six data items are defined by this extension.
   The Credit Window Initialization
   Data Item is used by a modem to identify a credit window and set its
   size.
   The Credit Window Traffic Classification
   Data Item is used by a modem to identify a set which identifies which
   DSCPs are mapped to a credit window.
   The Credit Window Association
   Data Item is used by a modem to identify which traffic classification
   set should be used when sending traffic to a particular DLEP
   identified destination.
   The Credit Window Grant is used by a modem to provide additional
   credits to a router.
   The Credit Request is used by a router to request additional
   credits.
   The Credit Window Status is used to advertise the sender's view of
   number of available credits for state synchronization purposes.
</t>
<t>
   Any errors or inconsistencies encountered in parsing data items
   are handled in the same fashion as any other data dtem parsing error
   encountered in DLEP, see <xref target="RFC8175"/>. In particular, the
   node parsing the data item MUST terminate the session with a
   Status Data Item indicating Invalid Data.
</t>
<t>
  The defined data items and operations have similar objectives as those
  found in <xref target="I-D.ietf-manet-credit-window"/>.  One notable
  difference from this extension is that in this document credits are
  never provided by the router to the modem.
</t>
<section anchor="sec-di-cwi" title="Credit Window Initialization">
<t>
  The Credit Window Initialization Data Item is used by a modem to
  identify a credit window and set its size.  This Data Item SHOULD be
  included in any Session Initialization Response Message that also
  contains the DiffServ Aware Credit Windowing Extension Type Value in
  the Extensions Supported Data Item.  Updates to previously identified
  credit windows or new credit windows MAY be sent by a modem by
  including the data item in Session Update Messages.  More than one data
  item MAY be included in a message to provide information on multiple
  credit windows.
</t>
<t>
  The Credit Window Initialization Data Item identifies a credit window
  using a Credit Window Identifier, or CID.  It also provides the size of
  the identified credit window.  Finally, a queue size (in bytes) is
  provided for informational purposes.  Note that to be used, a CID must
  be listed in a Credit Window Traffic Classification Data Item.
</t>
<t>
  The format of the Credit Window Initialization Data Item is:
</t>
<t>
<figure>
<artwork>
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Data Item Type                | Length (16)                   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Credit Window Identifier (CID)|            Reserved           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         Credit Value                          :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :                         Credit Value                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Scale      |         Credit Window Size                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork>
</figure>
</t>
<t>
  <list style="hanging">
    <t hangText="Data Item Type:">TBA4</t>
    <t hangText="Length:"> 16
      <vspace blankLines="1"/>
      Per <xref target="RFC8175"/> Length
      is the number of octets in the data item, excluding the Type and
      Length fields.
    </t>
    <t hangText="Credit Window Identifier (CID):">
      <vspace blankLines="1"/>
      A 16-bit unsigned integer identifying a credit window.  The value
      of 0xFFFFFFFF is reserved and MUST not be used in this data item.
      There is no other restriction on values used by a modem, and there
      is no requirement for sequential or ordered values.
    </t>
    <t hangText="Reserved:">
      <vspace blankLines="1"/>
      MUST be set to zero by the sender (a modem) and ignored by the
      receiver (a router).
    </t>
    <t hangText="Credit Value:">
      <vspace blankLines="1"/>
      A 64-bit unsigned integer representing the credits, in octets, to
      be applied to the Credit Window.  This value includes MAC
      headers as seen on the link between the modem and router.
    </t>
    <t hangText="Scale:">
      <vspace blankLines="1"/>
      An 8-bit unsigned integer indicating the scale used in the Credit Window
      Size fields.  The valid values are:
      <figure>
        <artwork>
      Value  Scale
      ------------
          0   B - Bytes     (Octets)
          1  KB - Kilobytes (B/1024)
          2  MB - Megabytes (KB/1024)
          3  GB - Gigabytes (MB/1024)
        </artwork>
      </figure>
    </t>
    <t hangText="Credit Window Size:">
      <vspace blankLines="1"/>
      A 24-bit unsigned integer representing the maximum size, in the
      octet scale indicated by the Scale field, of the associated credit
      window.
    </t>
  </list>
</t>
<t>
  A router that receives a Credit Window Initialization Data Item MUST
  locate the credit window that is associated with the CID indicated in
  each received data item.  If no associated credit window is found, the
  router MUST initialize a new credit window using the values carried in
  the data item.  When an associated credit window is found, the router
  MUST update the credit window using the values carried in the Data
  Item. It is worth noting, that such updates can result in a credit
  window size being reduced, for example, due to a transmission rate
  change on the modem.
</t>

</section>

<section anchor="sec-di-tc" title="Credit Window Traffic Classification">
  <t>
    The Credit Window Traffic Classification Data Item is used by a modem
    to provide information to enable router to identify the credit window
    associated with traffic the router sends.  Each data item includes a
    set of credit windows and provides traffic classification for each
    window.  The data item is defined to support classification based on
    DSCPs, but is designed to be extensible for future traffic
    classification types.  The data item is not required to provide full
    traffic classification information.  In the context of the
    definition included in this document, the DLEP destination address
    needed to complete the traffic classification information is provided
    by a modem when it identifies the traffic classification set in a
    Destination Up Message using the Credit Window Associate Data Item
    defined below.
  </t>
  <t>
    The Credit Window Traffic Classification Data Item SHOULD be
    included by a modem in any Session Initialization Response Message
    that also contains the DiffServ Aware Credit Windowing Extension
    Type Value in the Extensions Supported Data Item.  Updates to
    previously provided traffic classifications or new traffic
    classifications MAY be sent by a modem by including the data item in
    Session Update Messages.  More than one data item MAY be included in
    a message to provide information on multiple traffic classifiers.
  </t>
  <t>
    The set of traffic classification information provided in the data
    item is identified using a Traffic Classification Identifier, or TID.
    Addition information, e.g., the list DSCPs associated with a credit
    window, is provided in a variable series of Queue Parameter sub-data
    items.  Note that to be used, a TID must be listed in a Credit Window
    Associate Data Item.
  </t>
  <t>
    The format of the Credit Window Traffic Classification Data Item is:
  </t>
  <t>
    <figure>
      <artwork>
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Data Item Type                | Length                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Traffic Class. Identifier (TID)|   Num SDIs    |   Reserved    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |           Traffic Classification Sub Data Item 1              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :                                ...                            :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |           Traffic Classification Sub Data Item n              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      </artwork>
    </figure>
  </t>
  <t>
    <list style="hanging">
      <t hangText="Data Item Type:">TBA5</t>
      <t hangText="Length:">Variable
        <vspace blankLines="1"/>
        Per <xref target="RFC8175"/> Length
        is the number of octets in the data item, excluding the Type and
        Length fields.
      </t>
      <t hangText=" Traffic Classification Identifier (TID):">
        <vspace blankLines="1"/>
        A 16-bit unsigned integer identifying a traffic classification
        set.  There is no restriction on values used by a modem, and there
        is no requirement for sequential or ordered values.
      </t>
      <t hangText="Num SDIs:">
        <vspace blankLines="1"/>
        An 8-bit unsigned integer indicating the number of Traffic
        Classification Sub Data Items included in the data item.  A value
        of zero (0) is allowed and indicates that no traffic should be
        matched against this TID.
      </t>
      <t hangText="Reserved:">
        <vspace blankLines="1"/>
        MUST be set to zero by the sender (a modem) and ignored by the
        receiver (a router).
      </t>
      <t hangText="Traffic Classification Sub Data Item:">
        <vspace blankLines="1"/>
        Zero or more Traffic Classification Sub Data Items of the format
        defined below MAY be included.  The number MUST match the value
        carried in the Num SDIs field.
      </t>
    </list>
  </t>
  <t>
    A router receiving the Traffic Classification Data Item MUST locate
    the traffic classification information that is associated with the
    TID indicated in each received data item.  If no associated traffic
    classification information is found, the router MUST initialize a
    new information set using the values carried in the data item.  When
    associated traffic classification information is found, the router
    MUST update the information using the values carried in the Data
    Item.  In both cases, a router MUST also ensure that any data plane
    state, see <xref target="data-plane"/>, that is associated with the
    TID is updated as needed.
  </t>

  <section anchor="sec-di-tc-sub" title="Traffic Classification Sub Data Item">
    <t>
      All Traffic Classification Sub Data Items share a common format
      that is patterned after the standard DLEP data item format, see
      <xref target="RFC8175"/> Section 11.3.  There is no requirement
      on, or meaning to sub data item ordering.  Any errors or
      inconsistencies encountered in parsing sub data items are handled
      in the same fashion as any other data item parsing error
      encountered in DLEP.
    </t>
    <t>
      The format of the Traffic Classification Sub Data Item is:
    </t>
    <t>
      <figure>
        <artwork>
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Sub Data Item Type            | Length                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Value...                            :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
      </figure>
    </t>
    <t>
      <list style="hanging">
        <t hangText="Sub Data Item Type:">
        <vspace blankLines="1"/>
        A 16-bit unsigned integer that indicates the type and
        corresponding format of the data item's Value field.  Sub Data
        Item Types are managed according to the IANA registry described
        in <xref target="sec-iana-sdi"/>.
        </t>
        <t hangText="Length:">Variable
        <vspace blankLines="1"/>
        Copying <xref target="RFC8175"/>, Length a 16-bit unsigned
        integer that is the number of octets in the sub data item,
        excluding the Type and Length fields.
        </t>
      </list>
    </t>
  </section>

  <section anchor="sec-di-tc-ds-sub" title="DiffServ Traffic Classification Sub Data Item">
    <t>
      The DiffServ Traffic Classification Sub Data Item is used to
      identify the DSCPs associated with a specific credit
      window.  Credit windows are identified using CID values that have
      been previously been sent by the modem or are listed in a Credit
      Window Initialization Data Item carried in the same messages as
      the sub data item.  DSCPs are identified in a list of DiffServ
      fields.  An implementation that does not support DSCPs, and wants
      to use credit window flow control for all traffic to a destination
      or destinations, would indicate with 0 DSCPs.
    </t>
    <t>
      The format of the DiffServ Traffic Classification Sub Data Item is:
    </t>
    <t>
      <figure>
        <artwork>
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Must be two (2)               | Length                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Credit Window Identifier (CID)|   Num DSCPs   |   DS Field 1  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   DS Field 2  |      ...      |   DS Field n  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
      </figure>
    </t>
    <t>
      <list style="hanging">
        <t hangText="Length:">Variable
          <vspace blankLines="1"/>
          Length is the number of octets
          in the sub data item.  It is equal to seven (7) plus the value
          of the Num DSCPs field.
        </t>
        <t hangText="Credit Window Identifier (CID):">
          <vspace blankLines="1"/>
          A 16-bit unsigned integer identifying a credit window that has
          been identified in a Credit Window Initialization Data Item,
          see <xref target="sec-di-cwi"/>.  Unknown CID values SHOULD be
          reported and result in associated traffic being dropped.
        </t>
        <t hangText="Num DSCPs:">
          <vspace blankLines="1"/>
          An 8-bit unsigned integer indicating the number of DSCPs
          carried in the sub data item.  A zero (0) indicates a (wildcard)
          match against any DSCP value.
        </t>
        <t hangText="DS Field:">
          <vspace blankLines="1"/>
          Each DS Field is an 8-bit whose definition is the same as <xref
          target="RFC2474"/>.
          <figure>
            <artwork>
            0   1   2   3   4   5   6   7
          +---+---+---+---+---+---+---+---+
          |         DSCP          |  CU   |
          +---+---+---+---+---+---+---+---+

            DSCP: differentiated services codepoint
            CU:   currently unused, MUST be zero
            </artwork>
          </figure>
        </t>
      </list>
    </t>
    <t>
      A router receiving the DiffServ Traffic Classification Sub Data
      Item MUST validate the information on receipt prior to the
      information and data plan update described earlier in this
      section.  The credit window associated with the CID indicated in
      each data item must be located.  It is important to note that the
      CID value may be present in a Credit Window Initialization Data
      Item carried in the same message as the sub data item. If the CID
      is not located, the it MUST be treated as an error as described
      above.
    </t>
    <t>
      In the case there are no unknown CIDs, the receiver MUST ensure
      that each DS Field value is listed only once across the whole
      Credit Window Traffic Classification Data Item.  Note, this check
      is across the data item and not the individual sub data item.  If
      the same DS Field value is listed more than once within the same
      Credit Window Traffic Classification Data Item, the data item MUST
      be treated as an error as described above.
    </t>
  </section>
</section>

<section anchor="sec-di-cwa" title="Credit Window Associate">
  <t>
    The Credit Window Associate Data Item is used by a modem to
    associate traffic classification information with a destination.
    The traffic classification information is identified using a TID
    value that has been previously been sent by the modem or is listed
    in a Credit Window Traffic Classification Data Item carried in the
    same message as the data item.
  </t>
  <t>
    A single Credit Window Associate Data Item MUST be included in all
    Destination Up and Destination Update Messages sent by a modem when
    the use of the extension defined in this document is agreed upon,
    see <xref target="sec-ext-type"/>.
  </t>
  <t>
    The format of the Credit Window Associate Data Item is:
  </t>
  <t>
    <figure>
      <artwork>
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Data Item Type                | Length (2)                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Traffic Class. Identifier (TID)|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      </artwork>
    </figure>
  </t>
  <t>
    <list style="hanging">
      <t hangText="Data Item Type:">TBA6</t>
      <t hangText="Length:"> 2
        <vspace blankLines="1"/>
        Per <xref target="RFC8175"/> Length
        is the number of octets in the data item, excluding the Type and
        Length fields.
      </t>
      <t hangText=" Traffic Classification Identifier (TID):">
        <vspace blankLines="1"/>
        A 16-bit unsigned integer identifying a traffic classification
        set that has been identified in a Credit Window Traffic
        Classification Data Item, see <xref target="sec-di-tc"/>.
        Unknown TID values SHOULD be reported and result in associated
        traffic being dropped.
      </t>
    </list>
  </t>
  <t>
    A router that receives the Credit Window Associate Data Item MUST
    locate the traffic classification information indicated by the
    received TID.  If no corresponding information can be located, the
    data item MUST be treated as an error as described above. Once the
    traffic classification information is located, it MUST be associated
    with the destination and the router MUST ensure that any data plane
    state, see <xref target="data-plane"/>, that is associated with the
    TID is updated as needed.
  </t>
</section>

<section anchor="sec-di-grant" title="Credit Window Credit Grant">
<t>
   The Credit Window Credit Grant data item is used by a modem to
   provide credits to a router.  One or more Credit Window Grant Data
   Items MAY be carried in the DLEP Destination Up, Destination Announce
   Response, Destination Update, Credit Control Messages, and Credit
   Control Response Messages.  Multiple
   Credit Window Grant Data Items in a single message are used to
   indicate different credit values for different credit windows.  In all
   message types, this data item provides an additional number of octets
   to be added to the indicated credit window.  Credit window are
   identified via using using CID values that have been previously been
   sent by the modem or are listed in a Credit Window Initialization
   Data Item carried in the same messages as the data item.
</t>
<t>
  The format of the Credit Window Grant Data Item is:
</t>
<t>
<figure>
<artwork>
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Data Item Type                | Length (12)                   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Credit Window Identifier (CID)|            Reserved           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                     Additional Credits                        :
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   :                     Additional Credits                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork>
</figure>
</t>
<t>
  <list style="hanging">
    <t hangText="Data Item Type:">TBA7</t>
    <t hangText="Length:">12
      <vspace blankLines="1"/>
      Per <xref target="RFC8175"/>, Length
      is the number of octets in the data item, excluding the Type and
      Length fields.  It will equal 8 plus the number of CID
      fields carried in the data item and MUST be at least 9.
    </t>
    <t hangText="Credit Window Identifier (CID):">
      <vspace blankLines="1"/>
      A 16-bit unsigned integer identifying a credit window that has
      been identified in a Credit Window Initialization Data Item,
      see <xref target="sec-di-cwi"/>.  Unknown CID values SHOULD be
      reported and ignored.
    </t>
    <t hangText="Additional Credit:">
      <vspace blankLines="1"/>
      A 64-bit unsigned integer representing the credits, in octets, to
      be added to the Credit Window.  This value includes MAC
      headers as seen on the link between the modem and router. A value
    of zero indicates that no additional credits are being provided.</t>
  </list>
</t>
<t>
  When receiving this data item, a router MUST identify the credit
  window indicated by the CID.  If the CID is not known to the router,
  it SHOULD report or log this information and discard the Data Item.
  It is important to note that while this data item can be received in a
  destination specific message, credit windows are managed independently
  from the destination identified in the message carrying this Data
  Item, and the indicated CID MAY even be disjoint from the identified
  destination.
</t>
<t>
  Once the credit window is identified, the credit window size MUST be
  increased by the value contained in the Additional Credits field.  If
  the increase results in a window overflow, i.e., the size of the
  credit window after the increase is smaller than the original credit
  window size, the Credit Window must be set to its maximum
  (0xFFFFFFFFFFFFFFFF).
</t>
<t>
  No response is sent by the router to a modem after processing a Credit
  Window Grant Data Item received in a Credit Control Response Message.
  In other cases, the receiving router MUST send a
  Credit Window Status data item or items reflecting the
  resulting Credit Window value of the updated credit window.  When the
  Credit Grant data item is received in a Destination Up Message, the
  Credit Window Status data item(s) MUST be sent in the
  corresponding Destination Up Response Message.  Otherwise, a
  Credit Control Message MUST be sent.
</t>
</section>

<section anchor="sec-di-status" title="Credit Window Status">
<t>
   The Credit Window Status data item is used by
   a router to report the current credit window size to its peer modem.  One
   or more Credit Window Status data items MAY be carried in a
   Destination Up Response Message or a Credit Control Response Message.
   As discussed above, the Destination Up Response Message is used when
   the data item is sent in response to a Destination Up Message, and
   the Credit Control Response Message is sent in response to a Credit
   Control Message.  Multiple Credit Window Status data items in a
   single message are used to indicated different sizes of different
   credit windows.  Similar to the Credit Window Grant, credit windows
   are identified using CID values that have been previously been sent
   by the modem.
</t>
<t>
  The format of the Credit Window Status Data Item is:
</t>
<t>
<figure>
<artwork>
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Data Item Type                | Length (12)                   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Credit Window Identifier (CID)|            Reserved           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                       Credit Window Size                      :
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   :                       Credit Window Size                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork>
</figure>
</t>
<t>
  <list style="hanging">
    <t hangText="Data Item Type:">TBA8</t>
    <t hangText="Length:">12
      <vspace blankLines="1"/>
      Per <xref target="RFC8175"/> Length
      is the number of octets in the data item, excluding the Type and
      Length fields.  It will equal 8 plus the number of CID
      fields carried in the data item and MUST be at least 9.
    </t>
    <t hangText="Credit Window Identifier (CID):">
      <vspace blankLines="1"/>
      A 16-bit unsigned integer identifying a credit window that has
      been identified in a Credit Window Initialization Data Item,
      see <xref target="sec-di-cwi"/>.
    </t>
    <t hangText="Credit Window Size:">
      <vspace blankLines="1"/>
      A 64-bit unsigned integer, indicating
      the current number of credits, in octets, available for the
      router to send to the modem.  This is referred to as the
      Modem Receive Window in <xref
      target="I-D.ietf-manet-credit-window"/>.
    </t>
  </list>
</t>
<t>
  When receiving this data item, a modem MUST identify the credit
  window indicated by the CID.  If the CID is not known to the modem,
  it SHOULD report or log this information and discard the data item.  As
  with the Credit Window Grant Data Item, the CID MAY be unrelated to
  the Destination indicated in the message carrying the data item.
</t>
<t>
  Once the credit window is identified, the modem SHOULD check the
  received Credit Window Size field value against the outstanding credit
  window's available credits at the time the most Credit Window
  Initialization or Grant data item associated with the indicated CID
  was sent.  If the values significantly differ, i.e., greater than can
  be accounted for based on observed data frames, then the modem SHOULD
  send a Credit Window Initialization Data Item to reset the associated
  credit window size to the modem's current view of the available
  credits.  As defined above, Credit Window Initialization Data Items are
  sent in Session Update Messages.  When multiple data items need to be
  sent, they SHOULD be combined into a single message when possible.
  Alternatively, and also in cases where there are small differences,
  the modem MAY adjust the values sent in Credit Window Grant data items
  to account for the reported Credit Window.
  </t>
</section>
<section anchor="sec-di-request" title="Credit Window Request">
<t>
   The Credit Window Request Data Item is used by a router to
   request additional credits for particular credit windows.  Credit
   Window Request Data Items are carried in Credit Control Messages, and
   one or more Credit Window Request Data Items MAY be present in a
   message.
</t>
<t>
   Credit windows identified using a CID as defined above in <xref
   target="sec-di-cwi"/>.  Multiple CIDs MAY be present to allow for the
   case where the router identifies that credits are needed in multiple
   credit windows.  The special CID value of 0xFFFFFFFF is used to
   indicate that a credit request is being made across all queues.
</t>

<t>
  The format of the Credit Window Request Data Item is:
</t>
<t>
<figure>
<artwork>
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Data Item Type                | Length                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Credit Window Identifier (CID)|               ...             :
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   :               ...             | Credit Window Identifier (CID)|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork>
</figure>
</t>
<t>
[LB note: a list of CIDs is now supported as is special value
255.]
</t>
<t>
  <list style="hanging">
    <t hangText="Data Item Type:">TBA9</t>
    <t hangText="Length:">Variable
      <vspace blankLines="1"/>
      Per <xref target="RFC8175"/> Length
      is the number of octets in the data item, excluding the Type and
      Length fields.  It will equal the number of CID
      fields carried in the data item and MUST be at least 1.
    </t>
    <t hangText="Credit Window Identifier (CID):">
      <vspace blankLines="1"/>
      One or more 16-bit fields used to indicate a credit window that
      has been identified in a Credit Window Initialization Data Item,
      see <xref target="sec-di-cwi"/>.  The special value of 0xFFFFFFFF
      indicates that the request applies to all CIDs.
    </t>
  </list>
</t>
<t>
  A modem receiving this data item MUST provide a Credit Increment for
  the indicated credit windows via Credit Window Grant Data Items
  carried in a new Credit Control Message.  Multiple values and queue
  indexes SHOULD be combined into a single Credit Control Message when
  possible.  Unknown CID values SHOULD be reported or logged and then
  ignored by the modem.
</t>
</section>
</section>

<section anchor="sec-compat" title="Compatibility">
<t>
  Sessions established with both peers identified as supporting the
  DiffServ Aware Credit Windowing Extension Type, see <xref
  target="sec-ext-type"/>, MUST NOT use the <xref
  target="I-D.ietf-manet-credit-window"/> defined Credit data items.
  If a node supporting the extension defined in this document, receives a
  <xref  target="I-D.ietf-manet-credit-window"/> defined data item,
  the recipient MUST ignore the received information.
</t>
</section>

<section anchor="sec-sec" title="Security Considerations">
<t>
   The extension introduces a DiffServ awareness to the mechanisms
   defined in <xref target="I-D.ietf-manet-credit-window"/>.  The
   extension does not inherently introduce any additional threats above
   those documented in <xref target="RFC8175"/>.  The
   approach taken to Security in that document and <xref
   target="I-D.ietf-manet-credit-window"/> apply equally when running
   the extension defined in this document.
</t>
</section>
<section anchor="sec-iana" title="IANA Considerations">
<t>
  This document requests the assignment of 5 values by IANA.  All
  assignments are to registries defined by <xref
  target="RFC8175"/>.
</t>
<section anchor="sec-iana-ext" title="Extension Type Value">
<t>
  This document requests 1 new assignment to the DLEP Extensions
  Registry named "Extension Type Values" in the range with the
  "Specification Required" policy.  The requested value is as follows:
</t>
<texttable anchor="table_et" title="Requested Extension Type Value">
  <preamble></preamble>
  <ttcol>Code</ttcol> <ttcol>Description</ttcol>
    <c>TBA1</c> <c>DiffServ Aware Credit Windowing</c>
    <postamble></postamble>
    </texttable>
</section>
<section anchor="sec-iana-msg" title="Message Values">
<t>
  This document requests 2 new assignments to the DLEP Message Registry
  named "Message Values" in the range with the "Specification Required"
  policy.  The requested values are as follows:
</t>
<texttable anchor="table_msg" title="Requested Message Values">
  <preamble></preamble>
  <ttcol>Type Code</ttcol> <ttcol>Description</ttcol>
    <c>TBA2</c> <c>Credit Control</c>
    <c>TBA3</c> <c>Credit Control Response</c>
    <postamble></postamble>
    </texttable>
</section>
<section anchor="sec-iana-di" title="Data Item Values">
<t>
  This document requests the following new assignments to the DLEP Data Item
  Registry named "Data Item Values" in the range with the "Specification
  Required" policy.  The requested values are as follows:
</t>
<texttable anchor="table_di" title="Requested Data Item Values">
  <preamble></preamble>
  <ttcol>Type Code</ttcol> <ttcol>Description</ttcol>
    <c>TBA4</c> <c>Credit Window Initialization</c>
    <c>TBA5</c> <c>Credit Window Traffic Classification</c>
    <c>TBA6</c> <c>Credit Window Association</c>
    <c>TBA7</c> <c>Credit Window Grant</c>
    <c>TBA8</c> <c>Credit Window Status</c>
    <c>TBA9</c> <c>Credit Window Request</c>
    <postamble></postamble>
    </texttable>
</section>
<section anchor="sec-iana-sdi" title="DLEP Sub Data Item Registry">
  <t>
    Upon approval of this document, IANA is requested to create a new
    DLEP registry, named "Sub Data Item Type Values".  The registry
    shall identify the type code value, the Data Item which may use the
    value, and a description of the value.  While the same value may be
    reused in different data items, this is not recommended at this time.
  </t>
  <t>
   The following table provides initial registry values and the
   <xref target="RFC8126"/> defined policies that should apply to the registry:
 </t>
 <texttable anchor="table_tc_sdi" title="Initial Registry Values">
  <preamble></preamble>
   <ttcol>Type Code</ttcol><ttcol>Valid Data Items</ttcol> <ttcol>Description</ttcol>
    <c>0</c> <c>N/A</c> <c>Reserved</c>
    <c>1</c> <c>N/A</c> <c>Reserved (for pause sub-DI)</c>
    <c>2</c> <c>(TBD4) Credit Window Traffic Classification</c>
        <c>DiffServ Traffic Classification</c>
    <c>2-65407</c> <c></c> <c>Specification Required</c>
    <c>65408-65534</c> <c></c> <c>Private Use</c>
    <c>65535</c> <c></c> <c>Reserved</c>
    <postamble></postamble>
    </texttable>
</section>
</section>
</middle>

<?rfc needLines="20"?>
<back>
<references title="Normative References">

<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.8174"?>
<?rfc include="reference.RFC.8175"?>

</references>

<references title="Informative References">

<?rfc include="reference.I-D.ietf-manet-credit-window.xml"?>
<?rfc include="reference.RFC.2474"?>
<?rfc include="reference.RFC.2475"?>
<?rfc include="reference.RFC.8126"?>

</references>
<?rfc needLines="100"?>
<section title="Acknowledgments">
   <t>
     The sub data item format was inspired by Rick Taylor's "Data Item
     Containers".  He also proposed the separation of credit windows from
     traffic classification at IETF98.
   </t>
</section>

<section anchor="issues" title="Open and Resolved Issues">
  <!--
   Todo:
   - explicitly state no data until have credit - DONE
   - queues per neighbor (modem) vs per mac
   - negotiating number of destination supported
   - rejecting Queues how to say no
   To consider/discussed
   - add increment vs grant DI
   - handling resync: absolute counts, set vs increment etc
   - possibility / implications of eliminating increment
   - bidirection flow control
     - terminology: local vs remote credit window (local = receiver, remote = sender)
   -->
  <t>
    This section captures issues that are open or have been addressed
    since the document has become a WG draft.  This section will be
    removed before submission for publication.
  </t>
  <section anchor="issue-merge" title="Merge with [I-D.ietf-manet-credit-window]">
    <t>
       There has been discussion within the WG that this document should
       be merged with <xref target="I-D.ietf-manet-credit-window"/>.
       The timing of this is TBD.  The authors would like to reach
       closure on some of the remaining open issues before embarking on
       this merge, but are open to discussion with the WG and other authors.
    </t>
  </section>
  <section anchor="issue-num-queues" title="Supporting Router Limits">
    <t>
      Routers may have limits on the number of queues that they can
      support and, perhaps, if per destination queues can even be
      supported at all.  There is no current way for a router to
      communicate these limits to a modem or for a router to indicate
      that the identified queue information cannot be supported.
      Support for these cases clearly needs to be addressed.
    </t>
    <t>
      This issue was reported by Stan Ratliff &lt;ratliffstan@gmail.com&gt;.
    </t>
  </section>
  <section anchor="issue-abs" title="Absolute vs Increment">
    <t>
      Stan Ratliff &lt;ratliffstan@gmail.com&gt; suggested an approach to
      simplify credit synchronization and re-synchronization by always
      passing the credit window size rather than credit window
      increments.  This is an interesting idea that needs to be explored
      and perhaps experimented with.
    </t>
  </section>
  <section anchor="issue-bidirectional-fc" title="Bidirectional Flow
                                                  Control (closed)">
    <t>
      One of the key differences between this draft and <xref
      target="I-D.ietf-manet-credit-window"/> is that this document only
      supports flow control in one direction, i.e., for traffic sent
      from a router to a modem, while the other credit-window draft
      supports it in both directions.
    </t>
    <t>
      This was a conscious choice, made out of the desire to keep the
      extension as simple as possible and to provide what is really
      expected to be used.
      Clearly the reason for being able to control traffic that is sent from
      the router to the modem/radio is pretty easily understood.  Also, while
      bidirectional flow control existed in pre-dlep solutions, it wasn't
      really used.  There is also no reason why router to modem flow
      control can't be defined at a later time - once there is an actual
      need.
    </t>
    <t>
      Based on a brief discussion on the WG list, and the absence of any
      advocates for bidirectional flow control, there is no current plan
      to add bidirectional flow control to this document.
    </t>
  </section>
</section>

</back>
</rfc>

<!-- Local Variables: -->
<!-- fill-column:72 -->
<!-- End: -->
