Feedback
|
Table Of Contents
Using Cisco IOS Flexible NetFlow Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic
Prerequisites for Using Flow Sampling
Restrictions for for Using Flow Sampling
Information About Flexible NetFlow Samplers
How to Configure Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic with Flexible NetFlow
Configuring and Enabling Flow Sampling
Example: Configuring and Enabling a Deterministic Sampler for IPv4 Traffic
Example: Configuring and Enabling a Deterministic Sampler for IPv6 Traffic
Example: Adding a Sampler to a Flow Monitor When a Flow Monitor Is Already Enabled on an Interface
Example: Removing a Sampler from a Flow Monitor
Feature Information for Flexible NetFlow
Using Cisco IOS Flexible NetFlow Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic
First Published: June 19, 2006Last Updated: July 20, 2011This document contains information about and instructions for configuring sampling to reduce the CPU overhead of analyzing traffic with Flexible NetFlow.
NetFlow is a Cisco IOS 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 Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see 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 for Flexible NetFlow" section.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Contents
•
Prerequisites for Using Flow Sampling
•
Information About Flexible NetFlow Samplers
•
How to Configure Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic with Flexible NetFlow
•
Feature Information for Flexible NetFlow
Prerequisites for Using Flow Sampling
•
You are familiar with the information in the "Cisco IOS Flexible NetFlow Overview" module.
•
The networking device must be running a Cisco IOS release that supports Flexible NetFlow. See the "Cisco IOS Flexible NetFlow Features Roadmap" module for a list of Cisco IOS software releases that support Flexible NetFlow.
IPv4 Traffic
•
The networking device must be configured for IPv4 routing.
•
One of the following must be enabled on your router and on any interfaces on which you want to enable Flexible NetFlow: Cisco Express Forwarding or distributed Cisco Express Forwarding.
IPv6 Traffic
•
The networking device must be configured for IPv6 routing.
•
One of the following must be enabled on your router and on any interfaces on which you want to enable Flexible NetFlow: Cisco Express Forwarding IPv6 or distributed Cisco Express Forwarding IPv6.
Restrictions for for Using Flow Sampling
Cisco IOS Release 12.2(50)SY
•
Deterministic sampling is not supported.
Information About Flexible NetFlow Samplers
Flow Samplers
Flow 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. Samplers use either random or deterministic sampling techniques (modes):
•
Deterministic—The same sampling position is used each time a sample is taken.
•
Random—A randomly selected sampling position is used each time a sample is taken.
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 Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic with Flexible NetFlow
Flow sampling reduces the CPU overhead of analyzing traffic with Flexible NetFlow by reducing the number of packets that are analyzed.
Note
Only the keywords and arguments required for the Flexible NetFlow commands used in these tasks are explained in these tasks. For information about the other keywords and arguments available for these Flexible NetFlow commands, refer to the Cisco IOS Flexible NetFlow Command Reference.
To configure flow sampling to reduce the CPU overhead of analyzing traffic with Flexible NetFlow, perform the following tasks:
•
Configuring a Flow Monitor (required)
•
Configuring and Enabling Flow Sampling (required)
Configuring a Flow Monitor
Samplers 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 match commands in Flexible NetFlow flow record configuration mode.
Restrictions
You must use the no ip flow monitor command to remove a flow monitor from all of the interfaces to which you have applied it before you can modify the parameters for the record command on the flow monitor.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
flow monitor monitor-name
4.
description description
5.
record {record-name | netflow-original | netflow {ipv4 | ipv6} record [peer]}
6.
end
DETAILED STEPS
Configuring and Enabling Flow Sampling
To configure and enable a flow sampler, perform the following required task.
Restrictions
When you specify the "NetFlow original," or the "NetFlow IPv4 original input," or the "NetFlow IPv6 original input" predefined record for the flow monitor to emulate original NetFlow, the flow monitor can be used only for analyzing input (ingress) traffic.
When you specify the "NetFlow IPv4 original output" or the "NetFlow IPv6 original output" predefined record for the flow monitor to emulate the Egress NetFlow Accounting feature, the flow monitor can be used only for analyzing output (egress) traffic.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
sampler sampler-name
4.
description description
5.
mode {deterministic | random} 1 out-of window-size
6.
exit
7.
interface type number
8.
{ip | ipv6} flow monitor monitor-name [[sampler] sampler-name] {input | output}
9.
end
10.
show sampler sampler-name
DETAILED STEPS
Configuration Examples for Using Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic with Flexible NetFlow
This section provides the following configuration examples:
•
Example: Configuring and Enabling a Deterministic Sampler for IPv4 Traffic
•
Example: Configuring and Enabling a Deterministic Sampler for IPv6 Traffic
•
Example: Adding a Sampler to a Flow Monitor When a Flow Monitor Is Already Enabled on an Interface
•
Example: Removing a Sampler from a Flow Monitor
Example: Configuring and Enabling a Deterministic Sampler for IPv4 Traffic
The 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-1record netflow ipv4 original-outputexit!sampler SAMPLER-1mode deterministic 1 out-of 2exit!ip cef!interface Ethernet 0/0ip address 172.16.6.2 255.255.255.0ip 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-1record netflow ipv4 original-inputexit!sampler SAMPLER-1mode deterministic 1 out-of 2exit!ip cef!interface Ethernet 0/0ip address 172.16.6.2 255.255.255.0ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-1 input!Example: Configuring and Enabling a Deterministic Sampler for IPv6 Traffic
The 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-2record netflow ipv6 original-outputexit!sampler SAMPLER-1mode deterministic 1 out-of 2exit!ip cefipv6 cef!interface Ethernet 0/0ipv6 address 2001:DB8:2:ABCD::2/48ipv6 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-2record netflow ipv6 original-inputexit!sampler SAMPLER-1mode deterministic 1 out-of 2exit!ip cefipv6 cef!interface Ethernet 0/0ipv6 address 2001:DB8:2:ABCD::2/48ipv6 flow monitor FLOW-MONITOR-1 sampler SAMPLER-1 input!Example: Adding a Sampler to a Flow Monitor When a Flow Monitor Is Already Enabled on an Interface
The 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 Ethernet 0/0Router(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 Ethernet 0/0Router(config-if)# no ip flow monitor FLOW-MONITOR-1 inputRouter(config-if)# ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-2 inputExample: Removing a Sampler from a Flow Monitor
The 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 Ethernet 0/0Router(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 Ethernet 0/0Router(config-if)# no ip flow monitor FLOW-MONITOR-1 sampler SAMPLER-2 inputRouter(config-if)# ip flow monitor FLOW-MONITOR-1 inputWhere to Go Next
For information on advanced Flexible NetFlow configurations for specific purposes such as quality of service (QoS) and bandwidth monitoring, application and user flow monitoring and profiling, and security analysis, refer to the "Customizing Cisco IOS Flexible NetFlow Flow Records and Flow Monitors" module.
If you want to configure any of the predefined records for Flexible NetFlow, refer to the "Configuring Cisco IOS Flexible NetFlow with Predefined Records" module.
If you want to configure data export for Flexible NetFlow, refer to the "Configuring Data Export for Cisco IOS Flexible NetFlow with Flow Exporters" module.
Additional References
Related Documents
Related Topic Document TitleCisco IOS commands
Overview of Flexible NetFlow
Flexible NetFlow Feature Roadmap
Emulating original NetFlow with Flexible NetFlow
"Getting Started with Configuring Cisco IOS Flexible NetFlow"
Configuring flow exporters to export Flexible NetFlow data
"Configuring Data Export for Cisco IOS Flexible NetFlow with Flow Exporters"
Customizing Flexible NetFlow
"Customizing Cisco IOS Flexible NetFlow Flow Records and Flow Monitors"
Configuring Flexible NetFlow using predefined records
"Configuring Cisco IOS Flexible NetFlow with Predefined Records"
Using Flexible NetFlow Top N Talkers to analyze network traffic
"Using Cisco IOS Flexible NetFlow Top N Talkers to Analyze Network Traffic"
Configuring IPv4 multicast statistics support for Flexible NetFlow
"Configuring IPv4 Multicast Statistics Support for Cisco IOS Flexible NetFlow"
Configuration commands for Flexible NetFlow
Standards
MIBs
MIB MIBs LinkNone
To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL:
RFCs
Technical Assistance
Feature Information for Flexible NetFlow
Table 1 lists the release history for this feature.
Only features that were introduced or modified in Cisco IOS Release 12.2(1) or Cisco IOS Releases 12.2(1) or 12.0(3)S or a later release appear in the table.
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required
Note
Table 1 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 Cisco IOS software release train also support that feature.
Table 1 Feature Information for Flexible NetFlow
Feature Name Releases Feature InformationFlexible NetFlow
12.2(33)SRC12.2(50)SY 12.4(9)T
Flexible NetFlow is introduced.
Support for this feature was added for Cisco 7200 series routers in Cisco IOS Release 12.2(33)SRC.
Information about the Flexible NetFlow feature is included in the following sections:
The following commands were introduced or modified: cache (Flexible NetFlow), clear flow exporter, clear flow monitor, clear sampler, collect counter, collect flow, collect interface, collect ipv4, collect ipv4 destination, collect ipv4 fragmentation, collect ipv4 section, collect ipv4 source, collect ipv4 total-length, collect ipv4 ttl, collect routing, collect timestamp sys-uptime, collect transport, collect transport icmp ipv4, collect transport tcp, collect transport udp, debug flow exporter, debug flow monitor, debug flow record, debug sampler, description (Flexible NetFlow), destination, dscp (Flexible NetFlow), exporter, flow exporter, flow monitor, flow record, ip flow monitor, match flow, match interface (Flexible NetFlow), match ipv4, match ipv4 destination, match ipv4 fragmentation, match ipv4 section, match ipv4 source, match ipv4 total-length, match ipv4 ttl, match routing, match transport, match transport icmp ipv4, match transport tcp, match transport udp, mode (Flexible NetFlow), option (Flexible NetFlow), record, sampler, show flow exporter, show flow interface, show flow monitor, show flow record, show sampler, source (Flexible NetFlow), statistics packet, template data timeout, transport (Flexible NetFlow).
Flexible NetFlow—Random Sampling
12.2(50)SY 12.4(20)T
Flow 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. Samplers use either random or deterministic sampling techniques (modes).
Information about the Flexible NetFlow—Random Sampling feature is included in the following sections:
•
Prerequisites for Using Flow Sampling
•
Information About Flexible NetFlow Samplers
•
How to Configure Flow Sampling to Reduce the CPU Overhead of Analyzing Traffic with Flexible NetFlow
The following commands were introduced or modified: clear sampler, debug sampler, mode, record, sampler show sampler.
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at 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. (1005R)
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
© 2006-2011 Cisco Systems, Inc. All rights reserved.
Feedback