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. In Junos OS Release 8.3 and later, you can also configure traffic sampling of MPLS traffic.
To configure traffic sampling on a logical interface:
The forwarding plane provides support for random sampling that
can be configured through the rate or run-length
statement. The rate
statement sets the ratio of the number
of packets to be sampled on an average. For example, if you configure
a rate of 10, on average every tenth packet (1 packet out of 10) 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.
The run-length
statement is not supported on
MX Series routers with Modular Port Concentrators (MPCs) and T4000
router with Type 5 FPC.
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 Directing Traffic Sampling Output to a Server Running the cflowd Application and Collecting Traffic Sampling Output in the Cisco Systems NetFlow Services Export Version 9 Format.
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.
Targeted broadcast does not work when the targeted broadcast
option forward-and-send-to-re
and the traffic sampling
option sampling
are configured on the same egress interface
of an M320 router, a T640 router, or an MX960 router. To overcome
this scenario, you must either disable one of the these options or
enable the sampling
option with the targeted broadcast
option forward-only
on the egress interface. For information
about targeted broadcast, see Understanding
Targeted Broadcast.