Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Configuring Active Flow Monitoring Version 9 for MPLS and IPv4

 

This example shows how to monitor MPLS and IPv4 flows by using active flow Monitoring version 9. It is organized in the following sections:

Requirements

This example requires the following hardware and software components:

  • Junos OS Release 9.2 or later

  • One M Series Multiservice Edge Router, MX Series 3D Universal Edge Routers, or T Series Core Router

  • One Adaptive Services PIC

Note

This configuration example has been tested using the software release listed and is assumed to work on all later releases.

Overview of Flow Monitoring

This example explains how to monitor MPLS and IPv4 flows.

The physical connections used in this example are shown in Figure 1.

Figure 1: Active Flow Monitoring Version 9 for MPLS and IPv4 Topology
Active Flow Monitoring Version
9 for MPLS and IPv4 Topology

Configuring Active Flow Monitoring Version 9 for MPLS and IPv4

Step-by-Step Procedure

  1. Enable the services PIC interface to process MPLS and IPv4 addresses by including the family statement and specifying the mpls option and the inet option at the [edit interfaces sp-0/0/0 unit 0] hierarchy level.
  2. Configure the interface connected to the flow collector by including the address statement and specifying 100.1.1.1/24 as the IPv4 address of the interface at the [edit interfaces ge-1/1/3 unit 0 family inet] hierarchy level.
  3. Create a version 9 template by including the template statement and specifying mpls-ipv4 as the name of the template at the [edit services flow-monitoring version9] hierarchy level.

    Enable the template for MPLS and IPv4 flows by including the mpls-ipv4-template statement at the [edit services flow-monitoring version9 template mpls-ipv4] hierarchy level. Also include the label-position statement and specify label positions 1 and 2 at the [edit services flow-monitoring version9 template mpls-ipv4 mpls-ipv4-template] hierarchy level.

    Configure the flow active timeout by including the flow-active-timeout statement and specifying 600 seconds at the [edit services flow-monitoring version9 template mpls-ipv4] hierarchy level. Configure the flow inactive timeout by including the flow-inactive-timeout statement and specifying 30 seconds at the [edit services flow-monitoring version9 template mpls-ipv4] hierarchy level.

  4. Configure the rate at which the router sends template definitions and options to the flow collector for IPv4 and MPLS.

    Since version 9 flow monitoring traffic is unidirectional from the monitor (router) to the flow collector, configure the monitor to send template definitions and options, such as sampling rate, to the collector.

    In this example, the template definitions and options are refreshed every 600 seconds or 480000 packets, whichever occurs first.

    Include the packets statement and specify 480000 packets at the [edit services flow-monitoring version9 template mpls-ipv4 template-refresh-rate] and [edit services flow-monitoring version9 template mpls-ipv4 option-refresh-rate] hierarchy levels. Include the seconds statement and specify 600 seconds at the [edit services flow-monitoring version9 template mpls-ipv4 template-refresh-rate] and [edit services flow-monitoring version9 template mpls-ipv4 option-refresh-rate] hierarchy levels.

  5. Configure the sampling rate and run length.

    The sampling rate determines the ratio of the number of packets to be sampled. For example, if you specify a rate of 10, 1 out of every 10 packets is sampled. In this example, the rate is 1 out of every 1 packets.

    Sampling can be configured as a global chassis configuration that is applicable to all Flexible PIC Concentrators (FPCs) and Dense Port Concentrators (DPCs) at the [edit forwarding-options sampling input] hierarchy level. Sampling can also be configured at the [edit forwarding-options sampling instance instance-name] hierarchy level and then applied to a single FPC.

    In this example, two sampling categories are created. The global instance is configured to sample all packets matching a flow. Instance inst1 is configured to sample one in every 10 packets.

    To configure the global rate, include the rate statement and specify 1 as the rate at the [edit forwarding-options sampling input] hierarchy level. To configure the instance rate, include the rate statement and specify 10 as the rate at the [edit forwarding-options sampling instance ins1 input] hierarchy level.

  6. Apply the sampling instance to the desired FPC, MPC, or DPC.

    The FPC number must match the FPC portion of the interface name for the interface on which sampling is enabled.

    To apply the sampling instance, include the sampling-instance statement and specify ins1 at the [edit chassis fpc 0] hierarchy level.

  7. Configure the flow collector and enable active flow monitoring for IPv4 and for MPLS using the version 9 template format.

    • To configure the flow collector for IPv4, include the flow-server statement and specify the IP address of the host system that is collecting traffic flows using version 9 at the [edit forwarding-options sampling instance ins1 family inet output] hierarchy level. Also include the port statement and specify UDP port 2055 for use by the flow collector.

      To enable active flow monitoring for IPv4 using the version 9 template format, include the template statement and specify ipv4-template as the name of the template to use at the [edit forwarding-options sampling instance ins1 family inet output flow-server 100.1.1.2 version9] hierarchy level.

    • To configure the flow collector for MPLS, include the flow-server statement and specify the IP address of the host system that is collecting traffic flows using version 9 at the [edit forwarding-options sampling instance ins1 family mpls output] hierarchy level. Also include the port statement and specify UDP port 2055 for use by the flow collector.

      To enable active flow monitoring for MPLS using the version 9 template format, include the template statement and specify mpls as the name of the template to use at the [edit forwarding-options sampling instance ins1 family mpls output flow-server 100.1.1.2 version9] hierarchy level.

  8. Configure the IPv4 source address for the services PIC to be used in flow export.

    • To configure the IPv4 source address for the sp-0/0/0 interface, include the source-address statement and specify 3.3.3.3 at the [edit forwarding-options sampling instance ins1 family inet output interface sp-0/0/0] hierarchy level.

    • To configure the IPv4 source address for the sp-0/0/0 interface for MPLS, include the source-address statement and specify 3.3.3.3 at the [edit forwarding-options sampling instance ins1 family mpls output interface sp-0/0/0] hierarchy level.

  9. Configure the firewall filter.

    The firewall filter identifies the traffic flows that need to be sampled and processed by the services PIC. Note that the implied “from” clause in the filter determines the packets that are matched and sampled according to the sampling rate.

    • To configure the firewall filter for IPv4, include the filter statement and specify ipv4_sample_filter as the name of the filter at the [edit firewall family inet] hierarchy level. Include the term statement and specify 1 as the name of the term. For active monitoring using version 9, you must include the sample and accept action statements at the [edit firewall family inet filter ipv4_sample_filter term 1 then] hierarchy level.

    • To configure the firewall filter for MPLS, include the filter statement and specify mpls_sample_filter as the name of the filter at the [edit firewall family mpls] hierarchy level. Include the term statement and specify 1 as the name of the term. For active monitoring using version 9, you must include the sample and accept action statements at the [edit firewall family mpls filter mpls_sample_filter term 1 then] hierarchy level.

  10. Apply the firewall filter to the set of media interfaces where traffic flow needs to be sampled for IPv4 and MPLS.

    • To apply the firewall filter to the fe-0/3/2 interface for IPv4, include the input statement and specify ipv4_sample_filter as the name of the filter at the [edit interfaces fe-0/3/2 unit 0 family inet filter] hierarchy level.

    • To apply the firewall filter to the fe-0/3/2 interface for MPLS, include the input statement and specify mpls_sample_filter as the name of the filter at the [edit interfaces fe-0/3/2 unit 0 family mpls filter] hierarchy level.

Results

For your reference, the relevant sample configuration for the IPv4 and MPLS flow collector follows.