<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5777 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5777.xml">
<!ENTITY RFC6733 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6733.xml">
<!ENTITY RFC7155 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7155.xml">

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc category="std" docName="draft-bertz-dime-policygroups-01" ipr="pre5378Trust200902">
 <front>
   <title>Diameter Policy Groups and Sets</title>

   <author fullname="Lyle Bertz" initials="L." surname="Bertz">
     <organization>Sprint</organization>
     <address>
       <postal>
         <street>6220 Sprint Parkway</street>
         <city>Overland Park</city>
         <region>KS</region>
         <code>66251</code>
         <country>United States</country>
       </postal>
       <email>lylebe551144@gmail.com</email>
     </address>
   </author>

   <date year="2016" />

   <area>Operations and Management Area</area>

   <workgroup>Diameter Maintenance and Extensions</workgroup>

   <keyword>diameter</keyword>
   <keyword>rfc5777</keyword>
   <keyword>filter</keyword>
   <keyword>policy</keyword>
   <keyword>groups</keyword>
   <abstract>
<t>
     This document defines optional Diameter attributes for efficient
     policy provisioning.
</t>
   </abstract>
 </front>

 <middle>
   <section title="Introduction">
<t>
    Quite often policy applications will apply common policies over
    multiple authorized endpoints.  These policies may be
    pre-provisioned or dynamically installed on the Diamater Client
    by the Diamater Server.
</t><t>
    Techniques such as policy grouping, e.g. Base Name used in many
    3GPP specifications or Bit Set values are applied.
</t><t>
    This document defines both a grouping mechanism, the Group-Name
    AVP, and a membership (bit set) that can be used to quickly apply
    one or more Diameter based policies, e.g. Filter-Rule <xref target="RFC5777"/>.
</t>
</section>
<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"/>.
</t>
</section>
<section anchor="terms" title="  Terminology">
  <t>
    <list style="hanging">
      <t hangText="Authorized Users">
        An Entity that has been authorized to use a service via a
        Diamater Application.
      </t>
      <t hangText="Base Name">
        An organizational structure used to define a domain for multiple
        Policy Groups or Membership Domains.
      </t>
      <t hangText="Determination Type">
        The matching policy applied, e.g. ANDMASK, AND, etc, for Membership
        Determination.
      </t>
      <t hangText="Policy Entity">
        A type that may be assigned to a Policy Group or Membership.  This
        includes but is not limited to Filters <xref target="RFC7155"/> or Filter-Rules <xref target="RFC5777"/>.
      </t>
      <t hangText="Membership Determination">
        The process by which Policy Entities are selected to be applied
        to an authorized User.
      </t>
      <t hangText="Membership Domain">
        A name assigned to a Membership Set.
      </t>
      <t hangText="Membership Value">
        A binary set of values where each bit represents a specific
        membership pattern.
      </t>
    </list>
  </t>
</section>
<section title="Concepts">
<t>
    Policy Groups represent a union of Policy Entities.  These entities
    MUST be of the same type, e.g. Filters <xref target="RFC7155"/> or Filter-Rules <xref target="RFC5777"/>.
</t>
<t>
    When establishing groups and membership Sets an optional Base Name MAY
    be used.  It identifies the top level grouping.  Policy Entity groups
    MAY be directly named as well.  When no Base Name is provided the value
    a policy entity is considered to be part of the Base Name "" (empty string)
    for any matching purposes.
</t><t>
    Base Name values create a two tier heirarchy for grouping.  However, a
    Policy Entity can be applied to multiple, distinct sets of authorized
    Users.  These sets can be based upon their state (paid, past due, etc.),
    customer type (pre-paid, post-paid, etc.) or many other factors.
    In such cases, a Membership Domain is used.
</t><t>
    Membership Domains are named domains (UTF8Strings) with binary values
    stored in BitStrings to represent where the Policy Entity is used.
    A Policy Entity MAY appear in multiple Membership Domains.
