|
|
This feature module describes the Sampled NetFlow feature. It includes information on the benefits of the new feature, supported platforms, supported standards, and the commands necessary to configure the Sampled NetFlow feature.
This document includes the following sections:
The Sampled NetFlow feature allows you to sample one out of "x" IP packets being forwarded to routers, by allowing the user to define the "x" interval with a value between a minimum and maximum. Sampling packets will be accounted for in the NetFlow Flow Cache of the router. These sampling packets will substantially decrease the CPU utilization needed to account for NetFlow packets by allowing the majority of the packets to be switched faster because they will not need to go through additional NetFlow processing.
Forwarding rates on a Gigabit Switch Router (GSR) series are an order of magnitude greater then traditional platforms that support NetFlow. "Touching" every switched packet for NetFlow accounting becomes a challenge at these high switching rates. However, collecting characteristic statistics on IP traffic being forwarded, such as source and destination IP addresses, route prefixes, and autonomous system numbers is still a necessary tool for managing and planning a network.
The Sampled NetFlow feature was developed to alleviate the performance penalty incurred by turning on NetFlow on the GSR routers. In order to scale to higher forwarding rates, NetFlow will now allow the user to sample one out of every "x" IP packets being forwarded. These sample packets will be accounted for in the NetFlow cache on the router. The user can configure the "x" interval. This feature will substantially decrease the CPU utilization needed to account for NetFlow packets by allowing a majority of the packets to be switched faster because they will not need to go through additional NetFlow processing.
The Sampled NetFlow feature will be available only on the Cisco 12000 (GSR) series of routers. Also, for the Cisco 12000 series of routers, the feature currently is supported only on the Engine0 and Engine1 line cards. GSR has only one image, and no special packaging is necessary.
This feature is supported on the following platforms:
Standards
None
MIBs
None
For descriptions of supported MIBs and how to use MIBs, see the Cisco MIB web site on CCO at http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml.
RFCs
None
The Sampled NetFlow feature must be enabled explicitly.
See the following sections for configuration tasks for the Sampled NetFlow feature.
To configure NetFlow in the sampled mode on an interface, use the following command in interface configuration mode:
| Command | Purpose |
|---|---|
Router(config-if)#ip route-cache flow sampled | Enables NetFlow switching in the sampled mode. |
![]() |
NoteWhen the Sampled NetFlow feature is disabled on an interface, normal NetFlow also becomes disabled. This restriction was made to prevent the interface from being overwhelmed by the sudden transition from sampled NetFlow to normal Netflow. You need to explicitly reenable NetFlow if so desired. The default value for the sampling interval is 4 billion. This default packet interval was designed to protect the router from being choked by a misconfiguration. You need to explicitly configure a usable packet interval for your case. |
To configure the sampling mode (that is, the type of sampling) and the sampling interval value, use the following command in global configuration mode:
| Command | Purpose |
|---|---|
Router(config)#ip flow-sampling-mode packet-interval value | Enables sampling mode and the sampling interval for NetFlow sampling. |
To monitor sampled NetFlow, use the following command in EXEC mode:
| Command | Purpose |
|---|---|
Router#show ip flow sampling | Displays the sampling mode and sampling interval settings. |
This section provides the following configuration examples:
interface FastEthernet9/0/0 mac-address 4000.0209.0000 ip address 150.1.2.2 255.255.255.0 no ip directed-broadcast ip route-cache flow sampled ip route-cache distributed no ip mroute-cache no keepalive !\
ip classless ip route 20.1.1.1 255.255.255.255 Null0 ip route 171.69.1.129 255.255.255.255 10.0.101.1ip flow-export version 5 ip flow-export destination 10.42.42.1 9991 ip flow-sampling-mode packet-interval 100 !
This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.1 command reference publications.
The following is a modified Cisco IOS command:
The following is a list of new Cisco IOS commands:
To enable NetFlow switching for IP routing, use the ip route-cache flow command in interface configuration mode. To disable NetFlow switching, use the no form of this command.
ip route-cache flow [sampled]
Syntax Description
sampled (Optional) Enables NetFlow cache in sampled mode.
Defaults
This command is not enabled by default.
Command Modes
Interface configuration
Command History
11.1 This command was introduced. 12.0(11)S The sampled keyword was added.
Release
Modification
Usage Guidelines
NetFlow is an accounting and acceleration mechanism that captures a rich set of traffic statistics. These traffic statistics include user, protocol, port, and type of service information that can be used for a wide variety of purposes such as network analysis and planning, accounting, and billing. To export NetFlow data, use the ip flow-export global configuration command.
NetFlow is supported on IP and IP encapsulated traffic over all interface types and encapsulations except for Inter-Switch Link/VLAN, ATM, and Frame Relay interfaces when more than one input access control list is used on the interface, and ATM local area network emulation (LANE).
In conventional switching at the network layer, each incoming packet is handled on an individual basis with a series of functions to perform access list checks, capture accounting data, and switch the packet. With NetFlow, after a flow has been identified and access list processing of the first packet in the flow has been performed, all subsequent packets are handled on a "connection-oriented" basis as part of the flow, where access list checks are bypassed and statistics capture are performed in tandem.
A network flow is identified as a unidirectional stream of packets between a source and destination---both defined by a network-layer IP address and transport-layer port number. Specifically, a flow is identified as the combination of the following fields:
NetFlow operates by creating a flow cache that contains the information needed to perform access list check for all active flows. The NetFlow cache is built by processing the first packet of a flow through the standard fast switching path. As a result, each flow is associated with an incoming and outgoing interface port number and with a specific security access permission and encryption policy. The cache also includes entries for traffic statistics that are updated in tandem with the switching of subsequent packets. After the NetFlow cache is created, packets identified as belonging to an existing flow have their traffic statistic counters incremented and security access list checks bypassed. Flow information is maintained within the NetFlow cache for all active flows.
NetFlow accounting is based on identifying packet flows and maintaining statistics and access list processing within a router. It does not involve any connection-setup protocol either between routers or to any other networking device or end station and does not require any change externally---either to the traffic or packets themselves or to any other networking device. Thus, NetFlow is completely transparent to the existing network, including end stations and application software and network devices like LAN switches. Also, because NetFlow is performed independently on each internetworking device, it does not need to be operational on each router in the network. Network planners can selectively invoke NetFlow accounting (and NetFlow data export) on a router/interface basis to gain traffic performance, control, or accounting benefits in specific network locations.
![]() |
NoteWhen sampled NetFlow is disabled on an interface, normal NetFlow also becomes disabled. This restriction was made to prevent the interface from being overwhelmed by the sudden transition from sampled NetFlow to normal NetFlow. You need to explicitly reenable NetFlow if so desired. The default value for the sampling interval is 4 billion. This default packet interval was designed to protect the router from being choked by a misconfiguration. You need to explicitly configure a usable packet interval for your case. |
![]() |
NoteNetFlow does consume additional memory and CPU resources in comparison with other switching modes; therefore, it is important to understand the resources required on your router before enabling NetFlow. |
Examples
The following example enables NetFlow switching on the interface:
interface ethernet 0/5/0 ip address 17.252.245.2 255.255.255.0 ip route-cache flow
Related Commands
ip flow-export Enables the exporting of information in NetFlow cache entries.
Command
Description
To enable sampling mode in the NetFlow cache, use the ip flow-sampling-mode global configuration command. To disable sampling mode, use the no form of this command.
ip flow-sampling-mode packet-interval value
Syntax Description
packet-interval Samples a single packet out of a user-defined interval. value Number of intervals to the next sampled packet in the NetFlow cache. The valid range is from 10 to 16382. The default is 4 billion.
Defaults
This command is not enabled by default.
Command Modes
Global configuration
Command History
12.0(11)S This command was introduced.
Release
Modification
Examples
The following example shows how to enable sampling mode and to set the sampling interval to 100:
ip flow-sampling-mode packet-interval 100
To display the settings of the sampling type and sampling interval, use the show ip flow sampling EXEC command.
show ip flow samplingSyntax Description
This command has no keywords and arguments.
Defaults
No default behavior or values.
Command Modes
EXEC
Command History
12.0(11)S This command was introduced.
Release
Modification
Examples
The following example displays NetFlow sampling by using the show ip flow sampling command:
show ip flow sampling Flow sampling is enabled'Packet Interval' sampling mode is configured. 1 out of every 100 packets is being sampled.
This section documents the new debug ip flow sampling command. All other commands used with this feature are documented in the Cisco IOS Release 12.1 command reference publications.
To help debug sampling-related activities, use the debug ip flow sampling command in EXEC mode.
debug ip flow samplingSyntax Description
This command has no keywords and arguments.
Defaults
No default behavior or values.
Command Modes
EXEC
Command History
12.0(11)S This command was introduced.
Release
Modification
Examples
The following example displays NetFlow sampling by using the debug ip flow sampling command:
debug ip flow sampling
IP Flow sampling mode events debugging is on
The following example displays a configuration of a sampled mode and sampling interval:
ip flow-sampling-mode packet-interval 100 debug ip flow sampling 01:58:18: Flow sampling is enabled 01:58:18: Sampling parameters: mode = 'Packet Interval', interval = 100 01:58:18: IPFLOW: Sending sampling config message to all LC
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Wed Jun 21 14:57:15 PDT 2000
Copyright 1989 - 2000©Cisco Systems Inc.