NetFlow Configuration Guide
NetFlow Configuration Guide
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL
STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT
WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT
SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE
OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCBs public
domain version of the UNIX operating system. All rights reserved. Copyright 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED AS IS WITH
ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF
DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING,
WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO
OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
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 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.
NetFlow Configuration Guide
2010 Cisco Systems, Inc. All rights reserved.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology. This module provides an overview
of the NetFlow application and advanced NetFlow features and services.
Contents
Glossary, page 10
NetFlow Benefits: Monitoring, Analysis and Planning, Security, and Accounting and Billing, page 2
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
NetFlow Advanced Features and Services: BGP Next Hop, Multicast, MPLS, NetFlow Layer 2 and
Security Monitoring Exports, and IPv6, page 6
NetFlow data enables you to view detailed, time- and application-based usage of a network. This
information allows you to plan and allocate network and application resources, and provides for
extensive near real-time network monitoring capabilities. It can be used to display traffic patterns and
application-based views. NetFlow provides proactive problem detection and efficient troubleshooting,
and it facilitates rapid problem resolution. You can use NetFlow information to efficiently allocate
network resources and to detect and resolve potential security and policy violations.
Network Planning
NetFlow can capture data over a long period of time, which enables you to track and anticipate network
growth and plan upgrades. NetFlow service data can be used to optimize network planning, which
includes peering, backbone upgrade planning, and routing policy planning. It also enables you to
minimize the total cost of network operations while maximizing network performance, capacity, and
reliability. NetFlow detects unwanted WAN traffic, validates bandwidth and quality of service (QoS)
usage, and enables the analysis of new network applications. NetFlow offers valuable information that
you can use to reduce the cost of operating the network.
Denial of Service and Security Analysis
You can use NetFlow data to identify and classify denial of service (DoS) attacks, viruses, and worms
in real-time. Changes in network behavior indicate anomalies that are clearly reflected in NetFlow data.
The data is also a valuable forensic tool that you can use to understand and replay the history of security
incidents.
Accounting and Billing
NetFlow data provides fine-grained metering for highly flexible and detailed resource utilization
accounting. For example, flow data includes details such as IP addresses, packet and byte counts,
timestamps, type-of-service, and application ports. Service providers might utilize the information for
billing based on time-of-day, bandwidth usage, application usage, or quality of service. Enterprise
customers might utilize the information for departmental chargeback or cost allocation for resource
utilization.
Traffic Engineering
NetFlow provides autonomous system (AS) traffic engineering details. You can use NetFlow-captured
traffic data to understand source-to-destination traffic trends. This data can be used for load-balancing
traffic across alternate paths or for forwarding traffic to a preferred route. NetFlow can measure the
amount of traffic crossing peering or transit points to help you determine if a peering arrangement with
other service providers is fair and equitable.
NetFlow Data Storage and Data Mining
NetFlow data (or derived information) can be stored for later retrieval and analysis in support of
marketing and customer service programs. For example, the data can be used to find out which
applications and services are being used by internal and external users and to target those users for
improved service and advertising. In addition, NetFlow data gives market researchers access to the who,
what, where, and how long information relevant to enterprises and service providers.
Although NetFlow functionality is included in all software images for these platforms, you must
purchase a separate NetFlow feature license. NetFlow licenses are sold on a per-node basis.
Other Routers
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image
support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on
Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at
the login dialog box and follow the instructions that appear.
NetFlow Flows
A NetFlow network flow is defined as a unidirectional stream of packets between a given source and
destination. The source and destination are each defined by a network-layer IP address and
transport-layer source and destination port numbers. Specifically, a flow is defined by the combination
of the following seven key fields:
Source IP address
Destination IP address
These seven key fields define a unique flow. If a packet has one key field different from another packet,
it is considered to belong to another flow. A flow might also contain other accounting fields (such as the
AS number in the NetFlow export Version 5 flow format), depending on the export record version that
you configure. Flows are stored in the NetFlow cache.
IP-to-IP packets
ATM-terminated packets
NetFlow captures data for all egress (outgoing) packets through the use of the following features:
Egress NetFlow AccountingNetFlow gathers data for all egress packets for IP traffic only.
NetFlow MPLS EgressNetFlow gathers data for all egress MPLS-to-IP packets.
Version 9A flexible and extensible format, which provides the versatility needed for support of
new fields and record types. This format accommodates new NetFlow-supported technologies such
as multicast, Multiprotocol Label Switching (MPLS), and Border Gateway Protocol (BGP) next
hop. The distinguishing feature of the NetFlow Version 9 format is that it is template based.
Templates provide a means of extending the record format, a feature that should allow future
enhancements to NetFlow services without requiring concurrent changes to the basic flow-record
format. Internet Protocol Information Export (IPFIX) was based on the Version 9 export format.
Version 8A format added to support data export from aggregation caches. Version 8 allows export
datagrams to contain a subset of the usual Version 5 export data, if that data is valid for a particular
aggregation cache scheme.
Version 7A version supported on Catalyst 6000 series switches with a Multilayer Switch Feature
Card (MSFC) on CatOS Release 5.5(7) and later.
On Catalyst 6000 series switches with an MSFC, you can export using either the Version 7 or
Version 8 format.
Information about and instructions for configuring NetFlow on Catalyst 6000 series switches is
available in the Catalyst 6500 Series Switches documentation.
Version 5A version that adds BGP autonomous system (AS) information and flow sequence
numbers.
Version 1, the initially released export format, is rarely used today. Do not use the Version 1 export
format unless the legacy collection system you are using requires it. Use either the Version 9 export
format or the Version 5 export format for data export from the main cache.
For more information on a specific NetFlow data export format, see the Configuring NetFlow and
NetFlow Data Export module.
Preprocessing features that allow you to collect subsets of your network traffic data for analysis.
Advanced features and services based on the flexible NetFlow Version 9 export format that allow
you to collect data on types of traffic in addition to IP traffic.
Postprocessing features that allow you to define fields that control how traffic data is exported.
You need to decide if you want to further analyze your network traffic. If you do want to do further
analysis, you need to make choices in two areas:
Do you want to customize or fine-tune the way that you collect NetFlow data? For example, you
might want to configure packet sampling, or packet filtering, or an aggregation scheme.
Do you want to collect and analyze data about the use of other Cisco IOS applications? For example,
you might want to configure NetFlow support for BGP next hop, multicast, MPLS, or IPv6.
Before you configure or enable an additional NetFlow feature or service, you need to understand the
prerequisites, restrictions, and key concepts that apply to each feature or service. Refer to the following
sections for information about and links to the NetFlow features and services:
NetFlow Advanced Features and Services: BGP Next Hop, Multicast, MPLS, NetFlow Layer 2 and
Security Monitoring Exports, and IPv6, page 6
Preprocessing Feature
Brief Description
Packet sampling
Filtering
NetFlow Advanced Features and Services: BGP Next Hop, Multicast, MPLS,
NetFlow Layer 2 and Security Monitoring Exports, and IPv6
Table 2 briefly describes advanced features and services supported by NetFlow and indicates where you
can find concept and task information about each. Configure these features and services to collect and
analyze NetFlow traffic statistics about them (features such as BGP Next Hop, multicast, and MPLS).
Table 2
Feature or Service
Brief Description
Multicast support
Table 2
Feature or Service
Brief Description
MPLS support
Postprocessing Features
Brief Description
Aggregation schemes
Export to multiple
destinations
NetFlow MIBs
The NetFlow MIB and the NetFlow MIB and Top Talkers features provide real time access to NetFlow
cache information. These feature do not require a collector to obtain NetFlow data. This allows smaller
enterprises to collect NetFlow data.
With the NetFlow MIB feature, you can access in real time the system information that is stored in the
NetFlow cache by utilizing a MIB implementation based on the Simple Network Management Protocol
(SNMP). This information is accessed by get and set commands entered on the network management
system (NMS) workstation for which SNMP has been implemented. The NetFlow MIB feature provides
MIB objects that allow you to monitor cache flow information, the current NetFlow configuration, and
statistics. For details about the NetFlow MIB, see the Configuring SNMP and using the NetFlow MIB
to Monitor NetFlow Data module.
The NetFlow MIB and Top Talkers feature uses NetFlow functionality to obtain information regarding
heaviest traffic patterns and most-used applications in the network. You can use this feature for security
monitoring or accounting purposes for top talkers, and matching and identifying addresses for key users
of the network. You configure the criteria by which flows from the NetFlow cache are sorted and placed
in a special cache. The flows that are displayed by this feature are known as top talkers. For details
about the NetFlow MIB and Top Talkers, see the Configuring NetFlow Top Talkers using Cisco IOS
CLI Commands or SNMP Commands module.
Where to Go Next
To configure basic NetFlow, refer to the Configuring NetFlow and NetFlow Data Export module. See
the Related Documents section on page 9 for links to configuration information about additional
NetFlow features and services.
Additional References
The following sections provide references related to configuring NetFlow.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data
configuring NetFlow and NetFlow Data Export
Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFCs
Title
RFC 2460
RFC 3954
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
Glossary
ASautonomous system. A collection of networks under a common administration sharing a common
routing strategy. Autonomous systems are subdivided into areas. An autonomous system must be
assigned a unique 16-bit number by the Internet Assigned Numbers Authority (IANA).
BGPBorder Gateway Protocol. An interdomain routing protocol that replaces Exterior Gateway
Protocol (EGP). A BGP system exchanges reachability information with other BGP systems. BGP is
defined by RFC 1163.
BGP next hopIP address of the next hop to be used to reach a certain destination.
flow(NetFlow) A set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which the flow is monitored.
Ingress flows are associated with the input interface, and egress flows are associated with the output
interface.
IPv6IP Version 6. Replacement for the current version of IP (Version 4). IPv6 includes support for
flow ID in the packet header, which can be used to identify flows. Formerly called IPng (next
generation).
ISLInter-Switch Link. Cisco-proprietary protocol that maintains VLAN information as traffic flows
between switches and routers.
MPLSMultiprotocol Label Switching. An emerging industry standard for the forwarding of packets
along normally routed paths (sometimes called MPLS hop-by-hop forwarding).
10
multicastWhen single packets are copied by the network and sent to a specific subset of network
addresses, they are said to be multicast. These addresses are specified in the Destination Address field.
NetFlowA Cisco IOS application that provides statistics on packets flowing through the routing
devices in the network. It is emerging as a primary network accounting and security technology.
NetFlow aggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router or switch that is running NetFlow and decodes, aggregates, and stores them. You can
generate reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow V9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
QoSquality of service. A measure of performance for a transmission system that reflects the systems
transmission quality and service availability.
traffic engineeringTechniques and processes that cause routed traffic to travel through the network
on a path other than the one that would have been chosen if standard routing methods were used.
VLANvirtual LAN. Group of devices on one or more LANs that are configured (by management
software) so that they can communicate as if they were attached to the same wire, when in fact they are
located on a number of different LAN segments. Because VLANs are based on logical instead of
physical connections, they are extremely flexible.
CCDE, CCENT, CCSI, Cisco Eos, Cisco Explorer, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Nurse Connect, Cisco Pulse,
Cisco SensorBase, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco TrustSec, Cisco Unified Computing System, Cisco WebEx,
DCE, Flip Channels, Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to
the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed
(Stylized), Cisco Store, Flip Gift Card, and One Million Acts of Green are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS,
Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert
logo, Cisco IOS, Cisco Lumin, Cisco Nexus, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity,
Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center, Explorer, Follow Me Browsing, GainMaker, iLYNX, IOS,
iPhone, IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking
Academy, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect, ROSA, SenderBase, SMARTnet,
Spectrum Expert, StackWise, WebEx, and the WebEx logo are registered trademarks of Cisco and/or its affiliates in the United States and certain
other countries.
All other trademarks mentioned in this document or website 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. (1002R)
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.
2008 Cisco Systems, Inc. All rights reserved.
11
12
This roadmap lists the features documented in the Cisco IOS NetFlow Configuration Guide. This
roadmap is organized by software releases and features available in that release. For any feature, click
the link in the Where Documented column to view the document that contains information about the
feature.
Many legacy features have been incorporated into the configuration files, and these features may not
have entries in this roadmap. In addition, information in this roadmap supports other software releases
or platforms. For the latest feature information and caveats, see the release notes for your platform and
software release.
Feature and Release Support
Table 1 lists Cisco IOS NetFlow feature support for the following Cisco IOS software release trains:
Cisco IOS Software Releases 12.2T, 12.3, 12.3T, 12.4, 12.4T and 15.0M
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco
Feature Navigator enables you to determine which Cisco IOS and Catalyst OS 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 Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Table 1 lists the most recent release of each software train first and the features in alphabetical order
within the release.
Table 1
Release
Feature Name
Feature Description
Where Documented
12.0(26)S
12.0(25)S
12.0(24)S
MPLS-aware NetFlow
Configuring
Multiprotocol Label Switching (MPLS)-aware
NetFlow is an extension of the NetFlow accounting MPLS-aware NetFlow
feature that provides highly granular traffic statistics
for Cisco routers. MPLS-aware NetFlow collects
statistics on a per-flow basis just as NetFlow does.
MPLS-aware NetFlow uses the NetFlow Version 9
export format.
12.0(26)S
12.0(11)S
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
a minimum mask size for prefix aggregation,
Aggregation
destination-prefix aggregation, and source-prefix
aggregation schemes.
12.0(19)S
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.0(22)S
NetFlow Subinterface
Support
12.0(15)S
NetFlow ToS-Based
Router Aggregation
12.0(24)S
NetFlow v9 Export
Format
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
Table 1
Release
Feature Name
Feature Description
12.0(26)S
Random Sampled
NetFlow
Where Documented
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
12.2(18)S
12.2(25)S
The NetFlow Input Filters feature provides NetFlow Using NetFlow Filtering
or Sampling to Select the
data for a specific subset of traffic by letting you
create filters to select flows for NetFlow processing. Network Traffic to Track
For example, you can select flows from a specific
group of hosts. This feature also lets you select
various sampling rates for selected flows. The
NetFlow Input Filters feature is used, for example,
for class-based traffic analysis and monitoring
on-network or off-network traffic.
12.2(25)S
NetFlow MIB
12.2(25)S
12.2(18)S
NetFlow Multicast
Support
Configuring NetFlow
The NetFlow Multicast Support feature lets you
Multicast Accounting
capture multicast-specific data (both packets and
bytes) for multicast flows. For example, you can
capture the packet-replication factor for a specific
flow as well as for each outgoing stream. This feature
provides complete end-to-end usage information
about network traffic for a complete multicast traffic
billing solution.
Table 1
Release
Feature Name
12.2(14)S
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.2(14)S
NetFlow Subinterface
Support
12.2(14)S
NetFlow ToS-Based
Router Aggregation
12.2(18)S
NetFlow v9 Export
Format
12.2(18)S
Random Sampled
NetFlow
Feature Description
Where Documented
12.2(28)SBB
Egress NetFlow
Accounting
Table 1
Release
Feature Name
Feature Description
Where Documented
12.2(27)SBC
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
12.2(31)SB2
NetFlow MIB
12.2(27)SBC
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
Aggregation
a minimum mask size for prefix aggregation,
destination-prefix aggregation, and source-prefix
aggregation schemes.
12.2(27)SBC
NetFlow Multicast
Support
12.2(27)SBC
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.2(27)SBC
NetFlow Subinterface
Support
12.2(27)SBB
NetFlow ToS-Based
Router Aggregation
12.2(27)SBC
NetFlow v9 Export
Format
Configuring NetFlow
The NetFlow Multicast Support feature lets you
Multicast Accounting
capture multicast-specific data (both packets and
bytes) for multicast flows. For example, you can
capture the packet-replication factor for a specific
flow as well as for each outgoing stream. This feature
provides complete end-to-end usage information
about network traffic for a complete multicast traffic
billing solution.
Table 1
Release
Feature Name
Feature Description
12.2(28)SB
MPLS-aware NetFlow
Configuring
Multiprotocol Label Switching (MPLS)-aware
NetFlow is an extension of the NetFlow accounting MPLS-aware NetFlow
feature that provides highly granular traffic statistics
for Cisco routers. MPLS-aware NetFlow collects
statistics on a per-flow basis just as NetFlow does.
MPLS-aware NetFlow uses the NetFlow Version 9
export format.
12.2(27)SBC
Random Sampled
NetFlow
Where Documented
12.2(33)SRA
Egress NetFlow
Accounting
12.2(33)SRA
Configuring MPLS
The MPLS Egress NetFlow Accounting feature
allows you to capture IP flow information for packets Egress NetFlow
undergoing MPLS label disposition; that is, packets Accounting and Analysis
that arrive on a router as MPLS packets and are
transmitted as IP packets.
12.2(33)SRB
The NetFlow data export (NDE) for VRF Interfaces NDE for VRF Interfaces
feature enables the creation and export of hardware
NetFlow cache entries for traffic entering a router on
the last multiprotocol label switching (MPLS) hop of
an IPv4 MPLS virtual private network (VPN).
12.2(33)SRA
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
Table 1
Release
Feature Name
Feature Description
12.2(33)SRA
The NetFlow Input Filters feature provides NetFlow Using NetFlow Filtering
or Sampling to Select the
data for a specific subset of traffic by letting you
create filters to select flows for NetFlow processing. Network Traffic to Track
For example, you can select flows from a specific
group of hosts. This feature also lets you select
various sampling rates for selected flows. The
NetFlow Input Filters feature is used, for example,
for class-based traffic analysis and monitoring
on-network or off-network traffic.
12.2(33)SRD
NetFlow MIB
12.2(33)SRA
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
Aggregation
a minimum mask size for prefix aggregation,
destination-prefix aggregation, and source-prefix
aggregation schemes.
12.2(33)SRA
NetFlow Multicast
Support
12.2(33)SRA
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.2(33)SRA
NetFlow Subinterface
Support
12.2(33)SRA
NetFlow ToS-Based
Router Aggregation
Where Documented
Configuring NetFlow
The NetFlow Multicast Support feature lets you
Multicast Accounting
capture multicast-specific data (both packets and
bytes) for multicast flows. For example, you can
capture the packet-replication factor for a specific
flow as well as for each outgoing stream. This feature
provides complete end-to-end usage information
about network traffic for a complete multicast traffic
billing solution.
Table 1
Release
Feature Name
Feature Description
12.2(33)SRA
NetFlow v9 Export
Format
12.2(33)SRB
12.2(33)SRA
Random Sampled
NetFlow
Where Documented
12.2(18)SXF
Egress NetFlow
Accounting
12.2(18)SXE
Configuring MPLS
The MPLS Egress NetFlow Accounting feature
allows you to capture IP flow information for packets Egress NetFlow
undergoing MPLS label disposition; that is, packets Accounting and Analysis
that arrive on a router as MPLS packets and are
transmitted as IP packets.
12.2(33)SXI
Configuring Netflow
Accounting for Unicast
and Multicast on GRE
Tunnel Interfaces
Table 1
Release
Feature Name
Feature Description
Where Documented
12.2(18)SXF
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
12.2SX1
The NetFlow Input Filters feature provides NetFlow Using NetFlow Filtering
or Sampling to Select the
data for a specific subset of traffic by letting you
create filters to select flows for NetFlow processing. Network Traffic to Track
For example, you can select flows from a specific
group of hosts. This feature also lets you select
various sampling rates for selected flows. The
NetFlow Input Filters feature is used, for example,
for class-based traffic analysis and monitoring
on-network or off-network traffic.
12.2SX1
12.2(18)SXF
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
Aggregation
a minimum mask size for prefix aggregation,
destination-prefix aggregation, and source-prefix
aggregation schemes.
12.2(18)SXF
NetFlow Multicast
Support
12.2(18)SXE
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.2(33)SXH
NetFlow Subinterface
Support
Configuring NetFlow
The NetFlow Multicast Support feature lets you
Multicast Accounting
capture multicast-specific data (both packets and
bytes) for multicast flows. For example, you can
capture the packet-replication factor for a specific
flow as well as for each outgoing stream. This feature
provides complete end-to-end usage information
about network traffic for a complete multicast traffic
billing solution.
Table 1
Release
Feature Name
Feature Description
12.2(18)SXF
NetFlow ToS-Based
Router Aggregation
12.2(18)SXF
NetFlow v9 Export
Format
12.2(33)SXH
12.2(18)SXF
Random Sampled
NetFlow
Where Documented
Cisco IOS Software Releases 12.2T, 12.3, 12.3T, 12.4, 12.4T and 15.0M
12.3(11)T
Egress NetFlow
Accounting
12.3(8)T
MPLS-aware NetFlow
Configuring
Multiprotocol Label Switching (MPLS)-aware
NetFlow is an extension of the NetFlow accounting MPLS-aware NetFlow
feature that provides highly granular traffic statistics
for Cisco routers. MPLS-aware NetFlow collects
statistics on a per-flow basis just as NetFlow does.
MPLS-aware NetFlow uses the NetFlow Version 9
export format.
10
Table 1
Release
Feature Name
Feature Description
12.3(11)T
Configuring MPLS
The MPLS Egress NetFlow Accounting feature
allows you to capture IP flow information for packets Egress NetFlow
undergoing MPLS label disposition; that is, packets Accounting and Analysis
that arrive on a router as MPLS packets and are
transmitted as IP packets.
12.3(1)
12.4(4)T
The NetFlow Dynamic Top Talkers CLI feature gives Detecting and Analyzing
you an overview of the highest volume traffic in your Network Threats With
NetFlow
network by aggregating flows on a common field.
For example, you can aggregate all of the flows for a
destination network by aggregating them on the
destination prefix.
12.3(4)T
The NetFlow Input Filters feature provides NetFlow Using NetFlow Filtering
or Sampling to Select the
data for a specific subset of traffic by letting you
create filters to select flows for NetFlow processing. Network Traffic to Track
For example, you can select flows from a specific
group of hosts. This feature also lets you select
various sampling rates for selected flows. The
NetFlow Input Filters feature is used, for example,
for class-based traffic analysis and monitoring
on-network or off-network traffic.
12.3(14)T
12.3(7)T
NetFlow MIB
12.3(11)T
12.1(2)T
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
Aggregation
a minimum mask size for prefix aggregation,
destination-prefix aggregation, and source-prefix
aggregation schemes.
Where Documented
Configuring NetFlow
BGP Next Hop Support
for Accounting and
Analysis
11
Table 1
Release
Feature Name
Feature Description
12.3(1)
NetFlow Multicast
Support
Configuring NetFlow
The NetFlow Multicast Support feature lets you
Multicast Accounting
capture multicast-specific data (both packets and
bytes) for multicast flows. For example, you can
capture the packet-replication factor for a specific
flow as well as for each outgoing stream. This feature
provides complete end-to-end usage information
about network traffic for a complete multicast traffic
billing solution.
12.2(2)T
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
12.4(4)T
12.2(15)T
NetFlow Subinterface
Support
12.2(4)T
NetFlow ToS-Based
Router Aggregation
12.3(1)
NetFlow v9 Export
Format
12
Where Documented
Table 1
Release
Feature Name
Feature Description
12.3(2)T
Random Sampled
NetFlow
12.4(2)T
Where Documented
2.1
Egress NetFlow
Accounting
2.1
NetFlow Aggregation
2.1
Configuring NetFlow
NetFlow Minimum Prefix The NetFlow Minimum Prefix Mask for
Mask for Router-Based
Router-Based Aggregation feature allows you to set Aggregation Caches
Aggregation
a minimum mask size for prefix aggregation,
destination-prefix aggregation, and source-prefix
aggregation schemes.
2.1
NetFlow Multiple Export The NetFlow Multiple Export Destinations feature Configuring NetFlow and
Destinations
enables configuration of multiple destinations of the NetFlow Data Export
NetFlow data.
2.1
NetFlow Subinterface
Support
13
Table 1
Release
Feature Name
Feature Description
2.1
NetFlow v9 Export
Format
2.1
Random Sampled
NetFlow
Where Documented
12.2(18)ZYA2 Application-aware
NetFlow
1. This feature is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform,
and platform hardware.
2. This is a minor enhancement. Minor enhancements are not typically listed in Feature Navigator.
CCDE, CCENT, CCSI, Cisco Eos, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Lumin, Cisco Nexus, Cisco Nurse Connect,
Cisco Pulse, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco Unified Computing System, Cisco WebEx, DCE, Flip Channels,
Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to the Human Network
are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed (Stylized), Cisco Store,
and Flip Gift Card are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP,
CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems,
Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center,
Explorer, Fast Step, Follow Me Browsing, FormShare, GainMaker, GigaDrive, HomeLink, iLYNX, Internet Quotient, IOS, iPhone, iQuick Study,
IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers,
Networking Academy, Network Registrar, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect,
ROSA, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx,
and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0908R)
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.
20062009 Cisco Systems, Inc. All rights reserved.
14
This module contains the minimum amount of information about and instructions necessary for
configuring NetFlow to capture and export network traffic data. This module is intended to help you get
started using NetFlow and NetFlow Data Export as quickly as possible. If you want more detailed
information about and instructions for configuring NetFlow and NetFlow Data Export please refer to
Configuring NetFlow and NetFlow Data Export.
NetFlow capture and export are performed independently on each internetworking device on which
NetFlow is enabled. NetFlow need not be operational on each router in the network.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router.
NetFlow is emerging as a primary network accounting and security technology.
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Prerequisites for Configuring NetFlow and NetFlow Data Export
Configuration Examples for Configuring NetFlow and NetFlow Data Export, page 9
Feature Information for Configuring NetFlow and NetFlow Data Export, page 13
Glossary, page 16
Ensure that one of the following is enabled on your router, and on the interfaces that you want to
configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
Understand the resources required on your router because NetFlow consumes additional memory
and CPU resources
During times of heavy traffic, the additional flows can fill up the global flow hash table. If you need to
increase the size of the global flow hash table, increase the memory of the router.
Cisco IOS Releases 12.2(14)S, 12.0(22)S, or 12.2(15)T
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Egress NetFlow Accounting in Cisco IOS 12.3T Releases, 12.3(11)T or Later
The Egress NetFlow Accounting feature captures NetFlow statistics for IP traffic only. MPLS statistics
are not captured. The MPLS Egress NetFlow Accounting feature can be used on a provider edge (PE)
router to capture IP traffic flow information for egress IP packets that arrived at the router as MPLS
packets and underwent label disposition.
Egress NetFlow accounting might adversely affect network performance because of the additional
accounting-related computation that occurs in the traffic-forwarding path of the router.
Locally generated traffic (traffic that is generated by the router on which the Egress NetFlow Accounting
feature is configured) is not counted as flow traffic for the Egress NetFlow Accounting feature.
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Information About Configuring NetFlow and NetFlow Data Export
Note
In Cisco IOS 12.2S releases, egress NetFlow captures either IPv4 or MPLS packets as they leave the
router.
Export bandwidthExport bandwidth use increases for Version 9 (because of template flowsets)
versus Version 5. The increase in bandwidth usage versus Version 5 varies with the frequency with
which template flowsets are sent. The default is to resend templates every 20 packets, which has a
bandwidth cost of about 4 percent. If necessary, you can lower the resend rate with the ip
flow-export template refresh-rate packets command.
IP-to-IP packets
ATM-terminated packets
NetFlow captures data for all egress (outgoing) packets through the use of the following features:
Egress NetFlow AccountingNetFlow gathers statistics for all egress packets for IP traffic only.
NetFlow MPLS EgressNetFlow gathers statistics for all egress MPLS-to-IP packets.
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
How to Configure NetFlow and NetFlow Data Export
Source IP address
Destination IP address
These seven key fields define a unique flow. If a packet has one key field different from another packet,
it is considered to belong to another flow. A flow might contain other accounting fields (such as the AS
number in the NetFlow export Version 5 flow format) that depend on the export record version that you
configure. Flows are stored in the NetFlow cache.
Configure NetFlow and NetFlow Data Export Using the Version 9 Export Format, page 4 (required)
Verify that NetFlow is Operational and View NetFlow Statistics, page 6 (optional)
Configure NetFlow and NetFlow Data Export Using the Version 9 Export Format
Perform the steps in this required task to configure NetFlow and NetFlow Data Export Using the Version
9 Export Format.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
How to Configure NetFlow and NetFlow Data Export
4.
5.
ip flow-export version 9
6.
7.
8.
exit
9.
10. end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Note
Step 4
Step 5
ip flow-export version 9
Example:
Router(config)# ip flow-export version 9
Caution
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
How to Configure NetFlow and NetFlow Data Export
Step 6
Command or Action
Purpose
Example:
Router(config)# interface ethernet 0/0
Step 7
Example:
Router(config-if)# ip flow ingress
or
Example:
Router(config-if)# ip flow egress
Step 8
exit
Example:
Note
Router(config-if)# exit
Step 9
(Optional)
Step 10
end
Example:
Router(config-if)# end
SUMMARY STEPS
1.
2.
3.
DETAILED STEPS
Step 1
Step 2
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
How to Configure NetFlow and NetFlow Data Export
Use this command to verify that NetFlow is operational, and to display a summary of the NetFlow
statistics. The following is sample output from this command:
Router# show ip cache flow
IP packet size distribution (1103746 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.249 .694 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .027 .000 .027 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 278544 bytes
35 active, 4061 inactive, 980 added
2921778 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 21640 bytes
0 active, 1024 inactive, 0 added, 0 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol
Total
Flows
Packets Bytes Packets Active(Sec) Idle(Sec)
-------Flows
/Sec
/Flow /Pkt
/Sec
/Flow
/Flow
TCP-FTP
108
0.0
1133
40
2.4
1799.6
0.9
TCP-FTPD
108
0.0
1133
40
2.4
1799.6
0.9
TCP-WWW
54
0.0
1133
40
1.2
1799.6
0.8
TCP-SMTP
54
0.0
1133
40
1.2
1799.6
0.8
TCP-BGP
27
0.0
1133
40
0.6
1799.6
0.7
TCP-NNTP
27
0.0
1133
40
0.6
1799.6
0.7
TCP-other
297
0.0
1133
40
6.8
1799.7
0.8
UDP-TFTP
27
0.0
1133
28
0.6
1799.6
1.0
UDP-other
108
0.0
1417
28
3.1
1799.6
0.9
ICMP
135
0.0
1133
427
3.1
1799.6
0.8
Total:
945
0.0
1166
91
22.4
1799.6
0.8
SrcIf
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
.
.
.
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Router#
Step 3
SrcIPaddress
192.168.67.6
10.10.18.1
10.10.18.1
10.234.53.1
10.10.19.1
10.10.19.1
192.168.87.200
192.168.87.200
DstIf
Et1/0.1
Null
Null
Et1/0.1
Null
Null
Et1/0.1
Et1/0.1
DstIPaddress
172.16.10.200
172.16.11.5
172.16.11.5
172.16.10.2
172.16.11.6
172.16.11.6
172.16.10.2
172.16.10.2
Pr
01
11
11
01
11
11
06
06
SrcP
0000
0043
0045
0000
0044
00A2
0014
0015
DstP
0C01
0043
0045
0800
0044
00A2
0014
0015
Pkts
51
51
51
51
51
51
50
52
172.16.1.84
172.16.1.84
172.16.1.85
172.16.1.85
10.251.10.1
10.162.37.71
Et1/0.1
Et1/0.1
Et1/0.1
Et1/0.1
Et1/0.1
Null
172.16.10.19
172.16.10.19
172.16.10.20
172.16.10.20
172.16.10.2
172.16.11.3
06
06
06
06
01
06
0087
0050
0089
0050
0000
027C
0087
0050
0089
0050
0800
027C
50
51
49
50
51
49
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
How to Configure NetFlow and NetFlow Data Export
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .027 .000 .027 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 278544 bytes
35 active, 4061 inactive, 980 added
2992518 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 21640 bytes
0 active, 1024 inactive, 0 added, 0 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol
Total
Flows
Packets Bytes Packets Active(Sec) Idle(Sec)
-------Flows
/Sec
/Flow /Pkt
/Sec
/Flow
/Flow
TCP-FTP
108
0.0
1133
40
2.4
1799.6
0.9
TCP-FTPD
108
0.0
1133
40
2.4
1799.6
0.9
TCP-WWW
54
0.0
1133
40
1.2
1799.6
0.8
TCP-SMTP
54
0.0
1133
40
1.2
1799.6
0.8
TCP-BGP
27
0.0
1133
40
0.6
1799.6
0.7
TCP-NNTP
27
0.0
1133
40
0.6
1799.6
0.7
TCP-other
297
0.0
1133
40
6.6
1799.7
0.8
UDP-TFTP
27
0.0
1133
28
0.6
1799.6
1.0
UDP-other
108
0.0
1417
28
3.0
1799.6
0.9
ICMP
135
0.0
1133
427
3.0
1799.6
0.8
Total:
945
0.0
1166
91
21.9
1799.6
0.8
SrcIf
Port Msk
Et0/0
0000 /0
Et0/0
0043 /0
Et0/0
0045 /0
Et0/0
0000 /0
Et0/0
0044 /0
.
.
.
Et0/0
0087 /0
Et0/0
0050 /0
Et0/0
0089 /0
Et0/0
0050 /0
Et0/0
0000 /0
Et0/0
027C /0
Router#
SrcIPaddress
AS
192.168.67.6
0
10.10.18.1
0
10.10.18.1
0
10.234.53.1
0
10.10.19.1
0
172.16.1.84
0
172.16.1.84
0
172.16.1.85
0
172.16.1.85
0
10.251.10.1
0
10.162.37.71
0
DstIf
Port Msk
Et1/0.1
0C01 /0
Null
0043 /0
Null
0045 /0
Et1/0.1
0800 /0
Null
0044 /0
Et1/0.1
0087 /0
Et1/0.1
0050 /0
Et1/0.1
0089 /0
Et1/0.1
0050 /0
Et1/0.1
0800 /0
Null
027C /0
AS
0
0
0
0
0
0
0
0
0
0
0
DstIPaddress
NextHop
172.16.10.200
0.0.0.0
172.16.11.5
0.0.0.0
172.16.11.5
0.0.0.0
172.16.10.2
0.0.0.0
172.16.11.6
0.0.0.0
172.16.10.19
0.0.0.0
172.16.10.19
0.0.0.0
172.16.10.20
0.0.0.0
172.16.10.20
0.0.0.0
172.16.10.2
0.0.0.0
172.16.11.3
0.0.0.0
06 00
06
06
06
01
06
00
40
00 00
40
00 00
40
00 00
40
00 10
1500
00 00
40
799
1258.1
799
1258.0
798
1256.5
799
1258.0
799
1258.1
798
1256.4
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Configuration Examples for Configuring NetFlow and NetFlow Data Export
SUMMARY STEPS
1.
DETAILED STEPS
Step 1
Configure NetFlow and NetFlow Data Export Using the Version 9 Export Format, page 10
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Configuration Examples for Configuring NetFlow and NetFlow Data Export
Note
NetFlow performs additional checks for the status of each subinterface that requires more CPU
processing time and bandwidth. If you have several subinterfaces configured and you want to configure
NetFlow data capture on all of them, we recommend that you configure NetFlow on the main interface
instead of on the individual subinterfaces.
Note
You can configure a maximum of two export destinations for the main cache and for each aggregation
cache.
Configure NetFlow and NetFlow Data Export Using the Version 9 Export Format
The following example shows how to configure NetFlow and NetFlow data export using the Version 9
export format:
configure terminal
!
ip flow-export destination 10.10.10.10 9991
ip flow-export version 9
!
10
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Additional References
The following example shows how to configure egress NetFlow on a virtual template interface so that
you can accurately analyze the packet size distribution statistics of the traffic that the router is sending
to the end user over the PPoE session:
configure terminal
Router(config)# interface Virtual-Template 1
Router(config-if)# ip unnumbered ethernet 0
Router(config-if)# encapsulation ppp
Router(config-if)# ip flow egress
The following display output from the show ip cache flow command shows that this PPPoE session
traffic is comprised primarily of 1536 byte packets.
Router# show ip cache flow
IP packet size distribution (11014160 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .000 .999 .000 .000 .000 .000 .000 .000
Additional References
The following sections provide references related to the configuring of NetFlow to capture and export
netflow traffic data.
Related Documents
Related Topic
Document Title
11
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Additional References
Related Topic
Document Title
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
12
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Feature Information for Configuring NetFlow and NetFlow Data Export
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
Note
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
13
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Feature Information for Configuring NetFlow and NetFlow Data Export
Table 1
Feature Name
Releases
12.3(11)T
15.0(1)S
12.2(14)S,
12.0(22)S
12.2(15)T
14
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Feature Information for Configuring NetFlow and NetFlow Data Export
Table 1
Feature Information for Configuring NetFlow and NetFlow Data Export (continued)
Feature Name
Releases
12.0(19)S
12.2(2)T
12.2(14)S
15.0(1)S
12.0(24)S
12.3(1)
12.2(18)S
12.2(27)SBC
12.2(18)SXF
15.0(1)S
15
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Glossary
Glossary
ASautonomous system. A collection of networks under a common administration sharing a common
routing strategy. Autonomous systems are subdivided by areas. An autonomous system must be assigned
a unique 16-bit number by the Internet Assigned Numbers Authority (IANA).
CEFCisco Express Forwarding. Layer 3 IP switching technology that optimizes network performance
and scalability for networks with large and dynamic traffic patterns.
BGPBorder Gateway Protocol. An interdomain routing protocol that replaces Exterior Gateway
Protocol (EGP). A BGP system exchanges reachability information with other BGP systems. BGP is
defined by RFC 1163.
BGP next hopIP address of the next hop to be used by a router to reach a certain destination.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
export packetType of packet built by a device (for example, a router) with NetFlow services enabled
that is addressed to another device (for example, the NetFlow Collection Engine). The packet contains
NetFlow statistics. The other device processes the packet (parses, aggregates, and stores information on
IP flows).
fast switchingCisco feature in which a route cache is used to expedite packet switching through a
router.
flowA set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which the flow is monitored.
Ingress flows are associated with the input interface, and egress flows are associated with the output
interface.
MPLSMultiprotocol Label Switching. An emerging industry standard for the forwarding of packets
along a normally routed path (sometimes called MPLS hop-by-hop forwarding).
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
RPRoute Processor. A processor module in the Cisco 7000 series routers that contains the CPU,
system software, and most of the memory components that are used in the router. Sometimes called a
Supervisory Processor.
16
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Glossary
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.
2009 Cisco Systems, Inc. All rights reserved.
17
Getting Started with Configuring Cisco IOS NetFlow and NetFlow Data Export
Glossary
18
This module contains information about and instructions for configuring NetFlow to capture and export
network traffic data. NetFlow capture and export are performed independently on each internetworking
device on which NetFlow is enabled. NetFlow need not be operational on each router in the network.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router.
NetFlow is emerging as a primary network accounting and security technology.
Contents
Configuration Examples for Configuring NetFlow and NetFlow Data Export, page 31
Feature Information for Configuring NetFlow and NetFlow Data Export, page 36
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Glossary, page 38
Ensure that one of the following is enabled on your router, and on the interfaces that you want to
configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
Understand the resources required on your router because NetFlow consumes additional memory
and CPU resources
During times of heavy traffic, the additional flows can fill up the global flow hash table. If you need to
increase the size of the global flow hash table, increase the memory of the router.
Cisco IOS Releases 12.2(14)S, 12.0(22)S, or 12.2(15)T
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Egress NetFlow Accounting in Cisco IOS 12.3T Releases, 12.3(11)T or Later
The Egress NetFlow Accounting feature captures NetFlow statistics for IP traffic only. MPLS statistics
are not captured. The MPLS Egress NetFlow Accounting feature can be used on a provider edge (PE)
router to capture IP traffic flow information for egress IP packets that arrived at the router as MPLS
packets and underwent label disposition.
Egress NetFlow accounting might adversely affect network performance because of the additional
accounting-related computation that occurs in the traffic-forwarding path of the router.
Locally generated traffic (traffic that is generated by the router on which the Egress NetFlow Accounting
feature is configured) is not counted as flow traffic for the Egress NetFlow Accounting feature.
Note
In Cisco IOS 12.2S releases, egress NetFlow captures either IPv4 or MPLS packets as they leave the
router.
Export bandwidthExport bandwidth use increases for Version 9 (because of template flowsets)
versus Version 5. The increase in bandwidth usage versus Version 5 varies with the frequency with
which template flowsets are sent. The default is to resend templates every 20 packets, which has a
bandwidth cost of about 4 percent. If necessary, you can lower the resend rate with the ip
flow-export template refresh-rate packets command.
Version 8 export format is available only for aggregation caches, and it cannot be expanded to support
new features.
Restrictions for NetFlow Version 5 Export Format
Version 5 export format is suitable only for the main cache, and it cannot be expanded to support new
features.
Restrictions for NetFlow Version 1 Export Format
The Version 1 format was the initially released version. Do not use Version 1 format unless you are using
a legacy collection system that requires it. Use Version 9 or Version 5 export format.
IP-to-IP packets
ATM-terminated packets
NetFlow captures data for all egress (outgoing) packets through the use of the following features:
Egress NetFlow AccountingNetFlow gathers statistics for all egress packets for IP traffic only.
NetFlow MPLS EgressNetFlow gathers statistics for all egress MPLS-to-IP packets.
Source IP address
Destination IP address
These seven key fields define a unique flow. If a packet has one key field different from another packet,
it is considered to belong to another flow. A flow might contain other accounting fields (such as the AS
number in the NetFlow export Version 5 flow format) that depend on the export record version that you
configure. Flows are stored in the NetFlow cache.
Flows which have been idle for a specified time are expired and removed from the cache.
Long lived flows are expired and removed from the cache. (Flows are not allowed to live more than
30 minutes by default; the underlying packet conversation remains undisturbed.)
As the cache becomes full a number of heuristics are applied to aggressively age groups of flows
simultaneously.
TCP connections which have reached the end of byte stream (FIN) or which have been reset (RST)
are expired.
Expired flows are grouped together into NetFlow export datagrams for export from the NetFlowenabled device. NetFlow export datagrams can consist of up to 30 flow records for Version 5 or Version 9
flow export. NetFlow functionality is configured on a per-interface basis. To configure NetFlow export
capabilities, you need to specify the IP address and application port number of the Cisco NetFlow or
third-party flow collector. The flow collector is a device that provides NetFlow export data filtering and
aggregation capabilities. Figure 1 shows an example of NetFlow data export from the main and
aggregation caches to a collector.
Figure 1
Direction of traffic
CE1
NetFlow
enabled
on ingress
interface
PE
Core network
CE2
NetFlow
collector
Workstation
135047
Version 9A flexible and extensible format, which provides the versatility needed for support of
new fields and record types. This format accommodates new NetFlow-supported technologies such
as Multicast, Multiprotocol Label Switching (MPLS), and Border Gateway Protocol (BGP)
next hop. Version 9 export format enables you to use the same version for main and aggregation
caches, and the format is extendable, so you can use the same export format with future features.
Version 8A format added to support data export from aggregation caches. Export datagrams
contain a subset of the usual Version 5 export data, which is valid for the particular aggregation
cache scheme.
Version 5A later enhanced version that adds BGP autonomous system (AS) information and flow
sequence numbers. (Versions 2 through 4 were not released.) This is the most commonly used
format.
Version 1, the initially released export format, is rarely used today. Do not use the Version 1 export
format unless the legacy collection system you are using requires it. Use either the Version 9 export
format or the Version 5 export format.
Details
The following sections provide more detailed information on NetFlow Data Export Formats:
You can export almost any information from a router or switch including Layer 2 through 7
information, routing information, IP Version 6 (IPv6), IP Version 4 (IPv4), multicast, and
Multiprotocol Label Switching (MPLS) information. This new information allows new applications
for export data and new views of network behavior.
Third-party business partners who produce applications that provide collector or display services for
NetFlow are not required to recompile their applications each time a new NetFlow export field is
added. Instead, they might be able to use an external data file that documents the known template
formats.
New features can be added to NetFlow more quickly, without breaking current implementations.
NetFlow is future-proofed against new or developing protocols, because the Version 9 export
format can be adapted to provide support for them and for other non-NetFlow-based approaches to
data collection.
The work of the Internet Engineering Task Force (IETF) IP Information Export (IPFIX) Working Group
(WG) and the IETF Pack Sampling (PSAMP) WG are based on the NetFlow Version 9 export format.
The Version 1 export format was the original format supported in the initial Cisco IOS software releases
containing NetFlow functionality and is rarely used today. The Version 5 export format is a later
enhancement that adds Border Gateway Protocol (BGP) autonomous system information and flow
sequence numbers. Versions 2 through 4 and Version 6 export formats were either not released or are not
supported. Version 8 export format is the NetFlow export format to use when you enable router-based
NetFlow aggregation on Cisco IOS router platforms.
Figure 2 shows a typical datagram used for NetFlow fixed format export Versions 1, 5, 7, and 8.
Figure 2
IP header
UDP header
NetFlow header
Flow record
Flow record
Flow record
121902
...
Version 9
1 2 3 4 5 6 7 8 9
1
0
1
1
1
2
Version
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
31
bits
Count
System Uptime
UNIX Seconds
Package Sequence
121897
Source ID
Table 1 lists the NetFlow Version 9 export packet header field names and descriptions.
Table 1
Field Name
Description
Version
The version of NetFlow records exported in this packet; for Version 9, this value
is 0x0009.
Count
Number of FlowSet records (both template and data) contained within this packet.
System Uptime
UNIX Seconds
Package Sequence Incremental sequence counter of all export packets sent by this export device; this
value is cumulative, and it can be used to find out whether any export packets have
been missed.
This is a change from the NetFlow Version 5 and Version 8 headers, where this
number represented total flows.
Source ID
The Source ID field is a 32-bit value that is used to guarantee uniqueness for each
flow exported from a particular device. (The Source ID field is the equivalent of
the engine type and engine ID fields found in the NetFlow Version 5 and Version 8
headers.) The format of this field is vendor specific. In Ciscos implementation,
the first two bytes are reserved for future expansion, and are always zero. Byte 3
provides uniqueness with respect to the routing engine on the exporting device.
Byte 4 provides uniqueness with respect to the particular line card or Versatile
Interface Processor on the exporting device. Collector devices should use the
combination of the source IP address and the Source ID field to associate an
incoming NetFlow export packet with a unique instance of NetFlow on a
particular device.
Field
Version 5
Version 9
source IP address
destination IP address
source AS number
destination AS number
1. For a list of other flow fields available in Version 9 export format, see Figure 5.
Figure 4 is an example of the NetFlow Version 5 export record format, including the contents and
description of byte locations. The terms in bold indicate values that were added for the Version 5 format.
Figure 4
Time
Port
utilization
QoS
Packet count
Byte count
Source IP address
Destination IP address
From/To
Start sysUpTime
End sysUpTime
Application
Input ifIndex
Output ifIndex
Type of Service
TCP flags
Protocol
Routing
and
peering
60682
Usage
Table 3 shows the field names and descriptions for the NetFlow Version 5 export record format.
Table 3
10
Content
Bytes
Descriptions
srcaddr
03
Source IP address
dstaddr
47
Destination IP address
nexthop
811
input
1213
output
1415
dPkts
1619
dOctets
2023
first
2427
last
2831
SysUptime at the time the last packet of the flow was received
srcport
3233
dstport
3435
pad1
36
tcp_flags
37
prot
38
tos
39
IP type-of-service byte
src_as
4041
dst_as
4243
src_mask
44
dst_mask
45
pad2
4647
Figure 5 shows a typical flow record for the Version 9 export format. The NetFlow Version 9 export
record format is different from the traditional NetFlow fixed format export record. In NetFlow Version 9,
a template describes the NetFlow data and the flow set contains the actual data. This allows for flexible
export. Detailed information about the fields currently in Version 9 and export format architecture are
available in the NetFlow Version 9 Flow-Record Format document.
NetFlow Version 9 Export Packet Example
Header
First Template FlowSet
Template Record
First Record FlowSet
(Template ID 256)
First data Record
Second Data Record
Second Template Flow Set
Template Record
Template Record
Second Record FlowSet
(Template ID 257)
Data Record
Data Record
Data Record
Data Record
121979
Figure 5
For all export versions, you specify a destination where NetFlow data export packets are sent, such as
the workstation running NetFlow Collection Engine, either when the number of recently expired flows
reaches a predetermined maximum, or every secondwhichever occurs first. For a Version 1 datagram,
up to 24 flows can be sent in a single UDP datagram of approximately 1200 bytes; for a Version 5
datagram, up to 30 flows can be sent in a single UDP datagram of approximately 1500 bytes.
For detailed information on the flow record formats, data types, and export data fields for Versions 1, 7,
and 9 and platform-specific information when applicable, see Appendix 2 in the NetFlow Solutions
Service Guide.
11
Table 4
Export Format
Select When
Version 9
You need to export data from various technologies, such as Multicast, DoS, IPv6,
BGP next hop, and so on. This format accommodates new NetFlow-supported
technologies such as Multicast, MPLS, and BGP next hop.
The Version 9 export format supports export from the main cache and from
aggregation caches.
Version 8
You need to export data from aggregation caches. Version 8 export format is available
only for export from aggregation caches.
Version 5
You need to export data from the NetFlow main cache, and you are not planning to
support new features.
Version 5 export format does not support export from aggregation caches.
Version 1
You need to export data to a legacy collection system that requires Version 1 export
format. Otherwise, do not use Version 1 export format. Use Version 9 or Version 5
export format.
Template descriptions are communicated from the router to the NetFlow Collection Engine.
Flow records are sent from the router to the NetFlow Collection Engine with minimal template
information so that the NetFlow Collection Engine can relate the records to the appropriate template.
Version 9 is independent of the underlying transport (UDP, TCP, SCTP, and so on).
The main feature of NetFlow Version 9 export format is that it is template based. A template describes
a NetFlow record format and attributes of the fields (such as type and length) within the record. The
router assigns each template an ID, which is communicated to the NetFlow Collection Engine along with
the template description. The template ID is used for all further communication from the router to the
NetFlow Collection Engine.
12
The basic output of NetFlow is a flow record. In NetFlow Version 9 export format, a flow record follows
the same sequence of fields as found in the template definition. The template to which NetFlow flow
records belong is determined by the prefixing of the template ID to the group of NetFlow flow records
that belong to a template. For a complete discussion of existing NetFlow flow-record formats, see the
NetFlow Services Solutions Guide.
NetFlow Version 9 Export Packet
In NetFlow Version 9, an export packet consists of the packet header and flowsets. The packet header
identifies the new version and provides other information. See Figure 3 on page 8 for Version 9 export
packet header details. Flowsets are of two types: template flowsets and data flowsets. The template
flowset describes the fields that will be in the data flowsets (or flow records). Each data flowset contains
the values or statistics of one or more flows with the same template ID. When the NetFlow Collection
Engine receives a template flowset, it stores the flowset and export source address so that subsequent
data flowsets that match the flowset ID and source combination are parsed according to the field
definitions in the template flowset. Version 9 supports NetFlow Collection Engine Version 4.0. For an
example of a Version 9 export packet, see Figure 5 on page 11.
NetFlow Export Templates
NetFlow implements a variety of templates, each exporting a different set of fields for a specific purpose.
For example, the MPLS templates are different from the OER templates and the various option
templates.
Table 5 lists the export templates and the specific set of fields the export pertains to.
Table 5
21
OER
11
13
The Version 8 export format was introduced in Cisco IOS 12.0(3)T for the Cisco IOS NetFlow
Aggregation feature. An additional six aggregation schemes that also use Version 8 format were defined for
the NetFlow ToS-Based Router Aggregation feature introduced in Cisco IOS 12.0(15)S and integrated
into Cisco IOS Releases 12.2(4)T and 12.2(14)S. Refer to the Configuring NetFlow Aggregation
Caches module for information on configuring Version 8 data export for aggregation caches.
The Version 8 datagram consists of a header with the version number (which is 8) and time stamp
information, followed by one or more records corresponding to individual entries in the NetFlow cache.
Figure 6 displays the NetFlow Version 8 export packet header format.
Figure 6
Version 8
1 2 3 4 5 6 7 8 9
31
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 bits
Version
Count
System Uptime
UNIX Seconds
UNIX NanoSeconds
Flow Sequence Number
Engine ID
Sampling Interval
Aggregation
Agg Version
Reserved
Table 6 lists the NetFlow Version 8 export packet header field names and definitions.
Table 6
14
Field Name
Description
Version
Count
System Uptime
UNIX Seconds
UNIX NanoSeconds
Engine Type
Engine ID
Aggregation
Agg Version
Sampling Interval
Reserved
Zero field.
121898
Engine Type
Version 5
1 2 3 4 5 6 7 8 9
31
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 bits
Version
Count
System Uptime
UNIX Seconds
UNIX NanoSeconds
Flow Sequence Number
Engine Type
121900
Reserved
Engine ID
Table 7 lists the NetFlow Version 5 export packet header field names and descriptions.
Table 7
Field
Description
Version
Count
System Uptime
UNIX Seconds
UNIX NanoSeconds
Reserved
Zero field.
Engine Type
Engine ID
15
Table 8 describes the Version 5 export format header network byte order.
Table 8
Bytes
Content
Description
0 to 3
4 to 7
SysUptime
8 to 11
unix_secs
12 to 15
unix_nsecs
16 to 19
flow_sequence
20 to 23
Reserved
Table 9 lists the byte definitions for the Version 5 flow record format.
Table 9
Bytes
Content
Description
0 to 3
srcaddr
Source IP address.
4 to 7
dstaddr
Destination IP address.
8 to 11
nexthop
12 to 15
16 to 19
dPkts
20 to 23
dOctets
24 to 27
First
28 to 31
Last
32 to 35
36 to 39
pad1, tcp_flags, prot, Unused (zero) byte, cumulative OR of TCP flags, IP protocol
and tos
(for example, 6 = TCP, 17 = UDP), and IP ToS.
40 to 43
44 to 47
src_mask, dst_mask,
and pad2
16
Version 1
1 2 3 4 5 6 7 8 9
31
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 bits
Version
Count
System Uptime
UNIX Seconds
121901
UNIX NanoSeconds
Table 10 lists the NetFlow Version 1 export packet header field names and descriptions.
Table 10
Field Name
Description
Version
Count
Number of FlowSet records (both template and data) contained within this
packet.
System Uptime
UNIX Seconds
UNIX NanoSeconds
Enable NetFlow on an interface on Router B to track ingress IP traffic from Router A to Router B.
Enable NetFlow on an interface on Router D to track ingress IP traffic from Router B to Router D.
17
Enable NetFlow on an interface on Router A to track ingress traffic from the MPLS VPN from
Router B to Router A.
Enable NetFlow on an interface on Router B to track ingress traffic from the MPLS VPN from
Router D to Router B.
Figure 9
Server
121274
Flows are
counted here
A configuration such as the one used in Figure 9 requires that NetFlow statistics from three separate
routers be added together to obtain the flow statistics for the server.
In comparison, the example in Figure 10 shows NetFlow, the Egress NetFlow Accounting feature, and
the MPLS Egress NetFlow Accounting feature being used to capture ingress and egress flow statistics
for Router B, thus obtaining the required flow statistics for the server.
In Figure 10, the following NetFlow configurations are applied to Router B:
Enable NetFlow on an interface on Router B to track ingress IP traffic from Router A to Router B.
Enable the Egress NetFlow Accounting feature on an interface on Router B to track egress IP traffic
from Router B to Router D.
Enable NetFlow an interface on Router B to track ingress traffic from the MPLS VPN from Router B
to Router D.
Enable NetFlow on an interface on Router B to track ingress traffic from the MPLS VPN from
Router B to Router A.
After NetFlow is configured on Router B, you can display all NetFlow statistics for the server by entering
the show ip cache flow command or the show ip cache verbose flow command for Router B.
Figure 10
18
Server
121275
Flows are
counted here
Reduced bandwidth requirement between routing devices and NetFlow management workstations.
Reduced NetFlow workstation requirements; the number of flows sent to the workstation for
processing is reduced.
Verifying that NetFlow Is Operational and View NetFlow Statistics, page 21 (optional)
Configuring NetFlow Data Export Using the Version 9 Export Format, page 23 (optional)
19
Configuring NetFlow
Perform the steps in this required task to enable NetFlow.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
exit
6.
7.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface ethernet 0/0
Step 4
Example:
Router(config-if)# ip flow ingress
or
Example:
Router(config-if)# ip flow egress
Step 5
exit
Example:
Note
Router(config-if)# exit
20
Command or Action
Purpose
Step 6
(Optional)
Step 7
end
Example:
Router(config-if)# end
SUMMARY STEPS
1.
2.
3.
DETAILED STEPS
Step 1
Step 2
21
-------TCP-FTP
TCP-FTPD
TCP-WWW
TCP-SMTP
TCP-BGP
TCP-NNTP
TCP-other
UDP-TFTP
UDP-other
ICMP
Total:
SrcIf
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
.
.
.
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Et0/0
Router#
Step 3
Flows
108
108
54
54
27
27
297
27
108
135
945
/Sec
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
/Flow
1133
1133
1133
1133
1133
1133
1133
1133
1417
1133
1166
/Pkt
40
40
40
40
40
40
40
28
28
427
91
/Sec
2.4
2.4
1.2
1.2
0.6
0.6
6.8
0.6
3.1
3.1
22.4
/Flow
1799.6
1799.6
1799.6
1799.6
1799.6
1799.6
1799.7
1799.6
1799.6
1799.6
1799.6
/Flow
0.9
0.9
0.8
0.8
0.7
0.7
0.8
1.0
0.9
0.8
0.8
SrcIPaddress
192.168.67.6
10.10.18.1
10.10.18.1
10.234.53.1
10.10.19.1
10.10.19.1
192.168.87.200
192.168.87.200
DstIf
Et1/0.1
Null
Null
Et1/0.1
Null
Null
Et1/0.1
Et1/0.1
DstIPaddress
172.16.10.200
172.16.11.5
172.16.11.5
172.16.10.2
172.16.11.6
172.16.11.6
172.16.10.2
172.16.10.2
Pr
01
11
11
01
11
11
06
06
SrcP
0000
0043
0045
0000
0044
00A2
0014
0015
DstP
0C01
0043
0045
0800
0044
00A2
0014
0015
Pkts
51
51
51
51
51
51
50
52
172.16.1.84
172.16.1.84
172.16.1.85
172.16.1.85
10.251.10.1
10.162.37.71
Et1/0.1
Et1/0.1
Et1/0.1
Et1/0.1
Et1/0.1
Null
172.16.10.19
172.16.10.19
172.16.10.20
172.16.10.20
172.16.10.2
172.16.11.3
06
06
06
06
01
06
0087
0050
0089
0050
0000
027C
0087
0050
0089
0050
0800
027C
50
51
49
50
51
49
22
TCP-other
UDP-TFTP
UDP-other
ICMP
Total:
SrcIf
Port Msk
Et0/0
0000 /0
Et0/0
0043 /0
Et0/0
0045 /0
Et0/0
0000 /0
Et0/0
0044 /0
.
.
.
Et0/0
0087 /0
Et0/0
0050 /0
Et0/0
0089 /0
Et0/0
0050 /0
Et0/0
0000 /0
Et0/0
027C /0
Router#
297
27
108
135
945
SrcIPaddress
AS
192.168.67.6
0
10.10.18.1
0
10.10.18.1
0
10.234.53.1
0
10.10.19.1
0
172.16.1.84
0
172.16.1.84
0
172.16.1.85
0
172.16.1.85
0
10.251.10.1
0
10.162.37.71
0
0.0
0.0
0.0
0.0
0.0
1133
1133
1417
1133
1166
DstIf
Port Msk
Et1/0.1
0C01 /0
Null
0043 /0
Null
0045 /0
Et1/0.1
0800 /0
Null
0044 /0
Et1/0.1
0087 /0
Et1/0.1
0050 /0
Et1/0.1
0089 /0
Et1/0.1
0050 /0
Et1/0.1
0800 /0
Null
027C /0
AS
0
0
0
0
0
0
0
0
0
0
0
40
28
28
427
91
6.6
0.6
3.0
3.0
21.9
1799.7
1799.6
1799.6
1799.6
1799.6
0.8
1.0
0.9
0.8
0.8
DstIPaddress
NextHop
172.16.10.200
0.0.0.0
172.16.11.5
0.0.0.0
172.16.11.5
0.0.0.0
172.16.10.2
0.0.0.0
172.16.11.6
0.0.0.0
172.16.10.19
0.0.0.0
172.16.10.19
0.0.0.0
172.16.10.20
0.0.0.0
172.16.10.20
0.0.0.0
172.16.10.2
0.0.0.0
172.16.11.3
0.0.0.0
06 00
06
06
06
01
06
00
40
00 00
40
00 00
40
00 00
40
00 10
1500
00 00
40
799
1258.1
799
1258.0
798
1256.5
799
1258.0
799
1258.1
798
1256.4
Note
This task does not include instructions for configuring Reliable NetFlow Data Export using SCTP. Refer
to the NetFlow Reliable Export with SCTP module for information about, and instructions for
configuring Reliable NetFlow Data Export using SCTP.
Prerequisites
This task does not include the steps for configuring NetFlow. You must configure NetFlow by enabling
it on at least one interface in the router in order to export traffic data with NetFlow Data Export. Refer
to the Configuring NetFlow section on page 20 for information about configuring NetFlow.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
23
4.
5.
6.
7.
ip flow-export interface-names
8.
9.
DETAILED STEPS
Step 1
Command
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ip flow-export
destination 172.16.10.2 99
Step 4
Step 5
Example:
Router(config)# ip flow-export source
ethernet 0/0
24
Step 6
Command
Purpose
The version 9 keyword specifies that the export packet uses the
Version 9 format.
Example:
Router(config)# ip flow-export version 9
Caution
Step 7
ip flow-export interface-names
Example:
Router(config)# ip flow-export
interface-names
Step 8
Example:
Router(config)# ip flow-export template
refresh-rate 15
Step 9
Example:
Router(config)# ip flow-export template
timeout-rate 90
25
Step 10
Command
Purpose
Example:
Router(config)# ip flow-export template
options export-stats
Step 11
Example:
Router(config)# ip flow-export template
options refresh-rate 25
Step 12
Example:
Router(config)# ip flow-export template
options timeout-rate 120
Step 13
end
Example:
Router(config)# end
SUMMARY STEPS
26
1.
2.
DETAILED STEPS
Step 1
Step 2
SUMMARY STEPS
1.
enable
2.
27
DETAILED STEPS
Step 1
enable
Use this enter privileged EXEC mode on the router:
Router> enable
Router#
Step 2
Flow transport is completed (TCP connections that have reached the end of the byte stream [FIN] or
which have been reset [RST] are expired).
A flow becomes inactive. By default, a flow unaltered in the last 15 seconds is classified as inactive.
An active flow has been monitored for a specified number of minutes. By default, active flows are
flushed from the cache when they have been monitored for 30 minutes.
Routing device default timer settings are 15 seconds for the inactive timer and 30 minutes for the active
timer. You can configure your own time interval for the inactive timer between 10 and 600 seconds. You
can configure the time interval for the active timer between 1 and 60 minutes.
28
A NetFlow cache can be resized depending on the platform and the amount of DRAM on a line card. For
example, the NetFlow cache size is configurable for software-based platforms such as Cisco 75xx and
72xx series routers. The amount of memory on a Cisco 12000 line card determines how many flows are
possible in the cache.
Using the ip flow-cache entries command, you can configure the size of your NetFlow cache between
1024 entries and 524,288 entries. Using the cache entries command (after you configure NetFlow
aggregation), you can configure the size of the NetFlow aggregation cache from 1024 entries to 524,288
entries.
Caution
We recommend that you not change the values for NetFlow cache entries. Improper use of this feature
could cause network problems. To return to the default value for NetFlow cache entries, use the
no ip flow-cache entries global configuration command.
Restrictions
If you modify any parameters for the NetFlow main cache after you enable NetFlow the changes will not
take effect until you reboot the router or disable NetFlow on every interface it is enabled on, and then
re-enable NetFlow on the interfaces.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
exit
6.
Repeat Steps 3 through 5 for every interface that has NetFlow enabled on it.
7.
8.
9.
29
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Step 4
Example:
or
Example:
Router(config-if)# no ip flow egress
Step 5
exit
Example:
Note
Router(config-if)# exit
Step 6
Repeat Steps 3 through 5 for the remaining interfaces (Required if NetFlow is enabled on any other interfaces)
that have NetFlow enabled on them.
Step 7
Example:
Step 8
Example:
Router(config)# ip flow-cache timeout active 20
Step 9
Example:
Router(config)# ip flow-cache timeout inactive
130
30
Step 10
Command or Action
Purpose
Example:
Router(config)# interface ethernet 0/0
Step 11
Example:
Router(config-if)# ip flow ingress
or
Example:
Router(config-if)# ip flow egress
Step 12
exit
Example:
Note
Router(config-if)# exit
Step 13
Step 14
end
Example:
Router(config-if)# end
31
Note
NetFlow performs additional checks for the status of each subinterface that requires more CPU
processing time and bandwidth. If you have several subinterfaces configured and you want to configure
NetFlow data capture on all of them, we recommend that you configure NetFlow on the main interface
instead of on the individual subinterfaces.
Note
32
You can configure a maximum of two export destinations for the main cache and for each aggregation
cache.
Note
No AS number or BGP next-hop information is exported with the Version 1 export format.
Additional References
The following sections provide references related to the configuring of NetFlow to capture and export
NetFlow traffic data.
33
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring Configuring MPLS Aware
NetFlow
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats with NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export with
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
34
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/cisco/web/support/index.html
35
Note
Table 11
Table 11 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
12.3(11)T
15.0(1)S
36
Table 11
Feature Information for Configuring NetFlow and NetFlow Data Export (continued)
Feature Name
Releases
12.2(14)S,
12.0(22)S,
12.2(15)T
12.2(33)SB
12.0(19)S,
12.2(2)T,
12.2(14)S
15.0(1)S
12.0(24)S, 12.3(1),
12.2(18)S,
12.2(27)SBC,
12.2(18)SXF
15.0(1)S
1. This is a minor enhancement. Minor enhancements are not typically listed in Feature Navigator.
37
Glossary
ASautonomous system. A collection of networks under a common administration sharing a common
routing strategy. Autonomous systems are subdivided by areas. An autonomous system must be assigned
a unique 16-bit number by the Internet Assigned Numbers Authority (IANA).
CEFCisco Express Forwarding. Layer 3 IP switching technology that optimizes network performance
and scalability for networks with large and dynamic traffic patterns.
BGPBorder Gateway Protocol. An interdomain routing protocol that replaces Exterior Gateway
Protocol (EGP). A BGP system exchanges reachability information with other BGP systems. BGP is
defined by RFC 1163.
BGP next hopIP address of the next hop to be used by a router to reach a certain destination.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
export packetType of packet built by a device (for example, a router) with NetFlow services enabled
that is addressed to another device (for example, the NetFlow Collection Engine). The packet contains
NetFlow statistics. The other device processes the packet (parses, aggregates, and stores information on
IP flows).
fast switchingCisco feature in which a route cache is used to expedite packet switching through a
router.
flowA set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which the flow is monitored.
Ingress flows are associated with the input interface, and egress flows are associated with the output
interface.
MPLSMultiprotocol Label Switching. An emerging industry standard for the forwarding of packets
along a normally routed path (sometimes called MPLS hop-by-hop forwarding).
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
RPRoute Processor. A processor module in the Cisco 7000 series routers that contains the CPU,
system software, and most of the memory components that are used in the router. Sometimes called a
Supervisory Processor.
38
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.
20062010 Cisco Systems, Inc. All rights reserved.
39
40
This document provides information about and instructions for configuring NetFlow Border Gateway
Protocol (BGP) next hop support. This feature lets you measure network traffic on a per BGP next hop
basis.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Contents
This document includes the following sections:
Prerequisites for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis, page 2
Restrictions for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis, page 2
Information About Configuring NetFlow BGP Next Hop Support for Accounting and Analysis,
page 3
How to Configure NetFlow BGP Next Hop Support for Accounting and Analysis, page 3
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Prerequisites for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Configuration Examples for NetFlow BGP Next Hop Support for Accounting and Analysis, page 8
Feature Information for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis,
page 11
Glossary, page 12
Configure Cisco Express Forwarding (CEF) switching or distributed CEF (dCEF) switching on the
router and on the interfaces that you want to enable NetFlow on (fast switching is not supported)
Configure NetFlow v9 (Version 9) data export (if only Version 5 is configured, then BGP next hop
data is visible in the caches, but is not exported)
Configure BGP
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Recursive Load Sharing
The NetFlow cache does not capture the BGP next hop when the route to that BGP next hop is recursively
load-shared via several IGP links. Instead, the NetFlow cache captures (as the BGP next hop) the
effective simple next hop from among a random selection of the load-shared routes to which the BGP
route recurses.
Memory Impact
For BGP-controlled routes, the NetFlow BGP Next Hop Support feature adds 16 bytes to each NetFlow
flow record. This increases memory requirements by 16 bytes times the number of flow cache entries
that have BGP-controlled prefixes.
Performance Impact
Because the BGP next hop is fetched from the CEF path only once per flow, the performance impact of
the NetFlow BGP Next Hop Support feature is minimal.
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Information About Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
How to Configure NetFlow BGP Next Hop Support for Accounting and Analysis
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
enabled
6.
exit
7.
8.
9.
exit
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
How to Configure NetFlow BGP Next Hop Support for Accounting and Analysis
Step 3
Command or Action
Purpose
Example:
Router(config)# ip flow-export version 9 origin-as
bgp-nexthop
Caution
Step 4
Example:
Router(config)# ip flow-aggregation cache
bgp-nexthop-tos
Step 5
enabled
Example:
Router(config-flow-cache)# enabled
Step 6
exit
Example:
Note
Router(config-if)# exit
Step 7
Example:
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
How to Configure NetFlow BGP Next Hop Support for Accounting and Analysis
Step 8
Command or Action
Purpose
Example:
Router(config-if)# ip flow ingress
or
Example:
Router(config-if)# ip flow egress
Step 9
exit
Example:
Note
Router(config-if)# exit
Step 10 Repeat Steps 7 through 9 to enable NetFlow on other
(Optional)
interfaces
Step 11 end
Example:
Router(config-if)# end
Troubleshooting Tips
If there are no BGP-specific flow records in the NetFlow cache, make sure that CEF or dCEF switching
is enabled and that the destination for NetFlow data export is configured. Also check the routing table
for BGP routes.
SUMMARY STEPS
1.
enable
2.
3.
4.
exit
DETAILED STEPS
Step 1
enable
Use this command to enable privileged EXEC mode. Enter your password if required. For example:
Router> enable
Router#
Step 2
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
How to Configure NetFlow BGP Next Hop Support for Accounting and Analysis
Use this command to verify successful configuration of NetFlow BGP next hop accounting. For
example:
Router# show ip cache verbose flow
IP packet size distribution (120 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .000 .000 1.00 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 17826816 bytes
8 active, 262136 inactive, 8 added
26 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 1081480 bytes
8 active, 65528 inactive, 8 added, 8 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol
Total
Flows
Packets Bytes Packets Active(Sec) Idle(Sec)
-------Flows
/Sec
/Flow /Pkt
/Sec
/Flow
/Flow
SrcIf
SrcIPaddress
DstIf
Port Msk AS
Port Msk
MUL:M_Opaks M_Obytes BGP:BGP_NextHop
Et0/0/2
12.0.0.2
Et0/0/4
0000 /8 0
0800 /8
BGP:26.0.0.6
Et0/0/2
12.0.0.2
Et0/0/4
0000 /8 0
0800 /8
BGP:26.0.0.6
Et0/0/2
12.0.0.2
Et0/0/4
0000 /8 0
0000 /8
BGP:26.0.0.6
AS
DstIPaddress
NextHop
13.0.0.5
11.0.0.6
01 00
10
100
20
0.0
15.0.0.7
11.0.0.6
01 00
10
100
20
0.0
15.0.0.7
11.0.0.6
01 00
10
100
20
0.0
This command displays a detailed summary of NetFlow statistics (including additional NetFlow fields
in the header when NetFlow Version 9 data export is configured).
Step 3
Src AS
Dst If
Et0/0/4
Dst AS
TOS Flows
00
Pkts
36
B/Pk
40
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Configuration Examples for NetFlow BGP Next Hop Support for Accounting and Analysis
Step 4
exit
Use this command to exit to user EXEC mode. For example:
Router# exit
Router>
The following example shows how to configure a NetFlow BGP next hop ToS aggregation cache scheme:
configure terminal
!
ip flow-aggregation cache bgp-nexthop-tos
export destination 172.16.10.2 991
enabled
!
interface ethernet 0/0
ip flow ingress
!
end
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Additional References
Additional References
For additional information related to NetFlow BGP next hop support for accounting and analysis, see
the following references.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Additional References
Standards
Standards
Title
None
MIBs
MIBs
MIBs Link
None
RFCs
RFCs
Title
None
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
10
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Feature Information for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Note
Table 1
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Information for Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Feature Name
Software
12.3(1)
12.2(18)S
12.0(26)S
12.2(27)SBC
15.0(1)S
11
Configuring NetFlow BGP Next Hop Support for Accounting and Analysis
Glossary
Glossary
BGPBorder Gateway Protocol. Interdomain routing protocol that replaces Exterior Gateway Protocol
(EGP). BGP exchanges reachability information with other BGP systems. It is defined by RFC 1163.
BGP next hopIP address of the next hop to be used to reach a specific destination.
CEFCisco Express Forwarding. A Layer 3 IP switching technology that optimizes network
performance and scalability for networks with large and dynamic traffic patterns.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
fast switchingCisco feature in which a route cache expedites packet switching through a router.
FIBforwarding information base. A table containing the information needed to forward IP datagrams.
At a minimum, this table contains the interface identifier and next hop information for each reachable
destination network prefix. The FIB is distinct from the routing table (also called the routing information
base), which holds all routing information received from routing peers.
flow(NetFlow) A set of packets with the same source IP address, destination IP address, source and
destination ports, and type of service, and the same interface on which flow is monitored. Ingress flows
are associated with the input interface, and egress flows are associated with the output interface.
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
ToStype of service byte. Second byte in the IP header that indicates the desired quality of service for
a particular datagram.
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.
20082010 Cisco Systems, Inc. All rights reserved.
12
This module contains information about and instructions for configuring the MPLS Egress NetFlow
Accounting feature. The MPLS Egress NetFlow Accounting feature allows you to capture IP flow
information for packets that are undergoing MPLS label disposition; that is, packets that arrive on a
router as MPLS packets and that are transmitted as IP packets.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Glossary, page 12
Before you can configure the MPLS Egress NetFlow Accounting feature, you must:
Configure Cisco Express Forwarding (CEF) switching or distributed CEF (dCEF) switching on the
router and on the interfaces that you want to enable MPLS Egress NetFlow Accounting on (fast
switching is not supported)
The captured egress flows must originate from different sites of the same Virtual Private Network (VPN),
and they cannot connect to the same provider edge (PE) router. If both source and destination VPN sites
are connected to the PE router, the MPLS egress NetFlow accounting feature does not capture these
egress flows. You can capture these flows by enabling ingress NetFlow on the incoming customer edge
(CE)-PE link of the PE router. For example, in Figure 1, traffic from site 3 (VPN1 destined for site 2) is
captured by an ingress NetFlow enabled on the PE2-CE3 link of PE2.
Memory Impact
During times of heavy traffic, the additional flows can fill up the global flow hash table. If you need to
increase the size of the global flow hash table, increase the memory of the router.
Performance Impact
MPLS egress NetFlow accounting might adversely affect network performance because of the additional
accounting-related computations that occur in the traffic-forwarding path of the router.
MPLS Egress NetFlow Accounting Benefits: Enhanced Network Monitoring and More Accurate
Accounting Statistics, page 3
MPLS VPN Flow Capture with MPLS Egress NetFlow Accounting, page 3
You can now capture flows on the egress and ingress router interfaces and obtain complete end-to-end
usage information on network traffic. The accounting server uses the collected data for various levels of
aggregation for accounting reports and application programming interface (API) accounting
information, thus providing a complete billing solution.
More Accurate Accounting Statistics
NetFlow data statistics provided by the MPLS Egress NetFlow Accounting feature can account for all
packets that are dropped in the core of the service provider network, thus providing more accurate traffic
statistics and patterns.
To capture the flow of traffic going to site 2 of VPN 1 from any remote VPN 1 sites, you enable
MPLS egress NetFlow on link PE2-CE5 of provider edge router PE2.
To capture the flow of traffic going to site 1 of VPN 2 from any remote VPN 2 site, you enable MPLS
egress NetFlow on link PE3-CE4 of the provider edge router PE3.
The flows are stored in a global flow cache maintained by the router. You can use the show ip cache flow
command or other aggregation flow commands to view the egress flow data.
Sample MPLS VPN Network Topology with MPLS Egress NetFlow Accounting
Site 2
VPN 1
C
VPN-SC
Backbone
Site 1
VPN 1
CE5
Collector 2
P
CE1
PE1
Site 2
VPN 2
CE2
P
PE2
Collector 1
PE3
Site 3
VPN 1
PE4
Site 1
VPN 2
Site 4
VPN 1
CE4
CE6
CE3
42949
Figure 1
The PE routers export the captured flows to the configured collector devices in the provider network.
Applications such as the Network Data Analyzer or the VPN Solution Center (VPN-SC) can gather
information from the captured flows and compute and display site-to-site VPN traffic statistics.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface ethernet 1/4
Step 4
Example:
Router(config-if)# mpls netflow egress
Step 5
end
Example:
Router(config-if)# end
Troubleshooting Tips
To display debug messages for MPLS egress NetFlow accounting, use the debug mpls netflow
command.
SUMMARY STEPS
1.
2.
3.
DETAILED STEPS
Step 1
Step 2
Total
Flows
1
1
Flows
/Sec
0.0
0.0
Packets Bytes
/Flow /Pkt
5
100
5
100
SrcIPaddress
DstIf
209.165.200.225 Et1/4
Outgoing
Prefix
Bytes tag
tag or VC
or Tunnel Id
switched
Aggregate
34.0.0.0/8[V]
0
MAC/Encaps=0/0, MTU=0, Tag Stack{}
VPN route: vpn1
Feature Quick flag set
Outgoing
interface
Next Hop
Note
As shown above, the quick flag is set for the first two prefixes; therefore, traffic destined for
those prefixes is captured by MPLS egress NetFlow accounting.
Note
As shown above, the feature is not configured because MPLS egress NetFlow accounting is not
enabled on the outgoing interface for this prefix.
Step 3
8 9 10 11 12 13 14 15
Outgoing
interface
Next Hop
8 9 10 11 12 13 14 15
Note
Note
Default RD
100:1
300:1
Interfaces
Ethernet1/4
Loopback1
Ethernet1/2
Loopback2
In the following example, MPLS Egress NetFlow Accounting is enabled on interface Ethernet 1/4:
configure terminal
!
interface ethernet 1/4
ip address 172.17.24.2 255.255.255.0
mpls netflow egress
exit
Enter the show running-config command to view the current configuration in the router:
Router# show running-config
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
ip cef
no ip domain-lookup
!
This section of the output shows the VRF being defined and shows that the MPLS Egress NetFlow
Accounting feature is enabled:
ip vrf vpn1
rd 100:1
route-target export 100:1
route-target import 100:1
!
interface Loopback0
ip address 10.41.41.41 255.255.255.255
no ip directed-broadcast
no ip mroute-cache
!
interface Ethernet1/4
ip vrf forwarding vpn1
ip address 172.17.24.2 255.255.255.0
no ip directed-broadcast
mpls netflow egress
!
Additional References
The following sections provide references related to configuring the MPLS Egress NetFlow Accounting
feature.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standard
Title
MIBs
MIB
MIBs Link
RFCs
RFC
Title
RFC 1163
RFC 1340
Assigned Numbers
RFC 1918
RFC 2547
BGP/MPLS VPNs
Technical Assistance
Description
Link
http://www.cisco.com/cisco/web/support/index.html
10
Note
Table 1
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
12.1(5)T
12.0(20)S
11
Glossary
BGPBorder Gateway Protocol. An interdomain routing protocol that replaces Exterior Gateway
Protocol (EGP). A BGP system exchanges reachability information with other BGP systems. BGP is
defined by RFC 1163.
BGP/MPLS/VPNA Virtual Private Network (VPN) solution that uses Multiprotocol Label Switching
(MPLS) and Border Gateway Protocol (BGP) to allow multiple remote customer sites to be connected
over an IP backbone. Refer to RFC 2547 for details.
CE routerA customer edge router. A router that is part of a customer network and interfaces to a
provider edge (PE) router.
customer networkA network that is under the control of an end customer. A customer network can
use private addresses as defined in RFC 1918. Customer networks are logically isolated from each other
and from the provider network. A customer network is also known as a C network.
egress PEThe provider edge router through which traffic moves from the backbone to the destination
Virtual Private Network (VPN) site.
flowA set of packets with the same source IP address, destination IP address, source/destination ports,
and type-of-service, and the same interface on which flow is monitored. Ingress flows are associated
with the input interface, and egress flows are associated with the output interface.
ingress PEThe provider edge router through which traffic enters the backbone (provider network)
from a Virtual Private Network (VPN) site.
labelA short, fixed length identifier that tells switching nodes how the data (packets or cells) should
be forwarded.
MPLSMultiprotocol Label Switching. An emerging industry standard for the forwarding of packets
along normally routed paths (sometimes called MPLS hop-by-hop forwarding).
PE routerA provider edge router. A router at the edge of a provider network that interfaces to
customer edge (CE) routers.
provider networkA backbone network that is under the control of a service provider and provides
transport among customer sites. A provider network is also known as the P network.
VPNVirtual Private Network. The result of a router configuration that enables IP traffic to use
tunneling to travel securely over a public TCP/IP network.
VRFVirtual Private Network (VPN) routing/forwarding instance. The VRF is a key element in the
MPLS VPN technology. VRFs exist on PEs only. A VRF is populated with VPN routes and allows one
PE to have multiple routing tables. One VRF is required per VPN on each PE in the VPN.
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.
20062010 Cisco Systems, Inc. All rights reserved.
12
NetFlow is a technology that provides highly granular per-flow statistics on traffic in a Cisco router. The
NetFlow MIB feature provides MIB objects to allow users to configure NetFlow and to monitor flow
cache information, the current NetFlow configuration, and statistics.
Contents
Prerequisites for Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data, page 2
Restrictions for Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data, page 2
Information About Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data, page 2
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data, page 5
Configuration Examples using SNMP and the NetFlow MIB to Monitor NetFlow Data, page 19
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Prerequisites for Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data
Feature Information for Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data,
page 22
Glossary, page 23
Ensure that one of the following is enabled on your router, and on the interfaces that you want to
configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
Understand the resources required on your router because NetFlow consumes additional memory
and CPU resources
Configure SNMP on the router on which the NetFlow MIB feature is to be used. Refer to the
Configuring the Router to use SNMP for more information. For more information on configuring an
SNMP server, refer to the Configuring SNMP Support in the Cisco IOS Network Management
Configuration Guide.
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Information About Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data
Export Statistics.
Protocol Statistics.
Terminology Used
Flow
A flow is defined as an unidirectional sequence of packets between a given source and destination
endpoints. Network flows are highly granular; flow endpoints are identified both by IP address as well
as by transport layer application port numbers. NetFlow also utilizes the IP Protocol type, Type of
Service (ToS) and the input interface identifier to uniquely identify flows.
Exporter
A device (for example, a router) with NetFlow services enabled. The exporter monitors packets entering
an observation point and creates flows out of these packets. The information from these flows are
exported in the form of Flow Records to the collector. You can configure NetFlow data export using the
NetFlow MIB.
Flow Record
A Flow Record provides information about an IP Flow that exists on the Exporter. The Flow Records are
commonly referred to as NetFlow Services data or NetFlow data.
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Information About Configuring SNMP and the NetFlow MIB to Monitor NetFlow Data
Collector
The NetFlow Collector receives Flow Records from one or more Exporters. It processes the received
export packet, i.e. parses, stores the Flow Record information. The flow records may be optionally
aggregated before storing into the hard disk.
Template
NetFlow Version 9 Export format is template based. Version 9 record format consists of a packet header
followed by at least one or more template or data FlowSets. A template FlowSet (collection of one or
more template) provides a description of the fields that will be present in future data FlowSets.
Templates provide an extensible design to the record format, a feature that should allow future
enhancements to NetFlow services without requiring concurrent changes to the basic flow-record
format.
One additional record type is also a part of Version 9 specification: an options template. Rather than
supplying information about IP flows, options are used to supply meta-data about the NetFlow process
itself.
Top Flows
This feature provides a mechanism which allows the top N flows in the netflow cache to be viewed in
real time.
Criteria can be set to limit the feature to particular flows of interest, which can aid in DoS detection.
Only the number of flows (TopN) and the sort criteria (SortBy) need be set.
Top Flows is not intended as a mechanism for exporting the entire netflow cache.
For more information on the Top Flows and the NetFlow MIB refer to the Configuring NetFlow Top
Talkers using Cisco IOS CLI Commands or SNMP Commands.
Egress flows
This feature analyzes traffic that is being forwarded by the router. This feature is often referred to as
Egress NetFlow.
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Some of the tasks in this section include examples of the SNMP CLI syntax used to set configuration
parameters on the router, and to read values from MIB objects on the router. These SNMP CLI syntax
examples are taken from a Linux workstation using public domain SNMP tools. The SNMP CLI syntax
for your workstation might be different. Refer to the documentation that was provided with your SNMP
tools for the correct syntax for your network management workstation.
This section contains the following procedures:
Identifying the Interface Number to use for Enabling NetFlow with SNMP, page 9 (required)
Note
The SNMP community read-only (RO) string for the examples is public. The SNMP community
read-write (RW) string for the examples is private. You should use more complex strings for these
values in your configurations.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Step 4
Example:
Note
Step 5
end
Example:
Router(config)# end
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
4.
5.
6.
end
SNMP Commands
1.
2.
3.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Note
Step 4
Example:
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 5
Command or Action
Purpose
Example:
Step 6
end
Example:
Router(config)# end
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCICacheEntries.0 unsigned 4000
Note
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 2
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCIActiveTimeOut.0 unsigned 60
Note
Step 3
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCIInactiveTimeOut.0 unsigned 30
Note
Identifying the Interface Number to use for Enabling NetFlow with SNMP
Before you can use SNMP to enable NetFlow on an interface you must identify the correct SNMP
interface number on the router. To identify the interface number for the interface that you want to enable
NetFlow on perform the steps in this required task.
SUMMARY STEPS
1.
enable
2.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode. Enter the password if prompted.
Router> enable
Step 2
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
4.
5.
exit
6.
7.
end
SNMP Commands
1.
2.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface fastethernet0/0
Step 4
Example:
Router(config-if)# ip flow ingress
and/or
Example:
Router(config-if)# ip flow egress
10
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 5
Command or Action
Purpose
exit
Example:
Note
Router(config-if)# exit
Step 6
(Optional)
Step 7
end
Example:
Router(config-if)# end
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCINetflowEnable.1 integer 1
Step 2
0Disable NetFlow
(Optional)
Prerequisites
You must enable NetFlow on at least one interface before configuring a NetFlow aggregation cache.
SUMMARY STEPS
Router CLI Commands
1.
enable
11
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
2.
configure terminal
3.
4.
5.
6.
7.
enable
8.
end
SNMP Commands
1.
2.
3.
4.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Note
Step 4
Example:
Router(config-flow-cache)# cache entries 4000
Step 5
Example:
Note
12
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 6
Command or Action
Purpose
Example:
Note
Step 7
enable
Example:
Router(config-flow-cache)# enable
Step 8
end
Example:
Router(config-if)# end
13
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 1
Command or Action
Purpose
Example:
AS1
Protocol Port2
Source Prefix3
Destination Prefix4
prefix5
Destination Only6
Source Destination7
Full Flow8
AS ToS9
Protocol Port ToS10
Source Prefix ToS11
Destination Prefix Tos12
Prefix Tos13
Prefix Port14
BGP Nexthop Tos15
Step 2
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCICacheEntries.4 unsigned 4000
Note
14
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 3
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.14 cnfCIActiveTimeOut.4 unsigned 60
Note
Step 4
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.14 cnfCIInactiveTimeOut.4 unsigned 30
Note
Configuring NetFlow Export from the Main NetFlow Cache using the Version 9
Export Format
The following example configures the router to export statistics from the NetFlow main cache (0),
including peer autonomous system and BGP-related information using export Version 9.
Perform the steps in this optional task using either the router CLI commands or the SNMP commands to
configure the router to export statistics from the main cache using the Version 9.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
4.
5.
6.
end
15
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
SNMP Commands
1.
2.
3.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ip flow-export version 9
peer-as bgp-nexthop
Caution
Step 4
Example:
Router(config)# ip flow-export destination
10.0.19.2 999
16
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Command or Action
Purpose
Step 5
(Optional)
Step 6
end
Example:
Router(config)# end
Step 1
Command or Action
Purpose
Example:
Main0
AS1
Protocol Port2
Source Prefix3
Destination Prefix4
prefix5
Destination Only6
Source Destination7
Full Flow8
AS ToS9
Protocol Port ToS10
Source Prefix ToS11
Destination Prefix Tos12
Prefix Tos13
Prefix Port14
BGP Nexthop Tos15
17
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
How to Configure SNMP and use the NetFlow MIB to Monitor NetFlow Data
Step 2
Example:
AS1
Protocol Port2
Source Prefix3
Destination Prefix4
prefix5
Destination Only6
Source Destination7
Full Flow8
AS ToS9
Protocol Port ToS10
Source Prefix ToS11
Destination Prefix Tos12
Prefix Tos13
Prefix Port14
BGP Nexthop Tos15
configuration.
Step 3
18
(Optional)
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Configuration Examples using SNMP and the NetFlow MIB to Monitor NetFlow Data
Configuring the Minimum Mask for a Source Prefix Aggregation Scheme using SNMP: Example,
page 19
Configuring NetFlow Data Export for the Source Prefix Aggregation Scheme using SNMP:
Example, page 19
Configuring a NetFlow Minimum Mask for a Prefix Aggregation Cache using SNMP: Example,
page 19
Using SNMP to Gather Flow Information From the Router: Example, page 20
Configuring the Minimum Mask for a Source Prefix Aggregation Scheme using
SNMP: Example
The following example enables a Source-Prefix aggregation cache and sets the source prefix mask to 16
bits.
workstation% snmpset -c private -m all -v2c 10.4.9.14 cnfCICacheEnable.3 integer 1
CISCO-NETFLOW-MIB::cnfCICacheEnable.sourcePrefix = INTEGER: true(1)
workstation% snmpset -c private -m all -v2c 10.4.9.14 cnfCIMinSourceMask.3 unsigned 16
CISCO-NETFLOW-MIB::cnfCIMinSourceMask.sourcePrefix = Gauge32: 16
Configuring NetFlow Data Export for the Source Prefix Aggregation Scheme
using SNMP: Example
The following example enables a Source-Prefix aggregation cache and configures NetFlow Data Export
for the aggregation cache.
workstation% snmpset -c private -m all -v2c 10.4.9.14 cnfCICacheEnable.3 integer 1
CISCO-NETFLOW-MIB::cnfCICacheEnable.sourcePrefix = INTEGER: true(1)
workstation% snmpset -c private -m all -v2c 10.4.9.14
cnfEICollectorStatus.3.1.4.10.0.19.2.3 integer 4
CISCO-NETFLOW-MIB::cnfEICollectorStatus.sourcePrefix.ipv4."....".3 = INTEGER:
createAndGo(4)
19
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Additional References
This command will retrieve the Netflow Statistics from the main cache using the MIB.
workstation% snmpget -c public -v2c 10.4.9.14 cnfPSPacketSizeDistribution.0
cnfPSPacketSizeDistribution.0 =
00 00 00 00
03 e8 00 00
00 00
00 00 00 00
00 00 00 00
00 00
00 00 00 00
00 00 00 00
00 00
00 00 00 00
00 00
00 00
00 00
00 00
00 00
00 00
00 00
00 00
00 00
The IP packet size distribution values are in the same order as shown in the CLI, with each pair of bytes
representing a value of 1000 times the respective value in the CLI.
For example, for the packet range 65-96, the byte pair is 0x03e8 which is 1000 times 1. So to obtain the
same values as the CLI, divide the value by 1000.
View the NetFlow Main Cache Timeout Values using SNMP
This command will retrieve the cache timeout values from the main cache using the MIB.
workstation% snmpget -c public -v2c 10.4.9.14 cnfCIActiveFlows.0 cnfCIInactiveFlows.0
cnfCIActiveTimeOut.0 cnfCIInactiveTimeOut.0
CISCO-NETFLOW-MIB::cnfCIActiveFlows.main = Gauge32: 1
CISCO-NETFLOW-MIB::cnfCIInactiveFlows.main = Gauge32: 3999
CISCO-NETFLOW-MIB::cnfCIActiveTimeOut.main = Gauge32: 60 minutes
CISCO-NETFLOW-MIB::cnfCIInactiveTimeOut.main = Gauge32: 30 seconds
Additional References
The following sections provide references related to configuring SNMP and the NetFlow MIB to monitor
NetFlow data.
20
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Additional References
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data
configuring NetFlow and NetFlow Data Export
Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
21
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Feature Information for Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
MIBs
MIBs
MIBs Link
CISCO-NETFLOW-MIB.my
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
22
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Glossary
Note
Table 1
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Information for Configuring the NetFlow Top Talkers Feature using the Cisco IOS CLI or SNMP
Commands
Feature Name
Releases
NetFlow MIB
12.3(7)T,
12.2(25)S
12.2(27)SBC
12.2(33)SRD
Glossary
ASautonomous system. A collection of networks under a common administration sharing a common
routing strategy. Autonomous systems are subdivided by areas. An autonomous system must be assigned
a unique 16-bit number by the Internet Assigned Numbers Authority (IANA).
BGPBorder Gateway Protocol. Interdomain routing protocol that replaces Exterior Gateway Protocol
(EGP). A BGP system exchanges reachability information with other BGP systems. BGP is defined by
RFC 1163.
BGP next hopIP address of the next hop to be used to reach a specific destination.
CEFCisco Express Forwarding. A Layer 3 IP switching technology that optimizes network
performance and scalability for networks with large and dynamic traffic patterns.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
MIBManagement Information Base. Database of network management information that is used and
maintained by a network management protocol, such as Simple Network Management System (SNMP)
or the Common Management Information Protocol (CMIP). The value of a MIB object can be changed
or retrieved using SNMP or CMIP commands, usually through a GUI network management system. MIB
objects are organized in a tree structure that includes public (standard) and private (proprietary)
branches.
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
23
Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data
Glossary
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)A Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
NMSnetwork management system. A system responsible for managing at least part of a network. An
NMS is generally a reasonably powerful and well-equipped computer, such as an engineering
workstation. NMSs communicate with agents to help keep track of network statistics and resources.
SNMPSimple Network Management Protocol. A network management protocol used almost
exclusively in TCP/IP networks. SNMP provides a means to monitor and control network devices, and
to manage configurations, statistics collection, performance, and security.
SNMP communitiesAn authentication scheme that enables an intelligent network device to validate
SNMP requests.
ToS bytetype of service. Second byte in the IP header that indicates the desired quality of service for
a particular datagram.
CCDE, CCENT, CCSI, Cisco Eos, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Lumin, Cisco Nexus, Cisco Nurse Connect,
Cisco Pulse, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco Unified Computing System, Cisco WebEx, DCE, Flip Channels,
Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to the Human Network
are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed (Stylized), Cisco Store,
and Flip Gift Card are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP,
CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems,
Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center,
Explorer, Fast Step, Follow Me Browsing, FormShare, GainMaker, GigaDrive, HomeLink, iLYNX, Internet Quotient, IOS, iPhone, iQuick Study,
IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers,
Networking Academy, Network Registrar, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect,
ROSA, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx,
and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0908R)
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.
20052009 Cisco Systems, Inc. All rights reserved.
24
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology. This document describes the
NetFlow application and the new NetFlow Reliable Export With Stream Control Transmission Protocol
(SCTP) feature.
The NetFlow Reliable Export with SCTP feature adds the ability for NetFlow to use the reliable and
congestion-aware SCTP when exporting statistics to a network management system that supports the
NetFlow data export formats, such as a system running CNS NetFlow Collection Engine (NFC).
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Glossary, page 30
NetFlow Benefits
NetFlow captures a rich set of traffic statistics. These traffic statistics include user, protocol, port, and
type of service (ToS) information that can be used for a wide variety of purposes such as network
application and user monitoring (user monitoring is performed by monitoring the IP addresses of the
devices that users are running applications on), network analysis and planning, denial of service (DoS)
and security analysis, accounting and billing, traffic engineering, and data mining.
NetFlow can capture a rich set of traffic statistics. These traffic statistics include user, protocol, port, and
type of service (ToS) information that can be used for a wide variety of purposes, including network
traffic analysis and capacity planning, security, enterprise accounting and departmental chargebacks,
Internet Service Provider (ISP) billing, data warehousing, and data mining for marketing purposes.
Network Application and User Monitoring
NetFlow data enables you to view detailed, time and application based usage of a network. This
information allows you to plan and allocate network and application resources, and provides for
extensive near real-time network monitoring capabilities. It can be used to display traffic patterns and
application-based views. NetFlow provides proactive problem detection and efficient troubleshooting,
and it facilitates rapid problem resolution. You can use NetFlow information to efficiently allocate
network resources and to detect and resolve potential security and policy violations.
Network Analysis and Planning
You can use NetFlow to capture data for extended periods of time, which enables you to track network
utilization and anticipate network growth and plan upgrades. NetFlow service data can be used to
optimize network planning, which includes peering, backbone upgrades, and routing policy planning. It
also enables you to minimize the total cost of network operations while maximizing network
performance, capacity, and reliability. NetFlow detects unwanted WAN traffic, validates bandwidth and
quality of service (QoS) behavior, and enables the analysis of new network applications. NetFlow offers
valuable information that you can use to reduce the cost of operating the network.
Denial of Service and Security Analysis
You can use NetFlow data to identify and classify in real time denial of service (DoS) attacks, viruses,
and worms. Changes in network behavior indicate anomalies that are clearly reflected in NetFlow data.
The data is also a valuable forensic tool that you can use to understand and replay the history of security
incidents.
Accounting and Billing
NetFlow data provides fine-grained metering for highly flexible and detailed resource utilization
accounting. For example, flow data includes details such as IP addresses, packet and byte counts,
timestamps, and information about type of service (ToS) and application ports. Service providers might
utilize the information for billing based on time-of-day, bandwidth usage, application usage, or QoS.
Enterprise customers might utilize the information for departmental charge-back or cost allocation for
resource utilization.
Traffic Engineering
NetFlow provides autonomous system (AS) traffic engineering details. You can use NetFlow-captured
traffic data to understand source-to-destination traffic trends. This data can be used for load-balancing
traffic across alternate paths or for forwarding traffic along a preferred route. NetFlow can measure the
amount of traffic crossing peering or transit points. You can use the data to help you decide if a peering
arrangement with other service providers is fair and equitable.
NetFlow data can be stored for later retrieval and analysis in support of marketing and customer service
programs. For example, the data can be mined to find out which applications and services are being used
by internal and external users and target the users for improved service and advertising. In addition,
NetFlow data gives market researchers access to the who, what, where, and how long information
relevant to enterprises and service providers.
Although NetFlow functionality is included in all software images for these platforms, you must
purchase a separate NetFlow feature license. NetFlow licenses are sold on a per-node basis.
Other Routers
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image
support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on
Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at
the login dialog box and follow the instructions that appear.
Source IP address
Destination IP address
Type of service
These seven key fields define a unique flow. If a packet has one key field different from another packet,
it is considered to belong to another flow. A flow might also contain other accounting fields (such as the
AS number in the NetFlow export Version 5 flow format). The fields that a given flow contains depend
on the export record version that you configure. Flows are stored in the NetFlow cache.
IP-to-IP packets
NetFlow captures data for all egress (outgoing) packets through use of the following features:
Egress NetFlow AccountingNetFlow gathers data for all egress packets for IP traffic only.
NetFlow MPLS EgressNetFlow gathers data for all egress MPLS-to-IP packets.
Version 9A flexible and extensible format, which provides the versatility needed for support of
new fields and record types. This format accommodates new NetFlow-supported technologies such
as MPLS, and Border Gateway Protocol (BGP) next hop. The distinguishing feature of the NetFlow
Version 9 format is that it is template based. Templates provide an extensible design to the record
format, a feature that should allow future enhancements to NetFlow services without requiring
concurrent changes to the basic flow-record format. Internet Protocol Information Export (IPFIX)
was based on the Version 9 export format.
Version 8A format added to support data export from aggregation caches. Version 8 allows export
datagrams to contain a subset of the usual Version 5 export data, if that data is valid for a particular
aggregation cache scheme.
Version 7A version supported on a Catalyst 6000 series switch with a multilayer switch feature
card (MSFC) running CatOS Release 5.5(7) and later.
On a Catalyst 6000 series switch with an MSFC, you can export using either the Version 7 or the
Version 8 format.
Version 5A version that adds BGP AS information and flow sequence numbers.
Version 1The initially released export format, rarely used today. Do not use the Version 1 export
format unless the legacy collection system you are using requires it. Use either the Version 9 export
format or the Version 5 export format for data export from the main cache.
Lack of congestion awarenessThe exporter sends packets as fast as it can generate them, without
any regard to the bandwidth available on the network. If the link is fully congested when the
NetFlow router attempts to send, the packet might simply be dropped, either before it is put on the
exporters output queue or before it gets to the next hop's input queue.
Lack of reliabilityWith export over UDP, the collector has no method of signaling to the exporter
that it didn't receive an exported packet. Most versions of NetFlow export packet contain a sequence
number, so the collector often knows when it has lost a packet. But given that the exporter discards
the export packet as soon as it has been sent and that the NetFlow router lacks a mechanism to
request a retransmission of the packet, exporting over UDP can be considered to be unreliable
The NetFlow Reliable Export With SCTP feature uses the SCTP to overcome the two major
disadvantages of using UDP as the transport layer protocol:
SCTP has a congestion control mechanism to ensure that the router does not send data to the
collector faster than it can receive it.
SCTP transmits messages in a reliable manner. SCTP messages are buffered on the router until they
have been acknowledged by the collector. Messages that are not acknowledged by the collector are
retransmitted by the router.
SCTP is a reliable message-oriented transport layer protocol, which allows data to be transmitted
between two end-points in a reliable, partially reliable, or unreliable manner. An SCTP session consists
of an association between two end-points, which may contain one or more logical channels called
streams. SCTPs stream based transmission model facilitates the export of a mix of different data types,
such as NetFlow templates and NetFlow data, over the same connection. The maximum number of
inbound and outbound streams supported by an end-point is negotiated during the SCTP association
initialization process.
When you configure the NetFlow Version 9 Export and NetFlow Reliable Export features, NetFlow
creates a minimum of two streamsstream 0 for templates and options, and one or more streams for
carrying data, as required. The following commands are not applicable when you configure the NetFlow
Version 9 Export and NetFlow Reliable Export features together because NetFlow Reliable Export
export connections use SCTP reliable stream 0 for NetFlow Version 9 Export, and these commands apply
only to NetFlow export connections that use UDP:
When more than one cache (main cache and one or more aggregation caches) is exporting data, each
cache creates its own streams with their own configured reliability levels. For example, you can
configure the main cache to use SCTP in full reliability mode and the NetFlow prefix aggregation cache
to use partial reliability mode to send messages to the same collector using the same SCTP port.
Note
When you are using SCTP as the transport protocol for exporting NetFlow traffic, the traffic is usually
referred to as messages instead of datagrams because SCTP is a message-oriented protocol. When you
are using UDP as the transport protocol for exporting NetFlow traffic, the traffic is usually referred to
as datagrams because UDP is a datagram-oriented protocol.
Security
SCTP contains several built-in features to counter many common security threats such as the syn-flood
type of DoS attack.
A four-way start-up handshake is used to ensure that anyone opening an association is a genuine
caller, rather the someone performing a 'syn-flood' type of DoS attack.
Cookies are used to defer commitment of resources at the responding SCTP node until the
handshake is completed.
Verification Tags are used to prevent insertion of extraneous packets into the flow of an established
association.
Reliability Options
SCTP allows data to be transmitted between two end-points (a router running NetFlow SCTP export and
a collector that is receiving and acknowledging the SCTP messages) in a reliable manner. In addition to
the default behavior of full reliability, SCTP can be configured for partially-reliable or unreliable
transmission for applications that do not require full reliability.
When SCTP is operating in full reliability mode, it uses a selective-acknowledgment scheme to
guarantee the ordered delivery of messages. The SCTP protocol stack buffers messages until their receipt
has been acknowledged by the receiving end-point. (collector). SCTP has a congestion control
mechanism that can be used to limit how much memory is consumed by SCTP for buffering packets.
If a stream is specified as unreliable, then the packet is simply sent once and not buffered on the exporter.
If the packet is lost enroute to the receiver, the exporter cannot retransmit it.
When a stream is specified as partially-reliable a limit is placed on how much memory should be
dedicated to storing un-acknowledged packets. The limit on how much memory should be dedicated to
storing unacknowledged packets is configurable by means of the buffer-limit limit command. If the limit
on how much memory should be dedicated to storing unacknowledged packets is exceeded and the router
attempts to buffer another packet, the oldest unacknowledged packet is discarded. When SCTP discards
the oldest unacknowledged packet, a message called a forward-tsn (transmit sequence number) is sent
to the collector to indicate that this packet will not be received. This prevents NetFlow from consuming
all the free memory on a router when a situation has arisen which requires many packets to be buffered,
for example when SCTP is experiencing long response times from an SCTP peer connection.
When SCTP is operating in partially reliable mode, the limit on how much memory should be dedicated
to storing un-acknowledged packets should initially be set as high as possible. The limit can be reduced
if other processes on the router begin to run out of memory. Deciding on the best value for the limit
involves a trade-off between avoiding starving other processes of the memory that they require to operate
and dropping SCTP messages that have not been acknowledged by the collector.
Unreliable SCTP can be used when the collector that you are using doesnt support UDP as a transport
protocol for receiving NetFlow export datagrams and you do not want to allocate the resources on your
router required to provide reliable, or partially reliable, SCTP connections.
Congestion Avoidance
SCTP uses congestion avoidance algorithms that are similar to those for TCP. An SCTP end-point
advertises the size of its receive window (rWnd) to ensure that a sender cannot flood it with more
messages than it can store in its input queues.
Each SCTP sender also maintains a congestion window (cWnd), which determines the number of
unacknowledged packets that can be outstanding at a given time. SCTP uses the same 'slow-start'
algorithm as TCP, in which it starts with a small cWnd and gradually increases it until it reaches its
optimum size.
Whenever a packet isn't acknowledged within the given timeout period, the value of cWnd is halved. This
method of congestion avoidance is known as added increase / multiplicative decrease and has been
shown to be the most effective congestion avoidance algorithm in most circumstances.
SCTP also employs the fast-retransmit algorithm whereby it retransmits a message if it receives
acknowledgments from four messages which were sent after the message in question. This is preferable
to waiting for the timeout period to elapse and triggering a retransmit of the message.
Options for Backup Collectors
You can configure a backup collector for SCTP. It is used as a message destination in the event that the
primary collector becomes unavailable. When connectivity with the primary collector has been lost, and
a backup collector is configured, SCTP begins using the backup collector. The default period of time that
SCTP waits until it starts using the backup collector is 25 milliseconds (msec). You can configure a
different value for interval with the fail-over time command.
The router sends periodic SCTP heartbeat messages to the SCTP collectors that you have configured.
The router uses the SCTP heartbeat message acknowledgements from the collectors to monitor the status
of each collector. This allows an application, such as NetFlow, to be quickly informed when connectivity
to a collector is lost.
You can configure SCTP backup in fail-over or redundant mode. When the router is configured with
SCTP backup in fail-over mode, the router waits to activate the association with the backup collector
until the router has not received acknowledgements for the SCTP heartbeat messages from the primary
collector for the time specified by the fail-over time command (or the default of 25 msec if this
parameter has not been modified).
Note
SCTP retransmits messages that have not been acknowledged three times. The router will initiate
fail-over after three retransmissions of the same message are not acknowledged by the primary collector.
When the router is configured with SCTP backup in redundant mode, the router activates the association
with the backup collector immediately, and if NetFlow v9 export is configured the router sends the
(options) templates in advance. The router will not start sending other SCTP messages to a backup
collector in redundant mode until the router has not received acknowledgments for the SCTP heartbeat
messages from the primary collector for the time specified by the fail-over time command. Fail-over
mode is the preferred method when the backup collector is on the end of an expensive lower-bandwidth
link such as ISDN.
During the time that SCTP is using the backup collector, SCTP continues to try to restore the association
with the primary collector. This goes on until connectivity is restored or the primary SCTP collector is
removed from the configuration.
When connectivity to the primary collector is available again, the router waits for a period of time before
reverting to using it as the primary destination. You configure the value of the period of time that SCTP
waits until reverting to the primary collector with the restore-time time command. The default period
of time that SCTP waits until it reverts to the primary collector is 25 sec.
Under either fail-over mode any records which have been queued between losing connectivity with the
primary destination and establishing the association with the backup collector might be lost. A count is
maintained of how many records were lost. It can be viewed with the show ip flow export sctp verbose
command.
To avoid a flapping SCTP association with a collector (the SCTP association goes up and down in quick
succession), the time period configured with the restore-time time command should be greater than the
period of a typical connectivity problem. For example, your router is configured to use IP fast
convergence for its routing table and you have a LAN interface that is going up and down repeatedly
(flapping). That causes the IP route to the primary collector to be added and removed from the routing
table repeatedly (route flapping) every 2000 msec (2 sec). you need to configure the restore time for a
value greater than 2000 msecs.
The backup connection uses stream 0 for sending templates, options templates, and option data record.
The data stream(s) inherit the reliability settings of the primary connection.
Export to Multiple Collectors
You can configure your networking device to export NetFlow data to a maximum of two export
destinations (collectors) per cache (main and aggregation caches), using any combination of UDP and
SCTP. A destination is identified by a unique combination of hostname or IP address and port number
or port type. Table 1 shows examples of permitted multiple NetFlow export destinations for each cache.
Table 1
The most common use of the multiple-destination feature is to send the NetFlow cache entries to two
different destinations for redundancy. Therefore, in most cases the second destination IP address is not
the same as the first IP address. The port numbers can be the same when you are configuring two unique
destination IP addresses. If you want to configure both instances of the command to use the same
destination IP address, you must use unique port numbers. You receive a warning message when you
configure the two instances of the command with the same IP address. The warning message is,
%Warning: Second destination address is the same as previous address <ip-address>.
SCTP Support For Export Formats
SCTP based reliable transport is available for all NetFlow export formats: Versions 1, 5, 8 and 9.
Configuring NetFlow SCTP Export for One Export Destination with Partial Reliability, page 11
Configuring NetFlow SCTP Export for One Export Destination with No Reliability, page 12
Configuring NetFlow SCTP Export for One Export Destination and One Backup Export Destination,
page 13
Configuring NetFlow SCTP Export for One Export Destination and One Backup Export Destination
With Fail-Over Mode Backup, page 15
Configuring NetFlow SCTP Export for Two Export Destinations and Two Backup Export
Destinations, page 17
Configuring NetFlow SCTP Export for One Fully Reliable and One Partially Reliable Export
Destination, page 19
Configuring NetFlow SCTP Export for the NetFlow Source-Prefix Aggregation Cache, page 20
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
end
5.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
ip flow-export destination
Step 4
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
10
Step 5
Configuring NetFlow SCTP Export for One Export Destination with Partial
Reliability
This NetFlow SCTP export configuration uses partial reliability.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
6.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
ip flow-export destination
11
Step 4
Step 5
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 6
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
12
1.
enable
2.
configure terminal
3.
4.
reliability none
5.
end
6.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
Step 4
reliability none
Configures partial reliability for this SCTP export destination and sets the packet buffer limit to 3000.
Router(config-flow-export-sctp)# reliability none
Step 5
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 6
Configuring NetFlow SCTP Export for One Export Destination and One Backup
Export Destination
This NetFlow SCTP export configuration uses full reliability, a backup SCTP export destination, and
redundant mode backup.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
13
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
6.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
Step 4
Step 5
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 6
14
Configuring NetFlow SCTP Export for One Export Destination and One Backup
Export Destination With Fail-Over Mode Backup
This NetFlow SCTP export configuration uses full reliability, a backup SCTP export destination, and
fail-over mode backup.
Note
The backup fail-over and restore times are modified here so that you can see an example of how to
configure these commands. The values used in this example might not be suitable for your network. If
you want to override the default values for the fail-over and restore times you need to analyze the
performance of your network and the collector that you are using to determine values that are appropriate
for your network.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
6.
7.
8.
end
9.
15
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 9
16
Configuring NetFlow SCTP Export for Two Export Destinations and Two Backup
Export Destinations
This configuration is the most basic SCTP export configuration that uses multiple export destinations.
Note
You can configure a maximum of two export destinations for every NetFlow cache.
The backup destination 192.168.100.2 200 is assigned to the ip flow-export destination 172.16.45.57
100 sctp command.
Tip
To change the SCTP export destination that you are modifying, reenter the command line for the SCTP
export destination that you want to modify.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
17
6.
7.
end
8.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
Step 4
Step 5
ip flow-export destination
Step 6
Step 7
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 8
18
Configuring NetFlow SCTP Export for One Fully Reliable and One Partially
Reliable Export Destination
This SCTP export configuration uses two SCTP export destinations. One of the export destinations uses
full reliability and the other export destination uses partial reliability.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
6.
end
7.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
19
Step 3
Step 4
Step 5
Step 6
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 7
20
Note
You can configure a maximum of two export destinations for every NetFlow cache.
Tip
Use the configuration in the Configuration Examples for NetFlow Reliable Export With SCTP section
on page 25 to practice using the different configuration modes.
Prerequisites
You must have NetFlow enabled on at least one interface in your router before you can export NetFlow
data.
You must have a NetFlow collector in your network that supports NetFlow SCTP export.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
enable
5.
6.
end
7.
21
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode.
Router> enable
Step 2
configure terminal
Enters global configuration mode.
Router# configure terminal
Step 3
Step 4
enable
Activates the NetFlow aggregation cache.
Router(config-flow-cache)# enable
Step 5
Step 6
end
Returns to privileged EXEC mode.
Router(config-flow-export-sctp)# end
Step 7
22
http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122t/122t8/ft_sctp2.htm
for more information on interpreting the output from these commands, and the other commands that are
available for monitoring and troubleshooting SCTP.
SUMMARY STEPS
1.
2.
3.
4.
5.
DETAILED STEPS
Step 1
Step 2
23
Step 3
Step 4
Step 5
24
Additional Stats
Assocs Currently Estab: 2
Active Estab: 2 Passive Estab: 0
Aborts: 0 Shutdowns: 0
T1 Expired: 1 T2 Expired: 0
Multiple SCTP export destinations for the Main NetFlow cache with backup destinations
Multiple SCTP export destinations for the NetFlow protocol-port aggregation cache using partial
reliability and fail-over mode backup destinations
Multiple SCTP export destinations for the NetFlow bgp-nexthop-tos aggregation cache with
reliability disabled and redundant mode backup destinations
25
The display output of the show ip flow export sctp verbose command shows the status and statistics for
this configuration example:
Router# show ip flow export sctp verbose
IPv4 main cache exporting to 172.16.45.57, port 100, partial
status: connected
backup mode: redundant
104 flows exported in 84 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:
25 seconds
backup: 192.168.100.2, port 200
status: connected
fail-overs: 2
0 flows exported in 0 sctp messages.
0 packets dropped due to lack of SCTP resources
IPv4 main cache exporting to 172.16.12.200, port 100, partial
status: connected
backup mode: redundant
104 flows exported in 84 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:
25 seconds
backup: 192.168.247.198, port 200
status: connected
fail-overs: 1
0 flows exported in 0 sctp messages.
0 packets dropped due to lack of SCTP resources
protocol-port cache exporting to 172.16.12.200, port 100, partial
status: connected
backup mode: fail-over
19 flows exported in 18 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:
25 seconds
backup: 192.168.247.198, port 200
status: connected
fail-overs: 0
0 flows exported in 0 sctp messages.
0 packets dropped due to lack of SCTP resources
protocol-port cache exporting to 172.16.45.57, port 100, partial
status: connected
backup mode: fail-over
15 flows exported in 15 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:
25 seconds
backup: 192.168.100.2, port 200
status: connected
fail-overs: 0
0 flows exported in 0 sctp messages.
0 packets dropped due to lack of SCTP resources
bgp-nexthop-tos cache exporting to 172.16.12.200, port 100, full
status: connected
backup mode: redundant
20 flows exported in 10 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:
25 seconds
backup: 192.168.247.198, port 200
status: connected
fail-overs: 0
0 flows exported in 0 sctp messages.
0 packets dropped due to lack of SCTP resources
26
Additional References
The following sections provide references related to the NetFlow Reliable Export with SCTP feature.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Layer 2 and Security
Monitoring Exports
27
Related Topic
Document Title
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFC
Title
RFC 3954
RFC2690
RFC 3578
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
28
Note
Table 2
Table 2 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
12.4(4)T
29
Glossary
CEFCisco Express Forwarding. A Layer 3 IP switching technology that optimizes network
performance and scalability for networks with large and dynamic traffic patterns.
BGPBorder Gateway Protocol. Interdomain routing protocol that replaces Exterior Border Gateway
Protocol (EBGP). A BGP system exchanges reachability information with other BGP systems. BGP is
defined by RFC 1163.
BGP next hopIP address of the next hop to be used to reach a certain destination.
data recordProvides information about an IP flow that exists on the device that produced an export
packet. Each group of data records (meaning each data flowset), refers to a previously transmitted
template ID, which can be used to parse the data within the records.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
export packetA type of packet built by a device (for example, a router) with NetFlow services
enabled. The packet is addressed to another device (for example, the NetFlow Collection Engine). The
packet contains NetFlow statistics. The other device processes the packet (parses, aggregates, and stores
information on IP flows).
fast switchingA Cisco feature in which a route cache is used to expedite packet switching through a
router.
flowA unidirectional stream of packets between a given source and destination, each of which is
defined by a network-layer IP address and transport-layer source and destination port numbers.
flowsetA collection of flow records that follow the packet header in an export packet. A flowset
contains information that must be parsed and interpreted by the NetFlow Collection Engine. There are
two different types of flowsets: template flowsets and data flowsets. An export packet contains one or
more flowsets, and both template and data flowsets can be mixed in the same export packet.
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)A Cisco application that is used with
NetFlow on Cisco routers and Catalyst 5000 series switches. The NetFlow Collection Engine collects
packets from the router that is running NetFlow and decodes, aggregates, and stores them. You can
generate reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means of carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
options data recordA special type of data record used in the NetFlow process. It is based on an
options template and has a reserved template ID that provides information about the NetFlow process
itself.
options templateA type of template record used to communicate the format of data related to the
NetFlow process.
30
packet headerFirst part of an export packet. It provides basic information about the packet (such as
the NetFlow version, number of records contained in the packet, and sequence numbering) so that lost
packets can be detected.
SCTPStream Control Transmission Protocol. The Stream Control Transmission Protocol (SCTP) is a
transport layer protocol defined in 2000 by the IETF Signaling Transport (SIGTRAN) working group.
The protocol is defined in RFC 2960, and an introductory text is provided by RFC 3286.
template flowsetA collection of template records that are grouped in an export packet.
template IDA unique number that distinguishes a template record produced by an export device from
other template records produced by the same export device. A NetFlow Collection Engine application
can receive export packets from several devices. You should be aware that uniqueness is not guaranteed
across export devices. The NetFlow Collection Engine should cache the address of the export device that
produced the template ID in order to enforce uniqueness.
template recordDefines the format of subsequent data records that might be received in current or
future export packets. A template record within an export packet does not necessarily indicate the format
of data records within that same packet. A NetFlow Collection Engine application must cache any
template records received and then parse any data records it encounters by locating the appropriate
template record in the cache.
CCDE, CCENT, CCSI, Cisco Eos, Cisco Explorer, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Nurse Connect, Cisco Pulse,
Cisco SensorBase, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco TrustSec, Cisco Unified Computing System, Cisco WebEx,
DCE, Flip Channels, Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to
the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed
(Stylized), Cisco Store, Flip Gift Card, and One Million Acts of Green are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS,
Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert
logo, Cisco IOS, Cisco Lumin, Cisco Nexus, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity,
Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center, Explorer, Follow Me Browsing, GainMaker, iLYNX, IOS,
iPhone, IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking
Academy, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect, ROSA, SenderBase, SMARTnet,
Spectrum Expert, StackWise, WebEx, and the WebEx logo are registered trademarks of Cisco and/or its affiliates in the United States and certain
other countries.
All other trademarks mentioned in this document or website 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. (1002R)
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.
2008 Cisco Systems, Inc. All rights reserved.
31
32
This document contains information about and instructions for detecting and analyzing network threats
such as denial of service attacks (DoS) through the use of the following NetFlow features:
NetFlow Layer 2 and Security Monitoring ExportsThis feature improves your ability to detect and
analyze network threats such as denial of service attacks (DoS) by adding 9 fields that NetFlow can
capture the values from.A few examples are:
IP Time-to-Live field
Packet length field
ICMP type and code fields
NetFlow Dynamic Top Talkers CLIThis feature gives you an overview of the highest volume
traffic in your network by aggregating flows on a common field. For example, you can aggregate all
of the flows for a destination network by aggregating them on the destination prefix. There are over
20 fields from flows that you can aggregate the highest volume traffic on. A few examples are:
Source or destination IP address
Source or destination prefix
Source or destination port
ICMP type and code
NetFlow Top TalkersThis feature gives you a more detailed view of the traffic in your network
than the NetFlow Dynamic Top Talkers CLI feature because it looks at individual flows. You use the
NetFlow Dynamic Top Talkers CLI feature to quickly identify high volume traffic of interest. You
use the NetFlow Top Talkers feature to obtain more detailed information on each of the flows in the
high volume traffic.
NetFlow Input FiltersThis feature tracks a specific subset of NetFlow traffic for the purpose of
class-based traffic analysis and monitoring. This feature is used in conjunction with the Top Talkers
feature to help you focus your analysis on the traffic that might be a network threat such as a DoS
attack.
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Random Sampled NetFlowThis feature is typically used for statistical sampling of network traffic
for traffic engineering or capacity planning purposes. It is used in the context of monitoring and
analyzing network threats because it can be used to reduce the impact on the router using NetFlow
to monitor traffic that might be a network threat, such as a DoS attack.
Contents
Prerequisites for Detecting and Analyzing Network Threats With NetFlow, page 2
Information About Detecting and Analyzing Network Threats With NetFlow, page 2
How to Configure and Use NetFlow to Detect and Analyze Network Threats, page 19
Configuration Examples for Detecting and Analyzing Network Threats With NetFlow, page 40
Feature Information for Detecting and Analyzing Network Threats With NetFlow, page 56
Glossary, page 58
Time-to-Live field
ID field
Fragment offset
See the Layer 3 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports section
for more information on these Layer 3 fields.
The Layer 2 fields that NetFlow Layer 2 and Security Monitoring Exports feature captures the values of
are:
Source MAC address field from frames that are received by the NetFlow router
Destination MAC address field from frames that are transmitted by the NetFlow router
VLAN ID field from frames that are received by the NetFlow router
VLAN ID field from frames that are transmitted by the NetFlow router
Interface names
See the Layer 2 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports section
for more information on these Layer 2 fields.
The Layer 3 fields captured by the NetFlow Layer 2 and Security Monitoring Exports feature improve
NetFlows capabilities for identifying DoS attacks. The Layer 2 fields captured by the NetFlow Layer 2
and Security Monitoring Exports feature can help you identify the path that the DoS attack is taking
through the network.
The Layer 3 and Layer 2 fields captured by the NetFlow Layer 2 and Security Monitoring Exports feature
are not key fields. They provide additional information about the traffic in an existing flow. Changes in
the values of NetFlow key fields such as the source IP address from one packet to the next packet result
in the creation of a new flow. For example if the first packet captured by NetFlow has a source IP address
of 10.34.0.2 and the second packet captured by NetFlow has a source IP of 172.16.213.65, NetFlow will
create two separate flows.
Many DoS attacks consist of an attacker sending the same type of IP datagram over and over again in an
attempt to overwhelm the target systems. In such cases the incoming traffic often has similar
characteristics such as the same values in each datagram for one or more of the fields that the NetFlow
Layer 2 and Security Monitoring Exports feature can capture.
There is no easy way to identify the originator of many DoS attacks because the IP source address of the
device sending the traffic is usually forged. However by capturing the MAC address and VLAN-ID fields
using the NetFlow Layer 2 and Security Monitoring Exports feature, you can easily trace the traffic back
through the network to the router that it is arriving on. If the router that the traffic is arriving on supports
NetFlow, you can configure the NetFlow Layer 2 and Security Monitoring Exports feature on it to
identify the interface where the traffic is arriving. Figure 1 shows an example of an attack in progress.
Figure 1
Switch F
Host B
Switch G
NetFlow router
Internet
Router B
Switch B
Switch A
Host C
Router C
Switch C
Switch D
127557
Router D
Switch E
CNS NetFlow
collection engine
Note
You can analyze the data captured by NetFlow directly from the router using the show ip cache verbose
flow command or remotely with the CNS NetFlow Collector Engine.
Once you have concluded that a DoS attack is taking place by analyzing the Layer 3 fields in the NetFlow
flows, you can analyze the Layer 2 fields in the flows to discover the path that the DoS attack is taking
through the network.
An analysis of the data captured by the NetFlow Layer 2 and Security Monitoring Exports feature for
the scenario shown in Figure 1 indicates that the DoS attack is arriving on Router C because the upstream
MAC address is from the interface that connects Router C to Switch A. It is also evident that there are
no routers between the target host (the email server) and the NetFlow router because the destination
MAC address of the DoS traffic that the NetFlow router is forwarding to the email server is the MAC
address of the email server.
You can find out the MAC address that Host C is using to send the traffic to Router C by configuring the
NetFlow Layer 2 and Security Monitoring Exports feature on Router C. The source MAC address will
be from Host C. The destination MAC address will be for the interface on the NetFlow router.
Once you know the MAC address that Host C is using and the interface on Router C that Host Cs DoS
attack is arriving on, you can mitigate the attack by reconfiguring Router C to block Host Cs traffic. If
Host C is on a dedicated interface you can disable the interface. If Host C is using an interface that carries
traffic from other users, you must configure your firewall, or add an ACL, to block Host Cs traffic but
still allow the traffic from the other users to flow through Router C.
The Configuration Examples for Detecting and Analyzing Network Threats With NetFlow section has
two examples for using the NetFlow Layer 2 and Security Monitoring Exports feature to identify an
attack in progress and the path that the attack is taking through a network.
Layer 3 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports
The NetFlow Layer 2 and Security Monitoring Exports feature has support for capturing five fields from
Layer 3 IP traffic in a flow:
Time-to-Live field
ID field
Fragment offset
Figure 2 shows the fields in an IP packet header. Figure 3 shows the fields in an ICMP datagram. ICMP
datagrams are carried in the data area of an IP datagram, after the IP header.
Figure 2
Table 1
Field
Description
Version
Internet Header Length is the length of the internet header in 32-bit word and
thus points to the beginning of the data.
Note
ToS
Total Length
Table 1
Field
Description
Identification (ID)
The value in the ID field is entered by the sender. All of the fragments of an
IP datagram have the same value in the ID field. Subsequent IP datagrams
from the same sender will have different values in the ID field.
It is very common for a host to be receiving fragmented IP datagrams from
several senders concurrently. It is also common for a host to be receiving
multiple IP datagrams from the same sender concurrently.
The value in the ID field is used by the destination host to ensure that the
fragments of an IP datagram are assigned to the same packet buffer during
the IP datagram reassembly process. The unique value in the ID field is also
used to prevent the receiving host from mixing together IP datagram
fragments of different IP datagrams from the same sender during the IP
datagram reassembly process.
Flags
Fragment Offset
TTL (Time-to-Live)
This field indicates the maximum time the datagram is allowed to remain in
the internet system. If this field contains the value 0, then the datagram must
be destroyed. This field is modified in internet header processing. The time
is measured in units of seconds, but since every module that processes a
datagram must decrease the TTL by at least 1 even if it processes the
datagram in less than a second, the TTL must be thought of only as an upper
bound on the time a datagram can exist. The intention is to cause
undeliverable datagrams to be discarded, and to bound the maximum
datagram lifetime.
Protocol
Indicates the type of transport packet included in the data portion of the IP
datagram. Common values are:
1 = ICMP
6 = TCP
17 = UDP
Header checksum
A checksum on the header only. Since some header fields, such as the
time-to-live field, change every time an IP datagram is forwarded, this value
is recomputed and verified at each point that the internet header is processed.
Source IP Address
Table 1
Field
Description
Destination IP Address
The options and padding may or may not appear or not in datagrams. If they
do appear, they must be implemented by all IP modules (host and gateways).
What is optional is their transmission in any particular datagram, not their
implementation.
Figure 3
ICMP Datagram
Table 2
Type
Name
Codes
Echo reply
0None
Unassigned
Unassigned
Destination unreachable
0Net unreachable.
1Host unreachable.
2Protocol unreachable.
3Port unreachable.
4Fragmentation needed and DF bit set.
5Source route failed.
6Destination network unknown.
7Destination host unknown.
8Source host isolated.
9Communication with destination network is
administratively prohibited.
10Communication with destination host is administratively
prohibited.
11Destination network unreachable for ToS.
12Destination host unreachable for ToS.
Source quench
0None.
Table 2
Type
Name
Codes
Redirect
0None.
0Redirect datagram for the network.
1Redirect datagram for the host.
2Redirect datagram for the TOS and network.
3Redirect datagram for the TOS and host.
Unassigned
Echo
0None.
Router advertisement
0None.
10
Router selection
0None.
11
Time Exceeded
12
Parameter problem
13
Timestamp
0None.
14
Timestamp reply
0None.
15
Information request
0None.
16
Information reply
0None.
17
0None.
18
0None.
19
2029
30
Trace route
31
32
33
IPv6 where-are-you
34
IPv6 I-am-here
35
36
37255
Reserved
Layer 2 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports
The NetFlow Layer 2 and Security Monitoring Exports feature has the ability to capture the values of
the MAC address and VLAN ID fields from flows. The two supported VLAN types are 802.1q and
Ciscos Inter-Switch Link (ISL).
The source MAC address field from frames that are received by the NetFlow router
The destination MAC address field from frames that are transmitted by the NetFlow router
The VLAN ID field from frames that are received by the NetFlow router
The VLAN ID field from frames that are transmitted by the NetFlow router
The Ethernet Type II and Ethernet 802.3 frame formats are shown in Figure 4. The destination address
field and the source address field in the frame formats are the MAC addresses whose values NetFlow
captures. The fields for the Ethernet frame formats are explained in Table 3.
Figure 4
Table 3
Field
Description
Preamble
The entry in the Preamble field is an alternating pattern of 1s and 0s that tells
receiving stations that a frame is coming. It also provides a means for the
receiving stations to synchronize their clocks with the incoming bit stream.
The SOF field holds an alternating pattern of 1s and 0s, ending with two
consecutive 1-bits indicating that the next bit is the first bit of the first byte
of the destination MAC address.
Table 3
Field
Description
Destination Address
The 48-bit destination address identifies which station(s) on the LAN should
receive the frame. The first two bits of the destination MAC address are
reserved for special functions:
The remaining 46 bits are a uniquely assigned value that identifies a single
station, a defined group of stations, or all stations on the network.
Source Address
The 48-bit source address identifies which station transmitted the frame. The
source address is always an individual address and the left-most bit in the SA
field is always 0.
Type
TypeIn an Ethernet Type II frame this part of the frame is used for the Type
field. The Type field is used to identify the next layer protocol in the frame.
or
Length
LengthIn an 802.3 Ethernet frame this part of the frame is used for the
Length field. The Length field is used to indicate the length of the Ethernet
frame. The value can be between 46 and 1500 bytes.
Data
or
or
This field contains a 32-bit cyclic redundancy check (CRC) value, which is
created by the sending station and is recalculated by the receiving station to
check for damaged frames. The FCS is generated for the DA, SA, Type, and
Data fields of the frame. The FCS does not include the data portion of the
frame.
Note
It has become common to refer to both 802.1q and ISL as VLAN encapsulation protocols.
Devices that use 802.1q insert a four-byte tag into the original frame before it is transmitted. Figure 5
shows the format of an 802.1q tagged Ethernet frame. The fields for 802.1q VLANs are described in
Table 4.
10
Figure 5
Table 4
Field
Description
DA, SA, Type or Length, Data, and FCS These fields are described in Table 3.
Tag Protocol ID (TPID)
Priority
ISL is a Cisco proprietary protocol for encapsulating frames on a VLAN trunk. Devices that use ISL add
an ISL header to the frame. This process is known as VLAN encapsulation. 802.1Q is the IEEE standard
for tagging frames on a VLAN trunk. Figure 6 shows the format of a Cisco ISL-encapsulated Ethernet
frame. The fields for 802.1q VLANs are described in Table 5.
11
#of bits in
the field
40
48
16
24
24
15
16
16
Field Name DA TYPE USER SA LEN AAAA03(SNAP) HSA VLAN BPDU INDEX RES
Table 5
1 to 24575
bytes
32
Enscapsulated
FCS
FRAME
127755
Figure 6
Field
Description
DA (destination
address)
Type
This 4-bit field indicates the type of frame that is encapsulated and could be
used in the future to indicate alternative encapsulations.
TYPE codes:
USER
0000 = Ethernet
0010 = FDDI
0011 = ATM
This 4-bit field is used to extend the meaning of the Frame TYPE field. The
default USER field value is 0000. For Ethernet frames, the USER field bits
0 and 1 indicate the priority of the packet as it passes through the switch.
Whenever traffic can be handled more quickly, the packets with this bit set
should take advantage of the quicker path. Such paths however are not
required.
USER codes:
12
XX01 = Priority 1
XX10 = Priority 2
SA
This 48-bit field is the source address field of the ISL packet. It should be set
to the 802.3 MAC address of the switch port transmitting the frame. The
receiving device can ignore the SA field of the frame.
LEN
This 16-bit value field stores the actual packet size of the original packet.
The LEN field represents the length of the packet in bytes, excluding the DA,
TYPE, USER, SA, LEN, and FCS fields. The total length of the excluded
fields is 18 bytes, so the LEN field represents the total length minus 18 bytes.
AAAA03(SNAP)
HSA
This 24-bit field represents the upper three bytes (the manufacturers ID
portion) of the SA field. It must contain the value 0x00-00-0C.
VLAN
This 15-bit field is the Virtual LAN ID of the packet. This value is used to
mark frames on different VLANs.
Table 5
Field
Description
BPDU
The bit in the BPDU field is set for all BPDU packets that are encapsulated
by the ISL frame. The BPDUs are used by the spanning tree algorithm to find
out information about the topology of the network. This bit is also set for
CDP and VTP frames that are encapsulated.
INDEX
This 16-bit field indicates the port index of the source of the packet as it exits
the switch. It is used for diagnostic purposes only, and may be set to any
value by other devices. It is ignored in received packets.
RES
This 16-bit field is used when Token Ring or FDDI packets are encapsulated
with an ISL frame.
Encapsulated FRAME
FCS
The FCS field consists of 4 bytes. It includes a 32-bit CRC value, which is
created by the sending station and is recalculated by the receiving station to
check for damaged frames. The FCS covers the DA, SA, Length/Type, and
Data fields. When an ISL header is attached to a Layer 2 frame, a new FCS
is calculated over the entire ISL packet and added to the end of the frame.
Note
The addition of the new FCS does not alter the original FCS that is
contained within the encapsulated frame.
Comparison of the NetFlow Dynamic Top Talkers CLI and NetFlow Top Talkers Features
There are two very similar NetFlow features that can be used for monitoring the highest volume traffic
in your network. The feature names are:
13
Note
The information that you want to use the NetFlow Dynamic Top Talkers CLI feature to analyze must be
available in the cache. For example, if you want to be able to identify the MAC address in the flows, you
must configure the ip flow-capture mac-addresses command in order to capture the values from the
MAC address fields in the traffic first.
The NetFlow Dynamic Top Talkers CLI feature aggregates flows and allows them to be sorted so that
they can be viewed. The flows can be aggregated on fields in the cache such as source or destination IP
address, ICMP type and code values, and so forth. For a full list of the fields that you can aggregate the
flows on, refer to the show ip flow top command in the Cisco IOS NetFlow command reference
documentation.
The aggregated top talker flows can be sorted by any of the following criteria:
In ascending or descending order (to find the least used Top talker)
In addition to sorting top talkers, you can further organize your output by specifying criteria that the top
talkers must match, such as source or destination IP address or port. The match keyword is used to
specify this criterion. For a full list of the matching criterion that you can select, refer to the
show ip flow top command in the Cisco IOS NetFlow command reference documentation.
The NetFlow Dynamic Top Talkers CLI feature can help you quickly identify traffic that is associated
with security threats such as DoS attacks because it does not require configuration modifications. You
can change the NetFlow Dynamic Top Talkers CLI options for identifying and analyzing network threats
in the aggregated flows on-the-fly as you learn more about the traffic that is of interest. For example,
after you have identified that there is a lot of ICMP traffic in your network by using the show ip flow
top 10 aggregate icmp command you can learn what IP networks the traffic is being sent to by using
the show ip flow top 10 aggregate icmp match destination-prefix 172.0.0.0/8 command.
Note
A high volume of ICMP traffic might indicate that an ICMP-based DoS attack is in progress.
The show ip flow top command:
14
Does not require additional NetFlow configuration commands to display top talkers. Therefore you
do not need to supply the configuration mode password to the administrators who use the he show
ip flow top command to monitor network traffic. The only prerequisite for using the show ip flow
top command is that you have configured NetFlow on at least one interface on the router.
Aggregates flows automatically based on the aggregation method that you select, and independently
of any netflow aggregation cache(s).
Allows you to change the parameters of the command, such as the number of flows to display, the
display order, and match criterion, on-the-fly every time that you use the command without having
to change the routers configuration.
Allows you to sort the display output in ascending or descending order based on:
The aggregated field
The number of bytes
The number of flows,
The number of packets
Many of the values shown in the display output of the show ip cache verbose flow command are in
hexadecimal. If you want to match these values using the show ip flow top command with the match
keyword, you must enter the field value that you want to match in hexadecimal. For example, to match
on the destination port of 00DC in the following except from the show ip cache verbose flow command,
you would use the match destination-port 0x00DC keywords and argument for the show ip flow top
command.
SrcIf
SrcIPaddress
Port Msk AS
Et0/0.1
10.10.11.4
00DC /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
DstIf
Port Msk AS
Et1/0.1
00DC /0 0
(005)
DstIPaddress
NextHop
172.16.10.8
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
You can limit the top talkers that are displayed by the show ip flow top command by using the match
keyword and arguments. For example, you can display the IP destination address top talkers that have a
prefix of 224.0.0.0 using the show ip flow top 10 aggregate destination-address match
destination-prefix 224.0.0.0/3 command.
For a full list of the matching criterion that you can select, refer to the show ip flow top command in the
Cisco IOS NetFlow Command Reference. If you do not configure match criteria all of the flows are
considered as candidates for aggregation as top talkers based on the volume of traffic they represent.
The Order That Aggregation Occurs in
With the exception of the flows keyword, all matches are performed prior to aggregation, and only
matching flows are aggregated. For example, the show ip flow top 5 aggregate destination-address
match destination-prefix 172.16.0.0/16 command analyzes all of the available flows looking for any
flows that have destination addresses that match the destination-prefix value of 172.16.0.0/16. If it finds
any matches it aggregates them, and then displays the number of aggregated destination-address flows
that is equal to the number of top talkers that were requested in the commandin this case five.
The flows keyword matches the number of aggregated flows post-aggregation. For example, the
show ip flow top 2 aggregate destination-address match 6 command aggregates all of the flows on
the values in their destination IP address field, and then displays the top talkers that have 6 aggregated
flows.
Number of Flows Matched
If you do not specify match criteria and there is traffic in the flows that includes the field that you used
to aggregate the flows on, all of the flows will match. For example, if your router has 20 flows with IP
traffic and you enter the show ip flow top 10 aggregate destination-address command the display will
indicate that 20 of 20 flows matched, and the 10 top talkers will be displayed.
15
If you use the match keyword to limit the flows that are aggregated to the flows with a destination prefix
of 224.0.0.0/3, and only one flow matches this criterion the output will indicate that one out of six flows
matched. For example, if your router has 6 flows with IP traffic, but only one of them has a destination
prefix of 224.0.0.0/3, and you enter the show ip flow top 10 aggregate destination-address match
destination-prefix 224.0.0.0/3 command, the display will indicate that 1 of 6 flows matched.
If the total number of top talkers is less than the number of top talkers that were requested in the
command, the total number of top talkers is displayed. For example, if you enter a value of five for the
number of top talkers to display and there are only three top talkers that match the criteria that you used,
the display will only include three top talkers.
When a match criterion is included with the show ip flow top command, the display output will indicate
N of M flows matched where N <= M, N = matched flows, and M = total flows seen. The numbers of
flows seen could potentially be more than the total number of flows in the cache if some of the analyzed
flows were removed from the cache and new flows were created ahead of the current point, as the top
talkers feature sweeps through the cache. Therefore, M is NOT the total number of flows in the cache,
but rather, the number of observed flows.
If you attempt to display the top talkers by aggregating them on a field that is not in the cache you will
see the % aggregation-field is not available for this cache message. For example, if you use the
show ip flow top 5 aggregate source-vlan command, and you have not enabled the capture of VLAN
IDs from the flows, you will see the % VLAN id is not available for this cache message.
sort-bySelects the sort order for the flows in the display output.
bytesSort the flows based on the numbers of bytes in each flow.
packetsSort the flows based on the numbers of packets in each flow.
match (optional)Specifies additional criteria, such as IP addresses, port numbers, and so forth,
that must be matched in the flow to qualify as a candidate for top talker status.
For a full list of the matching criterion that you can select, refer to the ip flow top-talkers command
in the Cisco IOS NetFlow Command Reference. If you do not configure match criteria all of the
flows are considered as candidates as top talkers based on the volume of traffic they represent.
For more information on the NetFlow Top Talkers feature, refer to Configuring NetFlow Top Talkers
using Cisco IOS CLI Commands or SNMP Commands.
16
Note
Random Sampled NetFlow is more statistically accurate than Sampled NetFlow. NetFlow's ability to
sample packets was first provided by a feature named Sampled NetFlow. The methodology that the
Sampled NetFlow feature uses is deterministic sampling, which selects every nth packet for NetFlow
processing on a per-interface basis. For example, if you set the sampling rate to 1 out of 100 packets,
then Sampled NetFlow samples the 1st, 101st, 201st, 301st, and so on packets. Sampled NetFlow does
not allow random sampling and thus can make statistics inaccurate when traffic arrives in fixed patterns.
Note
The Random Sampled NetFlow algorithms are applied after input filtering.
Table 6 compares the NetFlow Input Filters feature and the NetFlow Random Sampled feature.
Table 6
Comparison of the NetFlow Input Filters Feature and the Random Sampled NetFlow Feature
Comparison Category
Brief description
Main uses
You can use this feature for class-based traffic You can use this feature for traffic
engineering, capacity planning, and
analysis and monitoring on-network or
applications where full NetFlow is not needed
off-network traffic.
for an accurate view of network traffic.
This feature is also useful if you have too
much traffic and you want to limit the traffic This feature is also useful if you have too
much traffic and you want to limit the traffic
that is analyzed.
that is analyzed.
This feature is supported in the Version 5 and This feature is supported in the Version 5 and
Version 9 NetFlow export formats.
Version 9 NetFlow export formats.
12.3(4)T.
17
Table 6
Comparison of the NetFlow Input Filters Feature and the Random Sampled NetFlow Feature (continued)
Comparison Category
Subinterface support
You can configure NetFlow Input Filters per You can configure the Random Sampled
subinterface as well as per physical interface. NetFlow feature per subinterface as well as
per physical interface.
You can select more than one filter per
You can not run Full NetFlow and Random
subinterface and have all of the filters run
Sampled NetFlow concurrently on the same
simultaneously.
subinterface. You must disable full NetFlow
on the subinterface before Random Sampled
NetFlow will take effect.
Traffic is collected only on the subinterfaces
on which Random Sampled NetFlow is
configured. As with full NetFlow, enabling
Random Sampled NetFlow on a physical
interface does not enable Random Sampled
NetFlow on subinterfaces automaticallyyou
must explicitly configure it on the
subinterfaces.
Memory impact
Performance impact
18
MQC has many policies (actions) such as bandwidth rate and queuing management. These policies are
applied only if a packet matches a criterion in a class map that is applied to the subinterface. A class map
contains a set of match clauses and instructions on how to evaluate the clauses and acts as a filter for the
policies, which are applied only if a packets content satisfies the match clause. The NetFlow Input
Filters feature adds NetFlow accounting to the MQC infrastructure, which means that flow accounting
is done on a packet only if it satisfies the match clauses.
Two types of filter are available:
Fields of filter (source IP address, destination IP address, source application port, destination
application port, port protocol, ToS bits, and TCP flags)
For more information on Modular QoS Command-Line Interface (MQC) refer to the Cisco IOS Quality
of Service Solutions Configuration Guide.
19
After you identify the type of flows that you want to focus, on such as ICMP traffic, and other
characteristics such as source IP addresses and destination network prefixes, you use the NetFlow Top
Talkers feature to obtain more focused and detailed information on the individual flows. The NetFlow
Top Talkers feature is configured with match criteria that focuses it on the types of traffic that you have
identified. If your router is keeping track of several flows and you are only interested in analyzing a
subset of them you, can configure NetFlow Input Filters to limit the flows that NetFlow is tracking.
Prerequisites
CEF or dCEF must be configured globally, and on the interface that you want to run NetFlow on, before
you configure NetFlow Layer 2 and Security Monitoring Exports.
You must have NetFlow enabled on at least one interface in the router before you configure NetFlow
Layer 2 and Security Monitoring Exports.
If you want to capture the values of the Layer 3 IP fragment offset field from the IP headers in your IP
traffic using the ip flow-capture fragment-offset command, your router must be running
Cisco IOS 12.4(2)T or later.
This section contains the following procedures:
Using NetFlow Dynamic Top Talkers CLI to Display the Protocol Distribution, page 24
Using NetFlow Dynamic Top Talkers CLI to Display the Source IP Address Top Talkers Sending
ICMP Traffic, page 25
Using NetFlow Dynamic Top Talkers CLI to Display the Destination IP Address Top Talkers
Receiving ICMP Traffic, page 27
Monitoring and Analyzing the Sampled and Filtered NetFlow Top Talkers Flows, page 39
Prerequisites
To export the data captured with the NetFlow Layer 2 and Security Monitoring feature, you must
configure NetFlow to use the NetFlow Version 9 data export format.
SUMMARY STEPS
20
1.
enable
2.
configure terminal
3.
ip flow-capture fragment-offset
4.
ip flow-capture icmp
5.
ip flow-capture ip-id
6.
ip flow-capture mac-addresses
7.
ip flow-capture packet-length
8.
ip flow-capture ttl
9.
ip flow-capture vlan-id
and/or
ip flow egress
12. end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-capture fragment-offset
Example:
Router(config)# ip flow-capture fragment-offset
Step 4
ip flow-capture icmp
Enables you to capture the value of the ICMP type and code
fields from the first ICMP datagram in a flow.
Example:
Router(config)# ip flow-capture icmp
Step 5
ip flow-capture ip-id
Enables you to capture the value of the IP-ID field from the
first IP datagram in a flow.
Example:
Router(config)# ip flow-capture ip-id
Step 6
ip flow-capture mac-addresses
Example:
Step 7
ip flow-capture packet-length
Example:
Router(config)# ip flow-capture packet-length
21
Step 8
Command or Action
Purpose
ip flow-capture ttl
Example:
Router(config)# ip flow-capture ttl
Step 9
ip flow-capture vlan-id
Example:
Step 10
Example:
Router(config)# interface ethernet 0/0
Step 11
ip flow ingress
and/or
ip flow egress
and/or
Example:
Router(config-if)# ip flow egress
Step 12
end
Example:
Router(config)# end
Restrictions
Displaying Detailed NetFlow Cache Information on Platforms Running Distributed Cisco Express Forwarding
On platforms running dCEF, NetFlow cache information is maintained on each line card or Versatile
Interface Processor. If you want to use the show ip cache verbose flow command to display this
information on a distributed platform, you must enter the command at a line card prompt.
22
To display detailed NetFlow cache information on a Cisco 7500 series router that is running distributed
dCEF, enter the following sequence of commands:
Router# if-con slot-number
LC-slot-number# show ip cache verbose flow
For Cisco IOS Releases 12.3(4)T, 12.3(6), and 12.2(20)S and later, enter the following command to
display detailed NetFlow cache information:
Router# execute-on slot-number show ip cache verbose flow
To display detailed NetFlow cache information on a Cisco 12000 Series Internet Router, enter the
following sequence of commands:
Router# attach slot-number
LC-slot-number# show ip cache verbose flow
For Cisco IOS Releases 12.3(4)T, 12.3(6), and 12.2(20)S and later, enter the following command to
display detailed NetFlow cache information:
Router# execute-on slot-number show ip cache verbose flow
To verify the configuration of NetFlow Layer 2 and Security Monitoring Exports use the following step.
SUMMARY STEPS
1.
DETAILED STEPS
Step 1
23
Total:
45
0.0
SrcIf
SrcIPaddress
Port Msk AS
.
.
.
Et0/0.1
10.71.200.138
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
538
29
25.7
189.2
11.6
DstIf
Port Msk AS
DstIPaddress
NextHop
Et1/0.1
0C01 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
10
28
696
241.4
(006)
28
59
1
Using NetFlow Dynamic Top Talkers CLI to Display the Protocol Distribution
You can obtain a quick overview of the traffic in your network by viewing the protocol distribution. Use
this task to display the top talkers (aggregated flows) for these three IPv4 protocol types:
1ICMP
6TCP
17UDP
1.
SUMMARY STEPS
DETAILED STEPS
Step 1
bytes
==========
406196
96560
52
15 of 15 flows matched.
24
pkts
==========
14507
2414
1
flows
==========
12
2
1
Field
Description
IPV4 PROT
1ICMP
6TCP
17UDP
bytes
pkts
flows
15 of 15 flows matched.
All 15 flows in the router are aggregated into three top talkers. In this example all of the flow traffic is
top talker traffic.
The majority of the traffic is ICMP traffic (IP protocol type 1). This might indicate an ICMP DoS attack
is in progress.
Using NetFlow Dynamic Top Talkers CLI to Display the Source IP Address Top
Talkers Sending ICMP Traffic
The display output from the show ip flow top 10 aggregate protocol sorted-by packets descending
used in Using NetFlow Dynamic Top Talkers CLI to Display the Protocol Distribution section indicates
that there is a possible ICMP-based DoS attack in progress. The next step to take is to identify the flows
that are sending the ICMP traffic. In this case the flows will be aggregated on the source IP addresses.
SUMMARY STEPS
1.
show ip flow top number aggregate aggregate-field sorted-by packets match match-field
match-value
DETAILED STEPS
Step 1
show ip flow top number aggregate aggregate-field sorted-by packets match match-field match-value
25
The following command looks for up to 20 top talkers, aggregates them on the source IP address, sorts
them by packets, and matches on the protocol icmp:
Router# show ip flow top 20 aggregate source-address sorted-by packets match protocol icmp
There are 6 top talkers:
IPV4 SRC-ADDR
===============
10.132.221.111
10.10.12.1
10.251.138.218
10.71.200.138
10.231.185.254
10.106.1.1
bytes
==========
90440
90440
90440
90384
90384
90356
pkts
==========
3230
3230
3230
3228
3228
3227
flows
==========
1
1
1
1
1
1
6 of 15 flows matched.
Router
show ip flow top 20 aggregate source-address sorted-by packets match protocol icmp
Field Descriptions
Field
Description
IPV4 SRC-ADDR
26
10.132.221.111
10.10.12.1
10.251.138.218
10.71.200.138
10.231.185.254
10.106.1.1
bytes
pkts
Table 8
show ip flow top 20 aggregate source-address sorted-by packets match protocol icmp
Field Descriptions (continued)
Field
Description
flows
6 of 15flows matched.
The ICMP traffic is aggregated into six top talkers (source IP addresses). Each top talker has one flow.
No aggregation is performed on this traffic because there is a 1-to-1 correlation of IP source addresses
and flows.
Using NetFlow Dynamic Top Talkers CLI to Display the Destination IP Address
Top Talkers Receiving ICMP Traffic
The display output from the show ip flow top 5 aggregate source-address sorted-by packets match
protocol icmp command used in Using NetFlow Dynamic Top Talkers CLI to Display the Source IP
Address Top Talkers Sending ICMP Traffic section showed the six top talkers (IP source addresses) that
are sending the 12 ICMP traffic flows. The next step to take is to identify the flows that are the target of
the ICMP traffic. In this case the flows will be aggregated on the destination IP addresses.
SUMMARY STEPS
1.
show ip flow top number aggregate aggregate-field sorted-by packets match match-field
match-value
DETAILED STEPS
Step 1
show ip flow top number aggregate aggregate-field sorted-by packets match match-field match-value
The following command looks for up to 20 top talkers, aggregates them on the destination IP address,
sorts them by packets, and matches on the protocol icmp
Router# show ip flow top 20 aggregate destination-address sorted-by packets match protocol
icmp
There is 1 top talker:
IPV4 DST-ADDR
===============
172.16.10.2
bytes
==========
407456
pkts
==========
14552
flows
==========
6
6 of 14 flows matched.
Router
27
Table 9
Field
Description
IPV4 DST-ADDR
172.16.10.2
bytes
pkts
flows
6 of 14 flows matched.
The previous task identified six ICMP top talkers based on source IP addresses that each had one flow.
This task identified that there is one ICMP top talker based on destination IP addresses that is the target
for 6 individual flows. There is a 1-to-1 correlation between the number of ICMP flows in the top talkers
aggregated on the source IP address and the number of ICMP flows in the top talkers aggregated on the
destination IP address. There is a high probability that an ICMP-based DoS attack on the host with the
IP address of 172.16.10.2 is in progress.
SUMMARY STEPS
28
1.
enable
2.
configure terminal
3.
ip flow-top-talkers
4.
5.
top number
6.
7.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-top-talkers
Example:
Router(config)# ip flow-top-talkers
Step 4
Example:
Router(config-flow-top-talkers)# match
destination address 172.16.10.2/32
Step 5
top number
Example:
Router(config-flow-top-talkers)# top 50
Step 6
Example:
Router(config-flow-top-talkers)#
sort-by packets
Step 7
end
Example:
Router(config-flow-top-talkers)# end
29
SUMMARY STEPS
1.
DETAILED STEPS
Step 1
30
SrcIf
SrcIPaddress
Port Msk AS
Et0/0.1
10.106.1.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
8
IP id:
0
DstIf
Port Msk AS
Et1/0.1
0800 /0 0
(005)
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
Et0/0.1
10.132.221.111
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
8
IP id:
0
Et1/0.1
0800 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
Et0/0.1
10.10.12.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
Et0/0.1
10.251.138.218
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
Et0/0.1
10.71.200.138
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
Et0/0.1
0000 /0
Et1/0.1
0C01 /0
172.16.10.2
0.0.0.0
01 00
10.231.185.254
0
10
28
9408
116.4
10
28
9408
116.4
10
28
9408
116.4
10
28
9408
116.5
10
28
9408
116.5
(006)
28
59
0
(006)
28
59
1
(006)
28
59
1
(006)
28
59
1
(005)
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
1
Note
Only six of the eight flows matched because the rest of the flows are not top talker flows.
Note
The top 50 flows were requested, however there are only eight flows in the cache.
This display output contains the information required for determining the path that the DoS attack traffic
is taking through the network. This information will be used to react to the DoS attack by adding security
measures such as access-lists to the affected interfaces. Table 10 describes the significant fields in the
display from the show ip flow top-talkers verbose command for determining the network path the DoS
traffic is taking.
Table 10
Field
Description
SrcIf
SrcIPaddress
DstIf
10.132.221.111
10.10.12.1
10.251.138.218
10.71.200.138
10.231.185.254
10.106.1.1
Note
ICMP Type
8Echo
12Parameter Problem
31
Table 10
Field
Description
ICMP Code
MAC
These are the source and destination MAC addresses from the
traffic. The source and destination MAC address are read
from left to right in the output.
Note
Note
VLAN id
These are the source and destination VLAN IDs. The source
and destination VLAN IDs are read from left to right in the
output.
This flows in this example show only the ICMP DoS attack traffic that is destined for the host with IP
address 172.16.10.1. These flows were created specifically for documenting this task. In a real network
the host under attack might be communicating with other hosts that are using legitimate applications
such as e-mail and web sites. In this case the Top Talkers match filter on the destination IP address
(match destination address 172.16.10.2/32) that was configured in the Configuring NetFlow Top
Talkers to Monitor Network Threats section on page 28 will not limit the display of the show ip flow
top-talkers command to the ICMP DoS attack traffic.
Note
For more information on the fields in the display output of the show ip cache verbose flow command,
refer to the Cisco IOS NetFlow Command Reference.
If you are using the Top Talkers feature to analyze a network threat and you are not able to use the basic
match filters to limit the display of the show ip flow top-talkers command to the traffic that you are
analyzing, you can use NetFlow filtering and sampling to limit the traffic that shows up in the display of
the show ip flow top-talkers command. The process for configuring NetFlow filtering and sampling is
explained in the Configuring NetFlow Filtering and Sampling section on page 33.
32
Restrictions
Restrictions for NetFlow Input Filters
On Cisco 7500 platforms, the NetFlow Input Filters feature is supported only in distributed mode.
Restrictions for Random Sampled NetFlow
If full NetFlow is enabled on an interface, it takes precedence over Random Sampled NetFlow (which
will thus have no effect). Disable full NetFlow on an interface before enabling Random Sampled
NetFlow on that interface.
Enabling Random Sampled NetFlow on a physical interface does not automatically enable Random
Sampled NetFlow on subinterfaces; you must explicitly configure it on subinterfaces. Also, disabling
Random Sampled NetFlow on a physical interface (or a subinterface) does not enable full NetFlow. This
restriction prevents the transition to full NetFlow from overwhelming the physical interface (or
subinterface). If you want full NetFlow, you must explicitly enable it.
You must use NetFlow Version 9 if you want to use sampler option templates or view NetFlow sampler
IDs.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
flow-sampler-map sampler-map-name
4.
33
5.
exit
6.
7.
8.
exit
9.
policy-map policy-map-name
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
flow-sampler-map sampler-map-name
Example:
Router(config)# flow-sampler-map icmp-dos-fs-map
34
Step 4
Command or Action
Purpose
Example:
Step 5
exit
Example:
Router(config-sampler-map)# exit
Step 6
Example:
Example:
Router(config-cmap)# match access-group 101
Step 8
exit
Example:
Router(config-cmap)# exit
35
Step 9
Command or Action
Purpose
policy-map policy-map-name
Example:
Example:
Router(config-pmap)# class icmp-dos-class-map
netflow-sampler sampler-map-name
Example:
Step 12
Router(config-pmap-c)# netflow-sampler
icmp-dos-fs-map
exit
Example:
Router(config-pmap-c)# exit
Step 13
exit
Example:
Router(config-pmap# exit
Step 14
interface interface-type
interface-number[.subinterface number]
Example:
Router(config)# interface Ethernet0/0.1
36
Step 15
Command or Action
Purpose
Example:
Note
Step 16
Example:
Router(config-subif)# service-policy input
icmp-dos-policy-map
Step 17
exit
Example:
Router(config-subif)# exit
Step 18
ip flow-top-talkers
Example:
Router(config)# ip flow-top-talkers
Step 19
top number
Example:
Router(config-flow-top-talkers)# top 50
Step 20
sort-by packets
Example:
Router(config-flow-top-talkers)# sort-by packets
Step 21
Example:
Router(config-flow-top-talkers)# match class-map
icmp-dos-class-map
Step 22
Example:
Router(config-flow-top-talkers)# no match
destination address 172.16.10.2/32
37
Step 23
Command or Action
Purpose
exit
Example:
Router(config-sampler-map)# exit
Step 24
Example:
Router(config)# access-list 101 permit icmp any host
172.16.10.2
Step 25
end
Example:
Router(config)# end
SUMMARY STEPS
1.
show flow-sampler
DETAILED STEPS
Step 1
show flow-sampler
Any non-zero value in the display output below indicates that Filtering and sampling is active.
Router# show flow-sampler
Sampler : icmp-dos-fs-map, id : 1, packets matched : 63226, mode : random sampling mode
sampling interval is : 2
Router
38
Monitoring and Analyzing the Sampled and Filtered NetFlow Top Talkers Flows
To monitor and analyze the filtered and sampled NetFlow top talkers flows use the following step.
SUMMARY STEPS
1.
2.
DETAILED STEPS
Step 1
Step 2
Pr
01
01
01
01
01
01
SrcP
0000
0000
0000
0000
0000
0000
DstP Bytes
0C01 5460
0800 5124
0800 5012
0C01 4844
0C01 4704
0C01 4396
DstIf
Port Msk AS
Et1/0.1
0800 /0 0
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
(005)
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
0
Et0/0.1
10.132.221.111
0000 /0 0
Sampler: 1 Class: 1
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
8
IP id:
0
Et1/0.1
0800 /0
172.16.10.2
0.0.0.0
01 00
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
0
Et0/0.1
10.231.185.254
0000 /0 0
Sampler: 1 Class: 1
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
Et1/0.1
0C01 /0
172.16.10.2
0.0.0.0
01 00
aaaa.bbbb.cc06
Max plen:
Max TTL:
(006)
28
59
(005)
(005)
10
28
2828
64.6
10
28
2716
64.6
39
ICMP type:
IP id:
12
0
ICMP code:
Et0/0.1
10.71.200.138
0000 /0 0
Sampler: 1 Class: 1
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
Et0/0.1
10.251.138.218
0000 /0 0
Sampler: 1 Class: 1
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
Et0/0.1
10.10.12.1
0000 /0 0
Sampler: 1 Class: 1
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
28
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
(005)
(005)
172.16.10.2
0.0.0.0
01 00
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
1
172.16.10.2
0.0.0.0
01 00
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
1
172.16.10.2
0.0.0.0
01 00
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
(006)
28
59
1
10
28
2548
58.0
10
28
2436
64.6
10
28
2352
57.7
40
Configuring NetFlow Layer 2 and Security Monitoring Exports to Capture Traffic From a Simulated
FTP Attack: Example, page 41
Analyze an FTP DoS Attack Using the show ip cache verbose flow command: Example, page 43
Analyze an FTP DoS Attack Using NetFlow Dynamic Top Talkers CLI: Example, page 45
Configuring NetFlow Layer 2 and Security Monitoring Exports to Capture Traffic From a Simulated
ICMP Attack: Example, page 46
Analyze an ICMP Ping DoS Attack Using the show ip cache verbose flow command: Example,
page 48
Analyze an ICMP Ping DoS Attack Using NetFlow Dynamic Top Talkers CLI: Example, page 51
Test Network
S2/0
172.16.1.2
E0/0
172.16.1.1
FTP server
S2/0
172.16.10.1
R2 E1/0.1
S3/0
E0/0.1
802.1q trunk
VLAN 5
R3
E1/0.1
E1/0.1
R4
S3/0
E0/0
172.16.10.2
802.1q trunk
VLAN 6
127556
Host A
Tip
Keep track of the MAC addresses and IP addresses of the devices in your network. You can use them to
analyze attacks and to resolve problems.
Note
This example does not include the ip flow-capture icmp command that captures the value of the ICMP
type and code fields. The use of the ip flow-capture icmp command is described in Configuring
NetFlow Layer 2 and Security Monitoring Exports to Capture Traffic From a Simulated ICMP Attack:
Example.
R2
!
hostname R2
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc02
ip address 172.16.1.2 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc03
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 5
41
R3
!
hostname R3
!
ip flow-capture fragment-offset
ip flow-capture packet-length
ip flow-capture ttl
ip flow-capture vlan-id
ip flow-capture ip-id
ip flow-capture mac-addresses
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc04
no ip address
!
interface Ethernet0/0.1
encapsulation dot1Q 5
ip address 172.16.6.2 255.255.255.0
ip accounting output-packets
ip flow ingress
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc05
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.1 255.255.255.0
ip accounting output-packets
ip flow egress
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R4
!
hostname R4
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc07
ip address 172.16.10.1 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc06
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.2 255.255.255.0
!
42
router rip
version 2
network 172.16.0.0
no auto-summary
!
Analyze an FTP DoS Attack Using the show ip cache verbose flow command:
Example
The show ip cache verbose flow command displays the NetFlow flows. You can use this display output
to identify the path that the FTP traffic from Host A is taking as it is received and transmitted by R3.
Note
To reduce the space required to display the output from the show ip flow cache verbose flow command
only the FTP flows are shown.
Tip
Look for the flows that have FTP in them and make a note of the interfaces, MAC addresses, and VLANs
(if applicable) for the flows.
R3# show ip cache verbose flow
IP packet size distribution (189118 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.043 .610 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .173 .000 .173 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 278544 bytes
25 active, 4071 inactive, 615 added
263794 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 25736 bytes
50 active, 974 inactive, 1648 added, 615 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol
Total
Flows
Packets Bytes Packets Active(Sec) Idle(Sec)
-------Flows
/Sec
/Flow /Pkt
/Sec
/Flow
/Flow
TCP-FTP
12
0.0
895
40
0.9
1363.8
5.5
TCP-FTPD
12
0.0
895
40
0.9
1363.8
5.6
Total:
590
0.0
317
383
16.1
430.1
12.4
Et0/0.1
192.168.87.200
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
192.168.87.200
0014 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
Et1/0.1
0014 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
00
40
63
94.5
00
40
63
94.5
(006)
40
59
(006)
40
59
43
IP id:
Et0/0.1
10.10.10.2
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
10.10.10.2
0014 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0014 /0
(005)
Et0/0.1
10.234.53.1
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
10.234.53.1
0014 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0014 /0
(005)
Et0/0.1
172.30.231.193
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
172.30.231.193
0014 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
40
Min TTL:
59
IP id:
0
Et1/0.1
0014 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 00
00
40
64
96.0
00
40
64
96.0
00
40
63
94.5
00
40
63
94.5
00
40
63
94.5
00
40
63
94.5
(006)
40
59
(006)
40
59
(006)
40
59
(006)
40
59
(006)
40
59
(006)
40
59
There are 8 FTP flows shown in the output. You can use the Layer 2 information in the flows that is
captured by the ip flow-capture command to identify the path the traffic is taking through the network.
In this example, the traffic is being sent to R3 on VLAN 5 by R2. You can demonstrate that R2 is
transmitting the traffic over interface 1/0.1 because the source MAC address (aaaa.bbb.cc03) belongs to
1/0.1 on R2. You can demonstrate that R3 is transmitting the traffic using VLAN 6 on interface 1/0.1 to
interface 1/0.1 on R4, because the destination MAC address (aaaa.bbbb.cc06) belongs to interface 1/0.1
on R4.
Note
For more information on the ip flow-capture command, and the fields in the display output of the show
ip cache verbose flow command, refer to the Cisco IOS NetFlow Command Reference.
You can use this information to mitigate this attack. One possible way to mitigate this attack is by
configuring an extended IP access list that blocks all FTP traffic from the source IP addresses that Host
A is spoofing and applying it Ethernet 0/0 on R2.
44
Analyze an FTP DoS Attack Using NetFlow Dynamic Top Talkers CLI: Example
You can use the NetFlow Dynamic Top Talkers CLI feature to quickly identify the FTP top talkers in the
network traffic that might be sending the traffic. This will show you the IP source addresses that Host A
is using as it sends the DoS attack traffic.
R3# show ip flow top 50 aggregate source-address sorted-by bytes descending match
destination-port min 20 max 21
There are 5 top talkers:
IPV4 SRC-ADDR
===============
10.231.185.254
10.132.221.111
10.10.12.1
10.251.138.218
10.71.200.138
bytes
==========
5640
3680
3640
3600
1880
pkts
==========
141
92
91
90
47
flows
==========
2
2
2
2
1
9 of 34 flows matched.
Note
Only source IP addresses from FTP traffic are shown because of the match destination-port min 20
max 21 criteria. The source addresses are aggregated together so only the most relevant sources are
shown.
Note
Only nine of the 34 flows matched because the rest of the flows are not FTP flows, therefore they do not
meet the match criteria (match destination-port min 20 max 21).
Tip
The top talkers are displayed in descending order of the aggregated field by default.
Tip
You can enter the port numbers in their decimal values as shown, or in their hexadecimal equivalents of
0x14 and 0x15.
After you have identified FTP top talkers traffic you need to identify the source IP addresses of IP traffic
that is being sent to the host that you believe is under attack.
R3# show ip flow top 50 aggregate source-address match destination-prefix 172.16.10.2/32
There are 6 top talkers:
IPV4 SRC-ADDR
===============
10.251.138.218
10.231.185.254
10.132.221.111
10.106.1.1
10.71.200.138
10.10.12.1
bytes
==========
6642
5068
14818
12324
12564
560
pkts
==========
18
28
25
12
18
14
flows
==========
4
4
4
2
3
2
19 of 33 flows matched.
45
Tip
You can specify the host that you believe is under attack by using a prefix value of 32 with the match
destination-prefix command.
Note
Only 19 of the 33 flows matched because the rest of the flows do not contain traffic that is destined for
the host with the IP address of 172.16.10.2, therefore they do not meet the match criteria (match
destination-prefix 172.16.10.2/32).
The final step is to cross reference the source IP addresses of any hosts that are sending any IP traffic to
the host under attack with the list of source IP addresses from the FTP top talkers. This is required
because the show ip flow top command does not support multiple match criteria. Therefore you cannot
limit the top talkers to FTP traffic being sent to a specific host with a single show ip flow top command
(match destination-port min 20 max 21 <and> match destination-prefix 172.16.10.2/32).
The host with the IP address of 10.106.1.1 is apparently not involved in this DoS attack because it is not
in the display output from the show ip flow top 50 aggregate source-address sorted-by bytes
descending match destination-port min 20 max 21 command. This means that it is not sending FTP
traffic to the host that is under attack.
Therefore the host IP addressees involved in this FTP DoS attack are likely to be:
10.231.185.254
10.132.221.111
10.10.12.1
10.251.138.218
10.71.200.138
Now that you know the source addresses of the FTP traffic you can configure an extended access list that
blocks FTP traffic from these address, and applying it to the interface that is closest to the point the
traffic in entering your network.
Note
Unless you recognize that some of the source IP addresses are not legitimate IP addresses for your
network it might not be possible to identify legitimate FTP traffic from FTP DoS attack traffic.
46
Figure 8
Test Network
S2/0
172.16.1.2
E0/0
172.16.1.1
172.16.10.1
R2 E1/0.1
S3/0
E0/0.1
802.1q trunk
VLAN 5
Tip
FTP server
S2/0
R3
E1/0.1
E1/0.1
R4
S3/0
E0/0
172.16.10.2
802.1q trunk
VLAN 6
127556
Host A
Keep track of the MAC addresses and IP addresses of the devices in your network. You can use them to
analyze attacks and to resolve problems.
R2
!
hostname R2
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc02
ip address 172.16.1.2 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc03
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 5
ip address 172.16.6.1 255.255.255.0
!
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R3
!
hostname R3
!
ip flow-capture fragment-offset
ip flow-capture packet-length
ip flow-capture ttl
ip flow-capture vlan-id
ip flow-capture icmp
ip flow-capture ip-id
ip flow-capture mac-addresses
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc04
no ip address
47
!
interface Ethernet0/0.1
encapsulation dot1Q 5
ip address 172.16.6.2 255.255.255.0
ip accounting output-packets
ip flow ingress
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc05
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.1 255.255.255.0
ip accounting output-packets
ip flow egress
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R4
!
hostname R4
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc07
ip address 172.16.10.1 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc06
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.2 255.255.255.0
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
Analyze an ICMP Ping DoS Attack Using the show ip cache verbose flow
command: Example
The show ip cache verbose flow command displays the NetFlow flows. You can use this display output
to identify the path that the ICMP traffic from Host A is taking as it is received and transmitted by R3.
Note
48
To reduce the space required to display the output from the show ip flow cache verbose flow command
only the ICMP flows are shown.
Tip
Look for the flows that have ICMP in them and make a note of the interfaces, MAC addresses, and
VLANs (if applicable) for the flows.
R3# show ip cache verbose flow
IP packet size distribution (122369 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.065 .665 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .134 .000 .134 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 278544 bytes
24 active, 4072 inactive, 404 added
176657 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 25736 bytes
48 active, 976 inactive, 1088 added, 404 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol
Total
Flows
Packets Bytes Packets Active(Sec) Idle(Sec)
-------Flows
/Sec
/Flow /Pkt
/Sec
/Flow
/Flow
ICMP
27
0.0
1131
763
3.9
1557.4
3.6
Total:
380
0.0
267
257
13.0
382.8
12.6
SrcIf
Port Msk AS
Et0/0.1
0000 /0 0
MAC: (VLAN id)
Min plen:
Min TTL:
ICMP type:
IP id:
SrcIPaddress
DstIf
Port Msk AS
Et1/0.1
0800 /0 0
(005)
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
Et0/0.1
10.71.200.138
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
172.16.10.2
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1090.0
Et0/0.1
10.231.185.254
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
172.16.10.2
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1090.0
Et0/0.1
10.10.12.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
172.16.10.200
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1090.0
Et0/0.1
Et1/0.1
10.106.1.1
aaaa.bbbb.cc03
1500
59
8
0
10.132.221.111
172.16.10.2
01 00
10
864
49
50
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
1500
Min TTL:
59
ICMP type:
8
IP id:
0
0800 /0
(005)
Et0/0.1
10.251.138.218
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
Et0/0.1
10.10.12.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
1500
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
Et0/0.1
10.106.1.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
Et0/0.1
10.251.138.218
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
1500
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
Et0/0.1
10.71.200.138
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
1500
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
Et0/0.1
10.132.221.111
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
554
Min TTL:
59
ICMP type:
0
IP id:
0
Et1/0.1
0000 /0
(005)
Et0/0.1
10.231.185.254
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
1500
Min TTL:
59
ICMP type:
12
IP id:
0
Et1/0.1
0C01 /0
(005)
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
1500
1089.9
172.16.10.2
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1089.9
172.16.10.200
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
10
1500
864
1090.0
172.16.10.2
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1089.9
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
10
1500
864
1089.9
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
01 00
10
1500
864
1090.0
172.16.10.2
01 00 00
0.0.0.0
554
aaaa.bbbb.cc06 (006)
Max plen:
554
Max TTL:
59
ICMP code:
0
FO:
185
864
1089.9
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
ICMP code:
864
1090.0
(006)
1500
59
0
01 00
(006)
1500
59
1
(006)
1500
59
1
(006)
1500
59
1
01 00
(006)
1500
59
1
10
1500
There are 12 ICMP flows shown in the output. You can use the Layer 2 information in the flows that is
captured by the ip flow-capture command to identify the path the traffic is taking through the network.
In this example, the traffic is being sent to R3 on VLAN 5 by R2. You can demonstrate that R2 is
transmitting the traffic over interface 1/0.1 because the source MAC address (aaaa.bbb.cc03) belongs to
1/0.1 on R2. You can demonstrate that R3 is transmitting the traffic using VLAN 6 on interface 1/0.1 to
interface 1/0.1 on R4, because the destination MAC address (aaaa.bbbb.cc06) belongs to interface 1/0.1
on R4.
Note
For more information on the ip flow-capture command, and the fields in the display output of the show
ip cache verbose flow command, refer to the Cisco IOS NetFlow Command Reference.
You can use this information to mitigate this attack. One possible way to mitigate this attack is by
configuring an extended IP access list that blocks all ICMP traffic from the source IP addresses that Host
A is spoofing and applying it Ethernet 0/0 on R2.
Analyze an ICMP Ping DoS Attack Using NetFlow Dynamic Top Talkers CLI:
Example
You can use the NetFlow Dynamic Top Talkers CLI feature to quickly identify the ICMP top talkers in
the network traffic that might be sending the traffic. This will show you the IP source addresses that Host
A is using as it sends the DoS attack traffic.
R3# show ip flow top 50 aggregate icmp
There are 3 top talkers:
ICMP TYPE
=========
12
8
0
ICMP CODE
=========
1
0
0
bytes
==========
2466000
1233000
1366164
pkts
==========
1644
822
2466
flows
==========
4
2
6
12 of 25 flows matched.
Note
Only 12 of the 25 flows matched because the rest of the flows are not ICMP flows.
Tip
The top talkers are displayed in descending order of the aggregated field by default.
After you have identified the ICMP types and code values in the network traffic, you need to determine
the source IP addresses for the ICMP traffic that being sent to the FTP server.
R3# show ip flow top 50 aggregate source-address match icmp type 12 code 1
There are 4 top talkers:
IPV4 SRC-ADDR
===============
10.251.138.218
10.231.185.254
10.71.200.138
10.10.12.1
bytes
==========
867000
865500
865500
867000
pkts
==========
578
577
577
578
flows
==========
1
1
1
1
51
4 of 24 flows matched.
Note
Only source IP addresses from ICMP traffic are shown because of the match icmp type 12 code 1
criteria. No aggregation is performed on the source IP addresses because there is only one flow for IP
each address.
Note
Only four of the 24 flows matched because the rest of the flows did not meet the match criteria
(match icmp type 12 code 1).
R3# show ip flow top 50 aggregate source-address match icmp type 8 code 0
There are 2 top talkers:
IPV4 SRC-ADDR
===============
10.132.221.111
10.106.1.1
bytes
==========
1095000
1095000
pkts
==========
730
730
flows
==========
1
1
2 of 24 flows matched.
Note
Only source IP addresses from ICMP traffic are shown because of the match icmp type 8 code 0 criteria.
No aggregation is performed on the source IP addresses because there is only one flow for IP each
address.
Note
Only two of the 24 flows matched because the rest of the flows did not meet the match criteria
(match icmp type 8 code 0).
R3# show ip flow top 50 aggregate source-address match icmp type 0 code 0
There are 6 top talkers:
IPV4 SRC-ADDR
===============
10.251.138.218
10.231.185.254
10.132.221.111
10.106.1.1
10.71.200.138
10.10.12.1
bytes
==========
416608
416608
416608
416608
416608
416608
pkts
==========
752
752
752
752
752
752
flows
==========
1
1
1
1
1
1
6 of 24 flows matched.
Note
52
Only source IP addresses from ICMP traffic are shown because of the match icmp type 0 code 0 criteria.
No aggregation is performed on the source IP addresses because there is only one flow for IP each
address.
Note
Only six of the 24 flows matched because the rest of the flows did not meet the match criteria
(match icmp type 0 code 0).
The next step is to create a list of the source IP addresses that Host A is using.
10.251.138.218
10.231.185.254
10.71.200.138
10.10.12.1
10.132.221.111
10.106.1.1.
Now that you know the source addresses of the ICMP DoS attack traffic you can mitigate this attack by
configuring an extended access list that blocks ICMP traffic from these address and applying it to the
interface that is closest to the point the traffic in entering your network.
53
ip flow-capture icmp
ip flow-capture ip-id
ip flow-capture mac-addresses
!
ip flow-top-talkers
top 5
sort-by bytes
match class-map icmp-dos-class-map
!
access-list 101 permit icmp any host 172.16.10.2
!
end
Where to Go Next
See the Related Documents section on page 54 for links to configuration information about additional
NetFlow features and services.
Additional References
The following sections provide references related to NetFlow Layer 2 and Security Monitoring Exports.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data
configuring NetFlow and NetFlow Data Export
Export
Tasks for configuring NetFlow to capture and export
network traffic data
54
Related Topic
Document Title
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
55
Note
Table 11
Table 11 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
12.3(14)T
56
12.4(2)T
Table 11
Feature Information for NetFlow Layer 2 and Security Monitoring Exports (continued)
Feature Name
Releases
12.3(11)T,
12.2(25)S
12.4(4)T
57
Table 11
Feature Information for NetFlow Layer 2 and Security Monitoring Exports (continued)
Feature Name
Releases
12.3(4)T,
12.2(25)S
12.3(4)T,
12.2(18)S,
12.0(26)S
1. This is a minor enhancement. Minor enhancements are not typically listed in Feature Navigator.
Glossary
data flowsetA collection of data records that are grouped in an export packet.
export packetA type of packet built by a device (for example, a router) with NetFlow services
enabled. The packet is addressed to another device (for example, the NetFlow Collection Engine). The
packet contains NetFlow statistics. The other device processes the packet (parses, aggregates, and stores
information about IP flows).
flowA set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which flow is monitored. Ingress
flows are associated with the input interface, and egress flows are associated with the output interface.
flowsetA collection of flow records that follow the packet header in an export packet. A flowset
contains information that must be parsed and interpreted by the NetFlow Collection Engine. There are
two types of flowsets: template flowsets and data flowsets. An export packet contains one or more
flowsets, and both template and data flowsets can be mixed in the same export packet.
NetFlowCisco IOS accounting feature that maintains per-flow information.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
58
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means of carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
templateDescribes the layout of a data flowset.
template flowsetA collection of template records that are grouped in an export packet.
CCDE, CCENT, CCSI, Cisco Eos, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Lumin, Cisco Nexus, Cisco Nurse Connect,
Cisco Pulse, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco Unified Computing System, Cisco WebEx, DCE, Flip Channels,
Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to the Human Network
are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed (Stylized), Cisco Store,
and Flip Gift Card are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP,
CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems,
Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center,
Explorer, Fast Step, Follow Me Browsing, FormShare, GainMaker, GigaDrive, HomeLink, iLYNX, Internet Quotient, IOS, iPhone, iQuick Study,
IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers,
Networking Academy, Network Registrar, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect,
ROSA, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx,
and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0908R)
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.
20062009 Cisco Systems, Inc. All rights reserved.
59
60
This module contains information about and instructions for configuring NetFlow aggregation caches.
The NetFlow main cache is the default cache used to store the data captured by NetFlow. By maintaining
one or more extra caches, called aggregation caches, the NetFlow Aggregation feature allows limited
aggregation of NetFlow data export streams on a router. The aggregation scheme that you select
determines the specific kinds of data that are exported to a remote host.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Glossary, page 38
Ensure that one of the following is enabled on your router, and on the interfaces that you want to
configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
Understand the resources required on your router because NetFlow consumes additional memory
and CPU resources
If you intend to use Version 8 export format with an aggregation cache, configure Version 5 export
format for the main cache.
If you need autonomous system (AS) information from the aggregation, make sure to specify either the
peer-as or origin-as keyword in your export command if you have not configured an export format
version.
You must explicitly enable each NetFlow aggregation cache by entering the enabled keyword from
aggregation cache configuration mode.
Router-based aggregation must be enabled for minimum masking.
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Memory Impact
During times of heavy traffic, the additional flows can fill up the global flow hash table. If you need to
increase the size of the global flow hash table, increase the memory of the router.
Performance Impact
Configuring Egress NetFlow accounting with the ip flow egress command might adversely affect
network performance because of the additional accounting-related computation that occurs in the
traffic-forwarding path of the router.
Export bandwidthExport bandwidth use increases for Version 9 (because of template flowsets)
versus Version 5. The increase in bandwidth usage versus Version 5 varies with the frequency with
which template flowsets are sent. The default is to resend templates every 20 packets, which has a
bandwidth cost of about 4 percent. If necessary, you can lower the resend rate with the ip
flow-export template refresh-rate packets command.
Version 8 export format is available only for aggregation caches, and it cannot be expanded to support
new features.
NetFlow Data Export Format Versions 9, and 8 for NetFlow Aggregation Caches: Overview, page 24
Reduces the bandwidth required between the router and the workstations
The NetFlow Type of Service (ToS)-Based Router Aggregation feature introduced support for additional
cache aggregation schemes, all of which include the ToS byte as one of the fields in the aggregation
cache. The following are the six ToS-based aggregation schemes:
Figure 1 shows an example of how the main NetFlow cache can be aggregated into multiple aggregation
caches based upon user-configured aggregation schemes.
Figure 1
Flow 2
Flow 3
Export V5
buffer
UDP
Export V8
buffer
UDP
Aggreg. cache
Flow entries
Flow expired
Cache full
Timer expired
Note
Cache full
Timer expired
Flow entries
60155
Flow entries
To collector
Figure 2 through Figure 12 illustrate the Version 8 export formats of the aggregation schemes listed
above. Additional export formats (for instance, Version 9) are also supported. If you are using Version 9,
the formats will be different from those shown in the figures. For more information about Version 9
export formats, see Configuring NetFlow and NetFlow Data Export.
Field
AS
Protocol
Port
Source
Prefix
Destination
Prefix
Prefix
Source prefix
Destination prefix
Table 1
Field
AS
Input interface
Output interface
IP protocol
Protocol
Port
Source
Prefix
Destination
Prefix
Prefix
X
X
Source AS
Destination AS
Number of flows
X
X
Number of packets
Number of bytes
Table 2 shows the NetFlow fields used in the TOS based aggregation schemes.
Table 2
Field
AS-ToS
Source
Prefix-ToS
Destination
Prefix-ToS Prefix-ToS
Prefix-Port
Source prefix
Destination prefix
Input interface
Output interface
IP protocol
Protocol
Port-ToS
X
X
Source AS
Destination AS
ToS
X
X
X
X
Number of flows
Number of packets
Number of bytes
Source interface
Destination interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
Figure 2 shows the data export format for the AS aggregation scheme. For a definition of the data export
terms used in the aggregation scheme, see Table 3.
Data Export Format for AS Aggregation Scheme
Flows
Packets
Bytes
12
16
20
Source AS
Destination AS
24
Source interface
Destination interface
26462
Figure 2
Table 3 lists definitions for the data export record fields used in the AS aggregation scheme.
Table 3
Field
Definition
Flows
Packets
Bytes
Table 3
Field
Definition
Source AS
Destination AS
Source interface
Destination interface
Source BGP AS
Destination BGP AS
ToS byte
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for generating AS-to-AS traffic flow data, and for
reducing NetFlow export data volume substantially. Figure 3 show the data export format for the AS-ToS
aggregation scheme. For a definition of the data export terms used in the aggregation scheme, see
Table 4.
Flows
Packets
Bytes
12
16
20
Source AS
Destination AS
24
Source interface
Destination interface
28
ToS
PAD
Reserved
135069
Figure 3
Table 4 lists definitions for the data export record terms used in the AS-ToS aggregation scheme.
Table 4
Term
Definition
Flows
Packets
Bytes
Source AS
Destination AS
Source interface
Destination interface
ToS
PAD
Zero field
Reserved
Zero field
Destination prefix
Destination BGP AS
Output interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
Figure 4 shows the data export format for the destination prefix aggregation scheme. For a definition of
the data export terms used in the aggregation scheme, see Table 5.
Destination Prefix Aggregation Data Export Record Format
Flows
Packets
Bytes
12
16
20
Destination prefix
24
Destination mask
bits
28
Destination AS
PAD
Reserved
Destination interface
26463
Figure 4
Table 5 lists definitions for the data export record terms used in the destination prefix aggregation
scheme.
Table 5
10
Data Export Record Term Definitions for Destination Prefix Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Destination prefix
Table 5
Data Export Record Term Definitions for Destination Prefix Aggregation Scheme
Term
Definition
PAD
Zero field
Destination AS
Destination interface
Reserved
Zero field
Destination IP address
Destination AS
ToS byte
Output interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for capturing data with which you can examine the
destinations of network traffic passing through a NetFlow-enabled device. Figure 5 shows the data
export format for the Destination prefix-ToS aggregation scheme. For a definition of the data export
terms used in the aggregation scheme, see Table 6.
11
Flows
Packets
Bytes
12
16
20
Destination prefix
Destination AS
ToS
Reserved
Destination interface
135070
Figure 5
Table 6 lists definitions for the data export record terms used in the destination prefix-ToS aggregation
scheme.
Table 6
Data Export Record Term Definitions for Destination Prefix-ToS Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Destination prefix
ToS
Destination AS
Destination interface
Reserved
Zero field
12
Time stamp when the first packet is switched and time stamp when the last packet is switched
Figure 6 shows the data export format for the prefix aggregation scheme. For a definition of the data
export terms used in the aggregation scheme, see Table 7.
Data Export Format for Prefix Aggregation Scheme
Flows
Packets
Bytes
12
16
20
Source prefix
24
Destination prefix
28
Destination mask
bits
Source mask
bits
Reserved
32
Source AS
Destination AS
36
Source interface
Destination interface
26464
Figure 6
13
Table 7 lists definitions for the data export record terms used in the prefix aggregation scheme.
Table 7
Data Export Record Terms and Definitions for Prefix Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Source prefix
Destination prefix
Reserved
Zero field
Source AS
Destination AS
Source interface
Destination interface
14
Source prefix
Destination prefix
Source port
Destination port
Source interface
Destination interface
Protocol
ToS byte
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for capturing data with which you can examine the
sources and destinations of network traffic passing through a NetFlow-enabled device. Figure 7 shows
the data export record for the prefix-port aggregation scheme. For a definition of the data export terms
used in the aggregation scheme, see Table 8.
Data Export Record for Prefix-Port Aggregation Scheme
Flows
Packets
Bytes
12
16
20
Source prefix
24
Destination prefix
ToS
Protocol
32
Source port
Destination port
36
Source interface
Destination interface
135071
Figure 7
Table 8 lists definitions for the data export record terms used in the prefix-port aggregation scheme.
Table 8
Term
Definition
Flows
Packets
Bytes
Source prefix
Destination prefix
15
Table 8
Data Export Record Term Definitions for Prefix-Port Aggregation Scheme (continued)
Term
Definition
ToS
Protocol
IP protocol byte
Source port
Destination port
Source interface
Destination interface
Source prefix
Destination prefix
Source AS
Destination AS
Source interface
Destination interface
ToS byte
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for capturing data so that you can examine the sources
and destinations of network traffic passing through a NetFlow-enabled device. Figure 8 displays the data
export format for the prefix-tos aggregation scheme. For a definition of the data export terms used in the
aggregation scheme, see Table 9.
16
Flows
Packets
Bytes
12
16
20
Source prefix
24
Destination prefix
ToS
PAD
32
Source AS
Destination AS
36
Source interface
Destination interface
135072
Figure 8
Table 9 lists definitions for the data export record terms used in the prefix-ToS aggregation scheme.
Table 9
Term
Definition
Flows
Packets
Bytes
Source prefix
Destination prefix
ToS
Pad
Zero field
Source AS
Destination AS
17
Table 9
Data Export Record Term Definitions for Prefix-ToS Aggregation Scheme (continued)
Term
Definition
Source interface
Destination interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
Figure 9 shows the data export format for the protocol port aggregation scheme. For a definition of the
data export terms used in the aggregation scheme, see Table 10.
Data Export Format for Protocol Port Aggregation Scheme
Flows
Packets
Bytes
12
16
20
24
Protocol
PAD
Source port
Reserved
Destination port
26465
Figure 9
Table 10 lists definitions for the data export record terms used in the protocol port aggregation scheme.
18
Table 10
Data Export Record Term Definitions for Protocol Port Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Protocol
IP protocol byte
PAD
Zero field
Reserved
Zero field
Source port
Destination port
IP protocol
ToS byte
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for capturing data so that you can examine network usage
by type of traffic. Figure 10 shows the data export format for the protocol-port-tos aggregation scheme.
For a definition of the data export terms used in the aggregation scheme, see Table 11.
19
Flows
Packets
Bytes
12
16
20
Protocol
ToS
Reserved
24
Source port
Destination port
28
Source interface
Destination interface
135073
Figure 10
Table 11 lists definitions for the data export record terms used in the protocol-port-ToS aggregation
scheme.
Table 11
Term
Definition
Flows
Packets
Bytes
Protocol
IP protocol byte
ToS
Reserved
Zero field
Source port
Destination port
Source interface
Destination interface
20
Source prefix
Source BGP AS
Input interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
Figure 11 show the data export format for the source prefix aggregation scheme. For a definition of the
data export terms used in the aggregation scheme, see Table 12.
Data Export Format for Source Prefix Aggregation Scheme
Flows
Packets
Bytes
12
16
20
Source prefix
24
Source mask
bits
28
PAD
Source AS
Reserved
Source interface
26466
Figure 11
Table 12 lists definitions for the data export record terms used in the source prefix aggregation scheme.
Table 12
Data Export Record Term Definitions for Source Prefix Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Source prefix
21
Table 12
Data Export Record Term Definitions for Source Prefix Aggregation Scheme
Term
Definition
PAD
Zero field
Source AS
Source interface
Reserved
Zero field
Source prefix
Source AS
ToS byte
Input interface
Time stamp when the first packet was switched and time stamp when the last packet was switched
This aggregation scheme is particularly useful for capturing data so that you can examine the sources of
network traffic passing through a NetFlow-enabled device. Figure 12 show the data export format for the
source prefix-ToS aggregation scheme. For a definition of the data export terms used in the aggregation
scheme, see Table 13.
Note
22
When a router does not have a prefix for the source IP address in the flow, NetFlow uses 0.0.0.0 with 0
mask bits rather than making /32 entries. This prevents DOS attacks that use random source addresses
from thrashing the aggregation caches. This is also done for the destination in the destination prefix-ToS,
the prefix-ToS, and prefix-port aggregation schemes.
Flows
Packets
Bytes
12
16
20
Source prefix
24
28
ToS
Source AS
Source interface
Reserved
135074
Figure 12
Table 13 lists definitions for the data export record terms used in the source prefix-ToS aggregation
scheme.
Table 13
Data Export Record Term Definitions for Source Prefix-ToS Aggregation Scheme
Term
Definition
Flows
Packets
Bytes
Source prefix
ToS
Source AS
Source interface
Reserved
Zero field
23
NetFlow Data Export Format Versions 9, and 8 for NetFlow Aggregation Caches:
Overview
Export formats available for NetFlow aggregation caches are the Version 9 export format and the Version
8 export format.
Version 9A flexible and extensible format, which provides the versatility needed for support of
new fields and record types. This format accommodates new NetFlow-supported technologies such
as Multicast, Multiprotocol Label Switching (MPLS), and Border Gateway Protocol (BGP)
next hop. Version 9 export format enables you to use the same version for main and aggregation
caches, and the format is extendable, so you can use the same export format with future features.
Version 8A format added to support data export from aggregation caches. Export datagrams
contain a subset of the usual Version 5 export data, which is valid for the particular aggregation
cache scheme. Version 8 is the default export version for aggregation caches when data export is
configured.
The Version 9 export format is flexible and extensible, which provides the versatility needed for the
support of new fields and record types. You can use the Version 9 export format for both main and
aggregation caches.
The Version 8 export format was added to support data export from aggregation caches. This format
allows export datagrams to contain a subset of the Version 5 export data that is valid for the cache
aggregation scheme.
Refer to the NetFlow Data Export section for more details.
SUMMARY STEPS
24
1.
enable
2.
configure terminal
3.
4.
5.
6.
7.
8.
9.
export version [9 | 8]
10. enabled
11. exit
12. interface interface-type interface-number
13. ip flow {ingress | egress}
14. exit
15. Repeat Steps 12 through 14 to enable NetFlow on other interfaces
16. end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
25
Step 3
Command or Action
Purpose
Example:
Router(config)# ip flow-aggregation cache
destination-prefix
Step 4
Example:
Step 5
Example:
26
Step 6
Command or Action
Purpose
Example:
Step 7
Example:
Router(config-flow-cache)# export destination
172.30.0.1 991
Step 8
Step 9
export version [9 | 8]
Example:
Step 10
enabled
Example:
Router(config-flow-cache)# enabled
Step 11
exit
Example:
Router(config-if)# exit
Step 12
Example:
Router(config)# interface ethernet 0/0
Step 13
Example:
Router(config-if)# ip flow ingress
or
Example:
Router(config-if)# ip flow egress
Step 14
exit
Example:
Note
Router(config-if)# exit
27
Command or Action
Purpose
Step 15
Step 16
end
Example:
Router(config-if)# end
1.
2.
SUMMARY STEPS
DETAILED STEPS
Step 1
28
Dst Prefix
0.0.0.0
172.16.6.0
172.16.7.0
172.16.1.0
172.16.10.0
Msk
/0
/24
/24
/24
/24
AS
0
0
0
0
0
Flows
5
1
3
16
9
Pkts
13
1
31K
104K
99K
B/Pk
52
56
1314
1398
1412
Active
138.9
0.0
187.3
188.4
183.3
Use the show ip cache verbose flow aggregation source-prefix command to verify the configuration
of a source-prefix aggregation cache. For example:
Router# show ip cache verbose flow aggregation source-prefix
IP Flow Switching Cache, 278544 bytes
4 active, 4092 inactive, 4 added
51 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 21640 bytes
4 active, 1020 inactive, 4 added, 4 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
Src If
Et1/0.1
Et0/0.1
Et1/0.1
Et0/0.1
Router#
Src Prefix
172.16.10.0
172.16.6.0
172.16.7.0
172.16.1.0
Msk
/24
/24
/24
/24
AS
0
0
0
0
Flows Pkts
4
35K
2
5
2 3515
2
20K
B/Pk
1391
88
1423
1416
Active
67.9
60.6
58.6
71.9
Use the show ip cache verbose flow aggregation protocol-port command to verify the configuration
of a protocol-port aggregation cache. For example:
Router# show ip cache verbose flow aggregation protocol-port
IP Flow Switching Cache, 278544 bytes
4 active, 4092 inactive, 4 added
158 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 21640 bytes
0 active, 1024 inactive, 0 added, 0 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
Protocol
0x01
0x11
0x01
0x01
Router#
Step 2
Source Port
0x0000
0x0208
0x0000
0x0000
Dest Port
0x0000
0x0208
0x0800
0x0B01
Flows
6
1
2
2
Packets
52K
3
846
10
Bytes/Packet
1405
52
1500
56
Active
104.3
56.9
59.8
63.0
29
0
0
0
0
export
export
export
export
packets
packets
packets
packets
were
were
were
were
dropped
dropped
dropped
dropped
due
due
due
due
to
to
to
to
no fib
adjacency issues
fragmentation failures
encapsulation fixup failures
Router#
Configuring the Minimum Mask of a Destination Prefix Aggregation Scheme: Example, page 33
Configuring the Minimum Mask of a Source Prefix Aggregation Scheme: Example, page 33
Configuring NetFlow Version 9 Data Export for Aggregation Caches: Example, page 33
Configuring NetFlow Version 8 Data Export for Aggregation Caches: Example, page 34
30
31
32
33
Additional References
The following sections provide references related to configuring NetFlow aggregation caches and
schemes.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
34
Related Topic
Document Title
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
35
Note
36
Table 14 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Table 14
Feature Name
Releases
12.0(15)S
12.2(4)T
12.2(14)S
15.0(1)S
37
Table 14
Feature Name
Releases
12.0(11)S
12.1(2)T
Glossary
ASautonomous system. A collection of networks under a common administration sharing a common
routing strategy. Autonomous systems are subdivided by areas. An autonomous system must be assigned
a unique 16-bit number by the Internet Assigned Numbers Authority (IANA).
CEFCisco Express Forwarding. A Layer 3 IP switching technology that optimizes network
performance and scalability for networks with large and dynamic traffic patterns.
dCEFDistributed Cisco Express Forwarding. Type of CEF switching in which line cards maintain an
identical copy of the forwarding information base (FIB) and adjacency tables. The line cards perform
the express forwarding between port adapters; this relieves the Route Switch Processor of involvement
in the switching operation.
export packetType of packet built by a device (for example, a router) with NetFlow services enabled.
The packet contains NetFlow statistics and is addressed to another device (for example, the NetFlow
Collection Engine). The other device processes the packet (parses, aggregates, and stores information on
IP flows).
flowA set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which flow is monitored. Ingress
flows are associated with the input interface, and egress flows are associated with the output interface.
flowsetCollection of flow records that follow the packet header in an export packet. A flowset contains
information that must be parsed and interpreted by the NetFlow Collection Engine. There are two
different types of flowsets: template flowsets and data flowsets. An export packet contains one or more
flowsets, and both template and data flowsets can be mixed in the same export packet.
NetFlowCisco IOS accounting feature that maintains per-flow information.
38
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
QoSquality of service. A measure of performance for a transmission system that reflects its
transmission quality and service availability.
template flowsetOne or more template records that are grouped in an export packet.
ToStype of service. The second byte in the IP header. It indicates the desired quality of service (QoS)
for a particular datagram.
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.
20062010 Cisco Systems, Inc. All rights reserved.
39
40
This module contains information about and instructions for selecting the network traffic to track
through the use of NetFlow filtering or sampling. The NetFlow Input Filtering and Random Sampled
NetFlow features, described in this module, allow you to collect data from specific subsets of traffic.
The NetFlow Input Filters feature provides NetFlow data for a specific subset of traffic by letting
you create filters to select flows for NetFlow processing. For example, you can select flows from a
specific group of hosts.
The Random Sampled NetFlow feature provides NetFlow data for a subset of traffic in a Cisco router
by processing only one randomly selected packet out of n sequential packets (n is a
user-configurable parameter).
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Contents
Prerequisites for Using NetFlow Filtering or Sampling to Select Network Traffic to Track, page 2
Restrictions for Using NetFlow Filtering or Sampling to Select Network Traffic to Track, page 3
Information About Using NetFlow Filtering or Sampling to Select Network Traffic to Track, page 3
Feature Information for Using NetFlow Filtering or Sampling to Select Network Traffic to Track,
page 21
Glossary, page 22
Before you can configure the NetFlow Input Filters feature, you must
Note
Configure Cisco Express Forwarding (CEF) switching or distributed CEF (dCEF) switching on the
router and on the interfaces that you want to enable NetFlow Input Filters on (fast switching is not
supported)
The NetFlow Input Filters feature is supported in the Version 5 and Version 9 NetFlow export formats.
Prerequisites for Random Sampled NetFlow
Before you can configure the Random Sampled NetFlow feature, you must:
Configure Cisco Express Forwarding (CEF) switching or distributed CEF (dCEF) switching on the
router and on the interfaces that you want to enable Random Sampled NetFlow on (fast switching is
not supported)
Configure NetFlow Version 5 or Version 9 data export if you want to export NetFlow data
(otherwise, NetFlow data is visible in the cache, but is not exported)
Configure NetFlow Version 9 if you want to use sampler option templates or view NetFlow sampler
IDs
On Cisco 7500 platforms, the NetFlow Input Filters feature is supported only in distributed mode.
Restrictions for Random Sampled NetFlow
If full NetFlow is enabled on an interface, it takes precedence over Random Sampled NetFlow (which
will thus have no effect). This means that you should disable full NetFlow on an interface before
enabling Random Sampled NetFlow on that interface.
Enabling Random Sampled NetFlow on a physical interface does not automatically enable Random
Sampled NetFlow on subinterfaces; you must explicitly configure it on subinterfaces. Also, disabling
Random Sampled NetFlow on a physical interface (or a subinterface) does not enable full NetFlow. This
restriction prevents the transition to full NetFlow from overwhelming the physical interface (or
subinterface). If you want full NetFlow, you must explicitly enable it.
If you enable Random Sampled NetFlow with Version 5 data export, sampler option templates are not
exported, and sampler IDs are exported in the least significant three bits of the last byte of the Version 5
record pad field. Use NetFlow Version 9 if you want to use sampler option templates or view NetFlow
sampler IDs.
Roadmap: Using NetFlow Filtering or Sampling to Select the Network Traffic to Track, page 3
Table 1
Roadmap: Selecting the Network Traffic to Track Using Sampling and Filtering
Traffic of Interest
Associated information:
A specific subset of NetFlow traffic for the
purpose of class-based traffic analysis and
Filtering and Sampling of NetFlow Traffic, page 4
monitoring (including on-network or off-network
NetFlow Input Filters: Flow Classification, page 6
traffic)
Configuration instructions:
Associated information:
Configuration instructions:
Note
Random Sampled NetFlow is more statistically accurate than Sampled NetFlow. NetFlow's ability to
sample packets was first provided by a feature named Sampled NetFlow. The methodology that the
Sampled NetFlow feature uses is deterministic sampling, which selects every nth packet for NetFlow
processing on a per-interface basis. For example, if you set the sampling rate to 1 out of 100 packets,
then Sampled NetFlow samples the 1st, 101st, 201st, 301st, and so on packets. Sampled NetFlow does
not allow random sampling and thus can make statistics inaccurate when traffic arrives in fixed patterns.
Note
The Random Sampled NetFlow algorithms are applied after input filtering.
Table 2 compares the NetFlow Input Filters feature and the NetFlow Random Sampled feature.
Table 2
Comparison of the NetFlow Input Filters Feature and the Random Sampled NetFlow Feature
Comparison Category
Brief description
Main uses
You can use this feature for class-based traffic You can use this feature for traffic
analysis and monitoring on-network or
engineering, capacity planning, and
off-network traffic.
applications where full NetFlow is not needed
for an accurate view of network traffic.
This feature is supported in the Version 5 and This feature is supported in the Version 5 and
Version 9 NetFlow export formats.
Version 9 NetFlow export formats.
12.3(4)T.
Subinterface support
You can configure NetFlow Input Filters per You can configure the Random Sampled
subinterface as well as per physical interface. NetFlow feature per subinterface as well as
per physical interface.
You can select more than one filter per
Traffic is collected only on the subinterfaces
subinterface and have all of the filters run
on which Random Sampled NetFlow is
simultaneously.
configured. As with full NetFlow, enabling
Random Sampled NetFlow on a physical
interface does not enable Random Sampled
NetFlow on subinterfaces automaticallyyou
must explicitly configure it on the
subinterfaces.
Memory impact
Performance impact
Fields of filter (source IP address, destination IP address, source application port, destination
application port, port protocol, ToS bits, and TCP flags)
Note
Configuring NetFlow Input Filters to Reduce the Impact of NetFlow Data Export, page 7
Configuring Random Sampled NetFlow to Reduce the Impact of NetFlow Data Export, page 12
You need to configure input filtering before you apply the random sampled NetFlow algorithms.
Configuring NetFlow Input Filters to Reduce the Impact of NetFlow Data Export
Perform the following tasks to configure NetFlow input filters. Configuring NetFlow input filters
reduces the impact of NetFlow data export.
Creating a Class Map for a Policy Map for NetFlow Input Filtering, page 7 (required)
Creating a Sampler Map for a Policy Map for NetFlow Input Filtering, page 9 (required)
Creating a Class Map for a Policy Map for NetFlow Input Filtering
Perform the steps in this required task to create a class map for a policy map for NetFlow input filtering.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Command or Action
Purpose
Example:
Example:
Router(config-cmap)# match access-group 101
Step 5
end
Example:
Router(config-cmap)# end
Creating a Sampler Map for a Policy Map for NetFlow Input Filtering
Perform the steps in this required task to create a sampler map for a policy map for NetFlow input
filtering.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
flow-sampler-map sampler-map-name
4.
5.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
flow-sampler-map sampler-map-name
Example:
Example:
Step 5
end
Example:
Router(config-sampler-map)# end
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
policy-map policy-map-name
4.
5.
netflow-sampler map-name
6.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
policy-map policy-map-name
Example:
Router(config)# policy-map mypolicymap
10
Step 4
Command or Action
Purpose
Example:
Router(config-pmap)# class my_high_importance_class
netflow-sampler sampler-map-name
Example:
Step 6
end
Example:
Router(config-pmap-c)# end
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
11
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface POS 1/0
Step 4
Example:
Router(config-if)# service-policy input
mypolicymap
Step 5
end
Example:
Router(config-if)# end
Troubleshooting Tips
Use the debug flow-sampler class-based command to display debugging output for NetFlow input
filters.
12
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
flow-sampler-map sampler-map-name
4.
5.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
flow-sampler-map sampler-map-name
Example:
Router(config)# flow-sampler-map mysampler1
Step 4
Example:
Step 5
end
Example:
Router(config-sampler)# end
13
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
flow-sampler sampler-map-name
5.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ethernet 1/0.2
Step 4
flow-sampler sampler-map-name
Example:
Router(config-if)# flow-sampler mysampler1
Step 5
end
Example:
Router(config-if)# end
SUMMARY STEPS
1.
show flow-sampler
2.
3.
DETAILED STEPS
Step 1
14
show flow-sampler
Use this command to display attributes (including mode, sampling rate, and number of sampled packets)
of one or all Random Sampled NetFlow samplers to verify the sampler configuration. For example:
Router# show flow-sampler
Sampler : mysampler1, id : 1, packets matched : 10, mode : random sampling mode
sampling interval is : 100
Sampler : myflowsampler2, id : 2, packets matched : 5, mode : random sampling mode
sampling interval is : 200
To verify attributes for a particular NetFlow sampler, use the show flow-sampler sampler-map-name
command. For example, enter the following for a NetFlow sampler named mysampler1:
Router# show flow-sampler mysampler1
Sampler : mysampler1, id : 1, packets matched : 0, mode : random sampling mode
sampling interval is : 100
Step 2
DstIPaddress
NextHop
01 00
10
100
3
0.1
This example shows the NetFlow output of the show ip cache verbose flow command in which the
sampler, class-id, and general flags are set. What is displayed for a flow depends on what flags are set
in the flow. If the flow was captured by a sampler, the output shows the sampler ID. If the flow was
marked by MQC, the display includes the class ID. If any general flags are set, the output includes the
flags.
NetFlow flags (FFlags) that might appear in the show ip cache verbose flow command output are:
IPv6 and RSVD FFlags are seldom used. If FFlags is zero, the line is omitted from the output. If multiple
flags are defined (logical ORed together), then both sets of flags are displayed in hexadecimal format.
Step 3
15
Troubleshooting Tips
Use the debug flow-sampler command to display debugging output for Random Sampled NetFlow.
Configuring NetFlow Input Filters to Reduce the Impact of NetFlow Data Export: Examples,
page 16
Configuring Random Sampled NetFlow to Reduce the Impact of NetFlow Data Export: Examples,
page 18
Configuring NetFlow Input Filters to Reduce the Impact of NetFlow Data Export:
Examples
This section contains the following configuration examples:
Creating a Class Map for a Policy Map for NetFlow Input Filtering: Example, page 16
Creating a Sampler Map for a Policy Map for NetFlow Input Filtering: Example, page 17
Creating a Class Map for a Policy Map for NetFlow Input Filtering: Example
The following example shows how to create a class map for a policy map for NetFlow input filtering. In
the example, class maps named my_high_importance_class and my_medium_importance_class are
created:
configure terminal
!
class-map my_high_importance_class
match access-group 101
exit
16
!
class-map my_medium_importance_class
match access-group 102
end
Creating a Sampler Map for a Policy Map for NetFlow Input Filtering: Example
The following example shows how to create a sampler map for a policy map for NetFlow input filtering.
In the following example, sampler maps called my_high_sampling, my_medium sampling, and
my_low_samplng are created for use with a policy map for NetFlow input filtering:
configure terminal
!
flow-sampler-map my_high_sampling
mode random one-out-of 1
exit
!
flow-sampler-map my_medium_sampling
mode random one-out-of 100
exit
!
flow-sampler-map my_low_sampling
mode random one-out-of 1000
end
17
!
interface ATM2/0
service-policy input mypolicymap
end
Additional References
The following sections provide references related to configuring NetFlow filtering and sampling.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
18
Related Topic
Document Title
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
19
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/cisco/web/support/index.html
20
Note
Table 3
Table 3 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Information for Using NetFlow Filtering or Sampling to Select Network Traffic to Track
Feature Name
Releases
12.3(4)T,
12.2(25)S
12.2(27)SBC
15.0(1)S
21
Table 3
Feature Information for Using NetFlow Filtering or Sampling to Select Network Traffic to Track (continued)
Feature Name
Releases
12.3(4)T,
12.2(18)S,
12.0(26)S,
12.2(27)SBC
Glossary
ACLAccess control list. A roster of users and groups of users kept by a router. The list is used to
control access to or from the router for a number of services.
BGPBorder Gateway Protocol. Interdomain routing protocol that replaces Exterior Gateway Protocol
(EGP). A BGP system exchanges reachability information with other BGP systems. BGP is defined by
RFC 1163.
BGP next hopIP address of the next hop to be used to reach a certain destination.
CEFCisco Express Forwarding. Layer 3 IP switching technology that optimizes network performance
and scalability for networks with large and dynamic traffic patterns.
22
dCEFDistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
fast switchingCisco feature in which a route cache is used to expedite packet switching through a
router.
flowUnidirectional stream of packets between a given source and destination. Source and destination
are each defined by a network-layer IP address and transport-layer source and destination port numbers.
MQCModular QoS command-line interface. A CLI structure that lets you create traffic polices and
attach them to interfaces. A traffic policy contains a traffic class and one or more QoS features. The QoS
features in the traffic policy determine how the classified traffic is treated.
NBARNetwork-Based Application Recognition. A classification engine in Cisco IOS software that
recognizes a wide variety of applications, including web-based applications and client/server
applications that dynamically assign Transmission Control Protocol (TCP) or User Datagram Protocol
(UDP) port numbers. After the application is recognized, the network can invoke specific services for
that application. NBAR is a key part of the Cisco Content Networking architecture and works with QoS
features to let you use network bandwidth efficiently.
NetFlowCisco IOS security and accounting feature that maintains per-flow information.
NetFlow samplerA set of properties that are defined in a NetFlow sampler map that has been applied
to at least one physical interface or subinterface.
NetFlow sampler mapThe definition of a set of properties (such as the sampling rate) for NetFlow
sampling.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
ToStype of service. Second byte in the IP header that indicates the desired quality of service for a
specific datagram.
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.
20062010 Cisco Systems, Inc. All rights reserved.
23
24
The NetFlow Layer 2 and Security Monitoring Exports feature improves your ability to detect and
analyze network threats such as denial of service (DoS) attacks by increasing the number of fields from
which NetFlow can capture values.
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 network and
security monitoring, network planning, traffic analysis, and IP accounting.
Contents
Configuration Examples for NetFlow Layer 2 and Security Monitoring Exports, page 19
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Feature Information for NetFlow Layer 2 and Security Monitoring Exports, page 34
Glossary, page 36
ID field
Fragment offset
See the Layer 3 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports section
for more information on these Layer 3 fields.
The Layer 2 fields for which NetFlow Layer 2 and Security Monitoring Exports feature captures the
values are as follows:
Source MAC address field from frames that are received by the NetFlow router
Destination MAC address field from frames that are transmitted by the NetFlow router
VLAN ID field from frames that are received by the NetFlow router
VLAN ID field from frames that are transmitted by the NetFlow router
See the Layer 2 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports section
for more information about these Layer 2 fields.
The Layer 3 fields captured by the NetFlow Layer 2 and Security Monitoring Exports feature improve
the capabilities of NetFlow for identifying DoS attacks. The Layer 2 fields captured by the NetFlow
Layer 2 and Security Monitoring Exports feature can help you identify the path that the DoS attack is
taking through the network.
The Layer 2 and Layer 3 fields captured by the NetFlow Layer 2 and Security Monitoring Exports feature
are not key fields. They provide additional information about the traffic in an existing flow. Changes in
the values of NetFlow key fields such as the source IP address from one packet to the next packet result
in the creation of a new flow. For example, if the first packet captured by NetFlow has a source IP address
of 10.34.0.2 and the second packet captured has a source IP address of 172.16.213.65, then NetFlow will
create two separate flows.
Many DoS attacks consist of an attacker sending the same type of IP datagram again and again in an
attempt to overwhelm the target systems. In such cases the incoming traffic often has similar
characteristics, such as the same values in each datagram for one or more of the fields that the NetFlow
Layer 2 and Security Monitoring Exports feature can capture.
There is no easy way to identify the originator of many DoS attacks because the IP source address of the
device sending the traffic is usually forged. However, you can easily trace the traffic back through the
network to the router on which it is arriving by capturing the MAC address and VLAN-ID fields using
the NetFlow Layer 2 and Security Monitoring Exports feature. If the router on which the traffic is
arriving supports NetFlow, you can configure the NetFlow Layer 2 and Security Monitoring Exports
feature on it to identify the interface where the traffic is arriving. Figure 1 shows an example of an attack
in progress.
Figure 1
Switch F
Host B
Switch G
NetFlow router
Internet
Router B
Switch B
Switch A
Host C
Router C
Switch C
Switch D
127557
Router D
Switch E
CNS NetFlow
collection engine
Note
You can analyze the data captured by NetFlow directly from the router using the show ip cache verbose
flow command or the CNS NetFlow Collector Engine.
Once you have concluded that a DoS attack is taking place by analyzing the Layer 3 fields in the NetFlow
flows, you can analyze the Layer 2 fields in the flows to discover the path that the DoS attack is taking
through the network.
An analysis of the data captured by the NetFlow Layer 2 and Security Monitoring Exports feature for
the scenario shown in Figure 1 indicates that the DoS attack is arriving on Router C because the upstream
MAC address is from the interface that connects Router C to Switch A. It is also evident that there are
no routers between the target host (the e-mail server) and the NetFlow router because the destination
MAC address of the DoS traffic that the NetFlow router is forwarding to the email server is the MAC
address of the e-mail server.
You can find out the MAC address that Host C is using to send the traffic to Router C by configuring the
NetFlow Layer 2 and Security Monitoring Exports feature on Router C. The source MAC address will
be from Host C. The destination MAC address will be for the interface on the NetFlow router.
Once you know the MAC address that Host C is using and the interface on Router C on which Host Cs
DoS attack is arriving, you can mitigate the attack by reconfiguring Router C to block Host Cs traffic.
If Host C is on a dedicated interface, you disable the interface. If Host C is using an interface that carries
traffic from other users, you must configure your firewall to block Host Cs traffic but still allow the
traffic from the other users to flow through Router C.
The Configuration Examples for NetFlow Layer 2 and Security Monitoring Exports section has two
examples for using the NetFlow Layer 2 and Security Monitoring Exports feature to identify an attack
in progress and the path that the attack is taking through a network.
Layer 3 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports
The NetFlow Layer 2 and Security Monitoring Exports feature has support for capturing five fields from
Layer 3 IP traffic in a flow:
Time-to-live field
ID field
Fragment offset
Field
Description
Version
Internet Header Length is the length of the Internet header in 32-bit word
format and thus points to the beginning of the data.
Note
ToS
Total Length
Table 1
Field
Description
Identification (ID)
The value in the ID field is entered by the sender. All of the fragments of an
IP datagram have the same value in the ID field. Subsequent IP datagrams
from the same sender will have different values in the ID field.
It is very common for a host to be receiving fragmented IP datagrams from
several senders concurrently. It is also common for a host to be receiving
multiple IP datagrams from the same sender concurrently.
The value in the ID field is used by the destination host to ensure that the
fragments of an IP datagram are assigned to the same packet buffer during
the IP datagram reassembly process. The unique value in the ID field is also
used to prevent the receiving host from mixing together IP datagram
fragments of different IP datagrams from the same sender during the IP
datagram reassembly process.
Flags
Fragment Offset
TTL (Time-to-Live)
This field indicates the maximum time the datagram is allowed to remain in
the Internet system. If this field contains the value 0, then the datagram must
be destroyed. This field is modified in Internet header processing. The time
is measured in units of seconds, but since every module that processes a
datagram must decrease the TTL by at least 1 even if it processes the
datagram in less than a second, the TTL must be thought of only as an upper
bound on the time a datagram can exist. The intention is to cause
undeliverable datagrams to be discarded and to bound the maximum
datagram lifetime.
Protocol
Indicates the type of transport packet included in the data portion of the IP
datagram. Common values are:
1 = ICMP
6 = TCP
17 = UDP
Header checksum
A checksum on the header only. Since some header fields, such as the
time-to-live field, change every time an IP datagram is forwarded, this value
is recomputed and verified at each point that the Internet header is processed.
Source IP Address
Table 1
Field
Description
Destination IP Address
The options and padding may or may not appear or not in datagrams. If they
do appear, they must be implemented by all IP modules (host and gateways).
What is optional is their transmission in any particular datagram, not their
implementation.
ICMP Datagram
Table 2 interprets the packet format in Figure 3. ICMP datagrams are carried in the data area of an IP
datagram, after the IP header.
Table 2
Type
Name
Codes
Echo reply
0None
Unassigned
Unassigned
Destination unreachable
0Net unreachable.
1Host unreachable.
2Protocol unreachable.
3Port unreachable.
4Fragmentation needed and DF bit set.
5Source route failed.
6Destination network unknown.
7Destination host unknown.
8Source host isolated.
9Communication with destination network is
administratively prohibited.
10Communication with destination host is administratively
prohibited.
11Destination network unreachable for ToS.
12Destination host unreachable for ToS.
Source quench
0None.
Table 2
Type
Name
Codes
Redirect
0None.
0Redirect datagram for the network.
1Redirect datagram for the host.
2Redirect datagram for the ToS and network.
3Redirect datagram for the ToS and host.
Unassigned
Echo
0None.
Router advertisement
0None.
10
Router selection
0None.
11
Time Exceeded
12
Parameter problem
13
Timestamp
0None.
14
Timestamp reply
0None.
15
Information request
0None.
16
Information reply
0None.
17
0None.
18
0None.
19
2029
30
Trace route
31
32
33
IPv6 where-are-you
34
IPv6 I-am-here
35
36
37255
Reserved
Layer 2 Information Capture Using NetFlow Layer 2 and Security Monitoring Exports
The NetFlow Layer 2 and Security Monitoring Exports feature has the ability to capture the values of
the MAC address and VLAN ID fields from flows. The two supported VLAN types are 802.1q and the
Cisco Inter-Switch Link (ISL) protocol. This section explains the following concepts:
The source MAC address field from frames that are received by the NetFlow router
The destination MAC address field from frames that are transmitted by the NetFlow router
The VLAN ID field from frames that are received by the NetFlow router
The VLAN ID field from frames that are transmitted by the NetFlow router
Figure 4 shows the Ethernet Type II and Ethernet 802.3 frame formats. The destination address field and
the source address field in the frame formats are the MAC addresses values that are captured by NetFlow.
Figure 4
Field
Description
Preamble
The entry in the Preamble field is an alternating pattern of 1s and 0s that tells
receiving stations that a frame is coming. It also provides a means for the
receiving stations to synchronize their clocks with the incoming bit stream.
The SOF field holds an alternating pattern of 1s and 0s, ending with two
consecutive 1-bits indicating that the next bit is the first bit of the first byte
of the destination MAC address.
Table 3
Field
Description
Destination Address
The 48-bit destination address identifies which station(s) on the LAN should
receive the frame. The first two bits of the destination MAC address are
reserved for special functions:
The remaining 46 bits are a uniquely assigned value that identifies a single
station, a defined group of stations, or all stations on the network.
Source Address
The 48-bit source address identifies which station transmitted the frame. The
source address is always an individual address, and the leftmost bit in the SA
field is always 0.
Type
TypeIn an Ethernet Type II frame, this part of the frame is used for the
Type field. The Type field is used to identify the next layer protocol in the
frame.
or
Length
LengthIn an 802.3 Ethernet frame, this part of the frame is used for the
Length field. The Length field is used to indicate the length of the Ethernet
frame. The value can be from 46 to 1500 bytes.
Data
or
or
This field contains a 32-bit cyclic redundancy check (CRC) value, which is
created by the sending station and is recalculated by the receiving station to
check for damaged frames. The FCS is generated for the DA, SA, Type, and
Data fields of the frame. The FCS does not include the data portion of the
frame.
Note
Devices that use 802.1q insert a four-byte tag into the original frame before it is transmitted. Figure 5
shows the format of an 802.1q tagged Ethernet frame.
10
Figure 5
Field
Description
DA, SA, Type or Length, Data, and FCS Table 3 describes these fields.
Tag Protocol ID (TPID)
Priority
ISL is a Cisco-proprietary protocol for encapsulating frames on a VLAN trunk. Devices that use ISL add
an ISL header to the frame. This process is known as VLAN encapsulation. 802.1Q is the IEEE standard
for tagging frames on a VLAN trunk. Figure 6 shows the format of a Cisco ISL-encapsulated Ethernet
frame.
11
#of bits in
the field
48
16
24
24
15
16
16
Field Name DA TYPE USER SA LEN AAAA03(SNAP) HSA VLAN BPDU INDEX RES
1 to 24575
bytes
32
Enscapsulated
FCS
FRAME
127755
Figure 6
Field
Description
DA (destination
address)
TYPE
This 4-bit field indicates the type of frame that is encapsulated and could be
used in the future to indicate alternative encapsulations.
TYPE codes:
USER
0000 = Ethernet
0010 = FDDI
0011 = ATM
This 4-bit field is used to extend the meaning of the Frame TYPE field. The
default USER field value is 0000. For Ethernet frames, the USER field bits
0 and 1 indicate the priority of the packet as it passes through the switch.
Whenever traffic can be handled more quickly, the packets with this bit set
should take advantage of the quicker path. However, such paths are not
required.
USER codes:
12
XX01 = Priority 1
XX10 = Priority 2
SA
This 48-bit field is the source address field of the ISL packet. It should be set
to the 802.3 MAC address of the switch port transmitting the frame. The
receiving device can ignore the SA field of the frame.
LEN
This 16-bit value field stores the actual packet size of the original packet.
The LEN field represents the length of the packet in bytes, excluding the DA,
TYPE, USER, SA, LEN, and FCS fields. The total length of the excluded
fields is 18 bytes, so the LEN field represents the total length minus 18 bytes.
AAAA03(SNAP)
HSA
This 24-bit field represents the upper three bytes (the manufacturers ID
portion) of the SA field. It must contain the value 0x00-00-0C.
VLAN
This 15-bit field is the virtual LAN ID of the packet. This value is used to
mark frames on different VLANs.
Table 5
Field
Description
BPDU
The bit in the BPDU field is set for all BPDU packets that are encapsulated
by the ISL frame. The BPDUs are used by the spanning tree algorithm to find
out information about the topology of the network. This bit is also set for
CDP and VTP frames that are encapsulated.
INDEX
This 16-bit field indicates the port index of the source of the packet as it exits
the switch. It is used for diagnostic purposes only, and may be set to any
value by other devices. It is ignored in received packets.
RES
This 16-bit field is used when Token Ring or FDDI packets are encapsulated
with an ISL frame.
Encapsulated FRAME
FCS
The FCS field consists of 4 bytes. It includes a 32-bit CRC value, which is
created by the sending station and is recalculated by the receiving station to
check for damaged frames. The FCS covers the DA, SA, Length/Type, and
Data fields. When an ISL header is attached to a Layer 2 frame, a new FCS
is calculated over the entire ISL packet and added to the end of the frame.
Note
The addition of the new FCS does not alter the original FCS that is
contained within the encapsulated frame.
13
SUMMARY STEPS
14
1.
enable
2.
configure terminal
3.
ip flow-capture fragment-offset
4.
ip flow-capture icmp
5.
ip flow-capture ip-id
6.
ip flow-capture mac-addresses
7.
ip flow-capture packet-length
8.
ip flow-capture ttl
9.
ip flow-capture vlan-id
and/or
ip flow egress
12. exit
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-capture fragment-offset
Example:
Router(config)# ip flow-capture fragment-offset
Step 4
ip flow-capture icmp
Example:
Router(config)# ip flow-capture icmp
Step 5
ip flow-capture ip-id
Example:
Router(config)# ip flow-capture ip-id
Step 6
ip flow-capture mac-addresses
Example:
Router(config)# ip flow-capture mac-addresses
Step 7
ip flow-capture packet-length
Example:
Step 8
ip flow-capture ttl
Example:
Step 9
ip flow-capture vlan-id
Example:
15
Step 10
Command or Action
Purpose
Example:
Router(config)# interface ethernet 0/0
Step 11
ip flow ingress
and/or
and/or
ip flow egress
Example:
Router(config-if)# ip flow ingress
and/or
Example:
Router(config-if)# ip flow egress
Step 12
exit
Example:
Router(config)# exit
Restrictions
The Verifying NetFlow Layer 2 and Security Monitoring Exports uses the show ip cache verbose flow
command. The following restrictions apply to using the show ip cache verbose flow command.
Displaying Detailed NetFlow Cache Information on Platforms Running Distributed Cisco Express Forwarding
On platforms running dCEF, NetFlow cache information is maintained on each line card or Versatile
Interface Processor. If you want to use the show ip cache verbose flow command to display this
information on a distributed platform, you must enter the command at a line card prompt.
Cisco 7500 Series Platform
To display detailed NetFlow cache information on a Cisco 7500 series router that is running distributed
dCEF, enter the following sequence of commands:
Router# if-con slot-number
LC-slot-number# show ip cache verbose flow
For Cisco IOS Releases 12.3(4)T, 12.3(6), and 12.2(20)S and later, enter the following command to
display detailed NetFlow cache information:
Router# execute-on slot-number show ip cache verbose flow
16
To display detailed NetFlow cache information on a Cisco 12000 Series Internet Router, enter the
following sequence of commands:
Router# attach slot-number
LC-slot-number# show ip cache verbose flow
For Cisco IOS Releases 12.3(4)T, 12.3(6), and 12.2(20)S and later, enter the following command to
display detailed NetFlow cache information:
Router#
SUMMARY STEPS
1.
DETAILED STEPS
Step 1
SrcIPaddress
10.251.138.218
aaaa.bbbb.cc03
840
59
0
DstIf
Port Msk AS
Et1/0.1
0015 /0 0
(005)
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
17
Prerequisites
You must enable NetFlow Version 9 and NBAR before you configure NBAR data export.
You must add and configure the following fields to the Cisco NetFlow Collector Software to identify the
flow exported by the NBAR data export feature:
Note
The biflowDirection field provides information about the host that initiates the session. The size
of this field is one byte. RFC 5103 provides details for using this field.
Restrictions
NBAR support can be configured only with NetFlow Version 9 format. If you try to configure NBAR
data export with other versions, the following error message appears:
1d00h: %FLOW : Export version 9 not enabled
The NBAR data export does not use NetFlow aging parameters.
SUMMARY STEPS
18
1.
enable
2.
configure terminal
3.
ip flow-export version
4.
ip flow-capture nbar
5.
6.
exit
7.
8.
DETAILED STEPS
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-export version 9
Example:
Router(config)# ip flow-capture version 9
Step 4
ip flow-capture nbar
Example:
Router(config)# ip flow-capture nbar
Step 5
Example:
Router(config)# ip flow-export template options
nbar
Step 6
exit
Example:
Router(config)# exit
Step 7
Example:
Router # show ip flow export nbar
Step 8
Example:
Router# clear ip flow stats nbar
Configuring and Using NetFlow Layer 2 and Security Monitoring Exports to Analyze a Simulated
FTP Attack: Example, page 20
Configuring and Using NetFlow Layer 2 and Security Monitoring Exports to Analyze a Simulated
ICMP Ping Attack: Example, page 26
19
Test Network
S2/0
172.16.1.2
E0/0
172.16.1.1
172.16.10.1
R2 E1/0.1
S3/0
E0/0.1
R3
802.1q trunk
VLAN 5
E1/0.1
E1/0.1
802.1q trunk
VLAN 6
R4
S3/0
E0/0
172.16.10.2
Tip
Keep track of the MAC addresses and IP addresses of the devices in your network. You can use them to
analyze attacks and to resolve problems.
Note
This example does not include the ip flow-capture icmp command, which captures the value of the
ICMP type and code fields. The use of the ip flow-capture icmp command is described in Configuring
and Using NetFlow Layer 2 and Security Monitoring Exports to Analyze a Simulated ICMP Ping Attack:
Example.
R2
!
hostname R2
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc02
ip address 172.16.1.2 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc03
no ip address
!
interface Ethernet1/0.1
20
FTP server
S2/0
127556
Host A
encapsulation dot1Q 5
ip address 172.16.6.1 255.255.255.0
!
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R3
!
hostname R3
!
ip flow-capture fragment-offset
ip flow-capture packet-length
ip flow-capture ttl
ip flow-capture vlan-id
ip flow-capture ip-id
ip flow-capture mac-addresses
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc04
no ip address
!
interface Ethernet0/0.1
encapsulation dot1Q 5
ip address 172.16.6.2 255.255.255.0
ip accounting output-packets
ip flow ingress
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc05
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.1 255.255.255.0
ip accounting output-packets
ip flow egress
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R4
!
hostname R4
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc07
ip address 172.16.10.1 255.255.255.0
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc06
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.2 255.255.255.0
21
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
The show ip cache verbose flow command displays the NetFlow flows that have been captured from the
FTP traffic that Host A is sending.
The fields that have the values captured by the ip flow-capture command are in Table 9. These are the
fields and the values that are used to analyze the traffic for this example. The other fields captured by
the show ip cache verbose flow command are explained in Table 6, Table 7, and Table 8.
R3# show ip cache verbose flow
IP packet size distribution (3596 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .003 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .995 .000 .000 .000 .000 .000 .000 .000
The preceding output shows the percentage distribution of packets by size. In this display, 99.5 percent
of the packets fall in the 1024-byte size range, and 0.3 percent fall in the 64-byte range.
The next section of the output can be divided into four parts. The section and the table corresponding to
each are as follows:
Field Descriptions in the NetFlow Cache Section of the Output (Table 6 on page 23)
Field Descriptions in the Activity by Protocol Section of the Output (Table 7 on page 24)
Field Descriptions in the NetFlow Record Section of the Output (Table 8 on page 24)
NetFlow Layer 2 and Security Monitoring Exports Fields in the NetFlow Record Section of the
Output (Table 9 on page 25)
SrcIPaddress
10.132.221.111
aaaa.bbbb.cc03
840
59
0
Et0/0.1
10.251.138.218
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
22
DstIf
Port Msk AS
Et1/0.1
0015 /0 0
(005)
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
Et1/0.1
0015 /0
(005)
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
06 80
(006)
00
840
198
41.2
Min plen:
Min TTL:
IP id:
840
59
0
Et0/0.1
10.10.12.1
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
840
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
10.231.185.254
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
840
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Et0/0.1
10.71.200.138
0015 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
840
Min TTL:
59
IP id:
0
Et1/0.1
0015 /0
(005)
Max plen:
Max TTL:
840
59
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 80
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 80
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Max plen:
Max TTL:
06 80
00
840
203
42.2
00
840
203
42.2
00
840
203
42.2
(006)
840
59
(006)
840
59
(006)
840
59
R3#
Table 6 describes the significant fields shown in the NetFlow cache section of the output.
Table 6
Field
Description
bytes
active
Number of active flows in the NetFlow cache at the time this command was
entered.
inactive
Number of flow buffers that are allocated in the NetFlow cache but that were
not assigned to a specific flow at the time this command was entered.
added
ager polls
Number of times the NetFlow code caused entries to expire (used by Cisco
Customer Support Engineers (CSE) for diagnostic purposes).
Number of times the NetFlow code tried to allocate a flow but could not.
last clearing of statistics The period of time that has passed since the clear ip flow stats privileged
EXEC command was last executed. The standard time output format of
hours, minutes, and seconds (hh:mm:ss) is used for a period of time less than
24 hours. This time output changes to hours and days after the time exceeds
24 hours.
23
Table 7 describes the significant fields shown in the activity by protocol section of the output.
Table 7
Field
Description
Protocol
Total Flows
Number of flows for this protocol since the last time statistics were cleared.
Flows/Sec
Average number of flows for this protocol per second; equal to the total flows
divided by the number of seconds for this summary period.
Packets/Flow
Average number of packets for the flows for this protocol; equal to the total
packets for this protocol divided by the number of flows for this protocol for
this summary period.
Bytes/Pkt
Average number of bytes for the packets for this protocol; equal to the total
bytes for this protocol divided by the total number of packets for this protocol
for this summary period.
Packets/Sec
Average number of packets for this protocol per second; equal to the total
packets for this protocol divided by the total number of seconds for this
summary period.
Active(Sec)/Flow
Number of seconds from the first packet to the last packet of an expired flow
divided by the number of total flows for this protocol for this summary period.
Idle(Sec)/Flow
Number of seconds observed from the last packet in each nonexpired flow for
this protocol until the time at which the show ip cache verbose flow
command was entered divided by the total number of flows for this protocol
for this summary period.
Table 8 describes the significant fields in the NetFlow record section of the output.
Table 8
Field
Description
SrcIf
Port Msk AS
SrcIPaddress
This is the source IP address of the traffic in the five flows. The traffic is
using five different IP source addresses
DstIf
10.132.221.111
10.251.138.218
10.10.12.1
10.231.185.254
10.71.200.138
Note
24
If an asterisk (*) immediately follows the DstIf field, the flow being
shown is an egress flow.
Table 8
Field
Description
Port Msk AS
DstIPaddress
NextHop
The Border Gateway Protocol (BGP) next-hop address. This is always set to
0 in MPLS flows.
Pr
ToS
B/Pk
Average number of bytes observed for the packets seen for this flow.
Flgs
TCP flags, shown in hexadecimal format. This value is the result of bitwise
OR of the TCP flags from all packets in the flow.
Pkts
Active
Table 9 describes the fields and values for the NetFlow Traffic Classification and Identification fields for
the NetFlow record section of the output.
Table 9
NetFlow Layer 2 and Security Monitoring Exports Fields in the NetFlow Record
Section of the Output
Field
Description
MAC
These are the source and destination MAC addresses from the traffic. The
source and destination MAC address are read from left to right in the output.
Note
Note
VLAN id
Min plen
These are the source and destination VLAN IDs. The source and destination
VLAN IDs are read from left to right in the output.
This is the minimum packet length for the packets captured in the five flows.
The current value is 840.
Max plen
This is the maximum packet length for the packets captured in the five flows.
The current value is 840.
25
Table 9
NetFlow Layer 2 and Security Monitoring Exports Fields in the NetFlow Record
Section of the Output (continued)
Field
Description
Min TTL
This is the minimum time-to-live (TTL) for the packets captured in the five
flows.
The current value is 59.
Max TTL
This is the maximum TTL for the packets captured in the five flows.
The current value is 59.
IP id
This is the IP identifier field for the traffic in the five flows.
The current value is 0.
The fact that the Layer 3 TTL, identifier, and packet length fields in the five flows have the same values
is a good indication that this traffic is a DoS attack. If this data had been captured from real traffic, the
values would typically be different. The fact that all six of these flows have a TTL value of 59 indicates
that this traffic is originating from points that are the same distance away from R3. Real user traffic
would normally be arriving from many different distances away; therefore the TTL values would be
different.
If this traffic is identified as a DoS attack (based on the data captured in the Layer 3 fields), you can use
the Layer 2 information in the flows to identify the path the traffic is taking through the network. In this
example, the traffic is being sent to R3 on VLAN 5 by R2. You can demonstrate that R2 is transmitting
the traffic over interface 1/0.1 because the source MAC address (aaaa.bbb.cc03) belongs to 1/0.1 on R2.
You can identify that R3 is transmitting the traffic using VLAN 6 on interface 1/0.1 to interface 1/0.1 on
R4 because the destination MAC address (aaaa.bbbb.cc06) belongs to interface 1/0.1 on R4.
You can use this information to develop a plan to mitigate this attack. One possible way to mitigate this
attack is by configuring an extended IP access list that blocks FTP traffic from any host with a source
address that is on the 10.0.0.0 network. Another possible solution is to configure a default route for the
10.0.0.0 network that points to the null interface on the router.
Caution
Each of these solutions blocks traffic from legitimate hosts on the 10.0.0.0 network. Therefore these
solutions should be used only temporarily while you identify the point of origin of the attack and decide
how to stop it there.
26
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc03
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 5
ip address 172.16.6.1 255.255.255.0
!
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R3
!
hostname R3
!
ip flow-capture fragment-offset
ip flow-capture packet-length
ip flow-capture ttl
ip flow-capture vlan-id
ip flow-capture icmp
ip flow-capture ip-id
ip flow-capture mac-addresses
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc04
no ip address
!
interface Ethernet0/0.1
encapsulation dot1Q 5
ip address 172.16.6.2 255.255.255.0
ip accounting output-packets
ip flow ingress
!
interface Ethernet1/0
mac-address aaaa.bbbb.cc05
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.1 255.255.255.0
ip accounting output-packets
ip flow egress
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
R4
!
hostname R4
!
interface Ethernet0/0
mac-address aaaa.bbbb.cc07
ip address 172.16.10.1 255.255.255.0
!
27
interface Ethernet1/0
mac-address aaaa.bbbb.cc06
no ip address
!
interface Ethernet1/0.1
encapsulation dot1Q 6
ip address 172.16.7.2 255.255.255.0
!
router rip
version 2
network 172.16.0.0
no auto-summary
!
The show ip cache verbose flow command displays the NetFlow flows that have been captured from the
ICMP traffic that Host A is sending.
The fields that have their values captured by the ip flow-capture command are explained in Table 13.
These are the fields and the values that are used to analyze the traffic for this example. The other fields
captured by the show ip cache verbose flow command are explained in Table 10, Table 11 and Table 12.
R3# show ip cache verbose flow
IP packet size distribution (5344 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .166 .832 .000 .000 .000 .000 .000 .000
The preceding output shows the percentage distribution of packets by size. In this display, 16.6 percent
of the packets fall in the 1024-byte size range and 83.2 percent fall in the 1536-byte range.
The next section of the output can be divided into four sections. The section and the table corresponding
to each are as follows:
Field Descriptions in the NetFlow Cache Section of the Output (Table 10 on page 29)
Field Descriptions in the Activity by Protocol Section of the Output (Table 11 on page 29)
Field Descriptions in the NetFlow Record Section of the Output (Table 12 on page 30)
NetFlow Layer 2 and Security Monitoring Exports Fields in the NetFlow Record Section of the
Output (Table 13 on page 31)
28
DstIf
Port Msk AS
Et1/0.1
0800 /0 0
(005)
DstIPaddress
NextHop
172.16.10.2
0.0.0.0
aaaa.bbbb.cc06
Min plen:
Min TTL:
ICMP type:
IP id:
1500
59
8
13499
Max plen:
Max TTL:
ICMP code:
Et0/0.1
10.106.1.1
0000 /0 0
MAC: (VLAN id) aaaa.bbbb.cc03
Min plen:
772
Min TTL:
59
ICMP type:
0
IP id:
13499
Et1/0.1
0000 /0
(005)
1500
59
0
172.16.10.2
01 00 00
0.0.0.0
1354
aaaa.bbbb.cc06 (006)
Max plen:
1500
Max TTL:
59
ICMP code:
0
FO:
185
1950
8.6
R3#
Table 10 describes the significant fields shown in the NetFlow cache lines of the output.
Table 10
Field
Description
bytes
active
Number of active flows in the NetFlow cache at the time this command was
entered.
inactive
Number of flow buffers that are allocated in the NetFlow cache but that were
not assigned to a specific flow at the time this command was entered.
added
ager polls
Number of times the NetFlow code caused entries to expire (used by Cisco
Customer Support Engineers (CSE) for diagnostic purposes).
Number of times the NetFlow code tried to allocate a flow but could not.
last clearing of
statistics
The period of time that has passed since the clear ip flow stats privileged
EXEC command was last executed. The standard time output format of hours,
minutes, and seconds (hh:mm:ss) is used for a period of time less than 24
hours. This time output changes to hours and days after the time exceeds
24 hours.
Table 11 describes the significant fields shown in the activity by protocol lines of the output.
Table 11
Field
Description
Protocol
Total Flows
Number of flows for this protocol since the last time statistics were cleared.
Flows/Sec
Average number of flows for this protocol per second; equal to the total flows
divided by the number of seconds for this summary period.
Packets/Flow
Average number of packets for the flows for this protocol; equal to the total
packets for this protocol divided by the number of flows for this protocol for
this summary period.
29
Table 11
Field
Description
Bytes/Pkt
Average number of bytes for the packets for this protocol; equal to the total
bytes for this protocol divided by the total number of packets for this protocol
for this summary period.
Packets/Sec
Average number of packets for this protocol per second; equal to the total
packets for this protocol divided by the total number of seconds for this
summary period.
Active(Sec)/Flow
Number of seconds from the first packet to the last packet of an expired flow
divided by the total number of flows for this protocol for this summary period.
Idle(Sec)/Flow
Number of seconds observed from the last packet in each nonexpired flow for
this protocol until the time at which the show ip cache verbose flow
command was entered divided by the total number of flows for this protocol
for this summary period.
Table 12 describes the significant fields in the NetFlow record lines of the output.
Table 12
Field
Description
SrcIf
Port Msk AS
SrcIPaddress
IP address of the device that transmitted the packet. The sending host is using
10.106.1.1 as the source IP address.
DstIf
Note
30
If an asterisk (*) immediately follows the DstIf field, the flow being
shown is an egress flow.
Port Msk AS
DstIPaddress
NextHop
Pr
ToS
B/Pk
Average number of bytes observed for the packets seen for this flow.
Flgs
TCP flags, shown in hexadecimal format. This value is the result of bitwise
OR of the TCP flags from all packets in the flow.
Pkts
Active
Table 13 describes the fields and values for the NetFlow Traffic Classification and Identification fields
for the NetFlow record lines of the output.
Table 13
NetFlow Layer 2 and Security Monitoring Exports Fields in the NetFlow Record
Section of the Output
Field
Description
MAC
These are the source and destination MAC addresses from the traffic. The
source and destination MAC address are read from left to right in the output.
Note
Note
VLAN id
Min plen
These are the source and destination VLAN IDs. The source and destination
VLAN IDs are read from left to right in the output.
This is the minimum packet length for the packets captured in the two flows.
The current value for the first flow is 1500.
The current value for the second flow is 772.
Max plen
This is the maximum packet length for the packets captured in the two flows.
The current value for the first flow is 1500.
The current value for the second flow is 1500.
Min TTL
This is the minimum time-to-live (TTL) for the packets captured in the two
flows.
The current value is 59.
Max TTL
This is the maximum TTL for the packets captured in the two flows.
The current value is 59.
IP id
This is the IP identifier field for the traffic in the flows. The current value is
0 for all three flows.
ICMP type
This is the Internet Control Message Protocol (ICMP) type field from the
ICMP datagram captured in the first flow.
The value is: 8
ICMP code
This is the ICMP code field from the ICMP datagram captured in the third
flow.
The value is: 0
FO
This is the value of the fragment offset field from the first fragmented
datagram in the second flow.
The value is: 185
31
There are two ICMP flows shown in the output. You can tell that they are from the same ICMP datagram
because they have the same IP ID field value of 13499. When two ICMP flows have the same IP ID value,
the ICMP datagram being analyzed has been fragmented. The first flow has the ICMP type field set to
8, which indicates that this is an ICMP echo request (ping) datagram. The value of 185 in the fragment
offset (FO) field in the second flow shows where this fragment will be placed in the memory buffer of
the FTP server as the server reassembles the ICMP datagram. The value of 185 is applicable only to the
first fragment of this datagram. The subsequent values will be greater because they take into account the
previous fragments.
The value of 0 in the ICMP type field of the second flow does not mean that this flow is an ICMP echo
reply as Table 2 shows. In this case the ICMP type field value is set to 0 because the ICMP headers for
fragments of ICMP datagrams do not have the type and code fields. The default value of 0 is inserted
instead.
Note
If this data were captured from a real ICMP attack, it would probably have more than one flow.
Although, you cannot find out the original size of the ICMP datagram from the information shown by
the show ip cache verbose flow, the fact that it was large enough to be fragmented in transit is a good
indication that this is not a normal ICMP datagram. Notice the values in the minimum and maximum
packet length fields for both flows. The values for both fields are set to 1500 for the first flow. The value
for the minimum packet length is set to 772 and the value for the maximum packet length is set to 1500
for the second flow.
If this traffic is identified as a DoS attack based on the data captured in the Layer 3 fields, you can use
the Layer 2 information in the flows to identify the path that the traffic is taking through the network. In
this example, the traffic is being sent to R3 on VLAN 5 by R2. You can demonstrate that R2 is
transmitting the traffic over interface 1/0.1 because the source MAC address (aaaa.bbb.cc03) belongs to
1/0.1 on R2. You can demonstrate that R3 is transmitting the traffic using VLAN 6 on interface 1/0.1 to
interface 1/0.1 on R4, because the destination MAC address (aaaa.bbbb.cc06) belongs to interface 1/0.1
on R4.
You can use this information to mitigate this attack. One possible way to mitigate this attack is by
configuring an extended IP access list that blocks ICMP traffic from any host with a source address that
is on the 10.0.0.0 network. Another possible solution is to configure a default route for the 10.0.0.0
network that points to the null interface on the router.
Caution
Each of these solutions blocks traffic from legitimate hosts on the 10.0.0.0 network. Therefore these
solutions should only be used temporarily while you identify the point of origin of the attack and decide
how to stop it there.
32
The following example shows sample output of the show ip flow export nbar command:
Router # show ip flow export nbar
Nbar netflow is enabled
10 nbar flows exported
0 nbar flows failed to export due to lack of internal buffers
The following example shows how to clear NBAR data from NetFlow accounting statistics:
Router # clear ip flow stats nbar
Additional References
The following sections provide references related to NetFlow Layer 2 and Security Monitoring Exports.
Related Documents
Related Topic
Document Title
Overview of NBAR
Configuring NBAR
NetFlow commands
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
33
RFCs
RFC
Title
5103
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
Note
34
Table 14 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Table 14
Feature Name
Releases
12.3(14)T
12.2(33)SRA
12.4(2)T
Application-aware NetFlow
12.2(18)ZYA2
35
Glossary
export packetA type of packet built by a device (for example, a router) with NetFlow services
enabled. The packet is addressed to another device (for example, the NetFlow Collection Engine). The
packet contains NetFlow statistics. The other device processes the packet (parses, aggregates, and stores
information about IP flows).
flowA set of packets with the same source IP address, destination IP address, protocol,
source/destination ports, and type-of-service, and the same interface on which flow is monitored. Ingress
flows are associated with the input interface, and egress flows are associated with the output interface.
NBARA classification engine in Cisco IOS Software that recognizes a wide variety of applications,
including web-based and client/server applications.
NetFlowCisco IOS accounting feature that maintains per-flow information.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on a Cisco IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly NetFlow FlowCollector)Cisco application that is used with
NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects packets
from the router that is running NetFlow and decodes, aggregates, and stores them. You can generate
reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means of carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
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 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.
2009-2010 Cisco Systems, Inc. All rights reserved.
36
This module contains information about and instructions for configuring Multiprotocol Label Switching
(MPLS)-aware NetFlow. MPLS-aware NetFlow is an extension of the NetFlow accounting feature that
provides highly granular traffic statistics for Cisco routers.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Contents
Glossary, page 23
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Configure Cisco Express Forwarding (CEF) or Distributed CEF (dCEF) enabled on the LSR and the
interfaces that you want to enable NetFlow on.
If you are exporting data to a Cisco NetFlow collector, the following requirements apply:
NetFlow collector and analyzer capable of using MPLS-aware NetFlow export packets in Version 9
format
Table 1 describes the Cisco 12000 Series Internet Router line card support for Cisco IOS 12.0 S releases
of MPLS-aware NetFlow.
Table 1
Cisco 12000 Series Line Card Support for MPLS-aware NetFlow in Cisco IOS 12.0 S
Releases
Type
Line Card
Ethernet
1-Port GE1
8-Port FE1
3-Port GE
1-Port 10-GE
Modular GE
Channelized
interfaces
Electrical interface
6-Port DS32
12-Port DS3 2
6-Port E32
12-Port E32
Table 1
Cisco 12000 Series Line Card Support for MPLS-aware NetFlow in Cisco IOS 12.0 S
Releases (continued)
Type
Line Card
Dynamic packet
transport
Asynchronous
Transfer Mode
(ATM)
1. This Cisco 12000 Series Internet Router line card does not support MPLS-aware NetFlow.
2. This Cisco 12000 Series Internet Router line card supports MPLS-aware NetFlow enabled in either full or sampled mode.
Line cards not marked with a footnote character support MPLS-aware NetFlow in sampled mode only. In general,
Cisco 12000 line cards support MPLS-aware NetFlow in the same mode as they support NetFlow.
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
MPLS-aware NetFlow
No more than three MPLS labels are allowed to be captured and exported for this implementation.
MPLS-aware NetFlow reports the following fields in MPLS flows as 0: IP next-hop, source and
destination Border Gateway Protocol (BGP) autonomous system (AS) numbers, and source and
destination prefix masks.
For MPLS packets that contain non-IP packets under the MPLS label stack, MPLS-aware NetFlow
reports the following flow fields as 0: source and destination IP addresses, protocol, ToS, ports, and
TCP flags.
The IP addresses associated with the top label for traffic engineering (TE) tunnel midpoints and Any
Transport over MPLS (AToM) are reported as 0.0.0.0.
The top label type and IP address are obtained at the moment of flow export. Either can be incorrect
if the top label was deleted or reassigned after the creation of the flow in the NetFlow cache.
The following points hold true for the Cisco 12000 1-Port 10-GE, Modular GE, 1-Port OC-192 POS
ES (Edge Release), and 4-Port OC-48 POS ES (Edge Release) line cards:
MPLS-aware NetFlow samples both IP and MPLS packets, but reports only MPLS packets that
have one label per packet, ignoring all other packets (that is, IP and MPLS packets with more
than one label).
MPLS-aware NetFlow does not report application (TCP/UDP) port numbers.
MPLS-aware NetFlow reports experimental bits in MPLS labels as 0.
The Cisco 12000 1-Port OC-48 POS, 4-Port OC-12 POS, 16-Port OC-3 POS, 3-Port GE, and
1-Port OC-48 DPT line cards support MPLS-aware NetFlow in sampled mode in all microcode
bundles that include IP-sampled NetFlow.
MPLS labels
33
Top-level label
42 B 16
B Lb4Lb6 B IP Header
Data
IP packet
Miscellaneous bits
33
LDP
1 (top)
42
CSC
16
VPN
88306
Figure 1
Lb4Lb6 represents the fourth to sixth labels in the MPLS stack. LSRs in an MPLS cloud add up to
six labels to the MPLS label stack.
MPLS-aware NetFlow captures these labels if you indicate 4, 5, or 6 as labels of interest.
Figure 2 shows a sample Carrier Supporting Carrier (CSC) topology and the incoming MPLS label stack
on multiple LSRs as the packet travels through the network. Figure 2 shows what the stack might look
like at a provider core LSR.
Figure 2
Carrier's carrier
MPLS
Backbone MPLS
Carrier's carrier
MPLS
IP
16
IP
25
42
33
25 16
IP
Lx VPN
33 42 16
IP
LDP CSC VPN
CSC VPN IP
VPN IP
88307
Label 16
stack VPN IP
In the example in Figure 2, a hierarchical VPN is set up between two customer edge (CE) routers.
Traffic flows from the CE router to a provider edge (PE) router, possibly one belonging to an Internet
service provider (ISP). Here, a VPN label (16) is imposed on the inbound IP packet.
The ISP network eventually connects to an Internet backbone provider where a CSC label (42) is
imposed on the label stack.
As packets traverse the backbone network, a Label Distribution Protocol (LDP) label (33) is
imposed on the label stack.
At the inbound interface shown in Figure 2, MPLS-aware NetFlow captures the MPLS label stack and
reports that the top label (33) is an LDP label, the second label (42) is a CSC label, and the third
label (16) is a VPN label.
With NetFlow and MPLS-aware NetFlow enabled on the P router, you can determine the label type for
the specified labels, and the IP address associated with the top label on the incoming interface (see the
MPLS-aware NetFlow Capture of MPLS Labels section on page 6). Thus, you can track specific types
of MPLS traffic, such as TE, LDP, or Virtual Private Networks (VPNs).
The label-position-n argument represents the position of the label on the incoming label stack. For
example, the ip flow-cache mpls label-positions 1 3 4 command configures MPLS-aware NetFlow to
capture and export the first (top), third, and fourth labels. If you enter this command and the label stack
consists of two MPLS labels, MPLS-aware NetFlow captures only the first (top) label. If some of the
labels you requested are not available, they are not captured or reported.
Note
For this implementation, MPLS-aware NetFlow allows the capture of up to three labels.
In addition to capturing MPLS labels from the label stack, MPLS-aware NetFlow records the following
MPLS label information:
Note
Type of top labelThe type can be any of the following: unknown, TE tunnel midpoint, AToM,
VPN, BGP, or LDP.
The IP address associated with the top labelThe route prefix to which the label maps.
For this implementation, the IP address for any TE tunnel midpoint or AToM top label is reported as
0.0.0.0.
MPLS-aware NetFlow is enabled globally on the router. However, NetFlow is enabled per interface and
must be enabled in either full or sampled mode on the interfaces where you choose to capture and export
MPLS and IP NetFlow data.
Note
See Table 1 on page 2 for information on Cisco 12000 Series Internet Router line card support for
NetFlow (full and sampled modes).
The label type is LDP and the IP address associated with the label is 10.10.10.10.
The value of the second label is 12312, the experimental bits value is 6, and the end-of-stack bit is 1.
To fully understand and use the information gathered on the P router, you need information from the
label forwarding information base (LFIB) on the PE router.
Note
The MPLS application owner for a label is not reported by MPLS-aware NetFlow for any MPLS
label except for the top label. IP information, the label number, and the MPLS application are
reported for the top label. Only IP information and the label number are reported for labels other
than the top label. Therefore, you need to understand your network if you are interested in
identifying the MPLS application owner for labels other than the top MPLS label.
Using MPLS-aware NetFlow, you can monitor various labels in the MPLS label stack. You can also
export this information to a NetFlow collector for further processing with a data analyzer and look at
MPLS traffic patterns in your network.
For MPLS traffic, MPLS-aware NetFlow captures and reports up to three labels of interest and the
label type and associated IP address of the top label, along with a subset of NetFlow data.
MPLS-aware NetFlow uses Version 9 format to export both IP and MPLS NetFlow data.
MPLS-aware NetFlow provides the following traditional NetFlow per-flow statistics:
Number of packets
Number of bytes, counting either MPLS payload size only or MPLS payload size plus MPLS label
stack size
In addition to these statistics, MPLS-aware NetFlow exports values for the following fields for each flow,
using Version 9 NetFlow export format:
Note
With the exception of the input interface and output interface fields, these regular NetFlow fields
are not included in a flow if the no-ip-fields keyword is specified in the ip flow-cache mpls
label-positions command.
Additional fields:
Up to three incoming MPLS labels with experimental bits and an end-of-stack bit
Positions of the above labels in the label stack
Type of the top label
An address prefix associated with the top label specific to the label type:
TEThis is always set to "0.0.0.0" because tunnel label addresses are not supported.
LDPThe address prefix is the IP address of the next-hop.
VPNIf the VRFs do not have overlapping IP addresses, the address prefix is the destination
prefix. If the VRFs have overlapping IP addresses the destination prefix given may be
ambiguous.
Note
Unlike NetFlow, MPLS-aware NetFlow reports a 0 value for IP next-hop, source and destination BGP
autonomous system numbers, or source and destination prefix masks for MPLS packets.
Note
If you are exporting MPLS data to a NetFlow collector or a data analyzer, the collector must support
NetFlow Version 9 flow export format, and you must configure NetFlow export in Version 9 format on
the router.
Cisco IOS
Release
12.0(24)S
Sampled
Full
Sampled
flow-sampler-map sampler-map-name
12.0(26)S
ip route-cache flow
1. NetFlow sampling on the Cisco 7500/7200 platforms is performed by a feature called Random Sampled NetFlow.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
ip flow {ingress}
5.
exit
6.
Repeat Steps 3 through 5 for each interface you want to configure NetFlow on.
7.
8.
9.
exit
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface pos 3/0
10
Step 4
Command or Action
Purpose
ip flow {ingress}
Example:
Step 5
exit
Example:
Note
Router(config-if)# exit
Step 6
(Optional)
Step 7
Example:
Router(config)# ip flow-export version 9
origin-as
Caution
11
Step 8
Command or Action
Purpose
Example:
Router(config)# ip flow-cache mpls
label-positions 1 2 3
Source IP address
Destination IP address
Transport layer protocol
Source application port number
Destination application port number
IP type of service (ToS)
TCP flag (the result of a bitwise OR of TCP)
Step 9
exit
Example:
Router(config)# exit
SUMMARY STEPS
12
1.
enable
2.
configure terminal
3.
flow-sampler-map sampler-map-name
4.
5.
exit
6.
7.
flow-sampler sampler-map-name
8.
end
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
flow-sampler-map sampler-map-name
Example:
Step 4
Example:
Step 5
exit
Example:
Router(config-sampler-map)# exit
Step 6
Example:
Router(config)# interface ethernet 0/0
Step 7
flow-sampler sampler-map-name
Example:
Router(config-if)# flow-sampler mysampler
Step 8
end
Example:
Router(config-if)# end
13
Troubleshooting Tips
Use the show-sampler sampler-map-name command to verify the configuration of NetFlow sampling,
including the NetFlow sampling mode, sampling mode parameters, and number of packets sampled by the
NetFlow sampler.
For more information on NetFlow export sampling, see the Using NetFlow Filtering or Sampling to
Select the Network Traffic to Track module.
SUMMARY STEPS
1.
2.
DETAILED STEPS
Step 1
Step 2
show flow-sampler
Use the following command to verify the configuration for all Netflow samplers on the router:
Router# show flow-sampler
Sampler : mysampler, id : 1, packets matched : 10, mode : random sampling mode
sampling interval is : 100
Sampler : mysampler1, id : 2, packets matched : 5, mode : random sampling mode
sampling interval is : 200
14
SUMMARY STEPS
1.
enable
2.
attach slot-number (Cisco 12000 series routers only) or if-con slot-number (Cisco 7500 series
routers only)
3.
4.
5.
exit (Cisco 12000 Series Internet routers only) or if-quit (Cisco 7500 series routers only)
DETAILED STEPS
Step 1
enable
Use this command to enable privileged EXEC mode. Enter your password if required. For example:
Router> enable
Router#
Step 2
attach slot-number (Cisco 12000 Series Internet routers only) or if-con slot-number (Cisco 7500 series
routers only)
Use the attach command to access the Cisco IOS on the line card of a Cisco 12000 Series Internet
Router. For example:
Router# attach 3
LC-Slot3#
Use the if-con command to access the Cisco IOS on the line card of a Cisco 7500 series router. For
example:
Router# if-con 3
LC-Slot3#
Step 3
In this example, the value of the top label is 12305, the experimental bits value is 6, and the end-of-stack
bit is 0. The label is LDP and it has an associated IP address of 10.10.10.10. The value of the next from
the top label is 12312, the experimental bits value is 6, and the end-of-stack bit is 1. The 1 indicates that
this is the last MPLS label in the stack.
Use this command to display IP and MPLS flow records in the NetFlow cache on a Cisco 7200 series
router. For example:
Router# show ip cache verbose flow
...
SrcIf
SrcIPaddress
DstIf
DstIPaddress
Pr TOS Flgs
Pkts
15
Port Msk AS
Port Msk AS
NextHop
PO3/0
10.1.1.1
PO5/1
10.2.1.1
0100 /0 0
0200 /0 0
0.0.0.0
Pos:Lbl-Exp-S 1:12305-6-0 (LDP/10.10.10.10) 2:12312-6-1
01 00
B/Pk
10
100
Active
9
0.0
In this example, the value of the top label is 12305, the experimental bits value is 6, and the end-of-stack
bit is 0. The label is LDP and has an associated IP address of 10.10.10.10. The value of the next from
the top label is 12312, the experimental bits value is 6, and the end-of-stack bit is 1. The 1 indicates that
this is the last MPLS label in the stack.
Step 4
SrcIPaddress
10.1.1.1
DstIf
PO5/1
DstIPaddress
10.2.1.1
Pr SrcP DstP
01 0100 0200
Pkts
9
Use this command to display a summary of the IP and MPLS flow records in the NetFlow cache on a
Cisco 7200 series router. For example:
Router# show ip cache flow
...
SrcIf
PO3/0
...
Step 5
SrcIPaddress
10.1.1.1
DstIf
PO5/1
DstIPaddress
10.2.1.1
Pr SrcP DstP
01 0100 0200
Pkts
9
exit (Cisco 12000 series routers only) or if-quit (Cisco 7500 series routers only)
Use the exit command to exit from the line card to privileged EXEC mode of a Cisco 12000 Series
Internet Router. For example:
LC-Slot3# exit
Router#
Use the if-quit command to exit from the line card to privileged EXEC mode of a Cisco 7500 Series
Router. For example:
LC-Slot3# if-quit
Router#
16
The following examples show MPLS-aware NetFlow configured globally and NetFlow enabled on an
interface on a Cisco 7200 or 7500 series P router with Cisco IOS 12.0S releases:
configure terminal
!
interface pos 3/0
ip address 10.10.10.2 255.255.255.0
ip route-cache flow sampled
exit
!
ip flow-export version 9 origin-as
ip flow-sampling-mode packet-interval 101
ip flow-cache mpls label-positions 1 2 3
exit
The following examples show MPLS-aware NetFlow configured globally and NetFlow enabled on an
interface on a router with a Cisco IOS Release 12.2(14)S, 12.2(15)T, or 12.0(22)S or later:
configure terminal
!
interface pos 3/0
ip address 10.10.10.2 255.255.255.0
ip flow ingress
exit
!
ip flow-export version 9 origin-as
ip flow-sampling-mode packet-interval 101
ip flow-cache mpls label-positions 1 2 3
exit
To export MPLS-aware NetFlow data from the router, you need to configure NetFlow Version 9 export
format. This example shows the NetFlow Version 9 export format configuration options for MPLS-aware
NetFlow and IP NetFlow data export along with an explanation of what each command configures:
configure terminal
ip flow-export version 9 origin-as
17
The following example shows how to define a NetFlow sampler called mysampler that randomly selects
1 out of 100 packets for NetFlow processing:
configure terminal
!
flow-sampler-map mysampler
mode random one-out-of 100
end
exit
The following example shows how to apply the NetFlow sampler named mysampler to an interface:
configure terminal
!
interface FastEthernet 2/0
flow-sampler mysampler
end
exit
18
Additional References
The following sections provide references related to configuring MPLS-aware NetFlow.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data
configuring NetFlow and NetFlow Data Export
Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standard
Title
19
MIBs
MIB
MIBs Link
RFCs
RFC
Title
Technical Assistance
Description
Link
http://www.cisco.com/cisco/web/support/index.html
20
Note
Table 3 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
21
Table 3
Feature Name
Releases
MPLS-aware NetFlow
12.0(24)S,
12.3(8)T
15.0(1)S
22
Glossary
AToMAny Transport over MPLS. A protocol that provides a common framework for encapsulating
and transporting supported Layer 2 traffic types over a Multiprotocol Label Switching (MPLS) network
core.
BGPBorder Gateway Protocol. An interdomain routing protocol that replaces Exterior Gateway
Protocol (EGP). A BGP system exchanges reachability information with other BGP systems. It is
defined by RFC 1163.
CE routercustomer edge router. A router that is part of a customer network and that interfaces to a
provider edge (PE) router. CE routers do not have routes to associated Virtual Private Networks (VPNs)
in their routing tables.
core routerIn a packet-switched star topology, a router that is part of the backbone and that serves as
the single pipe through which all traffic from peripheral networks must pass on its way to other
peripheral networks.
EGPExterior Gateway Protocol. Internet protocol for exchanging routing information between
autonomous systems. It is documented in RFC 904. This term is not to be confused with the general term
exterior gateway protocol. EGP is an obsolete protocol that was replaced by Border Gateway Protocol
(BGP).
export packet(NetFlow) A packet from a device (for example, a router) with NetFlow services
enabled that is addressed to another device (for example, a NetFlow collector). This other device
processes the packet (parses, aggregates, and stores information on IP flows).
FECForward Equivalency Class. A set of packets that can be handled equivalently for the purpose of
forwarding and thus is suitable for binding to a single label. The set of packets destined for an address
prefix is one example of an FEC. A flow is another example.
flowA unidirectional set of packets (IP or Multiprotocol Label Switching [MPLS]) that arrive at the
router on the same subinterface and have the same source and destination IP addresses, the same Layer 4
protocol, the same TCP/UDP source and destination ports, and the same type of service (ToS) byte in
the IP header.
IPv6IP Version 6. Replacement for the current version of IP (Version 4). IPv6 includes support for
flow ID in the packet header, which can be used to identify flows. Formerly called IPng (next
generation).
labelA short, fixed-length identifier that tells switching nodes how the data (packets or cells) should
be forwarded.
label impositionThe act of putting a label or labels on a packet.
LDPLabel Distribution Protocol. A standard protocol that operates between Multiprotocol Label
Switching (MPLS)-enabled routers to negotiate the labels (addresses) used to forward packets. The
Cisco proprietary version of this protocol is the Tag Distribution Protocol (TDP).
LFIBlabel forwarding information base. A data structure and way of managing forwarding in which
destinations and incoming labels are associated with outgoing interfaces and labels.
LSRlabel switch router. A router that forwards packets in a Multiprotocol Label Switching (MPLS)
network by looking only at the fixed-length label.
MPLSMultiprotocol Label Switching. A switching method in which IP traffic is forwarded through
use of a label. This label instructs the routers and the switches in the network where to forward the
packets. The forwarding of MPLS packets is based on preestablished IP routing information.
23
MPLS flowA unidirectional sequence of Multiprotocol Label Switching (MPLS) packets that arrive
at a router on the same subinterface and have the same source and destination IP addresses, the same
Layer 4 protocol, the same TCP/UDP source and destination ports, and the same type of service (ToS)
byte in the IP header. A TCP session is an example of a flow.
packet header (NetFlow) The first part of an export packet that provides basic information about the
packet, such as the NetFlow version, number of records contained within the packet, and sequence
numbering. The header information enables lost packets to be detected.
PE routerprovider edge router. A router that is part of a service providers network connected to a
customer edge (CE) router. All Virtual Private Network (VPN) processing occurs in the PE router.
P routerprovider core or backbone router. A router that is part of a service provider's core or backbone
network and is connected to the provider edge (PE) routers.
TDPTag Distribution Protocol. The Cisco proprietary version of the protocol (label distribution
protocol) between Multiprotocol Label Switching (MPLS)-enabled routers to negotiate the labels
(addresses) used to forward packets.
TEtraffic engineering. Techniques and processes that cause routed traffic to travel through the
network on a path other than the one that would have been chosen if standard routing methods were used.
TE tunneltraffic engineering tunnel. A label-switched tunnel that is used for traffic engineering. Such
a tunnel is set up through means other than normal Layer 3 routing; it is used to direct traffic over a path
different from the one that Layer 3 routing could cause the tunnel to take.
VPNVirtual Private Network. A secure IP-based network that shares resources on one or more
physical networks. A VPN contains geographically dispersed sites that can communicate securely over
a shared backbone.
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.
20062010 Cisco Systems, Inc. All rights reserved.
24
This document contains information about and instructions for configuring NetFlow multicast
accounting. NetFlow multicast accounting allows you to capture multicast-specific data (both packets
and bytes) for multicast flows.
NetFlow is a Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
Contents
This document includes the following sections:
Glossary, page 14
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Configure Multicast fast switching or multicast distributed fast switching (MDFS); multicast Cisco
Express Forwarding (CEF) switching is not supported.
Configure NetFlow v9 (Version 9) data export (otherwise, multicast data is visible in the cache but
is not exported).
If traffic is heavy, the additional flows might fill the global flow hash table. If you must increase the size
of the global flow hash table, you must also add memory to the router.
NetFlow has a maximum cache size of 65,536 flow record entries of 64 bytes each. To deduce the
packet-replication factor, multicast accounting adds 16 bytes (for a total of 80 bytes) to each multicast
flow record.
Performance Impact
Ingress multicast accounting does not greatly affect performance. Because of the additional
accounting-related computation that occurs in the traffic-forwarding path of the router, egress NetFlow
multicast accounting might degrade network performance slightly, but it does not limit the functionality
of the router.
Multicast Addresses
Configuring NetFlow Multicast Accounting in Cisco IOS Releases Prior to 12.4(12), 12.4(11)T,
12.2(33)SRB, 12.2(33)SXH, and 12.2(33)SB, page 5
Prerequisites
You must have already configured IP multicast on the networking devices in your network. See the Cisco
IOS IP Multicast Configuration Guide, for more information on configuring IP multicast.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
6.
7.
ip flow ingress
8.
end
DETAILED STEPS
Step 1
Command
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ip multicast-routing
Step 4
Example:
Router(config)# ip multicast netflow rpf-failure
Step 5
Command
Purpose
Example:
Router(config)# ip multicast netflow
output-counters
Step 6
Example:
Router(config)# interface fastethernet 0/0
Step 7
ip flow ingress
Example:
Router(config-if)# ip flow ingress
Step 8
end
Example:
Router(config-if)# end
Troubleshooting Tips
If there are no multicast flow records in the NetFlow cache, check the multicast switching counters for
the existence of process-switched packets (NetFlow exports only fast-switched or MDFS-switched
packets). If process-switched packets are present, check the MDFS routing table to help determine
potential problems.
Prerequisites
You must have already configured IP multicast on the networking devices in your network. See the Cisco
IOS IP Multicast Configuration Guide, for more information on configuring IP multicast.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
6.
7.
end
DETAILED STEPS
Step 1
Command
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ip multicast-routing
Step 4
Example:
Router(config)# ip multicast netflow rpf-failure
Step 5
Example:
Router(config)# interface fastethernet 0/0
Step 6
Example:
Router(config-if)# ip multicast netflow egress
Step 7
end
Example:
Router(config-if)# end
Troubleshooting Tips
If there are no multicast flow records in the NetFlow cache, check the multicast switching counters for
the existence of process-switched packets (NetFlow exports only fast-switched or MDFS-switched
packets). If process-switched packets are present, check the MDFS routing table to help determine
potential problems.
Prerequisites
You must have already configured IP multicast on the networking devices in your network. See the Cisco
IOS IP Multicast Configuration Guide, for more information on configuring IP multicast.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
6.
7.
end
DETAILED STEPS
Step 1
Command
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# ip multicast-routing
Step 4
Command
Purpose
Example:
Router(config)# ip multicast netflow rpf-failure
Step 5
Example:
Router(config)# interface fastethernet 0/0
Step 6
Example:
Router(config-if)# ip multicast netflow ingress
Step 7
end
Example:
Router(config-if)# end
Troubleshooting Tips
If there are no multicast flow records in the NetFlow cache, check the multicast switching counters for
the existence of process-switched packets (NetFlow exports only fast-switched or MDFS-switched
packets). If process-switched packets are present, check the MDFS routing table to help determine
potential problems.
SUMMARY STEPS
1.
enable
2.
DETAILED STEPS
Step 1
enable
Use this command to enable privileged EXEC mode. Enter your password if required. For example:
Router> enable
Router#
Step 2
SrcIPaddress
OBytes
10.1.1.1
309K
10.1.1.1
DstIf
Port Msk AS
DstIPaddress
NextHop
Null
0000 /0
224.192.16.1
0.0.0.0
01 55
10
20
5164
262.8
Null
0208 /0
255.255.255.255 11 C0
0.0.0.0
10
52
1
0.0
The Opkts column displays the number of IP multicast (IPM) output packets, the OBytes column
displays the number of IPM output bytes, and the DstIPaddress column displays the destination IP
address for the IPM output packets.
Configuring NetFlow Multicast Accounting in Cisco IOS Releases Prior to 12.4(12), 12.4(11)T,
12.2(33)SRB, 12.2(33)SXH, and 12.2(33)SB, page 10
10
Additional References
The following sections provide references related to configuring NetFlow multicast accounting:
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
11
Standards
Standards
Title
MIBs
MIBs
MIBs Link
RFCs
RFCs
Title
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
12
Cisco IOS software images are specific to a Cisco IOS software release, a feature set, and a platform.
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image
support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on
Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at
the login dialog box and follow the instructions that appear.
Note
Table 1
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
12.3(1), 12.2(18)S,
12.2(27)SBC,
12.2(33)SXF,
12.2(33)SRB
12.4(11)T, 12.4(12),
12.(33)SRB, 12.2(33)SB,
12.2(33)SXH
1. This was a minor modification to the existing NetFlow Multicast Support feature. Minor feature modifications are not included in Feature Navigator.
13
Glossary
CEFCisco Express Forwarding. A Layer 3 IP switching technology that optimizes network
performance and scalability for networks with large and dynamic traffic patterns.
dCEFdistributed Cisco Express Forwarding. A type of CEF switching in which line cards (such as
Versatile Interface Processor (VIP) line cards) maintain identical copies of the forwarding information
base (FIB) and adjacency tables. The line cards perform the express forwarding between port adapters;
this relieves the Route Switch Processor of involvement in the switching operation.
egress trafficTraffic leaving the network.
fast switchingCisco feature in which a route cache is used for expediting packet switching through a
router.
ingress trafficTraffic entering the network.
multicast dataSingle packets copied by the network and sent to a specific subset of network
addresses. These addresses are specified in the Destination Address field.
NetFlowA Cisco IOS application that provides statistics on packets flowing through the router. It is
emerging as a primary network accounting and security technology.
NetFlow AggregationA NetFlow feature that lets you summarize NetFlow export data on an IOS
router before the data is exported to a NetFlow data collection system such as the NetFlow Collection
Engine. This feature lowers bandwidth requirements for NetFlow export data and reduces platform
requirements for NetFlow data collection devices.
NetFlow Collection Engine (formerly called NetFlow FlowCollector)A Cisco application that is used
with NetFlow on Cisco routers and Catalyst series switches. The NetFlow Collection Engine collects
packets from the router that is running NetFlow and decodes, aggregates, and stores them. You can
generate reports on various aggregations that can be set up on the NetFlow Collection Engine.
NetFlow v9NetFlow export format Version 9. A flexible and extensible means for carrying NetFlow
records from a network node to a collector. NetFlow Version 9 has definable record types and is
self-describing for easier NetFlow Collection Engine configuration.
RPFReverse Path Forwarding. Multicasting technique in which a multicast datagram is forwarded out
of all but the receiving interface if the receiving interface is the one used to forward unicast datagrams
to the source of the multicast datagram.
ToS bytetype of service byte. Second byte in the IP header that indicates the desired quality of service
(QoS) for a particular datagram.
CCDE, CCENT, CCSI, Cisco Eos, Cisco Explorer, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Nurse Connect, Cisco Pulse,
Cisco SensorBase, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco TrustSec, Cisco Unified Computing System, Cisco WebEx,
DCE, Flip Channels, Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to
the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed
(Stylized), Cisco Store, Flip Gift Card, and One Million Acts of Green are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS,
Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert
logo, Cisco IOS, Cisco Lumin, Cisco Nexus, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity,
Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center, Explorer, Follow Me Browsing, GainMaker, iLYNX, IOS,
iPhone, IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking
Academy, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect, ROSA, SenderBase, SMARTnet,
Spectrum Expert, StackWise, WebEx, and the WebEx logo are registered trademarks of Cisco and/or its affiliates in the United States and certain
other countries.
All other trademarks mentioned in this document or website 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. (1002R)
14
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.
2008 Cisco Systems, Inc. All rights reserved.
15
16
This module contains information about and instructions for configuring NetFlow Top Talkers feature.
The NetFlow Top Talkers feature can be configured using the Cisco IOS command-line interface (CLI)
or with SNMP commands using the NetFlow MIB. The NetFlow Top Talkers feature uses NetFlow
functionality to obtain information regarding heaviest traffic patterns and most-used applications in the
network. The NetFlow MIB allows you to configure NetFlow and the NetFlow Top Talkers feature using
SNMP commands from a network management workstation.
Note
If you are searching in Feature Navigator, the feature documented in this module is named NetFlow MIB
and Top Talkers.
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Prerequisites for Configuring NetFlow Top Talkers
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands,
page 4
Feature Information for Configuring NetFlow Top Talkers using the Cisco IOS CLI or SNMP
Commands, page 26
Ensure that one of the following is enabled on your router, and on the interfaces that you want to
configure NetFlow on: Cisco Express Forwarding (CEF), distributed CEF, or fast switching
Understand the resources required on your router because NetFlow consumes additional memory
and CPU resources.
If your router is running a version of Cisco IOS prior to releases 12.2(14)S, 12.0(22)S, or 12.2(15)T the
ip route-cache flow command is used to enable NetFlow on an interface.
If your router is running Cisco IOS release 12.2(14)S, 12.0(22)S, 12.2(15)T, or later the ip flow ingress
command is used to enable NetFlow on an interface.
Cisco IOS Release 12.2(33)SXH
Some of the keywords and arguments for the commands used to configure the NetFlow MIB and Top
Talkers feature are not supported in 112.2(33)SXH. See the syntax descriptions for the commands in the
command reference (URL for the 12.2SX NF CR to be added later) for details.
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Information About Configuring NetFlow Top Talkers
The usual implementation of NetFlow exports NetFlow data to a collector. The NetFlow MIB and Top
Talkers feature performs security monitoring and accounting for top talkers and matches and identifyies
key users of the network. This feature is also useful for a network location where a traditional NetFlow
export operation is not possible. The NetFlow MIB and Top Talkers feature does not require a collector
to obtain information regarding flows. Instead, these flows are placed in a special cache where they can
be viewed. The NetFlow MIB part of the NetFlow MIB and Top Talkers feature allows you to configure
the NetFlow Top Talkers feature using SNMP.
In addition to sorting top talkers, you can further organize your output by specifying criteria that the top
talkers must match, such as source or destination IP address or port. The match command is used to
specify this criterion. For a full list of the matching criteria that you can select, refer to the
match command in the Cisco IOS command reference documentation.
SecurityYou can view the list of top talkers to see if traffic patterns consistent with DoS attack are
present in your network.
Load balancingYou can identify the most heavily used parts of the system and move network
traffic over to less-used parts of the system.
Traffic analysisConsulting the data retrieved from the NetFlow MIB and Top Talkers feature can
assist you in general traffic study and planning for your network.
An additional benefit of the NetFlow MIB and Top Talkers feature is that it can be configured for a router
either by entering CLI commands or by entering SNMP commands on a network management system
(NMS) workstation. The SNMP commands are sent to the router and processed by a MIB. You do not
have to be connected to the router console to extract the list of top talkers information if an NMS
workstation is configured to communicate using SNMP to your network device. For more information
on configuring your network device to use MIB functionality for the NetFlow MIB and Top Talkers
feature, see Configuring SNMP Support on the Networking Device.
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
(a merged list of top lists from all modules) and then software switched top talkers. The NetFlow MIB
can be used to request the top talker list and to set and/or get the configuration parameters for the
NetFlow MIB Top Talkers feature.
Some of the tasks in this section include examples of the SNMP CLI syntax used to set configuration
parameters on the router and to read values from MIB objects on the router. These SNMP CLI syntax
examples are taken from a Linux workstation using public-domain SNMP tools. The SNMP CLI syntax
for your workstation might be different. Refer to the documentation that was provided with your SNMP
tools for the correct syntax for your network management workstation.
This section contains the following subsections:
Identifying the Interface Number to Use for Enabling NetFlow with SNMP, page 9
Note
The SNMP community read-only (RO) string for the examples is public. The SNMP community
read-write (RW) string for the examples is private. You should use more complex strings for these
values in your configurations.
Note
For more information on configuring SNMP support on your networking device, refer to the
Configuring SNMP Support chapter of the Cisco IOS Configuration Fundamentals and Network
Management Configuration Guide.
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
4.
5.
end
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 4
Command or Action
Purpose
Example:
Note
Step 5
end
Example:
Router(config)# end
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
4.
5.
6.
end
SNMP Commands
1.
2.
3.
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Step 4
Example:
Step 5
Example:
Step 6
end
Example:
Router(config)# end
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCICacheEntries.0 unsigned 4000
Step 2
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCIActiveTimeOut.0 unsigned 60
Step 3
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCIInactiveTimeOut.0 unsigned 30
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Identifying the Interface Number to Use for Enabling NetFlow with SNMP
If you want to configure the NetFlow Top Talkers feature using the Cisco IOS CLI, you do not have to
perform this task.
If you want to configure the NetFlow Top Talkers feature using the NetFlow MIB and SNMP, you must
perform this task.
Before you can use SNMP to enable NetFlow on an interface, you must identify the SNMP interface
number on the router. To identify the interface number for the interface on which you want to enable
NetFlow, perform the steps in this required task.
SUMMARY STEPS
1.
enable
2.
3.
Repeat Step 2 to identify the SNMP interface number for any other interfaces on which you plan to
enable NetFlow.
DETAILED STEPS
Step 1
enable
Enters privileged EXEC mode. Enter the password if prompted.
Router> enable
Step 2
Step 3
Repeat Step 2 to identify the SNMP interface number for any other interfaces on which you plan to
enable NetFlow.
Note
This task provides the minimum information required to configure NetFlow on your Cisco 6500 series
switch. See the Catalyst 6500 Series Cisco IOS Software Configuration Guide, for more information of
configuring NetFlow on your switch.
SUMMARY STEPS
Router CLI Commands
1.
enable
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
2.
configure terminal
3.
4.
5.
6.
exit
7.
8.
end
SNMP Commands
1.
2.
3.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# mls flow ip interface-full
Step 4
Example:
Router(config)# interface GigabitEthernet6/2
10
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 5
Command or Action
Purpose
Example:
Router(config-if)# ip flow ingress
and/or
Example:
Router(config-if)# ip flow egress
Step 6
exit
Example:
Router(config-if)# exit
Step 7
(Optional)
Step 8
end
Example:
Router(config-if)# end
Step 1
Step 2
Command or Action
Purpose
1destination-only
2source-destination
Example:
3full-flow
4source-only
5interface-source-destination
6interface-full
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCINetflowEnable.60 integer 1
Step 3
(Optional)
11
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
4.
5.
exit
6.
7.
end
SNMP Commands
1.
2.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Example:
Router(config)# interface GigabitEthernet6/2
12
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 4
Command or Action
Purpose
Example:
Router(config-if)# ip flow ingress
and/or
Example:
Router(config-if)# ip flow egress
Step 5
exit
Example:
Router(config-if)# exit
Step 6
(Optional)
Step 7
end
Example:
Router(config-if)# end
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfCINetflowEnable.60 integer 1
Step 2
(Optional)
13
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
ip flow-top-talkers
4.
top number
5.
6.
cache-timeout milliseconds
7.
end
SNMP Commands
1.
2.
3.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-top-talkers
Example:
Router(config)# ip flow-top-talkers
Step 4
top number
Example:
Router(config-flow-top-talkers)# top 50
Step 5
Example:
Router(config-flow-top-talkers)#
sort-by packets
14
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 6
Command or Action
Purpose
cache-timeout milliseconds
Example:
Router(config-flow-top-talkers)#
cache-timeout 30000
Step 7
end
Example:
Router(config-flow-top-talkers)# end
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfTopFlowsTopN.0 unsigned 50
15
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 2
Example:
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfTopFlowsCacheTimeout.0 unsigned
30000
16
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Note
When configuring a matching source, destination or nexthop address, both the address and a mask must
be configured. The configuration will remain unchanged until both have been specified.
Note
Note
When you are configuring the Top Talkers feature to match bytes and packets, the values that are
matched are the total number of bytes and packets in the flow so far. For example, it is possible to match
flows containing a specific number of packets, or flows with more or less than a set number of bytes.
For more information on using the match command, see the Cisco IOS NetFlow Command Reference.
Note
Some of the SNMP match criteria options, such as the cnfTopFlowsMatchSrcAddress option, require
that you enter more than one SNMP commands on the same line. For example, snmpset -c private -m
all -v2c 10.4.9.62 cnfTopFlowsMatchSrcAddressType.0 integer 1 cnfTopFlowsMatchSrcAddress.0
decimal 172.16.10.0 cnfTopFlowsMatchSrcAddressMask.0 unsigned 24.
Table 1
SNMP Command
cnfTopFlowsMatchSrcAddress decimal
ip-address
cnfTopFlowsMatchSrcAddressType integer
type1
cnfTopFlowsMatchSrcAddressMask unsigned
mask
cnfTopFlowsMatchDstAddress decimal
ip-address
cnfTopFlowsMatchDstAddressType integer
type1
cnfTopFlowsMatchDstAddressMask unsigned
mask
17
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Table 1
SNMP Command
cnfTopFlowsMatchProtocol integer
protocol-number
cnfTopFlowsMatchSampler string
flow-sampler-name
cnfTopFlowsMatchMinPackets unsigned
minimum-range
cnfTopFlowsMatchMaxPackets unsigned
maximum-range
cnfTopFlowsMatchMinBytes unsigned
minimum-range
cnfTopFlowsMatchMaxPackets unsigned
maximum-range
1. The only IP version type that is currently supported is IPv4 (type 1).
2. tos-value is 6 bits for DSCP, 3 bits for precedence, and 8 bits (one byte) for ToS.
18
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Prerequisites
You must configure NetFlow Top Talkers before you perform this task.
SUMMARY STEPS
Router CLI Commands
1.
enable
2.
configure terminal
3.
ip flow-top-talkers
4.
5.
end
SNMP Commands
1.
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip flow-top-talkers
Example:
Router(config)# ip flow-top-talkers
19
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 4
Command or Action
Purpose
Example:
Router(config-flow-top-talkers)# match source
address 172.16.10.0/24
Step 5
end
Example:
Router(config-flow-top-talkers)# end
20
Note
Note
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Step 1
Command or Action
Purpose
Example:
workstation% snmpset -c private -m all -v2c
10.4.9.62 cnfTopFlowsMatchSrcAddressType.0
integer 1 cnfTopFlowsMatchSrcAddress.0 decimal
172.16.10.0 cnfTopFlowsMatchSrcAddressMask.0
unsigned 24
Note
Note
Note
SUMMARY STEPS
Router CLI Commands
1.
SNMP Command
1.
2.
3.
21
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
How to Configure NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Pr
01
01
01
SrcP
0000
0000
0000
DstP Bytes
0000 4800
0000 4800
0000
800
In this example, even though a maximum of ten top talkers is configured by the top command, only three
top talkers were transmitting data in the network. Therefore, three top talkers are shown, and the 3 flows
processed message is displayed in the output. If you expect more top talkers to be displayed than are
being shown, this condition may possibly be the result of matching criteria, specified by the match
command, that are overly restrictive.
Step 2
Step 3
22
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Configuration Examples for NetFlow Top Talkers
CISCO-NETFLOW-MIB::cnfTopFlowsTCPFlags.1 = Gauge32: 16
CISCO-NETFLOW-MIB::cnfTopFlowsSamplerID.1 = Gauge32: 0
CISCO-NETFLOW-MIB::cnfTopFlowsClassID.1 = Gauge32: 0
CISCO-NETFLOW-MIB::cnfTopFlowsFlags.1 = Gauge32: 0
CISCO-NETFLOW-MIB::cnfTopFlowsBytes.1 = Gauge32: 75
CISCO-NETFLOW-MIB::cnfTopFlowsPackets.1 = Gauge32: 1
Tip
You must convert the source and destination IP addresses from hexadecimal to dotted decimal format
used in the display output before you can correlate them to source and destination hosts on your network.
For example, in the display output above: 0A 04 09 02 = 10.4.9.2 and 0A 04 09 AF = 10.4.9.175.
Configuring NetFlow Top Talkers Match Criteria Using SNMP Commands: Example, page 24
The following output from the network management workstation shows the command and the response
for specifying 5 as the maximum number of top talkers that will be retrieved by a NetFlow top talkers
query:
workstation% snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsTopN.0 unsigned 5
CISCO-NETFLOW-MIB::cnfTopFlowsTopN.0 = Gauge32: 5
The following output from the network management workstation shows the command and the response
for specifying the sort criteria for the top talkers:
workstation% snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsSortBy.0 integer 2
CISCO-NETFLOW-MIB::cnfTopFlowsSortBy.0 = INTEGER: byPackets(2)
The following output from the network management workstation shows the command and the response
for specifying the amount of time that the list of top talkers is retained:
workstation% snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsCacheTimeout.0 unsigned
2000
CISCO-NETFLOW-MIB::cnfTopFlowsCacheTimeout.0 = Gauge32: 2000 milliseconds
23
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Additional References
Source IP address172.16.23.0
IP address typeIPv4
The following output from the network management workstation shows the snmpset command and the
response for specifying the class-map my-class-map as aNetFlow Top Talkers match criterion:
workstation% snmpset -c private -m all -v2c 10.4.9.62 cnfTopFlowsMatchClass.0 s
my-class-map
CISCO-NETFLOW-MIB::cnfTopFlowsMatchClass.0 = STRING: my-class-map.
Additional References
The following sections provide references related to the NetFlow MIB and Top Talkers feature.
Related Documents
Related Topic
Document Title
The minimum information about and tasks required for Getting Started with Configuring NetFlow and NetFlow Data Export
configuring NetFlow and NetFlow Data Export
Tasks for configuring NetFlow to capture and export
network traffic data
24
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Additional References
Related Topic
Document Title
Tasks for detecting and analyzing network threats with Detecting and Analyzing Network Threats With NetFlow
NetFlow
Tasks for configuring NetFlow Reliable Export With
SCTP
Information for installing, starting, and configuring the Cisco CNS NetFlow Collection Engine Documentation
CNS NetFlow Collection Engine
Standards
Standards
Title
MIBs
MIBs
MIBs Link
CISCO-NETFLOW-MIB
RFCs
RFCs
Title
25
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Feature Information for Configuring NetFlow Top Talkers using the Cisco IOS CLI or SNMP Commands
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support website contains
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
Note
26
Table 2 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Feature Information for Configuring NetFlow Top Talkers using the Cisco IOS CLI or SNMP Commands
Table 2
Feature Information for Configuring NetFlow Top Talkers using the Cisco IOS CLI or SNMP Commands
Feature Name
Releases
NetFlow MIB
12.3(7)T,
12.2(25)S
12.2(27)SBC
12.3(11)T,
12.2(25)S
12.2(27)SBC
12.2(33)SXH
CCDE, CCENT, CCSI, Cisco Eos, Cisco HealthPresence, Cisco IronPort, the Cisco logo, Cisco Lumin, Cisco Nexus, Cisco Nurse Connect,
Cisco Pulse, Cisco StackPower, Cisco StadiumVision, Cisco TelePresence, Cisco Unified Computing System, Cisco WebEx, DCE, Flip Channels,
Flip for Good, Flip Mino, Flipshare (Design), Flip Ultra, Flip Video, Flip Video (Design), Instant Broadband, and Welcome to the Human Network
are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Capital, Cisco Capital (Design), Cisco:Financed (Stylized), Cisco Store,
and Flip Gift Card are service marks; and Access Registrar, Aironet, AllTouch, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP,
CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems,
Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, Continuum, EtherFast, EtherSwitch, Event Center,
Explorer, Fast Step, Follow Me Browsing, FormShare, GainMaker, GigaDrive, HomeLink, iLYNX, Internet Quotient, IOS, iPhone, iQuick Study,
IronPort, the IronPort logo, Laser Link, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers,
Networking Academy, Network Registrar, PCNow, PIX, PowerKEY, PowerPanels, PowerTV, PowerTV (Design), PowerVu, Prisma, ProConnect,
ROSA, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx,
and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0908R)
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.
20052009 Cisco Systems, Inc. All rights reserved.
27
Configuring NetFlow Top Talkers using Cisco IOS CLI Commands or SNMP Commands
Feature Information for Configuring NetFlow Top Talkers using the Cisco IOS CLI or SNMP Commands
28
This module contains information about and instructions for configuring NetFlow and NetFlow Data
Export (NDE) for capturing and exporting data from IP version 6 (IPv6) traffic flows using the NetFlow
version 9 (v9) export format.
Contents
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
source-onlyThe cache contains one entry for each source IP address. All flows from a given
source IP address use this entry.
destinationThe cache contains one entry for each destination IP address. All flows to a given
destination IP address use this entry.
destination-sourceThe cache contains one entry for each source and destination IP address pair.
All flows between the same source and destination IP addresses use this entry.
fullA separate cache entry is created for each IP flow. A full entry includes the source IP address,
destination IP address, protocol, and protocol interfaces.
full-interfaceAdds the source VLAN SNMP ifIndex to the information in the full flow mask.
See the Configuring NetFlow and NDE chapter of the Cisco 7600 Series Cisco IOS Software
Configuration Guide, Release 12.2SR, for detailed information on NetFlow flow masks and flow
records.
The use of templates with the NetFlow version 9 export format provides several other key benefits:
You can export almost any information from a router or switch, including Layer 2 through 7
information, routing information, IP version 6 (IPv6), IP version 4 (IPv4), multicast, and
Multiprotocol Label Switching (MPLS) information. This new information allows new applications
for export data and new views of network behavior.
Third-party business partners who produce applications that provide NetFlow collector or
display services for NetFlow are not required to recompile their applications each time a new
NetFlow export field is added. Instead, they can use an external data file that documents the known
template formats.
New features can be added to NetFlow more quickly, without breaking current implementations.
NetFlow is future-proofed against new or developing protocols, because the version 9 export
format can be adapted to provide support for them and for other non-NetFlow-based approaches to
data collection.
Bytes
Field Name
Description
01
Version
23
Count
47
System Uptime
811
UNIX Seconds
1215
Sequence Number
1619
Source ID
The Source ID field is a 32-bit value that is used to guarantee uniqueness for each flow exported from a particular device. (The Source ID
field is the equivalent of the engine type and engine ID fields found in
the NetFlow version 5 and version 8 headers.) The format of this field
is vendor specific. In Ciscos implementation, the first two bytes are
reserved for future expansion and are always zero. Byte 3 provides
uniqueness with respect to the routing engine on the exporting device.
Byte 4 provides uniqueness with respect to the particular line card or
Versatile Interface Processor on the exporting device. Collector
devices should use the combination of the source IP address and the
Source ID field to associate an incoming NetFlow export packet with a
unique instance of NetFlow on a particular device.
Figure 1 shows a typical example of exporting data using the NetFlow version 9 export format.
NetFlow Version 9 Export Format Packet Example
Header
First Template FlowSet
Template Record
First Record FlowSet
(Template ID 256)
First data Record
Second Data Record
Second Template Flow Set
Template Record
Template Record
Second Record FlowSet
(Template ID 257)
Data Record
Data Record
Data Record
Data Record
121979
Figure 1
Additional information about the NetFlow export format version 9 and the export format architecture is
available in the NetFlow version 9 Flow-Record Format document.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ipv6 unicast-routing
4.
5.
6.
ip flow-export version 9
7.
8.
9.
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ipv6 unicast-routing
Example:
Router(config)# ipv6 unicast-routing
Step 4
Example:
Router(config)# mls flow ipv6 interface-full
Step 5
Example:
Route(config)# mls nde sender
Step 6
ip flow-export version 9
Example:
Router(config)# ip flow-export version 9
Step 7
Example:
Router(config)# ip flow-export destination
172.16.10.2 88
Step 8
Command or Action
Purpose
Example:
Router(config)# interface fastethernet 1/1
Step 9
Example:
Router(config-if)# ipv6 address
2001:0DB8:AB::2/64
Examples
The following output of the show mls nde command verifies that NDE is enabled on the router.
Router#show mls nde
NetFlow Data Export enabled
Exporting flows to 10.30.30.2 (12345) 172.16.10.2 (88)
Exporting flows from 10.4.9.149 (58970)
Version: 9
Layer2 flow creation is disabled
Layer2 flow export is disabled
Include Filter not configured
Exclude Filter not configured
Total NetFlow Data Export Packets are:
0 packets, 0 no packets, 0 records
Total NetFlow Data Export Send Errors:
IPWRITE_NO_FIB = 0
IPWRITE_ADJ_FAILED = 0
IPWRITE_PROCESS = 0
IPWRITE_ENQUEUE_FAILED = 0
IPWRITE_IPC_FAILED = 0
IPWRITE_OUTPUT_FAILED = 0
IPWRITE_MTU_FAILED = 0
IPWRITE_ENCAPFIX_FAILED = 0
NetFlow Aggregation Disabled
Additional References
The following sections provide references related to the NDE for VRF Interfaces feature.
Related Documents
Related Topic
Document Title
Platform-independent NetFlow commands, complete Cisco IOS NetFlow Command Reference, Release 12.2SR
command syntax, command mode, defaults, command
history, usage guidelines, and examples.
Standards
Standard
Title
MIBs
MIB
MIBs Link
RFCs
RFC
Title
RFC 3954
Technical Assistance
Description
Link
http://www.cisco.com/techsupport
The Cisco Technical Support & Documentation
website contains thousands of pages of searchable
technical content, including links to products,
technologies, solutions, technical tips, tools, and
technical documentation. Registered Cisco.com users
can log in from this page to access even more content.
Note
Table 2
Table 2 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
Feature Information
12.2(33)SRB
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.
20072010 Cisco Systems, Inc. All rights reserved.
The NetFlow data export (NDE) for VRF Interfaces feature enables the creation and export of hardware
NetFlow cache entries for traffic entering a router on the last multi-protocol label switching (MPLS) hop
of an IPv4 MPLS virtual private network (VPN). The NDE for VRF Interfaces feature also ensures that
the data collected in the hardware NetFlow cache for traffic that is received on an IPv4 interface
configured for a per-site forwarding table (VRF) contains the routing information specific to the VRF.
Contents
How to Configure NDE for VRF Interfaces for an MPLS VPN, page 6
Americas Headquarters:
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Analysis of Traffic Exiting the MPLS VPN Network with NetFlow, page 3
IP
network
MPLS
network
MPLS
network
IP
network
Host A
Host B
PE1
P1
P2
PE2
CE2
119118
CE1
Owned by
service provider
For more information about configuring MPLS on Cisco 7600 series routers, see the chapter Configuring
PFC3BXL and PFC3B Multiprotocol Label Switching (MPLS) in the Cisco 7600 Series Cisco IOS
Software Configuration Guide.
Example of a Router (PE2) Receiving Traffic over a MPLS VPN VRF Interface
VPN red
FE0/1
10.2.0.2/24
CE2
MPLS core
Hosts
10.2.0.1/24
FE0/0
FE0/0
172.16.2.2/24
MPLS traffic
PE2
10.3.0.1/24
FE0/1
FE0/1
10.3.0.2/24
Hosts
230539
CE3
When you configure a MPLS VPN on a PE router the router allocates an aggregate MPLS label for the
VPN.
Since aggregate MPLS labels correspond to the VRF to which a packet belongs, the router must consult
the routing table for a VRF to determine the correct next hop IP address within the VPN domain in order
to forward the packet. The next-hop IP address is required before the router can forward the packet
because VPN domains are capable of supporting multiple next hop routers. For example, in Figure 2
there are two CE routers: CE2 and CE3. MPLS traffic arriving on VPN Red on PE1 could be destined to
hosts attached to either CE2 or CE3. PE2 must perform another lookup to identify the correct CE router
to which the traffic must be forwarded. The method that PE2 uses to perform the next-hop IP address
lookup depends on the number of MPLS aggregate labels that the router has stored.
2.
A lookup in the VPN CAM is performed for the MPLS aggregation label.
3.
The MPLS aggregation label is removed and the corresponding VPN ID for the packet is identified.
4.
The index from the VPN CAM is used to reference the MPLS VPN routing table.
5.
A lookup is performed for the destination IP prefix in the VPN VRF that was derived from the MPLS
VPN table. The lookup result contains the next hop IP address and all other rewrite information
needed for forwarding the packet to the correct CE router.
Note
The first 511 MPLS aggregate labels remain in the VPN CAM and are processed based on the steps in
the Stored MPLS Aggregate Labels section on page 4.
The following steps are performed by a PE router to forward MPLS traffic when the aggregate MPLS
label is not in the VPN CAM:
1.
2.
The MPLS label is popped and the reserved VLAN associated with the MPLS aggregation label is
assigned to the packet.
Note
When the number of MPLS aggregate labels exceeds 511, a reserved VLAN interface is assigned
for each new MPLS aggregate label.
3.
The VPN ID for the reserved VLAN ID is derived from the VLAN RAM. The VPN ID is used as a
part of the lookup key for the IP VRF Cisco express forwarding (CEF) lookup.
4.
The IP VRF CEF lookup result contains the next hop IP address and all other rewrite information
needed for forwarding the packet to the correct CE router.
MPLS-Specific Labels
For the nonaggregate label case, by definition, the router does not need to examine the underlying IP
packet to determine where to route the packet. In order to cause the IP flows to populate the cache, the
flow hardware mpls-vpn ip vrf-id configuration command must be entered. This causes the specific
label flow traffic to be stripped of its label and recirculated to the reserved VPN VLAN prior to being
forwarded to the exit interface. This introduces more delay in forwarding the traffic than would
otherwise be experienced.
Note
The steps required to configure NetFlow data export (NDE) for data in the NetFlow cache are provided
in the How to Configure NDE for VRF Interfaces for an MPLS VPN section on page 6.
Note
This task does not include the commands to configure open shortest path first (OSPF) and border
gateway protocol (BGP) that are required to activate the MPLS VPN between routers PE1 and PE2. See
the Configuration Examples for NDE for VRF Interfaces section on page 11 for the complete
configurations for all of the devices in the example network in Figure 3.
Figure 3
VRF Red
rd 100:1
rt 100:1
OSPF
172.16.1.2/24
FE1/1
10.1.0.2/24
FE0/0
Hosts
CE1
G5/2
10.1.0.1/24
FE0/1
172.16.1.1/24
Lo0 172.20.1.2/32
P1
FE0/0
172.16.2.2/24
PE2
10.2.0.1/24
FE0/1
FE0/1
10.2.0.2/24
CE2
Hosts
Lo0 10.2.2.2/32
230538
Lo0 10.1.1.1/32
PE1
172.16.2.1/24
FE0/0
eBGP or other
routing protocol
iBGP peers
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip vrf vrf-id
4.
rd route-distinguisher
5.
6.
7.
8.
exit
9.
eBGP or other
routing protocol
DETAILED STEPS
Step 1
Command or Action
Purpose
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip vrf vrf-id
Example:
Router(config)# ip vrf red
Step 4
rd route-distinguisher
Example:
Router(config)# rd 200:2
Step 5
Example:
Router(config)# route-target both 200:20
Step 6
Example:
Router(config)# interface loopback 0
Step 7
Command or Action
Purpose
Example:
Router(config-if)# ip address 172.20.1.2
255.255.255.0
Step 8
exit
Example:
Router(config-if)# exit
Step 9
Example:
Router(config)# mpls label protocol ldp
Step 10
Example:
Router(config)# mpls ldp router-id loopback0
Step 11
Example:
Router(config-if)# interface fastethernet1/1
Step 12
Example:
Router(config-if)# ip address 172.16.1.2
255.255.255.0
Step 13
mpls ip
Example:
Router(config-if)# mpls ip
Step 14
ip flow ingress
Example:
Router(config-if)# ip flow ingress
Step 15
Example:
Router(config)# interface GigabitEthernet5/2
Step 16
Example:
Router(config-if)# ip vrf forwarding red
Step 17
Command or Action
Purpose
Example:
Router(config-if)# ip address 10.1.0.1
255.255.255.0
Step 18
exit
Example:
Router(config-if)# exit
Step 19
Example:
Router(config)# mls nde sender
Step 20
Example:
Router(config)# mls flow ip
interface-destination-source
Step 21
ip flow-export version 9
Example:
Router(config)# ip flow-export version 9
Step 22
Example:
Step 23
Enables the NDE for VRF Interfaces feature for the VRF.
Example:
Router(config)# flow hardware mpls-vpn ip red
Examples
The following output of the show mls nde command displays the NDE configuration and statistics.
PE1# show mls nde
Netflow Data Export enabled
Exporting flows to 172.16.2.6 (99)
Exporting flows from 172.16.1.2 (51203)
Version: 9
Layer2 flow creation is disabled
Layer2 flow export is disabled
Include Filter not configured
Exclude Filter not configured
Total Netflow Data Export Packets are:
4 packets, 0 no packets, 19 records
Total Netflow Data Export Send Errors:
IPWRITE_NO_FIB = 0
IPWRITE_ADJ_FAILED = 0
IPWRITE_PROCESS = 0
IPWRITE_ENQUEUE_FAILED = 0
IPWRITE_IPC_FAILED = 0
IPWRITE_OUTPUT_FAILED = 0
IPWRITE_MTU_FAILED = 0
IPWRITE_ENCAPFIX_FAILED = 0
Netflow Aggregation Disabled
PE1#
The following output of the show mls netflow ip module command displays the Netflow entries in the
PFC. The first row of output shows traffic on VPN red.
Note
Module 5 is the active supervisor 720 on this Cisco 7600 series router.
Router# show mls netflow ip module 5
Displaying Netflow entries in module 5
DstIP
SrcIP
Prot:SrcPort:DstPort Src i/f
:AdjPtr
----------------------------------------------------------------------------Pkts
Bytes
Age
LastSeen Attributes
--------------------------------------------------10.1.1.1
10.2.0.2
0
:0
:0
vpn:red
:0x0
504
398020
1
23:20:48
L3 - Dynamic
224.0.0.5
172.16.1.1
89 :0
:0
Fa1/1
:0x0
1
84
7
23:20:42
L2 - Dynamic
0.0.0.0
0.0.0.0
0
:0
:0
-:0x0
2238
1582910
33
23:20:48
L3 - Dynamic
224.0.0.2
172.16.1.1
udp :646
:646
Fa1/1
:0x0
5
310
21
23:20:46
L2 - Dynamic
172.16.2.6
172.16.1.2
0
:0
:0
Fa1/1
:0x0
1
140
22
23:20:27
L2 - Dynamic
Router#
The following output of the show ip cache flow command displays the data in the NetFlow cache. The
last line of data in the output shows that the source interface for this traffic is VPN Red.
PE1# show ip cache flow
------------------------------------------------------------------------------MSFC:
IP packet size distribution (3139 total packets):
1-32
64
96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .685 .309 .000 .000 .000 .000 .003 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 278544 bytes
2 active, 4094 inactive, 56 added
20904 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 33992 bytes
0 active, 1024 inactive, 4 added, 4 added to flow
0 alloc failures, 0 force free
1 chunk, 2 chunks added
last clearing of statistics never
10
Protocol
-------TCP-BGP
TCP-other
UDP-other
IP-other
Total:
SrcIf
Fa1/1
Fa1/1
Total
Flows
10
6
28
6
50
SrcIPaddress
172.16.1.1
172.16.1.1
Flows
/Sec
0.0
0.0
0.0
0.0
0.0
Packets Bytes
/Flow /Pkt
1
49
2
49
74
63
153
80
60
68
DstIf
Null
Null
DstIPaddress
224.0.0.2
224.0.0.5
Pr SrcP DstP
11 0286 0286
59 0000 0000
Pkts
74
33
------------------------------------------------------------------------------PFC:
Displaying Hardware entries in Module 5
SrcIf
SrcIPaddress
DstIPaddress
Fa1/1
172.20.1.2
172.20.1.3
Fa1/1
172.20.1.3
172.20.1.2
Fa1/1
172.16.1.2
172.16.2.6
Fa1/1
172.16.1.1
224.0.0.2
-0.0.0.0
0.0.0.0
vpn:red
10.2.0.2
10.1.1.1
.
.
.
PE1#
Pr
0
0
0
udp
0
0
SrcP
0
0
0
646
0
0
Dss
0
0
0
64
0
0
Configurations for the Example Network with One MPLS VPN: Example, page 11
Configuring the NDE for VRF Interfaces Feature on a VRF: Example, page 15
Configurations for the Example Network with One MPLS VPN: Example
This section contains the configurations for all of the devices in Figure 3. The NDE for VRF Interfaces
feature is configured on routers PE1 and PE2.
CE1
!
hostname CE1
!
ip cef
!
interface Loopback0
no shutdown
ip address 10.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no shutdown
ip address 10.1.0.2 255.255.255.0
!
11
ip default-network 0.0.0.0
ip route 0.0.0.0 0.0.0.0 10.1.0.1
!
end
PE1
!
hostname PE1
!
ip cef distributed
!
mls nde sender
mls flow ip interface-destination-source
ip flow-export destination 172.16.2.6 99
ip flow-export version 9
!
ip vrf red
rd 200:2
route-target export 200:20
route-target import 200:20
!
flow hardware mpls-vpn ip red
!
multilink bundle-name authenticated
mpls label protocol ldp
!
interface Loopback0
ip address 172.20.1.2 255.255.255.255
!
interface gigabitEthernet5/2
no shutdown
ip vrf forwarding red
ip address 10.1.0.1 255.255.255.0
!
interface FastEthernet1/1
no shutdown
interface FastEthernet1/1
ip address 172.16.1.2 255.255.255.0
ip flow ingress
mpls ip
!
router ospf 100
router-id 172.20.1.2
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 0
network 172.20.1.2 0.0.0.0 area 0
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 172.0.0.0 mask 255.0.0.0
neighbor as200 peer-group
neighbor as200 remote-as 200
neighbor as200 description as200
neighbor as200 update-source Loopback0
neighbor as200 route-reflector-client
neighbor 172.20.1.4 remote-as 200
neighbor 172.20.1.4 description iBGP with r4
neighbor 172.20.1.4 update-source Loopback0
no auto-summary
!
address-family vpnv4
12
P1
!
hostname P1
!
ip cef
!
no ip domain lookup
!
mpls label protocol ldp
!
interface Loopback0
no shutdown
ip address 172.20.1.3 255.255.255.255
!
interface FastEthernet0/0
no shutdown
ip address 172.16.2.1 255.255.255.0
mpls ip
!
interface FastEthernet0/1
no shutdown
ip address 172.16.1.1 255.255.255.0
mpls ip
!
router ospf 100
router-id 172.20.1.3
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 0
network 172.20.1.3 0.0.0.0 area 0
!
mpls ldp router-id Loopback0
!
end
PE2
!
hostname PE2
!
ip cef distributed
!
mls nde sender
mls flow ip interface-destination-source
ip flow-export destination 172.16.2.6 99
ip flow-export version 9
!
13
ip vrf red
rd 200:2
route-target export 200:20
route-target import 200:20
!
flow hardware mpls-vpn ip red
!
multilink bundle-name authenticated
mpls label protocol ldp
!
interface Loopback0
no shutdown
ip address 172.20.1.4 255.255.255.255
!
interface FastEthernet0/0
no shutdown
ip address 172.16.2.2 255.255.255.0
mpls ip
ip flow ingress
!
interface FastEthernet0/1
no shutdown
ip vrf forwarding red
ip address 10.2.0.1 255.255.255.0
!
router ospf 100
router-id 172.20.1.4
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 0
network 172.20.1.4 0.0.0.0 area 0
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 172.0.0.0 mask 255.0.0.0
neighbor as200 peer-group
neighbor as200 remote-as 200
neighbor as200 description as200
neighbor as200 update-source Loopback0
neighbor as200 route-reflector-client
neighbor 172.20.1.2 remote-as 200
neighbor 172.20.1.2 description iBGP with r2
neighbor 172.20.1.2 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 172.20.1.2 activate
neighbor 172.20.1.2 send-community both
exit-address-family
!
address-family ipv4 vrf red
no synchronization
network 10.2.0.0 mask 255.255.255.0
network 10.2.2.2 mask 255.255.255.255
exit-address-family
!
ip route 172.0.0.0 255.0.0.0 Null0
ip route vrf red 10.2.2.2 255.255.255.255 10.2.0.2
!
mpls ldp router-id Loopback0
!
end
14
CE2
!
hostname CE2
!
ip cef
!
interface Loopback0
no shutdown
ip address 10.2.2.2 255.255.255.255
!
interface FastEthernet0/1
no shutdown
ip address 10.2.0.2 255.255.255.0
!
ip default-network 0.0.0.0
ip route 0.0.0.0 0.0.0.0 10.2.0.1
!
end
Where to Go Next
See the Configuring NetFlow and NDE chapter of the Cisco 7600 Series Cisco IOS Software
Configuration Guide, for more information on configuring NetFlow features on Cisco 7600 series
routers.
15
See the Configuring PFC3BXL and PFC3B Mode Multiprotocol Label Switching (MPLS) chapter
of the Cisco 7600 Series Cisco IOS Software Configuration Guide, for more information on
configuring MPLS features on Cisco 7600 series routers.
Additional References
The following sections provide references related to the NDE for VRF Interfaces feature.
Related Documents
Related Topic
Document Title
Information for configuring NetFlow, MPLS, and other Cisco 7600 Series Cisco IOS Software Configuration Guide
features on Cisco 7600 series routers.
Standards
Standard
Title
MIBs
MIB
MIBs Link
RFCs
RFC
Title
16
Technical Assistance
Description
Link
Note
Table 1
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given
Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS
software release train also support that feature.
Feature Name
Releases
Feature Information
12.2(33)SRB
15.0(1)S
17
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.
20052010 Cisco Systems, Inc. All rights reserved.
18