Use of version 9 allows you to define a flow record template suitable for IPv4 traffic, IPv6 traffic, MPLS traffic, or a combination of IPv4 and MPLS traffic. Templates and the fields included in the template are transmitted to the collector periodically, and the collector need not be aware of the router configuration.
![]() |
Note: Version 9 requires that you install a services PIC, such as the Adaptive Services PIC or MultiServices PIC in the routing platform. On MX-series platforms, the MultiServices DPC fulfills this requirement. For more information on determining which services PIC is suitable for your routing platform, see Table 4 or the appropriate hardware documentation. |
The following sections contain additional information:
To specify sampling of IPv4, IPv6, or MPLS traffic, include the appropriate configuration of the family statement at the [edit forwarding-options sampling input] hierarchy level:
- [edit forwarding-options sampling input]
- family (inet | inet6 | mpls)
{
- max-packets-per-second number;
- rate number;
- run-length number;
You can include either family inet or family mpls.
To define the version 9 templates, include the following statements at the [edit services flow-monitoring version9] hierarchy level:
- [edit services flow-monitoring version9]
- template name {
- flow-active-timeout seconds;
- flow-inactive-timeout seconds;
- option-refresh-rate packets packets seconds seconds;
- template-refresh-rate packets packets seconds seconds;
-
- (ipv4-template | ipv6-template | mpls-ipv4-template | mpls-template) {
- label-position [ positions ];
- }
- }
The following details apply to the configuration statements:
![]() |
Note: In active flow monitoring, the cflowd records are exported after a time period that is a multiple of 60 seconds and greater than or equal to the configured active timeout value. For example, if the active timeout value is 90 seconds, the cflowd records are exported at 120-second intervals. If the active timeout value is 150 seconds, the cflowd records are exported at 180-second intervals, and so forth. |
The following restrictions apply to version 9 templates:
In this case, mpls-ipv4 flows are not created on the PIC, because the IPv4 header does not directly follow the MPLS header. Packets are dropped on the PIC and are accounted as parser errors.
The following fields are common to all template types:
The IPv4 template includes the following specific fields:
The IPv6 template includes the following specific fields:
The MPLS template includes the following specific fields:
The MPLS-IPv4 template includes all the fields found in the IPv4 and MPLS templates.
This section describes the behavior when MPLS sampling is used on egress interfaces in various scenarios (label pop or swap) on provider routers (P routers). For more information on configuration and background specific to MPLS applications, see the JUNOS MPLS Applications Configuration Guide.
Previously, IPv4 packets (only) would have been sent to the PIC for sampling even though you configured MPLS sampling. No flows should be created, with the result that the parser fails.
With the current capability of applying MPLS templates, MPLS flows are created.
Resulting behavior is that MPLS packets are sent to PIC. The flow being sampled corresponds to the label before the swap.
Resulting behavior is that you cannot sample MPLS packets on the PE-A to P router link.
To verify the configuration properties, you can use the show services accounting aggregation template template-name name operational mode command.
All other show services accounting commands also support version 9 templates, except for show services accounting flow-detail and show services accounting aggregation aggregation-type. For more information about operational mode commands, see the JUNOS System Basics and Services Command Reference.
The following is a sample version 9 template configuration:
- services {
-
- flow-monitoring {
-
- version9 {
-
- template ip-template {
- flow-active-timeout 20;
- flow-inactive-timeout 120;
- ipv4-template;
- }
-
- template mpls-template-1 {
-
- mpls-template {
- label-position [1 3 4];
- }
- }
-
- template mpls-ipv4-template-1 {
-
- mpls-ipv4-template {
- label-position [1 5 7];
- }
- }
- }
- }
- }
The following is a sample firewall filter configuration for MPLS traffic:
The following sample configuration applies the MPLS sampling filter on a networking interface and configures the AS PIC to accept both IPv4 and MPLS traffic:
- interfaces {
-
- at-0/1/1 {
-
- unit 0 {
-
- family mpls {
-
- filter {
- input mpls_sample;
- }
- }
- }
- }
-
- sp-7/0/0 {
-
- unit 0 {
- family inet;
- family mpls;
- }
- }
- }
The following example applies the MPLS version 9 template to the sampling output and sends it to the AS PIC:
- forwarding-options {
-
- sampling {
-
- input {
-
- family mpls {
- rate 1;
- }
- }
-
- output {
- flow-active-timeout 60;
- flow-inactive-timeout 30;
-
- cflowd 1.2.3.4 {
- port 2055;
-
- version9 {
- template mpls-ipv4-template-1;
- }
- }
-
- interface sp-7/0/0 {
- source-address 1.1.1.1;
- }
- }
- }
- }