<?xml version="1.0" encoding="UTF-8"?>

<!--
vim:softtabstop=4:sw=4
-->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc2119 PUBLIC '' 
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY rfc2865 PUBLIC '' 
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2865.xml'>
    <!ENTITY rfc2868 PUBLIC '' 
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2868.xml'>
    <!ENTITY rfc2869 PUBLIC '' 
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2869.xml'>
]>

<rfc category="std" ipr="full3978" docName="draft-evbergen-radext-extended-attributes.txt">

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

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<!-- <?rfc compact="yes" ?> -->
<?rfc strict="yes" ?>

<front>
    <title>Extended RADIUS Attributes</title>
    <author initials='E.P' surname="van Bergen" fullname='Emile van Bergen'>
	<organization>E-Advies</organization>
	<address>
	    <postal>
		    <street>Heysterbachstraat 92</street>
		    <street>3312 JL  Dordrecht</street>
		    <country>The Netherlands</country>
	    </postal>
	    <email>emile@e-advies.nl</email>
	</address>
    </author>
    <date month="February" year="2006"/>
    <abstract><t>This document presents a mechanism to remove certain 
    limitations of the RADIUS protocol, in terms of attribute number space
    and attribute size. Special attention is given to backward
    compatibility. Additionally, a simple attribute grouping mechanism is
    proposed.</t>

    <t>Extending the standard attribute space is desireable because the 
    current standard space is very limited, and because practice has shown that
    vendors are reluctant to adopt vendor specific attributes defined by other
    vendors, leading to needless duplication of work and reduced
    interoperability.  Reasons vary between lack of trust in other vendors'
    management of their attribute space and unwillingness to advertise for
    other vendors using their private enterprise code or name.</t>

    <t>A larger standard attribute space allows for a more lightweight 
    assignment process than the current space, in which only about 90
    attributes remain unassigned; it also demands a more organized and
    centralized process for assignment than a vendor's own number space,
    which hopefully makes vendors more comfortable when adopting attributes
    devised by others.</t>
    
    </abstract>
</front>

