![]() |
Flexible Netflow Configuration Guide, Cisco IOS Release 15S
|
||||||||||||
Using Flexible NetFlow Flow Sampling
![]() |
|||||||||||||
|
Contents
Using Flexible NetFlow Flow SamplingLast Updated: November 19, 2012
This document contains information about and instructions for configuring sampling to reduce the CPU overhead of analyzing traffic with Flexible NetFlow. NetFlow is a Cisco technology that provides statistics on packets flowing through a router. NetFlow is the standard for acquiring IP operational data from IP networks. NetFlow provides data to support network and security monitoring, network planning, traffic analysis, and IP accounting. Flexible NetFlow improves on original NetFlow by adding the capability to customize the traffic analysis parameters for your specific requirements. Flexible NetFlow faciltates the creation of more complex configurations for traffic analysis and data export through the use of reusable configuration components. Finding Feature InformationYour software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module. Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required. Prerequisites for Using Flow Sampling
Information About Flexible NetFlow SamplersFlow SamplersFlow samplers are created as separate components in a router's configuration. Flow samplers are used to reduce the load on the device that is running Flexible NetFlow by limiting the number of packets that are selected for analysis. Flow sampling exchanges monitoring accuracy for router performance. When you apply a sampler to a flow monitor, the overhead load on the router of running the flow monitor is reduced because the number of packets that the flow monitor must analyze is reduced. The reduction in the number of packets that are analyzed by the flow monitor causes a corresponding reduction in the accuracy of the information stored in the flow monitor's cache. Samplers are combined with flow monitors when they are applied to an interface with the ip flow monitor command. How to Configure Flexible NetFlow Flow SamplingFlow sampling reduces the CPU overhead of analyzing traffic with Flexible NetFlow by reducing the number of packets that are analyzed. Configuring a Flow MonitorSamplers are applied to an interface in conjunction with a flow monitor. You must create a flow monitor to configure the types of traffic that you want to analyze before you can enable sampling. To configure a flow monitor, perform the following required task. Each flow monitor has a separate cache assigned to it. Each flow monitor requires a record to define the contents and layout of its cache entries. The record format can be one of the predefined record formats, or an advanced user may create his or her own record format using the collect and matchcommands in Flexible NetFlow flow record configuration mode. DETAILED STEPS Configuring and Enabling Flow Sampling
SUMMARY STEPS
DETAILED STEPS Configuration Examples for Using Flexible NetFlow Flow Sampling
Example: Configuring and Enabling a Deterministic Sampler for IPv4 TrafficThe following example shows how to configure and enable deterministic sampling for IPv4 output traffic. This sample starts in global configuration mode: ! flow monitor FLOW-MONITOR-1 record netflow ipv4 original-output exit ! sampler SAMPLER-1 mode deterministic 1 out-of 2 exit ! ip cef ! interface GigabitEthernet 0/0/0 ip address 172.16.6.2 255.255.255.0 ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-1 output ! The following example shows how to configure and enable deterministic sampling for IPv4 input traffic. This sample starts in global configuration mode: ! flow monitor FLOW-MONITOR-1 record netflow ipv4 original-input exit ! sampler SAMPLER-1 mode deterministic 1 out-of 2 exit ! ip cef ! interface GigabitEthernet 0/0/0 ip address 172.16.6.2 255.255.255.0 ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-1 input ! Example: Configuring and Enabling a Deterministic Sampler for IPv6 TrafficThe following example shows how to configure and enable deterministic sampling for IPv6 output traffic. This sample starts in global configuration mode: ! flow monitor FLOW-MONITOR-2 record netflow ipv6 original-output exit ! sampler SAMPLER-1 mode deterministic 1 out-of 2 exit ! ip cef ipv6 cef ! interface GigabitEthernet 0/0/0 ipv6 address 2001:DB8:2:ABCD::2/48 ipv6 flow monitor FLOW-MONITOR-2 sampler SAMPLER-1 output ! The following example shows how to configure and enable deterministic sampling for IPv6 input traffic. This sample starts in global configuration mode: ! flow monitor FLOW-MONITOR-2 record netflow ipv6 original-input exit ! sampler SAMPLER-1 mode deterministic 1 out-of 2 exit ! ip cef ipv6 cef ! interface GigabitEthernet 0/0/0 ipv6 address 2001:DB8:2:ABCD::2/48 ipv6 flow monitor FLOW-MONITOR-1 sampler SAMPLER-1 input ! Example: Adding a Sampler to a Flow Monitor When a Flow Monitor Is Already EnabledThe following example shows what happens when you try to add a sampler to a flow monitor that has already been enabled on an interface without a sampler: Router(config)# interface GigabitEthernet 0/0/0 Router(config-if)# ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-2 input % Flow Monitor: Flow Monitor 'FLOW-MONITOR-1' is already on in full mode and cannot be enabled with a sampler. The following example shows how to remove the flow monitor from the interface so that it can be enabled with the sampler: Router(config)# interface GigabitEthernet 0/0/0 Router(config-if)# no ip flow monitor FLOW-MONITOR-1 input Router(config-if)# ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-2 input Example: Removing a Sampler from a Flow MonitorThe following example shows what happens when you try to remove a sampler from a flow monitor on an interface by entering the flow monitor command again without the sampler keyword and argument: Router(config)# interface GigabitEthernet 0/0/0 Router(config-if)# ip flow monitor FLOW-MONITOR-1 input % Flow Monitor: Flow Monitor 'FLOW-MONITOR-1' is already on in sampled mode and cannot be enabled in full mode. The following example shows how to remove the flow monitor that was enabled with a sampler from the interface so that it can be enabled without the sampler: Router(config)# interface GigabitEthernet 0/0/0 Router(config-if)# no ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-2 input Router(config-if)# ip flow monitor FLOW-MONITOR-1 input Additional ReferencesRelated DocumentsMIBsTechnical Assistance
Feature Information for Flexible Netflow--Random SamplingThe following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature. Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R) Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental. © 2012 Cisco Systems, Inc. All rights reserved.
|
||||||||||||
|
|