</t>
<t>
    This mechanism creates a compact bit pattern to be used which notes
    when a Policy Entity or Policy Group applies to to an Authorized
    User.
</t>
<t>
    An Authorized User's memberships are assigned by a
    Policy-Membership.  A Policy Entity is assigned membership via
    a Membership-Assignment.   Multiple assignments may be applied
    to an Authorized User and Policy Entity but they MUST have unique
    Membership Domain values.  It is also RECOMMENDED to avoid
    numerous Policy-Membership assignments for an Authorized User as
    it delays computation of the Policy Entities that should be
    applied to their Service.
</t>
<t>
    Memberships are matched by understanding the relationship between
    their values which are represented as sets of bits.  These
    relationships are descibed as Match-Types and are specified as
    set relations, e.g. subset, superset, etc.
</t>
<t>
    To determine if a Rule is assigned to the User the following
    conditions MUST be true at least one Membership-Assignments
    must exist where
  <list>
<t>
    Policy-Membership's Membership-Domain = Membership-Assignment's
    Membership-Domain
</t><t>
    Policy-Membership's Membership-Value MUST satisfy the Match-Type
    for the Membership-Assignments' Membership-Value
</t>
  </list>
</t>
</section>
<section title="Groups and Membership AVPs">
  <section title="Base-Name AVP" anchor="basename">
<t>
    The Base-Name AVP (AVP Code TBD1) is of type UTF8String and
    defines a group of Policy Entities, e.g. Filters <xref target="RFC7155"/>
    or Filter-Rules <xref target="RFC5777"/>.
</t>
<t>
    All Policy Entities with the same Base-Name MUST be of the
    same AVP type.
</t>
<t>
    A Base-Name MAY be assigned at the creation of the Policy Entity
    or in a subsequent update but MUST only be assigned once, i.e.
    re-assignment of the Base-Name MUST NOT be allowed.
</t>
  </section>
  <section title="Policy-Membership AVP" anchor="membership">
<t>
   The Policy-Membership AVP (AVP Code TBD2) is of type Grouped and
   specifies the Membership-Value and optionally the Membership-Domain
   and Base-Name for an Authorized User.  It is defined as follows
   (per the grouped-avp-def of <xref target="RFC6733"/>):
</t>
<figure>
        <artwork><![CDATA[
      Policy-Membership ::= < AVP Header: TBD2 >
                   { Membership-Value }
                   [ Membership-Domain ]
                   [ Base-Name ]
]]>
        </artwork>
      </figure>
<t>
    Multiple Policy-Membership values MAY be assigned to an
    Authorzied User.  However, assigning multiple Policy-Memberships
    to an Authorized Users MAY delay policy enforcement as membership
    determination time is increased and SHOULD be avoided.
</t>
<t>
    If multiple Policy-Memberships are assigned to an Authorized
    User, the Membership-Domain of each Policy-Membership value MUST
    be unique.
</t>
  </section>
  <section title="Membership-Assignment AVP" anchor="membershipassign">
<t>
   The Membership-Assignment AVP (AVP Code TBD3) is of type Grouped
   and specifies the Membership-Value and optionally the
   Membership-Domain and Base-Name for a Policy-Entity.  It is
   defined as follows (per the grouped-avp-def of <xref target="RFC6733"/>):
</t>
<figure>
        <artwork><![CDATA[
      Membership-Assignment ::= < AVP Header: TBD3 >
                   { Membership-Value }
                   { Match-Type }
                   [ Membership-Domain ]
                   [ Base-Name ]
]]>
        </artwork>
      </figure>
<t>
    Multiple Policy-Membership values MAY be assigned to a Policy
    Entity.  If multiple Policy-Memberships are assigned, the
    Membership-Domain of each Membership-Assignment MUST be unique.
</t>
</section>
  <section title="Membership-Domain AVP" anchor="memberdomain">