<middle>

    <section title="Requirements notation">
	<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 title="Introduction">

    <t>This document relates to the RADIUS protocol as described in
    <xref target='RFC2865'/> and assumes the following goals:</t>

    <t><list style="numbers">

	<t>to expand the common attribute number space, in order to
	encourage vendors to build upon each others work and improve
	interoperability;</t>

	<t>to expand the current maximum attribute size of 253 bytes,
	which is insufficient to carry a standard DNS domain name, an 
	EAP packet, many packet filtering rules and location
	data;</t>

	<t>to create a light weight grouping method, in order to allow
	packets to contain multiple independent data structures consisting
	of an unordered set of one or more RADIUS attributes, as done
	earlier in <xref target="RFC2868"/>.</t>

    </list></t>

    <t>This document does not intend to address all real and perceived
    shortcomings of RADIUS, as DIAMETER does, nor does it discard accumulated
    experience by inventing new or subtly transformed approaches for things
    that already work well. It attempts to solve only a few essential problems,
    and thereby to provide a foundation for further solutions.</t>

    </section>

    <section title="RADIUS attributes">

	<t>The data structures involved in this proposal are described before
	anything else, because that likely makes the rest of the discussion
	easier to follow.</t>

	<t>A new RADIUS attribute is proposed, the Extended-Attribute.
	This attribute may occur zero or more times in any RADIUS packet.
	Whenever multiple instances of this attribute are found, the contents
	of all instances must be concatenated before any further decoding is
	done, similar to the way EAP-Message <xref target="RFC2869"/> is
	treated.</t>

	<t>Concatenation during decoding takes up all instances and splitting
	during encoding may happen at arbitrary boundaries. Thus, at most one
	extended attribute space can exist in a single RADIUS packet.</t>

	<t>Concatenation renders a virtual data field, called the extended
	attribute space. This space can be as large as is possible considering
	the maximum size of a RADIUS packet, which is currently 4096 bytes. It
	can never be larger than the length of a single RADIUS packet.</t>

	<t>An encapsulating attribute that follows the standard RADIUS format
	allows us to overcome the limit of 253 octets without violating the
	RADIUS protocol, and allows clients, proxies and servers that do not
	implement support for the extended attribute format to transparently
	pass any set of extended attributes as opaque data.</t>

	<section title="Extended-Attribute" anchor="subsec_extatr">
	    <t>Description</t>
	    <t><list>
		<t>This RADIUS attribute encapsulates the Extended Attribute
		space as described in <xref target='sec_extspc'/>. It follows
		the standard RADIUS format for opaque octet strings.</t>
	    </list></t>

	    <figure><preamble>A summary of this attribute is
	    shown below. The fields are transmitted from left to right.
	    </preamble>
	    <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|     Type      |    Length     |             String...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
	    </artwork>
	    </figure>

	    <t>Type</t>
	    <t><list><t>TBD for Extended-Attribute</t></list></t>

	    <t>Length</t>
	    <t><list><t>&gt;= 3</t></list></t>

	    <t>String</t>
	    <t><list><t>
		    The String field contains the Extended Attribute space
		    as defined in <xref target='sec_extspc'/>. If multiple 
		    instances of the Extended-Attribute are present in a 
		    packet, their values MUST be concatenated before any 
		    attempt to interpret the value is made.
	    </t></list></t>

	</section>

    </section>		

    <section anchor="sec_extspc" title="Extended Attribute space">

	<t>The Extended Attribute space is a single virtual field of which
	at most one may be present in any RADIUS packet. It is encapsulated 
	by one or more instances of the RADIUS Extended-Attribute as described 
	in <xref target="subsec_extatr"/>, each instance covering up to 253
	octets of this virtual field.</t>

	<t>The Extended Attribute space contains one or more Extended RADIUS
	attributes. Extended RADIUS attributes exist on the same conceptual
	level as a normal RADIUS attributes and have the same semantics, but
	allow for more attribute types, separate number spaces, longer values
	and tags contained in a fixed field that does not share a function as a
	flag, a tag and the first octet of the value, as in 
	<xref target="RFC2868"/>.</t>

	<section title="Extended Attribute format" anchor="subsec_extfmt">

	    <t>Description</t>
	    <t><list>
		<t>Each extended attribute specifies the number space for the
		attribute type field, the attribute type, an optional tag, an
		optional reference to another set of tagged attributes, a
		value length and an optional value.</t>

		<t>Each attribute type number space is able to contain 2^32
		attribute types. Every vendor who has an SMI Private Enterprise
		Number (TBD: ref) automatically gets one number space, and
		every standards development organisation can get either one or
		2^24 number spaces.</t>

		<t>The format for vendor-specific and non-vendor specific
		extended RADIUS attributes is the same, contrary to RADIUS,
		where each vendor is effectively assigned only one attribute.
		Most vendors have used their given space wisely and have
		adopted the standard RADIUS attribute encoding for their
		attribute sets, but others have not.</t>

		<t>In the extended RADIUS attribute space, each vendor gets a
		full number space of 2^32 attribute types, which, along with
		the other features offered by the extended attribute format,
		hopefully removes the need for re-creating a simple (but
		inaccessible without prior knowledge) TLV structure of their
		own in their values.</t>

		<t>While the syntax of the value remains entirely dependent on
		the attribute type in question, client vendors are strongly
		encouraged to follow the example of RADIUS as defined by the
		IETF and use standard data types whenever possible; eg. UTF-8
		for strings intended for human consumption, binary values
		contained in either 4 or 8 bytes in network order for ordinal
		values, an so on, to allow quick adoption of their new
		attributes by dictionary driven server implementations.  
		Opaque strings are not discouraged, as long as any standard
		authentication and authorization process can be performed using
		equality testing against and assignment from a stored value in
		a database.</t>

	    </list></t>

	    <figure>
	    <preamble>The format of the extended attribute is shown below. The
	    fields are transmitted from left to right.</preamble>
	    <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      STD      |	             Vendor			|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			      Type				|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Tag	|   Child-Tag   |	      Length		|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			      Value...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	    </artwork>
	    </figure>

	    <t>STD</t>
	    <t><list>
		<t>This field designates the standard or organization that 
		governs the number space for the Vendor and Type fields.  </t>

		<t>0x00: The Vendor field contains a SMI Private Enterprise
		Numbers (TBD: ref) as assigned by the IANA; the Type number 
		space is governed by the private entity designated by the
		Vendor number.</t>

		<t>0x40: The Vendor number designates a Standards Development
		Organization (SDO) or other publically recognised non-IETF
		process to assign type numbers.  (TBD: I'm not aware of any SDO
		registry at the IANA yet - is there one?); the Type number
		space is governed by the SDO or standard process designated by
		the Vendor number.</t>

		<t>0x80: The Vendor number space is governed by the IETF. Any
		IETF standard that wants to create a distinct Type space may be
		assigned a new Vendor number after expert review. Any backwards
		compatible revision of such a standard MUST keep the same
		Vendor number, otherwise a new Vendor number MUST be obtained.
		</t>

		<t>0xc0: The Vendor and Type numbers are governed by this
		document or any later backwards compatible revision and are
		described below.</t>

		<t>All other values are reserved. Values should be allocated
		using the highest order bits first, ie. the next value assigned
		should be 0x20.</t>
	    </list></t>

	    <t>Vendor</t>
	    <t><list><t>If the STD field described above is 0xc0, this value
	    MUST be set to zero upon transmission, and MUST be ignored upon
	    reception. (TBD: alternatively, see below)
	    </t></list></t>

	    <t>Type</t>
	    <t><list>
		<t>The attribute type number. There are 2^32 possible attribute
		types available for assignment in each of the 2^32 number
		spaces created by the STD and Vendor fields. The word Type may
		be confusing but is historic in RADIUS; each type represents a
		particular attribute or data item, not a data type.</t>

		<t>Multiple instances of each attribute type may exist; the
		relative ordering among instances of the same attribute type
		MUST be preserved by all parties.</t>

		<t>If the STD field is 0xc0 and the Vendor field is 0, then
		types 0-255 are shared with RADIUS and are assigned using the
		assignment process given in section 6 of <xref
		target="RFC2865"/>; all other types are shared with DIAMETER.
		A light weight common assignment process that reserves a number
		in both the DIAMETER space and the extended attribute space,
		even when an attribute is in practice only meaningful in either
		DIAMETER or RADIUS context, should be used at the IANA.</t>

		<t>TBD: Alternatively, DIAMETER and (extended) RADIUS could be
		separated by using STD 0xc0 and Vendor 1 for DIAMETER instead.
		The disadvantage is then that you can then represent standard
		RADIUS attributes in three ways instead of two: as RADIUS
		attributes, as extended RADIUS attributes and as DIAMETER
		attributes. This may be the only option if a shared yet
		sufficiently light weight assigment process is infeasible
		though.</t>

	    </list></t>

	    <t>Tag</t>
	    <t><list>
		<t>The Tag is a number that groups attributes of different
		types together into a single data structure. Using this field,
		up to 255 of these data structures can exist in any RADIUS
		packet containing the extended RADIUS attribute space.</t>

		<t>This facility allows structures composed of a set of RADIUS
		attributes without relying on relative attribute ordering,
		removing the need for each instance of such a compound data
		structure to include the same number of instances of each
		attribute type. See also <xref target="RFC2868"/>, which uses
		the same concept but a different way to represent the tags.</t>

		<t>A Tag value of zero does not represent any particular group.
		When no grouping is intended, the Tag field MUST be set to
		zero.</t>
	    </list></t>

	    <t>Child-Tag</t>
	    <t><list>
		<t>If the value of this field is non-zero, the attribute
		containing this field refers to a data structure consisting of
		the set attributes tagged with the same value.</t>

		<t>This facility allows any attribute to refer to a particular
		set of tagged attributes as its subordinates, and thus allows
		structures of arbitrary depth, without recursive parsing and
		while preserving a flat list of attributes and a flat, numbered
		list of compound structures.</t>

		<t>Using this facility, each instance of any attribute type
		gets the ability to convey both its own value and a unique set
		of attributes.</t>

		<t>Splitting a data structure into subattributes by tagging 
		them and having the parent attribute refer to the tag value
		using Child-Tag, allows for deeper access by dictionary driven
		implementations into compound data structures, which would
		otherwise require specific knowledge about the particular
		attribute.</t>

		<t>Attributes can either have a normal value and refer to at
		most one tagged set of attributes using its Child-Tag field, 
		or refer to a list of tagged sets of attributes, by having
		one or more tags as their value.</t>
	    </list></t>

	    <t>Length</t>
	    <t><list><t>The total length of the attribute, excluding 
	    padding to a multiple of 4 octets. The next attribute can thus be 
	    found at (length + 3) &amp; ~ 3 octets from the beginning of the
	    current attribute.</t></list></t>

	    <t>Value</t>
	    <t><list><t>The value of the attribute. The size of this field
	    in octets is given by the value of the Length field after
	    subtracting the size of the attribute header (8 octets). All values
	    MUST be padded on the right to a multiple of 4 octets. Zero-sized
	    values are allowed. The meaning of each possible value depends
	    entirely on the attribute type.
	    </t></list></t>

	</section>

    </section>


    <section title="Design issues">

	<t>This proposal involves a number of design choices. The following
	ones are addressed in more detail:</t>

	<t><list style="symbols">

	    <t>sharing the attribute number space with DIAMETER vs.
	    adopting the DIAMETER TLV format and flag semantics;</t>

	    <t>whether or not to allow existing attributes to use the
	    proposed new encoding;</t>

	    <t>structured data types in vales vs. creating a structure
	    containing attributes;</t>

	</list></t>

	<section title="DIAMETER considerations">
	    <t>Blah.</t>
	</section>

	<section title="RADIUS compatibility">
	    <t>Blah.</t>
	</section>

	<section title="Structured data">
	    <t>Blah.</t>
	</section>

    </section>

    <section title="IANA Considerations">
	<t>TBD</t>
    </section>

    <section title="Security Considerations">
	<t>Since neither a new authentication mechanism is proposed nor any
	new attribute protection scheme is suggested, this document is not
	believed to add or remove any security in the RADIUS protocol.</t>
    </section>

</middle>

<back>
    <references>
		&rfc2119;
	        &rfc2865;
		&rfc2868;
		&rfc2869;
    </references>
</back>

</rfc>

