<?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-04" 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>
   
   <author fullname="Mark Bales" initials="M." surname="Bales">
     <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>yellowjeep2017@gmail.com</email>
     </address>
   </author>

   <date year="2017" />

   <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>
    As Users connect to a network, policy applications often apply
    common policies to them. In some cases policies are grouped
    and applied through the use of AVPs, e.g. 3GPP Base Name.  
    Other options include sending identifiers, usually a list of
    integers, associated with rules to apply a group to a single user.  
    This compacts the over the wire representation but requires strong
    coordination between policy based Clients and Servers. 
</t>
<t>
	Application of common policy if further limited when the filters
	overlap.  This requires partitioning policies into non-overlapping
	namespaces, e.g. tables in a Software Defined Networking (SDN) switch.  
    To reduce the need to partition sets of policies some SDN technologies,
    e.g. OpenFlow, rely on metadata that is applied as part of the filter or
    metadata that is specific to the packet, e.g. OpenFlow Registers.
</t>
<t>
    This document defines grouping mechanisms to allow users or groups of 
    users to share policies or groups of policies.  The mechanism also extends
    filters to include a metadata matching field that permits filters that overlap
    at the protocol level to coexist in the same policy enforcement space.     
</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.  This metadata is used as part of the filter
        or as user information when policy application occurs.  
      </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.   A Policy Entity's name MUST contain
    zero or 1 separator character '/'.  The value before the separator is
    a Base Name.  When no Base Name is provided, i.e. no separator is present.
    The value of a policy entity is considered to be part of the Base Name
    "" (empty string) for any matching purposes.  Base Name values MUST NOT
    contain the '/' character.
</t><t>
    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 bit strings to represent where the Policy Entity is used.
    A Policy Entity MAY appear in multiple Membership Domains.
</t><t>
    Membership-Value is 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. <xref target="fig_refarch"/>
    shows the reference model.
</t>
      <t>
        <figure anchor="fig_refarch"
                  title="Reference Model">
            <artwork align="center"><![CDATA[
                    0..1 +-----------+ 0..1
          +------------->| Base-Name |<------------+
          |              +-----+-----+             |
          |               0..1 |       +-----------+-----------+
          |                    |       | Membership-Assignment |
          |                    |       +--------+--+-------+---+
          |                    |         * ^    |  |       |
          |                  * |           |    |  |       v
          |             +------+--------+  |    |  | +------------+
          |             | Policy Entity +--+    |  | | Match-Type |
          |             +---------------+       |  | +------------+
          |                                     |  |
+---------+---------+0..1  +-----------------+  |  |
| Policy-Membership |<-----+ Authorized User |  |  |
+-----+---+---------+      +-----------------+  |  |
      |   |                                     |  |
      |   |         0..1+-------------------+   |  |
      |   +------------>| Membership Domain |<--+  |
      |                 +-------------------+ 0..1 |
      v                                            |
+------------------+                               |
| Membership-Value |<------------------------------+
+------------------+
              ]]></artwork>
            <postamble></postamble>
          </figure>
        </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-Name 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="Examples">
<section title="Rule Sets" anchor="rulesetex">
<t>
  A policy administrator defines Product X with 3 separate rules sets. 
  The administrator creates the Membership-Domain "Product X" and Membership-Values 
  of 1, 2 and 4 representing separate rule sets. For this example each rule set
  consists of twenty Filter-Rules as defined in <xref target="RFC5777"/>.
</t>
<t>
  Each Rule Set is assigned a Membership-Value. Rule Set 1 is assigned a 
  Membership-Value of 1, Rule Set 2 members is assigned the value 2 and Rule Set 
  three members are assigned a value of 4.  All Membership-Assignments have the 
  Membership-Domain of "Product X" and a Match-Type of EQ (Equals). 
</t>
<t>
  The policy administrator defines three users. User 1 is assigned the Membership-Domain 
  of "Product X"" and Membership-Value of 1. User 2 is assigned a Membership-Domain of 
  "Product X" and a Membership-Value of 2. User 3 is assigned a Membership-Domain of 
  "Product X"" and Membership-Value of 4.
</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 shall be part of Users with either Rule Set 1 or
  Rule Set 2 of Product X.
</t>
<t>
  Accordingly, the policy administrator defines the Membership-Assignment 
  having 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 title="Default Route (Overlapping) Rules" anchor="defaultruleex">
<t>
  A common traffic rule is the default (all traffic) rule.  It is often
  used as the lowest priority rule in a policy enforcement session.  Even
  though the rule is typically the same, e.g. "any any", the actions taken
  may vary, e.g. deny traffic, permit traffic, set quality of service.  To
  distinguish the rules the use of the Membership-Domain in the
  Membership-Assignment even when the Membership-Value MAY be the same.
</t>
<t>Within the enforcement point, for each overlapping Match-Type can be set to 
   OVERLAP and contain all bits where the rule applies in its Membership-Value.  
   In general, the Membership-Value MUST be NOT overlap with other default rules
   or a Precedence MUST be followed.    
</t>
<t>In the case where a Filter-Rule <xref target="RFC5777"/> is used, the Match-Type 
   and Membership-Value can be used as part of the Classifier AVP.</t>
</section>
</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>
 </middle>
 <back>
   <references title="Normative References">
     &RFC2119;
     &RFC6733;
   </references>

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