5.4. MIB Field Options Template Formats
5.4.1. Data Template Containing a mibObjectValue Field
The Template Record format of a Template that uses a mibObjectValue Information Element is identical to the standard IPFIX format as defined in [RFC7011], so a field using a mibObjectValue Information Element is specified using standard IPFIX Field Specifiers per [RFC7011]. The only extra requirement on a Template Record using one or more mibObjectValue Information Elements is that it MUST export the required metadata specified in Section 5.3.1 for EACH mibObjectValue Information Element. If multiple MIB Field Options Data Records that refer to a mibObjectValue are received, the latest MUST be used. This matches the expected behavior of IPFIX Templates. There is a one-to-one mapping between each mibObjectValue Information Element and a MIB Field Options Data Record. A MIB Field Options Template and corresponding Data Record MUST be exported to provide the minimum required metadata.
Figure 4 shows an IPFIX Template Set using a mibObjectValue Information Element. 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 = 2 | Length = 16 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| IE = Existing IPFIX Field | Field Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| IE = <mibObjectValue> | Field Length (MIB) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 4: IPFIX Template Set Using mibObjectValue Information Element Where: <mibObjectValue> One of the mibObjectValue IPFIX Information Elements that denotes that MIB object data (i.e., the value of a MIB object) will be exported in the (Options) Data Record. This could be any one of the mibObjectValue Information Elements defined in Section 11.2.1: mibObjectValueInteger, mibObjectValueOctetString, mibObjectValueOID, mibObjectValueBits, mibObjectValueIPAddress, mibObjectValueCounter, mibObjectValueGauge, mibObjectValueTimeTicks, mibObjectValueUnsigned, mibObjectValueTable, and mibObjectValueRow. When a mibObjectValue Information Element is used, the MIB Object Identifier ("mibObjectIdentifier") MUST be exported via a MIB Field Options Template and MIB Field Options Data Record. See Section 5.3.1. Field Length (MIB) The length of the encoded MIB object data in the corresponding Data Records, in octets. See [RFC7011] for a detailed definition. Note that the Field Length can be expressed using reduced-size encoding per [RFC7011]. Note that the Field Length may be encoded using variable-length encoding per [RFC7011].
5.4.2. MIB Field Options Template
The MIB Field Options Template is a standard Options Template that defines the fields that will be exported to provide enough metadata about a mibObjectValue Information Element so that the Collector can tie the data values in the mibObjectValue Information Element back to the definition of the MIB object. All MIB Field Options Templates contain the fields specified in Section 5.3.1. Figure 5 shows the required fields to export a mibObjectIdentifier for the MIB Field Options Template format. 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 = 3 | Length = 22 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 5: MIB Field Options Template Format - Required Fields Where: templateId The first Scope Field is an IPFIX Information Element that denotes that a Template Identifier will be exported as part of the MIB Field Options Data Record. This Template Identifier, paired with an index into that Template (the "informationElementIndex" field), uniquely references one mibObjectValue Information Element being exported.
informationElementIndex The second Scope Field is an IPFIX Information Element that denotes a zero-based index into the fields defined by a Template. When paired with a "templateId", this uniquely references one mibObjectValue Information Element being exported. mibObjectIdentifier An IPFIX Information Element that denotes the MIB Object Identifier for the mibObjectValue Information Element exported in the (Options) Template Record. When a MIB Object Value Information Element is used, the MIB Object Identifier MUST be specified in the MIB Field Options Template Record or specified by other means. The Object Identifier is encoded in the IPFIX Data Record in ASN.1/BER [X.690] format. Variable-length encoding SHOULD be used with the mibObjectIdentifier so that multiple MIB OIDs of different lengths can be exported efficiently. This will also allow reuse of the MIB Field Options Template. Variable-length encoding is indicated by the Field Length value of 65535, per Sections 3.2 and 7 of [RFC7011]. The RECOMMENDED use of variable-length encoding for mibObjectIdentifier fields is indicated in subsequent figures by placing 65535 in the relevant length fields.5.4.3. MIB Field Options Data Records
The MIB Field Options Data Records conform to the Template Specification in the MIB Field Options Template. There may be multiple MIB Field Options Data Records exported. The Collecting Process MUST store all received MIB Field Options Data information for the duration of each Transport Session, because the Collecting Process will need to refer to the extra meta-information to fully decode each mibObjectValue Information Element.
Figure 6 shows the format of the exported MIB Field Options Data Record, detailing the metadata that will be exported to match the Template in Figure 5. 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 | Length = N | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | templateId | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLEN | mibObjectIdentifier ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... mibObjectIdentifier (continued) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | templateId | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLEN | mibObjectIdentifier ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... mibObjectIdentifier (continued) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 6: Format of MIB Field Options Data Record VLEN contains the variable length of the mibObjectIdentifier per Section 7 of [RFC7011].5.4.4. Options Template Containing a mibObjectValue Field
The Options Template Record format of a Template that uses a mibObjectValue Information Element is identical to the standard format as defined in [RFC7011]. The mibObjectValue Information Element is specified using standard Field Specifiers per [RFC7011]. A mibObjectValue Information Element can be either a Scope Field or a non-Scope Field in an Options Template Record. The only extra requirement on an Options Template Record using one or more mibObjectValue Information Elements is that it MUST export the required metadata specified in Section 5.3.1 for EACH mibObjectValue Information Element. An IPFIX Options Template Record MUST export a MIB Field Options Template and Data Record to provide the minimum required metadata for each mibObjectValue Information Element.
Figure 7 shows an IPFIX Options Template Set using an existing IPFIX field as a Scope Field and with a mibObjectValueInteger Information Element as a non-Scope Field, while Figure 8 shows an IPFIX Options Template Set using a mibObjectValueInteger Information Element as a Scope Field with an existing IPFIX field as a non-Scope Field. 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 = 3 | Length = 18 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 1 |0| IE = Existing IPFIX Field | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = mibObjectValueInteger | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 7: IPFIX Options Template Set Using a Non-Scope mibObjectValueInteger Field 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 = 3 | Length = 18 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 1 |0| IE = mibObjectValueInteger | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = Existing IPFIX Field | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 8: IPFIX Options Template Set Using a Scope mibObjectValueInteger Field
5.4.5. MIB Field Options Template with Semantics Fields
A MIB Field Options Template MAY specify that extra Information Elements will be exported to record how the mibObjectValue was collected. Alternatively, one of the existing IPFIX observationTime* elements [IANA-IPFIX] may be exported to specify exactly when the value was collected. Figure 9 shows the MIB Field Options Template for a non-columnar field with Semantic Data. 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 = 3 | Length = 26 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibCaptureTimeSemantics| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 9: MIB Field Options Template for a Non-columnar Field with Semantic Data Where: mibObjectIdentifier Note the use of variable-length encoding for this field. mibCaptureTimeSemantics The MIB Capture Time Semantics IPFIX Information Element, as defined in Section 11.2.2.4. It is RECOMMENDED to include this field when exporting a mibObjectValue Information Element that specifies counters or statistics, particularly for situations with long-lived Flows.
5.4.6. MIB Field Options Template with Extra MIB Object Details
The OID exported within the mibObjectIdentifier IPFIX Information Element provides an OID reference to a MIB object type definition that will fully describe the MIB object data being exported. However, an Exporting Process MAY decide to include some extra fields to more fully describe the MIB object that is being exported with a mibObjectValue Information Element. This can be helpful if the Collecting Process may not have access to the MIB module. The Exporting Process can either include the fields with extra object details as part of the MIB Field Options Template or export a separate Options Template and a Data Record that maps MIB OIDs in mibObjectIdentifier fields to the object details. If only a few fields are being exported, then including extra type data in the MIB Field Options export will be more efficient.
The MIB Field Options Template for a non-columnar field with extra MIB object details is shown in Figure 10. 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 = 3 | Length = 38 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 7 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectSyntax | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectName | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectDescription | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibModuleName | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 10: MIB Field Options Template for a Non-columnar Field with Extra MIB Object Details Where: mibObjectSyntax The MIB object syntax string as defined in Section 11.2.3.3. Note that a separate mibObjectSyntax Information Element is required (rather than extend the existing "IPFIX Information Elements" subregistry [IANA-IPFIX] that contains informationElementDataType) because the SYNTAX clause could contain almost any name. mibObjectName The textual name of a mibObjectIdentifier object.
mibObjectDescription The textual description for a mibObjectIdentifier. mibModuleName The textual name of the MIB module that defines a MIB object. Note the use of variable-length encoding for the mibObjectIdentifier, mibObjectSyntax, mibObjectName, mibObjectDescription, and mibModuleName, since these are all string fields. The MIB details can be exported in Data Records specified using a regular IPFIX Options Template Record [RFC7011], as shown in Figure 11. This may be more efficient, as the bulk of this data is text based and SHOULD be exported only once to the Collecting Process if there are many MIB objects being exported. This prevents this large textual data from being included for every use of a mibObjectValue Information Element. 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 = 3 | Length = 30 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 1 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectSyntax | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectName | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibObjectDescription | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 |0| IE = mibModuleName | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 11: Alternative mibObjectIdentifier Options Template Set with Object Details
5.5. Use of Field Order in the MIB Field Options Template
The MIB Field Options Template export makes use of the informationElementIndex [IANA-IPFIX] to specify which field in the Template the metadata relates to; this avoids any ordering constraints on the Data Template. The mibObjectValue Information Elements in an IPFIX export can be in any order in the export packet. However, fields used as an INDEX MUST be in the same order as the order specified in the INDEX clause of the conceptual row MIB object. The informationElementIndex specifies which field in the Template extra information is being provided for. This is analogous to standard IPFIX Template Sets, which also specify the order of the fields and provide their type and size. If the Template changes such that the order is different, then the MIB Field Options Data MUST be resent to reflect the new ordering. A new Template ID MUST be used to reflect that the ordering has changed. Older MIB Field Options Data may refer to the incorrect field. A templateId [IANA-IPFIX] is only locally unique within a combination of an Observation Domain and Transport Session. As such, each MIB Field Options Data Record can only refer to templateIds within the same Observation Domain and session.5.6. Identifying the SNMP Context
Each MIB OID is looked up in a specific context, usually the default context. If exporting a MIB OID value that isn't in the default context, then the context MUST be identified by including the mibContextEngineID (see Section 11.2.2.5) and mibContextName (see Section 11.2.2.6) fields in the MIB Field Options Template and associated MIB Field Options Data Records, or be included in the same Template as the mibObjectValue field. This context data MUST be included for each field that is not in the default context. The context information MAY be exported as part of the Template that includes the mibObjectValue Information Element, or the context information MAY be exported in the MIB Field Options Data Record that refers to the field. Context fields exported in the same Template MUST take precedence over those that refer to the Template. Context fields MUST apply to all mibObjectValue Information Elements in the same Template, and there MUST NOT be duplicates of mibContextName or mibContextEngineID in a Template.
So, a MIB Field Options Template MAY specify no context information, just the context engine ID or both the context engine and context name. This allows the Exporter to export the bulk of data in the default context and only tag those items that are required. Since the MIB Field Options Template applies for all the Data Records of a Template, using context fields in the MIB Field Options Data Template requires that each mibContextEngineID / mibContextName pair have its own Template.5.7. Template Management
Templates are managed as per Section 8 of [RFC7011], with the additional constraint that the MIB Field Options Template and MIB Field Options Data Records MUST be exported in the same IPFIX Message as any (Options) Template Record that uses a mibObjectValue Information Element. When exporting over a Stream Control Transmission Protocol (SCTP) transport [RFC4960], the MIB Field Options Data Records MUST be exported reliably and in the same SCTP stream as their associated Templates per [RFC6526]. If a Template using a mibObjectValue Information Element is resent for any reason, the Data Records it depends on MUST be sent as well. If a Template is replaced with a new (Options) Template, then a new MIB Field Options Data Record MUST be sent with the replacement referencing the new Template ID. An Exporting Process SHOULD reuse MIB Field Options Template IDs when the Templates are identical. Each (Options) Template Record MUST still be accompanied by a copy of the MIB Field Options Template.5.7.1. Large Messages
The requirement to export the MIB Field Options Template and MIB Field Options Data Records in the same IPFIX Message as any (Options) Template Record that uses a mibObjectValue Information Element may result in very large IPFIX Messages. In environments with restricted Message sizes, and only when a reliable SCTP transport is being used, the MIB Field Options Template, MIB Field Options Data, Data Template, and Data Records MAY be exported in separate Messages in the same SCTP stream, provided that their order is maintained.
5.7.2. Template Withdrawal and Reuse
Data Records containing mibObjectValue Information Elements MUST NOT be exported if their corresponding Data Template or MIB Field Options Template has been withdrawn, since the MIB Field Options Template MUST be exported in the same IPFIX Message as the Data Template that it annotates, except as allowed by the caveat mentioned in Section 5.7.1. MIB Field Options Template IDs MUST NOT be reused while they are required by any existing Data Templates.5.8. Exporting Conceptual Rows and Tables
There are three approaches for an IPFIX Exporting Process to export the values of columnar objects: 1. Ignoring the indexing of columnar objects 2. Exporting conceptual rows / table objects using IPFIX Structured Data [RFC6313] 3. Exporting individual indexed columnar objects Firstly, a subordinate columnar object may be used purely as a data type. In this case, there is no index information or relation to a conceptual row object provided by the Exporting Process. Secondly, mibObjectValueRow or mibObjectValueTable can be used to export partial or complete conceptual rows, using IPFIX Structured Data [RFC6313]. Thirdly, in a mixed option/data IPFIX/MIB Template, the mibObjectValue Information Element can have the values of the INDEX clause of the conceptual row provided by other fields in the Data Record. In this case, each mibObjectValue Information Element must specify which other field(s) in the Template is providing the index information.
5.8.1. Exporting Conceptual Rows - Indexing
This document defines two forms of indexing that can be used for conceptual row MIB objects: Indexing based on IPFIX Structured Data [RFC6313] is used solely by the mibObjectValueRow Information Element. Each conceptual row of the MIB object corresponds to a single Data Record exported. The index fields defined in the INDEX clause of the MIB object MUST all be present in the same order as the Scope Fields. This allows a simple table export of a conceptual row MIB object without any extra fields required to indicate which fields make up the conceptual row INDEX. Field-based indexing is used by giving each mibObjectValue Information Element a mibIndexIndicator to flag the required index fields. This allows complex indexing or mixing of existing IPFIX Information Elements with MIB fields, with minimum overhead. It also allows multiple columnar MIB objects from different conceptual rows to be exported with complete indexing in one IPFIX Template.5.8.2. Exporting Conceptual Rows - mibObjectValueRow
The simplest approach to exporting a complete or partial conceptual row object is done with the mibObjectValueRow Information Element. This is an IPFIX Structured Data subTemplateList Information Element as detailed in [RFC6313]. The Template specified MUST be an Options Template. It also MUST have the fields specified in the INDEX clause of the conceptual row object as the Scope Fields in the MIB Field Options Template and Data Set. An overview of this architecture is given in Figure 12. This shows that the full MIB object type definition OID is exported for the mibObjectValueRow conceptual row field but that the individual columnar objects only require the sub-identifier to be exported. To make the diagram clearer, the Templates for the MIB Field Options Templates are not shown.
+---------------------------+ +------------------------+ | Data Template | | MIB Field Options Data | | | | | | mibObjectValueRow |<---| OID | +---------------------------+ +------------------------+ | | +-----------------------+ +------------------------+ | | Options Template | | MIB Field Options Data | | | | | | | | Scope mibObjectValue* |<---| mibSubIdentifier | | | mibObjectValue* |<---| mibSubIdentifier | | +-----------------------+ +------------------------+ | | V V +---------------------------+ | Data Flows | | | | subTemplateList (1 entry) | +---------------------------+ Figure 12: Architecture for Exporting Conceptual Rows with mibObjectValueRow The mibIndexIndicator is not required for each individual mibObjectValue Information Element, as mibObjectValueRow provides a structure that includes the index details. When indexing based on IPFIX Structured Data [RFC6313] is used, all Scope Fields MUST be the INDEX objects in the same order as defined in the INDEX clause of the conceptual row being exported. Each conceptual table MIB object has two related OIDs. There is an OID that refers to the table with the syntax of SEQUENCE OF and an OID that refers to each entry or conceptual row with the syntax of SEQUENCE. The OID for the SEQUENCE of a conceptual row MUST be exported. For example, in the IF-MIB [RFC2863], the OID for ifEntry should be exported rather than the OID for ifTable. The OID for the table (in this case, ifTable) can be derived by removing one sub-identifier from the ifEntry OID. The full OID for the conceptual row MIB object type definition being exported with the mibObjectValueRow Information Element MUST be exported. However, the fields that are members of the conceptual row need not have the full OID of their MIB object type definition exported. Instead, the mibSubIdentifier Information Element can be used to document which entry in the conceptual row the field is.
In this case, the exported Flow will contain a single complete or partial row from a table inside a single field of the Data Record. There may be MIB objects that are specified in the INDEX of the conceptual row but not columnar objects of the same conceptual row; for these, the Exporter MUST provide the full OID in a mibObjectIdentifier field. So, for a conceptual row object with the OID "1.2.3.4.5.6" the OID of the type definitions for columnar objects "1.2.3.4.5.6.1" "1.2.3.4.5.6.2" can be exported with just a mibSubIdentifier of "1" and "2", respectively. The mibObjectValue Information Elements exported using the mibObjectValueRow export MUST all either be objects defined in the INDEX clause, columnar objects of the same conceptual row object, or columnar objects that augment the same conceptual row. The IPFIX Structured Data [RFC6313] subTemplateList format requires the Structured Data Type Semantics to be specified. Unless there is a more appropriate option in the "IPFIX Structured Data Types Semantics" subregistry [IANA-IPFIX], the "undefined" Structured Data Type Semantics can be used. Figure 13 shows an IPFIX Template for an IPFIX Structured Data [RFC6313] export of a conceptual row, while Figure 14 shows an IPFIX Options Template for a complete conceptual row with five columns and two index fields. Figure 15 shows the MIB Field Options Template for a conceptual row field. Figure 16 shows the MIB Field Options Template for the columns inside the conceptual row. Figure 17 shows the OID Data for the conceptual row that will be exported. 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 = 2 | Length = 12 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID = 300 | Field Count = 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| IE = mibObjectValueRow | Field Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 13: IPFIX Template for a Conceptual Row
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 = 3 | Length = 30 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID = 301 | Field Count = 5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = mibObjectValue INDEX1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = mibObjectValue INDEX2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = mibObjectValue COLUMN3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = mibObjectValue COLUMN4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length |0| IE = mibObjectValue COLUMN5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 14: IPFIX Options Template for a mibObjectValueRow with Five Columns and Two Index Fields 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 = 3 | Length = 22 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID = 302 | Field Count = 3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 15: MIB Field Options Template for a Conceptual Row Object
Where: templateId The templateId for the MIB option that will be exported. mibObjectIdentifier The MIB OID for the conceptual row that is being exported. Note the use of variable-length encoding for this field. 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 = 3 | Length = 22 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID = 303 | Field Count = 3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibSubIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 16: MIB Field Options Template for Columnar Objects of a Conceptual Table Where: templateId The templateId used will be for the Template referred to in the subTemplateList of the mibObjectValueRow that will be exported. mibSubIdentifier The sub-identifier that specifies the columnar object's ID within the conceptual row.
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 = 302 | Length = N | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID = 300 | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLEN | mibObjectIdentifier ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... mibObjectIdentifier (continued) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Set ID = 303 | Length = N | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | templateId = 301 | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | mibSubIdentifier | templateId = 301 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | informationElementIndex | mibSubIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | templateId = 301 | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | mibSubIdentifier | templateId = 301 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | informationElementIndex | mibSubIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | templateId = 301 | informationElementIndex | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | mibSubIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 17: mibOption Data Record for the Conceptual Row Where: mibObjectIdentifier Will contain the OID for the conceptual row as a whole. mibSubIdentifier The mibSubIdentifier fields will contain the extra sub-identifier that, when added to the OID for the conceptual row, gives the full OID for the object.
5.8.3. Exporting Conceptual Rows - AUGMENTS
SMIv2 defines conceptual rows as having either an INDEX clause or an AUGMENTS clause. Conceptual row definitions with an AUGMENTS clause extend an existing base conceptual row with an INDEX clause. It is not possible in SMIv2 to augment a conceptual row that itself has an AUGMENTS clause. The base table and the augmentation have an identical INDEX. Since augmentations allow adding extra columns to existing tables, it is beneficial to be able to support them easily in IPFIX exports of conceptual rows. The mibObjectValueRow OID MAY refer to either the base table with the INDEX clause or a conceptual row with an AUGMENTS clause. The mibSubIdentifier in any MIB Field Options Data Record MUST always refer to the OID exported for the mibObjectValueRow Information Element. If the mibObjectValueRow OID refers to a base table, then any extra columns from conceptual rows with an AUGMENTS clause MUST have their full OID exported. If the mibObjectValueRow OID refers to a conceptual row that augments another conceptual row using the AUGMENTS clause, then any MIB fields from the original table's INDEX or columnar objects MUST NOT use the mibSubIdentifier and MUST instead export the full OID in a mibObjectIdentifier. If the mibObjectValueRow refers to an augmenting conceptual row, the Scope Fields of the Template used in the subTemplateList MUST have the index fields from the base table, in the same order as its scope. This is identical to the Scope Field requirements for conceptual rows with an INDEX clause. This flexibility is provided so that the conceptual rows with the most columns can be exported using the more efficient mibSubIdentifier. For example, exporting a complete set of augmentation columns would only require the full OIDs for the MIB objects in the INDEX. It is possible to export MIB object columns from multiple augmenting conceptual rows. If this is done, then the base table SHOULD be used as the main OID for the mibObjectValueRow.
5.8.4. Exporting Conceptual Tables - mibObjectValueTable
Multiple rows of a conceptual table can be exported in the mibObjectValueTable Information Element (Section 11.2.1.10). This allows a set of conceptual rows corresponding to a conceptual table to be exported as a single field. Therefore, a complete set of rows can be exported as a single field with other Information Elements in a Template. In this fashion, several complete conceptual tables could be exported in one packet. As also specified for mibObjectValueRow (Section 5.8.2), the more specific (i.e., full) OID of the SEQUENCE entity MUST be exported. The format of mibObjectValueTable is identical to mibObjectValueRow, except that the length of the subTemplateList may be zero or more entries. All the other, i.e., non-length, requirements for mibObjectValueRow in Section 5.8.2 apply to mibObjectValueTable. An overview of this architecture is given in Figure 18. This architecture is similar to the architecture shown in Figure 12. +---------------------------+ +------------------------+ | Data Template | | MIB Field Options Data | | | | | | mibObjectValueTable |<---| OID | +---------------------------+ +------------------------+ | | +-----------------------+ +------------------------+ | | Options Template | | MIB Field Options Data | | | | | | | | Scope mibObjectValue* |<---| mibSubIdentifier | | | mibObjectValue* |<---| mibSubIdentifier | | +-----------------------+ +------------------------+ | | V V +-----------------------------+ | Data Flows | | | | subTemplateList (n entries) | | row 1 | | ... | | row n | +-----------------------------+ Figure 18: Architecture for Exporting Conceptual Tables with mibObjectValueTable
5.8.5. Exporting Columnar Objects: Using mibIndexIndicator
The other option for indexing a columnar object that is part of a conceptual table is explicit indexing. In this case, the Options Template Set scope may contain either non-index fields or columnar MIB objects from multiple conceptual rows being exported. In this case, each mibObjectValue Information Element requires the mibIndexIndicator with the bits set for the fields that are used to index that individual columnar object. The index fields MUST be in the "correct" order as defined in the conceptual row that each columnar object is a member of. If a mibObjectValue Information Element that is being indexed using mibIndexIndicator is being used as an Options Template Scope Field, then all fields used to index that field MUST also be Scope Fields. Figure 19 shows the MIB Field Options Template for an indexed MIB columnar object. 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 = 3 | Length = 26 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Template ID | Field Count = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Scope Field Count = 2 |0| IE = templateId | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = informationElementIndex| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibIndexIndicator | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 2 |0| IE = mibObjectIdentifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Length = 65535 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 19: MIB Field Options Template for an Indexed MIB Columnar Object
Where: mibIndexIndicator The MIB Index Indicator IPFIX Information Element that marks which fields in the Data Record will act as INDEX values for the exported MIB object. The index data for a mibObjectValue will be other fields contained in the same Data Record. The mibIndexIndicator marks the fields whose value(s) should be added to the OID for the MIB object type definition exported in mibObjectIdentifier to get the OID for the instance of the MIB object. Elements used to index MIB objects MUST be exported in the same order as they are specified in the index field of the conceptual table they belong to. mibObjectIdentifier Note the use of variable-length encoding for this field.