<?xml version="1.0"?>
<?rfc toc="yes"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119         SYSTEM 'reference.RFC.2119.xml'>
<!ENTITY rfc3917         SYSTEM 'reference.RFC.3917.xml'>
<!ENTITY RFC4234         SYSTEM 'reference.RFC.4234.xml'>
<!ENTITY ipfixarch       SYSTEM 'reference.I-D.ietf-ipfix-architecture.xml'>
<!ENTITY RFC5101         SYSTEM 'reference.RFC.5101.xml'>
<!ENTITY ipfixinfo       SYSTEM 'reference.I-D.ietf-ipfix-info.xml'>
<!ENTITY ipfixaggregation	SYSTEM 'reference.I-D.dressler-ipfix-aggregation.xml'>
<!ENTITY ipfixreducingredundancy	SYSTEM 'reference.I-D.ietf-ipfix-reducing-redundancy.xml'>
]>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc footer="draft-sommer-ipfix-richtemplate-00.txt"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc ipr="full3978" docName="&lt;draft-sommer-ipfix-richtemplate-00.txt&gt;" category="info">
	<front>
		<title abbrev="Rich Template Set IPFIX Extension">Rich Template Set Extension to the IPFIX Protocol</title>
		<author fullname="Christoph Sommer" initials="C." surname="Sommer">
			<organization abbrev="Univ. Erlangen">University of Erlangen-Nuremberg</organization>
			<address>
				<postal>
					<street>Department of Computer Science 7</street>
					<street>Martensstr. 3</street>
					<city>Erlangen</city>
					<code>91058</code>
					<country>Germany</country>
				</postal>
				<phone>+49 9131 85-27993</phone>
				<email>christoph.sommer@informatik.uni-erlangen.de</email>
				<uri>http://www7.informatik.uni-erlangen.de/~sommer/</uri>
			</address>
		</author>
		<author fullname="Falko Dressler" initials="F." surname="Dressler">
			<organization abbrev="Univ. Erlangen">University of Erlangen-Nuremberg</organization>
			<address>
				<postal>
					<street>Department of Computer Science 7</street>
					<street>Martensstr. 3</street>
					<city>Erlangen</city>
					<code>91058</code>
					<country>Germany</country>
				</postal>
				<phone>+49 9131 85-27914</phone>
				<email>dressler@informatik.uni-erlangen.de</email>
				<uri>http://www7.informatik.uni-erlangen.de/</uri>
			</address>
		</author>
		<author fullname="Gerhard Muenz" initials="G." surname="Muenz">
			<organization abbrev="Univ. Tuebingen">University of Tuebingen</organization>
			<address>
				<postal>
					<street>Computer Networks and Internet</street>
					<street>Sand 13</street>
					<city>Tuebingen</city>
					<code>72076</code>
					<country>Germany</country>
				</postal>
				<phone>+49 7071 29-70534</phone>
				<email>muenz@informatik.uni-tuebingen.de</email>
				<uri>http://net.informatik.uni-tuebingen.de/</uri>
			</address>
		</author>
		<date month="July" year="2008"/>
		<abstract>
			<t>
				This draft describes the Rich Template Set, a Template Set for the IPFIX Protocol, as well as its respective Template Records. One possible application domain for this new Set is the transport of IPFIX Flow Mediation selection criteria. In comparison to the use of Common Properties, the use of Rich Template Sets reduces the overhead of repeated transmissions and makes data transmissions more robust against failures.
			</t>
		</abstract>
	</front>
	<middle>
		<section title="Introduction">
			<t>
				IPFIX supports the concept of a Mediator, a device that receives, transforms, and exports data streams using IPFIX. A major requirement of flow mediation is the reduction of the volume of IPFIX traffic by discarding and aggregating received information.
				<xref target="I-D.dressler-ipfix-aggregation" /> describes how pattern matching is used for flow aggregation. The draft also outlines how to select flows and subsequently communicate the selection criteria to an IPFIX Collector, using Common Properties of the resulting Compound Flows to describe these attributes.
				In order to avoid the overhead of the repeated transmissions of all Common Properties (or their identifiers) in all Flow Records, a new Template Set, the Rich Template Set, is introduced.
				This Template Set allows an Exporting Process to simultaneously declare and transmit Common Properties to a receiver.
			</t>
			<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"/>.
				<vspace blankLines='100' />
			</t>
		</section>
		<section anchor="ipfix-extension-dt" title="Rich Template">
			<t>
				<figure anchor="RichTemplateSet" title="Rich Template Set Format">
					<artwork align="center"><![CDATA[
0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Set ID = 4           |          Length               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     Rich Template Record 1                    |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                              ...                              |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     Rich Template Record N                    |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Padding (opt)                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
				</figure>
				The basic format of a Rich Template Set is shown in <xref target="RichTemplateSet" />. 
				It is the same as that of a Template Set defined in <xref target="RFC5101" />, except for a different Set ID.
			</t>
			<t>
				The format of individual Rich Template Records, however, differs from that of Template Records and is shown in <xref target="RichTemplate" />.
				<vspace blankLines='100' />
			</t>
			<t>
				<figure anchor="RichTemplate" title="Rich Template Record Format">
					<artwork align="center"><![CDATA[
0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Template ID (> 255)          |  Field Count                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Data Count                   |  Common Properties ID         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                       Field 1 Specifier                       |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                              ...                              |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                       Field N Specifier                       |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                        Data 1 Specifier                       |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                              ...                              |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                        Data M Specifier                       |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                          Data 1 Value                         |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                              ...                              |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                          Data M Value                         |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
				</figure>
				<vspace blankLines='100' />
				The Rich Template Set field definitions are as follows:
				<list style="hanging">
					<t hangText="Set ID">
						<vspace blankLines="0" />
						Type of this Template Set. A Set ID value of 4 is proposed for the Rich Template Set.
					</t>
					<t hangText="Length">
						<vspace blankLines="0" />
						Total length of this set in bytes, as defined in <xref target="RFC5101"/>.
					</t>
					<t hangText="Padding">
						<vspace blankLines="0" />
						OPTIONAL padding, as defined in <xref target="RFC5101" />.
					</t>
				</list>
			</t>
			<t>
				The Rich Template Record field definitions are as follows:
				<list style="hanging">
					<t hangText="Template ID">
						<vspace blankLines="0" />
						Template ID of this Rich Template Record. As defined in <xref target="RFC5101"/>, this value MUST be greater than 255. 
					</t>
					<t hangText="Field Count">
						<vspace blankLines="0" />
						Number of regular fields that will be sent in subsequent Data Records using this Template, as defined in <xref target="RFC5101"/>.
					</t>
					<t hangText="Data Count">
						<vspace blankLines="0" />
						Number of fixed-value fields that will be sent in this Template.
					</t>
					<t hangText="Common Properties ID">
						<vspace blankLines="0" />
						Contains an identifier that can be referred to by commonPropertiesId Information Elements, as introduced in <xref target="I-D.ietf-ipfix-reducing-redundancy"/>.
					</t>
					<t hangText="Field N Specifier">
						<vspace blankLines="0" />
						Information Element identifier, Field length and an Enterprise Number (if applicable) of field N. Refer to <xref target="RFC5101"/> for more information on Field Specifiers.
					</t>
					<t hangText="Data M Specifier">
						<vspace blankLines="0" />
						Same as "Field N Specifier", but used for Common Properties of all Data Records of this Template. Together with Data M Value, a similar encoding like TLV (type-length-value) is achieved.
					</t>
					<t hangText="Data M Value">
						<vspace blankLines="0" />
						Bit representation of a Common Property as would be transmitted in a Data Record.
						<vspace blankLines='100' />
					</t>
				</list>
			</t>
		</section>
		<section anchor="ipfix-extension-dt-examples" title="Use of the Rich Template in Flow Aggregation">
			<t>
				The Rich Template is well-suited for use in flow aggregation, as introduced in <xref target="I-D.dressler-ipfix-aggregation" />.
				<xref target="field-modifier-export" /> illustrates the relationship between a flow aggregator's field modifiers and patterns on the one hand, and the resulting regular and fixed-value fields in the Rich Template on the other hand.
				It can be seen that the analyzer is able to deduce all instructions of the Aggregation Rule considering the structure of the Rich Template, except the combination "discard without pattern" that does not result in any field.
			</t>
			<texttable anchor="field-modifier-export" title="Relation between field modifiers, Flow Records, and Rich Templates">
				<ttcol>field modifier</ttcol><ttcol>pattern</ttcol><ttcol>field in Flow Record</ttcol><ttcol>fixed-value field in Rich Template</ttcol>
				<c>discard</c><c>no</c><c>N/A</c><c>N/A</c>
				<c>discard</c><c>yes</c><c>N/A</c><c>yes, contains pattern</c>
				<c>keep</c><c>no</c><c>yes</c><c>N/A</c>
				<c>keep</c><c>yes</c><c>yes, if pattern specifies a range of values</c><c>yes, contains pattern</c>
				<c>mask</c><c>no</c><c>yes, IP network address</c><c>N/A</c>
				<c>mask</c><c>yes</c><c>yes, IP network address</c><c>yes, contains pattern</c>
			</texttable>
			<t>
				Assume, for example, the concentrator was given the Aggregation Rule shown in <xref target="example-rule-1" />.
			</t>
			<texttable anchor="example-rule-1" title="Example Rule">
				<ttcol>IPFIX&nbsp;Field</ttcol><ttcol>Filtering</ttcol><ttcol>Aggregation</ttcol>
				<c>sourceIPv4Address</c><c>192.0.2.0/28</c><c>discard</c>
				<c>destinatonTransportPort</c><c></c><c>keep</c>
				<c>packetDeltaCount</c><c></c><c>aggregate</c>
			</texttable>
			<t>
				<vspace blankLines='100' />
				Based on the Aggregation Rule, the concentrator would now first send a corresponding Rich Template Record as shown in <xref target="RichTemplate.ex.dt" />.
			</t>
			<texttable anchor="RichTemplate.ex.dt" title="Rich Template used">
				<ttcol>Field</ttcol><ttcol>Value</ttcol>
				<c>Template ID</c><c>10001</c>
				<c>Field Count</c><c>2</c>
				<c>Data Count</c><c>2</c>
				<c>Common Properties ID</c><c>0</c>
				<c>Field 1 Type</c><c>Destination Port</c>
				<c>Field 2 Type</c><c>Packets</c>
				<c>Data 1 Type</c><c>Source IP Prefix</c>
				<c>Data 2 Type</c><c>Source IP Mask</c>
				<c>Data 1 Value</c><c>192.0.2.0</c>
				<c>Data 2 Value</c><c>28</c>
			</texttable>
			<t>
				Assume further that the concentrator receives the Flow Records shown in <xref target="RichTemplate.ex.in" />.
			</t>
			<texttable anchor="RichTemplate.ex.in" title="Incoming Flows">
				<ttcol>Source IP</ttcol><ttcol>Source Port</ttcol><ttcol>Destination IP</ttcol><ttcol>Destination Port</ttcol><ttcol>Packets</ttcol>
				<c>192.0.2.1</c><c>64235</c><c>192.0.2.101</c><c>80</c><c>10</c>
				<c>192.0.2.2</c><c>64236</c><c>192.0.2.102</c><c>110</c><c>10</c>
				<c>192.0.2.3</c><c>64237</c><c>192.0.2.103</c><c>80</c><c>10</c>
				<c>192.0.2.101</c><c>64238</c><c>192.0.2.1</c><c>80</c><c>10</c>
				<c>192.0.2.102</c><c>64239</c><c>192.0.2.2</c><c>80</c><c>10</c>
			</texttable>
			<t>
				The concentrator would then export Data Records of this type, which contain the Compound Flows resulting from aggregation.
				Note that the Flows' Common Property, having a source IP address in 192.0.2.0/28, was already transmitted in the Rich Template Record and is thus not included in Data Records.
				<vspace blankLines='100' />
				The exported Data Records, shown in <xref target="RichTemplate.ex.agg" />, only contain the aggregated packet counts and the destination port, the latter being the only discriminating Flow Key property.
			</t>
			<texttable anchor="RichTemplate.ex.agg" title="Aggregated Flows">
				<ttcol>Destination Port</ttcol><ttcol>Packets</ttcol>
				<c>80</c><c>20</c>
				<c>110</c><c>10</c>
			</texttable>
		</section>
		<section title="Security considerations">
			<t>
				This document introduces a new IPFIX Template Set, a variation on the Template Set and data types introduced in <xref target="RFC5101"/> and <xref target="I-D.ietf-ipfix-reducing-redundancy"/>. No additional security considerations apply.
			</t>
		</section>
		<section title="IANA Considerations">
			<t>
				Use of the Rich Template Set requires one new IPFIX Set ID to be assigned. 
			</t>
		</section>
	</middle>
	<back>
		<references title="Normative References">
			&rfc2119;
			&RFC5101;
			&ipfixreducingredundancy;
			&ipfixaggregation;
		</references>
	</back>
</rfc>
