The use of an Adaptive Services Physical Interface Card (PIC) or a Monitoring Services Physical Interface Card (PIC) allows network operators to perform sampling of network traffic, reducing the load placed on the routing-engine. This article provides a sample configuration and highlight some common mistakes made when using this service.
The following configuration can be used to configuring sampling which will be processed by the routing-engine. forwarding-options { sampling { input { family inet { rate <rate> ; run-length <run-rate> ; } } output { cflowd <host_ip> { version 8; } } } This sampling configuration is activated by applying a firewall filter with the action 'sample' to interfaces which are interesting. When attempting to sample large amounts of data, the routing-engine may discard traffic which was destined to be sampled. The use of a Service PIC to provide this functionality will increase the volume of traffic that can be sampled.
forwarding-options { sampling { input { family inet { rate <rate> ;
run-length <run-rate> ; } } output { cflowd <host_ip> { version 8; } } }
An Monitoring Services PIC, Adaptive Services PIC or internal Adaptive Services Module (M7i) can be used to produce cflowd accounting, bypassing the need for the routing-engine to process sampled packets. This will reduce the volume of packets which are forwarded to the routing-engine for processing. The following is an example configuration for configuration of an Adaptive Services PIC: forwarding-options { sampling { input { family inet { rate <rate> ; run-length <run-rate> ; } } output { cflowd <host_ip> { version 8; } interface sp-1/2/0 { source-address <cflowd_source_ip_address> ; } } } } As with the previous routing-engine processed sampling example, a firewall filter on the transit interface matches interesting packets and sets the terminating action 'sample': firewall { family inet { filter sampling-filter { term default { then { sample; accept; } } } } } Note: In order to use the Service PIC to generate accounting cflowd packets, you will need to enable the family inet on the interface: interfaces { sp-1/2/0 { unit 0 { family inet; } } } The status of the sampling can be verified with the command show services accouting status , as shown in the following example:
forwarding-options { sampling { input { family inet { rate <rate> ; run-length <run-rate> ; } } output { cflowd <host_ip> { version 8; } interface sp-1/2/0 { source-address <cflowd_source_ip_address> ; } } } }
firewall { family inet { filter sampling-filter { term default { then { sample; accept; } } } } }
interfaces { sp-1/2/0 { unit 0 { family inet; } } }
show services accouting status
lab@m7i# run show services accounting status Service Accounting interface: sp-1/2/0, Local interface index: 131Service name: (default sampling)Interface state: AccountingService ID: 0Export interval (in seconds): 60, Export format: cflowd v8Protocol: IPv4, Engine type: 188, Engine ID: 34Route record count: 10, IFL to SNMP index count: 15, AS count: 2Time set: Yes, Configuration set: YesRoute record set: Yes, IFL SNMP map set: Yes