Configuring Inline Active Flow Monitoring Using Routers, Switches or NFX250
Inline active flow monitoring is implemented on the Packet Forwarding Engine. The Packet Forwarding Engine performs functions such as creating and updating flows, and updating flow records. The flow records are sent out in industry-standard IPFIX or version 9 format.
On routers with MS-PICs or MS-DPCs, IPv4 and IPv6 fragments are processed accurately. The flow monitoring application creates two flows for every fragmented flow. The first fragment that has the complete Layer 4 information forms the first flow with 5-tuple data and subsequently, all the fragmented packets related to this flow form another flow with the Layer 4 fields set to zero.
The following limitations and restrictions apply to the inline active flow monitoring feature:
-
Configuring both sFlow and inline active flow monitoring on the same interface leads to unexpected behavior. Therefore, configure these features on separate interfaces.
-
Configuring both egress port mirroring and inline active flow monitoring on the same interface leads to unexpected behavior. Therefore, configure these features on separate interfaces.
-
Ingress and egress sampling are sent to the same host-path queue. The packet rate in the queue is shared across ingress and egress sampled packets.
-
Forwarding class configuration is not effective. Export record packets are always considered to be control frames and as such are pushed to the network-control queue.
-
If multiple inline active flow monitoring firewall filters match to a flow, only the actions of the first filter are taken.
-
In ingress sampling, if the destination port is on an aggregated Ethernet interface, the output interface is invalid.
The following considerations apply to the inline active flow monitoring instance configuration:
-
Sampling run-length and clip-size are not supported.
-
For inline configurations, collectors are not reachable via management interfaces, such as
fxp0
. -
Inline active flow monitoring does not support
cflowd
. Therefore, inline flow monitoring does not support the local dump option, which is available only with cflowd. -
Inline active flow monitoring is not supported when you enable Next Gen Services on an MX Series router.
-
The number of collectors that are supported depends on the device:
-
In Junos OS Release 16.2 and in Junos OS Release 16.1R3 and earlier, you can configure only one collector under a family for inline active flow monitoring. Starting with Junos OS Release 16.1R4 and 17.2R1, you can configure up to four collectors under a family for inline active flow monitoring. Starting with Junos OS Evolved 20.3R1, for the PTX10003 and PTX10008 (with the JNP10K-LC1201 line card and the JNP10008-SF3) routers, you can configure up to four collectors for inline active flow monitoring. Starting with Junos OS Evolved 20.4R1, for the PTX10001-36MR and the PTX10008 (with the JNP10K-LC1202 line card and the JNP10008-SF3) routers, you can configure up to four collectors for inline active flow monitoring. Starting with Junos OS Evolved 21.1R1, for the PTX10004 router, you can configure up to four collectors for inline active flow monitoring. The Packet Forwarding Engine (PFE) can export the flow record, flow record template, option data, and option data template packet to all configured collectors. To configure a collector under a family for inline active flow monitoring, configure the
flow-server
statement at the[edit forwarding-options sampling instance instance-name family (inet | inet6 | mpls) output]
hierarchy level. To specify up to four collectors, include up to fourflow-server
statements. -
For inline configurations on all other devices, each family can support only one collector.
-
Inline active flow monitoring is configured using statements from four hierarchy levels:
-
[edit chassis]
—At this level, you associate the sampling instance with the FPC on which the media interface is present (except on the MX80 and MX104—see Configuring Inline Active Flow Monitoring on MX80 and MX104 Routers). If you are configuring sampling of IPv4 flows, IPv6 flows or VPLS flows (Junos OS only), you can configure the flow hash table size for each family, as described below. -
[edit firewall]
—At this level, you configure a firewall filter for the family of traffic to be sampled. You must attach this filter to the interface on which you want to sample the traffic. -
[edit forwarding-options]
—At this level, you configure a sampling instance and associate the template with the sampling instance. At this level, you also configure the flow-server IP address and port number as well as the flow export rate. -
[edit services flow-monitoring]
—At this level, you configure the template properties for inline flow monitoring.
Before you configure inline active flow monitoring, you should ensure that you have adequately-sized hash tables for IPv4, IPv6, MPLS, and VPLS flow sampling. (VPLS flow sampling is Junos OS only). These tables can use one to fifteen 256K areas. Starting with Junos OS Release 16.1R1 and 15.1F2, the IPv4 table is assigned a default value of 1024. Prior to Junos OS Release 16.1 and 15.1F2, the IPv4 table is assigned a default value of fifteen 256K areas. The IPv6 table is assigned a default value of 1024, and the VPLS table is assigned a default value of 1024. When anticipated traffic volume requires larger tables, allocate larger tables.
To allocate flow hash tables:
To configure inline active flow monitoring on MX Series routers (except for MX80 and MX104 routers), EX Series switches, and T4000 routers with Type 5 FPC:
Enable inline active flow monitoring and specify the source address for the traffic.
[edit forwarding-options sampling instance instance-name family (bridge | inet | inet6 | mpls | vpls ) output] user@host# set inline-jflow source address address
Specify the template to use with the sampling instance.
[edit forwarding-options sampling instance instance-name family (bridge | inet | inet6 | mpls | vpls ) output flow-server hostname] user@host# set (version9 | version-ipfix) template template-name
Configure a template to specify output properties.
[edit services flow-monitoring] user@host# set (version-ipfix | version9) template template-name
(Optional) Configure the interval after which an active flow is exported.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set flow-active-timeout seconds
(Optional) Configure the interval of activity that marks a flow as inactive.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set flow-inactive-timeout seconds
(Optional) Configure the template refresh rate in either number of packets or number of seconds.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set template-refresh-rate (packets packets | seconds seconds)
(Optional) Configure the refresh rate in either number of packets or number of seconds.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set option-refresh-rate (packets packets | seconds seconds)
Specify the type of record that the template is used for.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set (bridge-template | ipv4-template | ipv6-template | mpls-ipv4-template | mpls-template | peer-as-billing-template | vpls-template)
The
vpls-template
option is only for IPFIX templates.Starting in Junos OS Release 18.2R1, the
bridge-template
option is available and thevpls-template
option is deprecated; use thebridge-template
option instead. Thebridge-template
option (Junos OS only) supports both VPLS and bridge records and is for both IPFIX and version9 templates.Starting in Junos OS Release 18.4R1, the
mpls-ipv4-template
option is deprecated for inline flow monitoring. To configure MPLS records starting in Junos OS Release 18.4R1, use thempls-template
option and thetunnel-observation
option. This is described in step 9.Starting in Junos OS Release 18.4R1 for the MX Series, if you are configuring any type of MPLS flow records, perform the following:
Specify the MPLS template.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set mpls-template
Configure the type of MPLS flow records to create.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set tunnel-observation [ipv4 | ipv6]
The
tunnel-observation
values enable the creation of the following types of flow records:ipv4
—MPLS-IPv4 flowsipv6
—MPLS-IPv6 flows
You can configure multiple values for
tunnel-observation
.For an MPLS traffic type that does not match any of the
tunnel-observation
values, plain MPLS flow records are created. For example, if you only configureipv4
, then MPLS-IPv6 traffic results in plain MPLS flow records.If you do not configure
tunnel-observation
, plain MPLS flow records are created.If you are running inline flow monitoring on a Lookup (LU) card, enable sideband mode to create MPLS-IPv6 flow records.
[edit chassis fpc slot-number inline-services] user@host# set use-extended-flow-memory
If you are running inline flow monitoring on an LU card and do not enable sideband mode, then MPLS-IPv6 traffic results in plain MPLS flow records.
(Optional) Include the flow direction value in the template.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set flow-key flow-direction
The reported data field contains 0x00 (ingress) or 0x01 (egress). If you do not include the
flow-key flow-direction
statement, the flow direction data field contains the invalid value 0xFF.(Optional) Include VLAN IDs in both the ingress and egress directions in the flow key.
[edit services flow-monitoring (version-ipfix | version9) template template-name] user@host# set flow-key vlan-id
This statement is not required for ingress and egress VLAN ID reporting on interfaces.
Associate the sampling instance with the FPC on which you want to implement inline active flow monitoring.
For MX240, MX480, MX960, MX2010, MX2020, use the following command:
[edit ] user@host# set chassis fpc fpc-number sampling-instance instance-name
Confirm the configuration by running the following show command:
user@host# show chassis
fpc 0 { sampling-instance sample-ins1; }
For MX5, MX10, MX40, and MX80, use the following command:
[edit ] user@host# set chassis tfeb slot 0 sampling-instance instance-name
Confirm the configuration by running the following show command:
user@host# show chassis
tfeb { slot 0 { sampling-instance sample-ins1; } }
For MX104, use the following command:
[edit ] user@host# set chassis afeb slot 0 sampling-instance instance-name
Confirm the configuration by running the following show command:
user@host# show chassis
afeb { slot 0 { sampling-instance sample-ins1; } }
This example shows the sampling configuration for an instance
that supports inline active flow monitoring on family inet
:
[edit] user@host> show forwarding-options sampling { instance { sample-ins1 { input { rate 1; } family inet { output { flow-server 192.0.2.2 { port 2055; version-ipfix { template { ipv4; } } } inline-jflow { source-address 10.11.12.13; } } } } } }
Here is the output format configuration:
[edit] user@host> show services flow-monitoring services { flow-monitoring { version-ipfix { template ipv4 { flow-active-timeout 60; flow-inactive-timeout 60; ipv4-template; template-refresh-rate { packets 1000; seconds 10; } option-refresh-rate { packets 1000; seconds 10; } } } } }
The following example shows the output format configuration
for chassis fpc0
:
[edit] user@host> show services flow-monitoring sampling-instance instance-1; { inline-services { flow-table-size { ipv4-flow-table-size 8; ipv6-flow-table-size 7; } } }
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
flow-server address
statement and the
source address with the inline-jflow source-address
address
statement at the [edit
forwarding-options sampling instance name family (inet |
inet6 | mpls) output]
hierarchy level.data-record-fields
at the [edit services
flow-monitoring version-ipfix template template-name]
hierarchy
level.mpls-ipv4-template
option is deprecated for inline flow
monitoring. To configure MPLS records starting in Junos OS Release 18.4R1, use
the mpls-template
option and the
tunnel-observation
option.bridge-flow-table-size
option is available and the
vpls-flow-table-size
option is deprecated; use the
bridge-flow-table-size
option instead.bridge-template
option is available and the
vpls-template
option is deprecated; use the
bridge-template
option instead.