<t>
    The Membership-Domain AVP (AVP Code TBD4) is of type UTF8String
    and defines a membership set for a group of Policy Entities, e.g.
    Filters <xref target="RFC7155"/> or Filter-Rules <xref target="RFC5777"/>, that
    are commonly applied to a set of Authorized Users.
</t>
   </section>
  <section title="Membership-Value AVP" anchor="membervalue">
<t>
    The Membership-Value AVP (AVP Code TBD5) is of type OctetString
    and defines a membership of a Policy Entity or Authorized User.
</t>
<t>
    Each bit of the OctetString represents a single position in the
    Membership-Domain set.
</t>
<t>
    When two Membership-Values of different lengths are compared, the
    smaller Membership-Value is padded with '0' valued bits until it
    is the same length as the longer Membership-Value.
</t>
  </section>
<section title="Match-Type AVP" anchor="matchtype">
<t>
    The Match-Type AVP (AVP Code TBD6) is of type Enumerated and
    defines the type of Matching algorithm used for the
    Policy Entity.
</t>
<t>
    When applying the Match-Type between the Membership-Value of
    Membership-Assignment (Policy Entity) and a Policy-Membership
    (Authorized User), the Membership-Domain MUST be the same, i.e.
    they are omitted or both MUST be present and have the same value.
</t>
<t> Match-Types can be one of the following:</t>
<t>
   EQ            0
</t><t>
      The Membership-Values are equal.
</t><t>
   SUPER         1
</t><t>
      The Membership-Assignment's Membership-Value is a superset of the
      Policy-Membership's Membership-Value, i.e. the may be equal.
</t>
<t>
   PSUPER      2
</t><t>
      The Membership-Assignment's Membership-Value is a proper superset
      of the Policy-Membership's Membership-Value.
</t>
<t>
   SUB     3
</t><t>
      The Membership-Assignment's Membership-Value is a subset of the
      Policy-Membership's Membership-Value, i.e. the may be equal.
</t>
<t>
  PSUB      4
</t><t>
      The Membership-Assignment's Membership-Value is a proper subset
      of the Policy-Membership's Membership-Value.
</t>
<t>
  OVERLAP      5
</t><t>
      The Membership-Assignment's Membership-Value has overlap with
      the Policy-Membership's Membership-Value.  They may be equal or
      have some form of subset / superset relationship.
</t>
<t>
  NONOVERLAP      6
</t><t>
      The Membership-Assignment's Membership-Value has no
      intersection with the Policy-Membership's Membership-Value.
</t>
</section>
</section>
<section title="Lifecycle Considerations">
<t>
    Base Names are typically assigned when a Policy Entity is
    installed on the Diameter Client.  Assignment MAY occur after
    installation but the impact of this is outside of the scope of
    this document.
</t>
<t>
    Membership-Assignments MAY occur at any time in the lifecycle of
    the Policy Entity.  However, there is no guarantee that resources
    exist on the Diameter Client to perform a re-evualation of the
    membership of all Authorized Users.   A Diameter Server MUST NOT
    assume that re-evaluation will occur or that an evaluation will
    occur immediately.
</t>
<t>
    Policy-Memberships MAY change at any time in the lifecycle of
    the Authorized User's session.  It is expected that sufficient
    resources exist to perform a re-evaluation of applicable Policy
    Entities based upon Membership testing.  If this cannot be done
    a Diameter Applicaiton level appropriate message MUST be sent to
    the Diamater Server.
</t>
<t>
    Generally, Base-Names assignment SHOULD occur upon creation of a
    Policy Entity or the authorization of a User.
    Membership-Assignments SHOULD occur prior to an Authorized User
    being created with a Policy-Membership that would apply the
    Policy Entity to the Authorized User's session.
</t>
</section>
<section title="Example">
<section title="Rule Sets" anchor="rulesetex">
<t>
  A policy administrator has defined three 'default rule sets' based
  upon various product options selected by a Customer.  Each rule set
  consists of twenty Filter-Rules as defined in <xref target="RFC5777"/>.
