Net Flow
Net Flow
Use Cisco Feature Navigator to find information about platform support and Cisco software image support.
To access Cisco Feature Navigator, go to [Link]/go/cfn. An account on [Link] is not required.
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.
Note In Cisco IOS 12.2S releases, egress NetFlow captures either IPv4 packets or MPLS packets as they leave
the router.
The Egress NetFlow Accounting feature counts CEF-switched packets only. Process-switched transit packets
are not counted.
NetFlow captures data for all egress (outgoing) packets through the use of the following features:
• Egress NetFlow Accounting--NetFlow gathers statistics for all egress packets for IP traffic only.
• NetFlow MPLS Egress--NetFlow gathers statistics for all egress MPLS-to-IP packets.
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.
Configuring NetFlow and NetFlow Data Export Using the Version 9 Export
Format
Perform this task to configure NetFlow and NetFlow Data Export using the Version 9 export format.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip flow-export destination {ip-address | hostname} udp-port
4. Repeat Step 3 once to configure a second NetFlow export destination.
5. ip flow-export version 9
6. interface interface-type interface-number
7. ip flow {ingress | egress}
8. exit
9. Repeat Steps 6 through 8 to enable NetFlow on other interfaces
10. end
DETAILED STEPS
Example:
Router# configure terminal
Step 3 ip flow-export destination {ip-address | (Optional) IP address or hostname of the workstation to which you want
hostname} udp-port to send the NetFlow information and the number of the UDP port on
which the workstation is listening for this input.
Example: Note The workstation is running an application such as NetFlow
Router(config)# ip flow-export Collection Engine (NFC) that is used to analyze the exported
destination [Link] 99 data.
Step 4 Repeat Step 3 once to configure a second (Optional) You can configure a maximum of two export destinations
NetFlow export destination. for NetFlow.
Step 5 ip flow-export version 9 (Optional) Enables the export of information in NetFlow cache entries.
• The version 9keyword specifies that the export packet uses the
Example: Version 9 format.
Router(config)# ip flow-export version
9 Caution Entering this command on a Cisco 12000 Series Internet
Router causes packet forwarding to stop for a few seconds
while NetFlow reloads the route processor and line card CEF
tables. To avoid interruption of service to a live network,
apply this command during a change window, or include it
in the startup-config file to be executed during a router reboot.
Step 8 exit (Optional) Exits interface configuration mode and returns to global
configuration mode.
Example: Note You only need to use this command if you want to enable
Router(config-if)# exit NetFlow on another interface.
SUMMARY STEPS
DETAILED STEPS
Example:
Router# show ip flow interface
Ethernet0/0
ip flow ingress
Example:
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 SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts
Et0/0 [Link] Et1/0.1 [Link] 01 0000 0C01 51
Et0/0 [Link] Null [Link] 11 0043 0043 51
Et0/0 [Link] Null [Link] 11 0045 0045 51
Et0/0 [Link] Et1/0.1 [Link] 01 0000 0800 51
Et0/0 [Link] Null [Link] 11 0044 0044 51
Et0/0 [Link] Null [Link] 11 00A2 00A2 51
Et0/0 [Link] Et1/0.1 [Link] 06 0014 0014 50
Et0/0 [Link] Et1/0.1 [Link] 06 0015 0015 52
.
.
.
Et0/0 [Link] Et1/0.1 [Link] 06 0087 0087 50
Et0/0 [Link] Et1/0.1 [Link] 06 0050 0050 51
Et0/0 [Link] Et1/0.1 [Link] 06 0089 0089 49
Et0/0 [Link] Et1/0.1 [Link] 06 0050 0050 50
Et0/0 [Link] Et1/0.1 [Link] 01 0000 0800 51
Et0/0 [Link] Null [Link] 06 027C 027C 49
Example:
Router# show ip cache verbose flow
IP packet size distribution (1130681 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
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 SrcIPaddress DstIf DstIPaddress Pr TOS Flgs Pkts
Port Msk AS Port Msk AS NextHop B/Pk Active
Et0/0 [Link] Et1/0.1 [Link] 01 00 10 799
0000 /0 0 0C01 /0 0 [Link] 28 1258.1
Et0/0 [Link] Null [Link] 11 00 10 799
0043 /0 0 0043 /0 0 [Link] 28 1258.0
Et0/0 [Link] Null [Link] 11 00 10 799
0045 /0 0 0045 /0 0 [Link] 28 1258.0
Et0/0 [Link] Et1/0.1 [Link] 01 00 10 799
0000 /0 0 0800 /0 0 [Link] 28 1258.1
Et0/0 [Link] Null [Link] 11 00 10 799
0044 /0 0 0044 /0 0 [Link] 28 1258.1
.
.
.
Et0/0 [Link] Et1/0.1 [Link] 06 00 00 799
0087 /0 0 0087 /0 0 [Link] 40 1258.1
Et0/0 [Link] Et1/0.1 [Link] 06 00 00 799
0050 /0 0 0050 /0 0 [Link] 40 1258.0
Et0/0 [Link] Et1/0.1 [Link] 06 00 00 798
0089 /0 0 0089 /0 0 [Link] 40 1256.5
Et0/0 [Link] Et1/0.1 [Link] 06 00 00 799
0050 /0 0 0050 /0 0 [Link] 40 1258.0
Et0/0 [Link] Et1/0.1 [Link] 01 00 10 799
0000 /0 0 0800 /0 0 [Link] 1500 1258.1
Et0/0 [Link] Null [Link] 06 00 00 798
027C /0 0 027C /0 0 [Link] 40 1256.4
SUMMARY STEPS
DETAILED STEPS
Example:
Router# show ip flow export
Flow export v9 is enabled for main cache
Exporting flows to [Link] (99)
Exporting using source interface Ethernet0/0
Version 9 flow records
0 flows exported in 0 udp datagrams
0 flows failed due to lack of export packet
0 export packets were sent up to process level
0 export packets were dropped due to no fib
0 export packets were dropped due to adjacency issues
0 export packets were dropped due to fragmentation failures
0 export packets were dropped due to encapsulation fixup failures
configure terminal
!
interface ethernet 0/0
ip flow egress
!
configure terminal
!
interface ethernet 0/0.1
ip flow ingress
!
configure terminal
!
interface ethernet 1/0.1
ip flow egress
!
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.
configure terminal
!
ip flow-export destination [Link] 9991
ip flow-export destination [Link] 9991
!
Note You can configure a maximum of two export destinations for the main cache and for each aggregation
cache.
Example Configuring 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 [Link] 9991
ip flow-export version 9
!
!
interface GigabitEthernet2/0/0.10
encapsulation dot1Q 10
ip flow egress
pppoe enable
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:
interface Virtual-Template 1
ip unnumbered ethernet 0
encapsulation ppp
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.
Additional References
Related Documents
Tasks for configuring NetFlow to capture and export Configuring NetFlow and NetFlow Data Export
network traffic data
Tasks for configuring Configuring MPLS Aware Configuring MPLS Aware NetFlow
NetFlow
Tasks for configuring MPLS egress NetFlow Configuring MPLS Egress NetFlow Accounting and
accounting Analysis
Tasks for configuring NetFlow input filters Using NetFlow Filtering or Sampling to Select the
Network Traffic to Track
Tasks for configuring NetFlow aggregation caches Configuring NetFlow Aggregation Caches
Tasks for configuring NetFlow BGP next hop support Configuring NetFlow BGP Next Hop Support for
Accounting and Analysis
Tasks for configuring NetFlow multicast support Configuring NetFlow Multicast Accounting
Tasks for detecting and analyzing network threats Detecting and Analyzing Network Threats With
with NetFlow NetFlow
Tasks for configuring NetFlow Reliable Export With NetFlow Reliable Export With SCTP
SCTP
Tasks for configuring NetFlow Layer 2 and Security NetFlow Layer 2 and Security Monitoring Exports
Monitoring Exports
Tasks for configuring the SNMP NetFlow MIB Configuring SNMP and using the NetFlow MIB to
Monitor NetFlow Data
Tasks for configuring the NetFlow MIB and Top Configuring NetFlow Top Talkers using Cisco IOS
Talkers feature CLI Commands or SNMP Commands
Information for installing, starting, and configuring Cisco CNS NetFlow Collection Engine
the CNS NetFlow Collection Engine Documentation
Standards
Standards Title
No new or modified standards are supported , and --
support for existing standards has not been modified.
MIBs
RFCs
RFCs Title
No new or modified RFCs are supported, and support --
for existing RFCs has not been modified .
Technical Assistance
Description Link
The Cisco Support and Documentation website [Link]
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a [Link] user ID
and password.
Table 1: Feature Information for Configuring NetFlow and NetFlow Data Export
NetFlow Multiple Export 12.0(19)S 12.2(2)T 12.2(14)S The NetFlow Multiple Export
Destinations 15.0(1)S Destinations feature enables
configuration of multiple
destinations of the NetFlow data.
The following commands were
modified by this feature: ip
flow-aggregation cache, ip
flow-export destination, and show
ip flow export.
NetFlow Subinterface Support 12.0(22)S 12.2(14)S 12.2(15)T The NetFlow Subinterface Support
feature provides the ability to
enable NetFlow on a
per-subinterface basis.
The following command was
introduced by this feature: ip flow
ingress.
The following command was
modified by this feature: show ip
interface.
Glossary
AS --autonomous 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).
CEF --Cisco Express Forwarding. Layer 3 IP switching technology that optimizes network performance and
scalability for networks with large and dynamic traffic patterns.
BGP --Border 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 hop --IP address of the next hop to be used by a router to reach a certain destination.
dCEF --distributed 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 packet --Type 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 switching --Cisco feature in which a route cache is used to expedite packet switching through a router.
flow --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.
MPLS --Multiprotocol Label Switching. An emerging industry standard for the forwarding of packets along
a normally routed path (sometimes called MPLS hop-by-hop forwarding).
NetFlow --A Cisco IOS application that provides statistics on packets flowing through the router. It is emerging
as a primary network accounting and security technology.
NetFlow Aggregation --A 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 v9 --NetFlow 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.
RP --Route 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.