
= IPFIX
:description: Learn how the IPFIX UDP and TCP parsers in OpenNMS {page-component-title} accept packets from UDP/TCP listeners and forward them to an IPFIX adapter.

The IP Flow Information Export (IPFIX) protocol is a vendor-neutral standard for transmitting traffic flow information.
See <<operation:deep-dive/flows/introduction.adoc#ga-flow-support-introduction, Flow Support>> for details on flow support in {page-component-title}.

[[telemetryd-ipfix-parser-udp]]
== IPFIX UDP Parser

The IPFIX UDP parser accepts packets received by a <<telemetryd/listeners/udp.adoc#telemetryd-listener-udp, UDP listener>> and must forward them to an <<telemetryd-ipfix-adapter, IPFIX adapter>>.

The IPFIX UDP parser supports protocol detection.

=== Facts

[options="autowidth"]
|===
| Class Name          | `org.opennms.netmgt.telemetry.protocols.netflow.parser.IpfixUdpParser`
|===

=== Configuration and use

.Optional parameters for the IPFIX UDP Parser
[options="header" cols="1,3,1"]
|===
| Parameter
| Description
| Default

| templateTimeout
| Templates must be redeclared in the given duration or they will be dropped.
| 30 minutes

| maxClockSkew
| The maximum delta in seconds between exporter and Minion timestamps.
| 0

| clockSkewEventRate
| Used to rate-limit clock skew events in seconds.
| 3600

| dnsLookupsEnabled
| Used to enable or disable DNS resolution for flows.
| true

| sequenceNumberPatience
| A value > 1 enables checking for sequence number completeness.
The value gives the size of the history buffer allowing flows to be processed out of order.
| 32

| flowActiveTimeoutFallback
| Fallback value for active flow timeout, if value is not included in exported flows.
| none

| flowInactiveTimeoutFallback
| Fallback value for inactive flow timeout, if value is not included in exported flows.
| none

| flowSamplingIntervalFallback
| Fallback value for sampling interval, if value is not included in exported flows.
| none
|===
NOTE: The parameter `maxClockSkew` in your parser definition enables clock skew detection for exporters.
It specifies the maximum delta in seconds between exporter and Minion timestamps.
If exceeded, an alarm will be generated for the exporting device.
The default value is 0, so clock skew detection is disabled.
Furthermore, you can use the `clockSkewEventRate` parameter to rate limit clock skew events.
The default is `3600` seconds, so every hour an event will be sent.

[[telemetryd-ipfix-parser-tcp]]
== IPFIX TCP Parser

The IPFIX TCP parser accepts packets received by a <<telemetryd/listeners/tcp.adoc#telemetryd-listener-tcp, TCP Listener>> and must forward them to an <<telemetryd-ipfix-adapter, IPFIX adapter>>.

=== Facts

[options="autowidth"]
|===
| Class Name          | `org.opennms.netmgt.telemetry.protocols.netflow.parser.IpfixTcpParser`
|===

=== Configuration and use

.Optional parameters for the IPFIX TCP Parser
[options="header" cols="1,3,1"]
|===
| Parameter
| Description
| Default

| maxClockSkew
| The maximum delta in seconds between exporter and Minion timestamps.
| 0

| clockSkewEventRate
| Rate limits clock skew events, in seconds.
| 3600

| dnsLookupsEnabled
| Enables or disables DNS resolution for flows.
| true

| sequenceNumberPatience
| A value > 1 enables checking for sequence number completeness.
The value gives the size of the history buffer allowing flows to be processed out of order.
| 32

| flowActiveTimeoutFallback
| Fallback value for active flow timeout, if value is not included in exported flows.
| none

| flowInactiveTimeoutFallback
| Fallback value for inactive flow timeout, if value is not included in exported flows.
| none

| flowSamplingIntervalFallback
| Fallback value for sampling interval, if value is not included in exported flows.
| none
|===
NOTE: The parameter `maxClockSkew` in your parser definition enables clock skew detection for exporters.
It specifies the maximum delta in seconds between exporter and Minion timestamps.
If exceeded, an alarm will be generated for the exporting device.
The default value is 0, so clock skew detection is disabled.
Furthermore, you can use the `clockSkewEventRate`  parameter to rate limit clock skew events.
The default is `3600` seconds, so every hour an event will be sent.

== Configure IPFIX listener on a Minion

To enable and configure a TCP Listener for IPFIX on Minion, connect to the Karaf Console and set the following properties:

[source, console]
----
$ ssh -p 8201 admin@localhost
...
admin@minion()> config:edit --alias tcp-50000 --factory org.opennms.features.telemetry.listeners
admin@minion()> config:property-set name IPFIX
admin@minion()> config:property-set class-name org.opennms.netmgt.telemetry.listeners.TcpListener
admin@minion()> config:property-set parameters.port 50000
admin@minion()> config:property-set parsers.0.name IPFIX
admin@minion()> config:property-set parsers.0.class-name org.opennms.netmgt.telemetry.protocols.netflow.parser.IpfixParser
admin@minion()> config:update
----

NOTE: The protocol must also be enabled on {page-component-title} for the messages to be processed.
If you do not specify the queue name, the fallback is the name of the parser.

[[telemetryd-ipfix-adapter]]
== IPFIX adapter

The IPFIX adapter handles IPFIX telemetry data received and parsed by either the <<deep-dive/telemetryd-ipfix-parser-udp, IPFIX UDP parser>> or <<deep-dive/telemetryd-ipfix-parser-tcp, IPFIX TCP parser>>.
Received flows are decoded from the messages into the canonical flow format and published to the flow repository.

=== Facts

[options="autowidth"]
|===
| Class Name          | `org.opennms.netmgt.telemetry.protocols.netflow.adapter.ipfix.IpfixAdapter`
|===

=== Configuration and use

.Required adapter-specific parameters
[options="header", cols="1,3,1"]
|===
| Parameter
| Description
| Default

| applicationDataCollection
| Enables data collection of bytesIn/bytesOut based on flow applications.
| false

| applicationThresholding
| Enables thresholding based on flow applications.
| false
|===
NOTE: For data collection to work properly you must also define a valid package definition inside your adapter configuration.
