Technical Documentation

Configuring Traffic Sampling

On routing platforms containing a Monitoring Services PIC or an Adaptive Services PIC, you can configure traffic sampling for traffic passing through the routing platform.

To configure traffic sampling on a logical interface, include the input statement at the [edit forwarding-options sampling] hierarchy level:

[edit forwarding-options sampling]input {max-packets-per-second number;maximum-packet-length bytes;rate number;run-length number;}

In Junos OS Release 8.3 and later, you can also configure traffic sampling of MPLS traffic.

Specify the threshold traffic value by using the max-packets-per-second statement. The value is the maximum number of packets to be sampled, beyond which the sampling mechanism begins dropping packets. The range is 0 through 65,535. A value of 0 instructs the Packet Forwarding Engine not to sample any packets. The default value is 1000.

Note: This statement is not valid for port mirroring.

Specify the maximum length of the sampled packet by using the maximum-packet-length bytes statement. For bytes, specify a value from 0 through 9192.

Specify the sampling rate by setting the values for rate and run-length (see Figure 1).

Figure 1: Configure Sampling Rate

Image h1746.gif

The rate statement specifies the ratio of packets to be sampled. For example, if you configure a rate of 10, x number of packets out of every 10 is sampled, where x=run-length+1. By default, the rate is 0, which means that no traffic is sampled.

The run-length statement specifies the number of matching packets to sample following the initial one-packet trigger event. Configuring a run length greater than 0 allows you to sample packets following those already being sampled.

Note: The run-length and maximum-packet-length configuration statements are not supported on MX80 routers.

If you do not include the input statement, sampling is disabled.

To collect the sampled packets in a file, include the file statement at the [edit forwarding-options sampling output] hierarchy level. For more information about the output file formats, see Configuring the Output File for Traffic Sampling.

You can also send the sampled packets to a specified host using the cflowd version 5 and 8 formats or the version 9 format as defined in RFC 3954. For more information, see Configuring Flow Aggregation (cflowd) and Configuring Active Flow Monitoring Using Version 9.

The Junos OS does not sample packets originating from the router. If you configure a sampling filter and apply it to the output side of an interface, then only the transit packets going through that interface are sampled. Packets that are sent from the Routing Engine to the Packet Forwarding Engine are not sampled.

When you apply a firewall filter to a loopback interface, the filter might block responses from the Monitoring Services PIC. To allow responses from the Monitoring Services PIC to pass through for sampling purposes, configure a term in the firewall filter to include the Monitoring Services PIC’s IP address. For more detailed information about configuring firewall filters, see Configuring Standard Firewall Filters.

Related Topics


Published: 2010-07-16

|
|