</t>
<t>
  Rules that are part of Rule Set 1 are given a Membership-Value of
  1, Rule Set 2 members are given the value 2 and Rule Set
  three members have a value of 4 in their respective
  Membership-Assignment values.  All Membership-Assignments have the
  Membership-Domain of "Product X" and a Match-Type of EQ (Equals).
</t>
<t>
  When a User is Authorized for service usage, a Policy-Membership
  value is provided with the appropriate Membership-Value set to
  1, 2 or 4 and a Membership-Domain of "Product X".  The
  Diameter Client can then appropriately the correct 20 Filter-Rules.
</t>
 </section>
<section title="Rule in multiple sets (1 Domain)" anchor="sharedruleex">
<t>
  Expanding upon our example from above <xref target="rulesetex"/>, a new
  Filter-Rule is added that is part of both Rule Set 1 and Rule
  Set 2.
</t>
<t>
  According, the Membership-Assignment has a Membership-Domain of
  "Product X", a Membership-Value of 3 and a Match-Type of
  OVERLAP.  Thus, any Policy-Membership whose Membership-Value is set
  to 1 or 2 will have this Filter-Rule applied.
</t>
</section>
<section anchor="IANA" title="IANA Considerations">
<t>
   IANA allocated AVP codes in the IANA-controlled namespace registry
   specified in Section 11.1.1 of <xref target="RFC6733"/> for the following AVPs that
   are defined in this document.
</t>
<texttable>
  <ttcol>AVP</ttcol>
  <ttcol>AVP Code</ttcol>
  <ttcol>Section Defined</ttcol>
  <ttcol>Data Type</ttcol>

  <c>Base-Name</c>
  <c>TBD1</c>
  <c><xref target="basename"/></c>
  <c>UTF8String</c>

  <c>Policy-Membership</c>
  <c>TBD2</c>
  <c><xref target="membership"/></c>
  <c>GROUPED</c>

  <c>Membership-Assignment</c>
  <c>TBD3</c>
  <c><xref target="membershipassign"/></c>
  <c>GROUPED</c>

  <c>Membership-Domain</c>
  <c>TBD4</c>
  <c><xref target="memberdomain"/></c>
  <c>UTF8String</c>

  <c>Membership-Value</c>
  <c>TBD5</c>
  <c><xref target="membervalue"/></c>
  <c>OctetString</c>

  <c>Match-Type</c>
  <c>TBD6</c>
  <c><xref target="matchtype"/></c>
  <c>Enumerated</c>
</texttable>
   </section>
<section anchor="Security" title="Security Considerations">
<t>
    The use of Base-Names and Membership-Domain can unintentionally
    provide user information if it is too explicit, e.g.
    "Bobs' Policies".  It is RECOMMENDED that an operator consider
    the values it assigns and ensure they provide no user or
    group speicific information.
</t>
<t>
    As bit and test patterns the data provided by the
    Membership-Assignment and Policy-Membership AVPs provide more
    clues between an Operator and Authorized User's policy
    relationship.  However, it is no different than if one has
    access to the information transmitted between the Diameter
    Client and Server today (if the Base-Names and
    Membership-Domains) follow the reommendations in this section.
</t>
<t>
    In either case, access to the Diameter communications is still
    required.
</t>
<t>
   The Security Considerations of the Diameter protocol itself have been
   discussed in <xref target="RFC6733"/>.  The Diameter base protocol <xref target="RFC6733"/>
   requires that each Diameter implementation use underlying
   security; i.e., TLS/TCP, DTLS/SCTP or IPsec. Use of the AVPs
   defined in this document MUST take into consideration the security
   issues and requirements of the Diameter base protocol.
</t>
</section>
   </section>
 </middle>
 <back>
   <references title="Normative References">
     &RFC2119;
     &RFC6733;
   </references>

   <references title="Informative References">
     &RFC5777;
     &RFC7155;
   </references>
 </back>
</rfc>
