This section describes the configuration of traffic sampling for SDK applications. For more information on sampling in the JUNOS software, see the JUNOS configuration guides.
For routing platforms containing a MultiServices PIC, the existing interface statement at the [edit forwarding-options sampling family family output] hierarchy level is extended to allow you to use an interface of the ms type (ms-fpc/pic/port) to sample traffic passing through the routing platform. You configure this interface similar to the way you configure traffic sampling for a Monitoring Services or an Adaptive Services PIC.
As with regular JUNOS software, to configure traffic sampling on a PIC, you must complete three tasks: create a firewall filter, apply it to the logical interface on which you want to sample traffic, and enable sampling.
To enable sampling on a MultiServices PIC, include the input and output statements at the [edit forwarding-options sampling] hierarchy level:
- [edit]
- forwarding-options {
-
- sampling {
-
- input {
-
- family inet {
- rate number;
- }
- }
-
- output {
-
- extension-service service-name {
-
provider-specific rules;
- }
- interface ms-fpc/pic/port;
- }
- }
- }
The extension-service statement provides a section of the configuration hierarchy in which the provider of your SDK application may have added its own traffic monitoring configuration statements. To enable sampling for SDK applications and be able to use the configuration statements the SDK application provider may have added, you must include the extension-service statement at the [edit forwarding-options sampling output] hierarchy level. For application-specific configuration guidelines, see the documenation provided with your application.
![]() |
Note: If you use the extension-service statement, the only other statement you can include at the [edit forwarding-options sampling output] hierarchy level is the interface statement. In this case, you must set the interface statement to an interface with an ms prefix. |
The following example shows a firewall filter sample-monitor, which, when attached to an interface, ensures that all traffic entering that interface with a source address matching address 10.1.1.1 is sampled and sent to the ouput interface ms-2/0/0.
- [edit]
- firewall {
-
- family inet {
-
- filter sample-monitor {
-
- term sample-term {
-
- from {
-
- source-address {
- 10.1.1.1/32;
- }
- }
-
- then {
- sample;
- accept;
- }
- }
- }
- }
- }
- forwarding-options {
-
- sampling {
-
- input {
-
- family inet {
- rate 1;
- }
- }
-
- output {
-
- extension-service abc-sample {
-
provider-specific rules;
- }
- interface ms-2/0/0;
- }
- }
You can attach the firewall filter created in the above sample to any interface in your network.
The following are limitations of traffic monitoring as supported for JUNOS SDK applications: