| Internet-Draft | IPFIX MultiLayer | March 2026 |
| Liu & Zhou | Expires 2 October 2026 | [Page] |
This document analyzes the requirements and problems when monitoring flows with multi-layer network encapsulations. This document aims to solve this problem by updating RFC7011 and introducing new IPFIX IEs for encapsulation layer indication.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 2 October 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
A packet may have multi-layer network encapsulations, and each layer may use the same or different network encapsulation headers. e.g, IP in IP encapsulation [RFC2003], which is an IP tunneling mechanism that encapsulates one IP packet in another IP packet, typical IP-in-IP scenario includes IPv4-in-IPv4, IPv6-in-IPv6, IPv4-in-IPv6 and IPv6-in-IPv4.¶
With the deployment of SRv6, the appearance of packets with IPv4-in-IPv6 or IPv6-in-IPv6 encapsulation becomes more and more common in the network. And there may be more than two network encapsulation layers in one packet as analyzed in section 3.1.¶
When monitoring a traffic flow with multiple encapsulations, e.g IP-in-IP, a typical use case is to answer the following questions:¶
However, based on the existing IPFIX mechanisms, it is not easy to differentiate between IEs of different encapsulation layers.¶
This document aims to solve this problem by updating [RFC7011] and introducing new IPFIX IEs for encapsulation layer indication.¶
[Editor's Note]This version provides two alternative options to indicate the encapsulation layer information for discussion.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document makes use of the terms defined in [RFC7011], [RFC8402] and [RFC8754].¶
The following terms are used as defined in [RFC7011]:¶
The following terms are used as defined in [RFC8402]:¶
The following terms are used as defined in [RFC8754]:¶
There may be more than two network encapsulation layers in one packet. As shown in the figure below.¶
+---+ +---+ +---+ +---+ +---+ +---+ |PE1|--|R1 |--|T1 |--|R2 |--|R3 |--|PE2| +-+-+ +---+ +---+ +---+ +---+ +---+ | | +-+-+ +-+-+ |CE1| |CE1| +---+ +---+¶
CE1 sends IPv6 packets to CE2.¶
Packet leaving CE1: IPv6<SA=CE1,DA=CE2>¶
PE1 performs SRv6 function H.Encaps with SRv6 Policy, and the corresponding SID list is <SID-R1,SID-T1,SID-PE2>, wherein SID-T1 is a BSID initiated on node T1.¶
Packet leaving PE1: IPv6<SA=PE1,DA=SID-R1><SID-R1,SID-T1,SID-PE2>IPv6<SA=CE1,DA=CE2>¶
When the packet arrives at T1, based on BSID SID-T1 , T1 performs End.B6.Encaps [RFC8986] and encapsulate the third IPv6 header onto the packet with the corresponding SID list <SID-R2,SID-R3>.¶
Packet leaving T1:IPv6<SA=T1,DA=R2><SID-R2,SID-R3>IPv6<SA=PE1,DA=SID-PE2>lt;SID-R1,SID-T1,SID-PE2>IPv6<SA=CE1,DA=CE2>¶
So the packet observed at node R2 has three IPv6 headers in it.¶
Based on different goals of the network monitor, the data collection scenario may include one of the following:¶
Based on the scenarios described in section 3.1, the information collection requirements in IPFIX for multi-layer encapsulated packets include:¶
For Req-a, [RFC7011] specifies that, if an Information Element is required more than once in a Template, the different occurrences of this Information Element SHOULD follow the logical order of their treatments by the Metering Process, but it can not be guaranteed that all the implementations follow this rule since there is not a "MUST" in the specification in [RFC7011].¶
This document updates section 8 of [RFC7011] by specifying mandatory rules when an Information Element is required more than once in a Template. The rules are:¶
If an Information Element is required more than once in a Template, the different occurrences of this Information Element MUST follow the logical order of their treatments by the Metering Process. For example, if a selected packet goes through two hash functions, and if the two hash values are sent within a single Template, the first occurrence of the hash value must belong to the first hash function in the Metering Process. For example, when exporting the two source IP addresses of an IPv4-in-IPv4 packet, the first sourceIPv4Address Information Element occurrence must be the IPv4 address of the outer header, while the second occurrence must be the address of the inner header. Collecting Processes MUST properly handle Templates with multiple identical Information Elements.¶
In the following subsections, two options are provided for encapsulation layer indication:¶
This section defines several Encapsulation Layer IEs for network encapsulation layer indication. When there is no need to differentiate between these IEs in this document, they will be collectively referred to as "encapsulation layer IE".¶
A new IE "encapLayerTop" is defined in this section to indicate which IEs in the IPFIX messages belongs to the outmost network encapsulation layer.¶
encapLayerTop¶
TBD1¶
A 16-bit identifier indicating that the IEs that follow immediately after it till the next Encapsulation Layer IE belong to the outmost network encapsulation layer (e.g, from the outmost Ethernet header to the first IP header). If there's not any other Encapsulation Layer IE exists in the Template, it means that all the IEs following encapLayerTop belong to the outmost network encapsulation layer. This IE has a fixed value of 0xFFFF.¶
unsigned16¶
identifier¶
This document.¶
A new IE "encapLayer2" is defined in this section to indicate which IEs in the IPFIX messages belongs to the second network encapsulation layer.¶
encapLayer2¶
TBD2¶
A 16-bit identifier indicating that the IEs that follow immediately after it till the next Encapsulation Layer IE belong to the second network encapsulation layer. If there's not any other Encapsulation Layer IE exists in the Template, it means that all the IEs following encapLayer2 belong to the second network encapsulation layer. This IE has a fixed value of 0xFFFF.¶
unsigned16¶
identifier¶
This document.¶
A new IE "encapLayer3" is defined in this section to indicate which IEs in the IPFIX messages belongs to the third network encapsulation layer.¶
encapLayer3¶
TBD3¶
A 16-bit identifier indicating that the IEs that follow immediately after it till the next Encapsulation Layer IE belong to the third network encapsulation layer. If there's not any other Encapsulation Layer IE exists in the Template, it means that all the IEs following encapLayer3 belong to the third network encapsulation layer. This IE has a fixed value of 0xFFFF.¶
unsigned16¶
identifier¶
This document.¶
A new IE "multiLayerEcapFields" is defined in this section as shown below. This IE supports to carry the header fields for packets with multiple layers of encapsulation.¶
multiLayerEcapFields¶
TBA1¶
subTemplateList¶
list¶
This document.¶
An example of the encoding of the IE "multiLayerEcapFields" is shown below for a traffic flow with IPv6-in-IPv6-in-IPv6 encapsulation, where the destination address of the outmost IPv6 header and the source address of the innermost IPv6 header are required to be exported, while the information of the second IPv6 header is not needed.¶
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 = multiLayerEcapFields | Field Length=65535 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 = 12 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 301 | Field Count = 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0|IE=destinationIPv6Address(28)| Field Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 = 12 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 302 | Field Count = 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| IE = sourceIPv6Address(27) | Field Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 = 300 | Length = N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 255 | List Length= 44 | semantic |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Top templateId=301 | Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 DA |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 DA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 DA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 DA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Second templateId=0 | Length = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Third templateId=302 | Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 SA |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 SA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 SA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv6 SA(continued) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
It should be noticed that the layer information on different exportors may be different, since the networking context might be different from each exporter and each exporter only knows the layer information locally.¶
To generate Flow Records with IEs for encapsulation layer included, the metering process SHOULD recognize the encapsulation layer of the corresponding fields in the packet. This is mainly based on local implementation and the details are out of the scope of this document.¶
The order of the IEs in the Template Records MUST be guaranteed when using encapLayerTop/encapLayer2/encapLayer3, that is, the IEs belonging to each encapsulation layer MUST immediately follow the corresponding encapsulation layer IE.¶
Each encapsulation layer IE SHALL NOT appear more than once in a Template. If there's more than one encapsulation layer IE of the same type in the Template, the Collecting Process MUST ignore the Template and the Collecting Process SHOULD log the error.¶
As in [RFC5012], the Information Elements are derived from fields of packets or from packet treatment. For IEs that are not related with header fields, whether they are covered by scope of the encapsulation layer IE, they SHOULD be processed following the existing specifications.¶
For IEs of Header Fields that are not in the scope of encapsulation layer IE, e.g, there're IEs of Header Fields in the Template before the appearance of Encapsulation Layer IEs, they SHOULD be processed properly based on the default behavior of the Collector, how the Collector would process them is out of the scope of this document.¶
Currently only three IEs are defined to meet the traffic monitoring requirements for packets of no more than three layers. If in the future , there're packets with four or five or more encapsulation layers in the network and the packet header information of each layer is required to be exported, more new IEs such as encapLayer4/encapLayer5 MAY be needed¶
Beside the templateId 0, if the templateId used by the multiLayerEcapFields IE in the data record doesn't exist, the collector SHOULD ingore the encapsulation layer this templateId represents and log an error, and it is RECOMMENDED to process the information of other layers normally.¶
For IEs of Header Fields that are not included the multiLayerEcapFields IE, they SHOULD be processed properly based on the default behavior of the Collector, how the Collector would process them is out of the scope of this document.¶
As in [RFC5012], the Information Elements are derived from fields of packets or from packet treatment. For IEs that are not related with header fields, whether they are included in the encapsulation layer IE, they SHOULD be processed following the existing specifications.¶
There are no additional security considerations regarding allocation of these new IPFIX IEs compared to [RFC7012].¶
For option 1, this document requests IANA to create new IEs under the "IPFIX Information Elements" registry [RFC7012] available at [IANA-IPFIX].¶
+-------+--------------------------------+
|Element| Name | Reference |
| ID | | |
+-------+-----------------+--------------+
| TBD1 | encapLayerTop |This document |
+-------+-----------------+--------------+
| TBD2 | encapLayer2 |This document |
+-------+-----------------+--------------+
| TBD3 | encapLayer3 |This document |
+-------+-----------------+--------------+
¶
For option 2, this document requests IANA to create new IEs under the "IPFIX Information Elements" registry [RFC7012] available at [IANA-IPFIX].¶
+-------+-----------------------------------+
|Element| Name | Reference |
| ID | | |
+-------+--------------------+--------------+
| TBA1 |multiLayerEcapFields|This document |
+-------+--------------------+--------------+
¶
The authors would like to thank Benoit Claise and Thomas Graf for their helpful comments and suggestions.¶