- Index
- Preface
- Product Overview
- Command-line Interfaces
- Configuring the Switch for the First Time
- Administering the Switch
- Configuring the Cisco IOS In Service Software Upgrade Process
- Configuring Interfaces
- Checking Port Status and Connectivity
- Configuring Supervisor Engine Redundancy Using RPR and SSO
- Configuring Cisco NSF with SSO Supervisor Engine Redundancy
- Environmental Monitoring and Power Management
- Configuring Power over Ethernet
- Configuring Energy Wise
- Configuring the Catalyst 4500 Series Switch with Cisco Network Assistant
- Configuring VLANs, VTP, and VMPS
- Configuring IP Unnumbered Interface
- Configuring Layer 2 Ethernet Interfaces
- Configuring SmartPort Macros
- Auto SmartPort Macro
- Configuring STP and MST
- Configuring Flex Links and the MAC Address-Table Move Update Feature
- Configuring Resilient Ethernet Protocol
- Configuring Optional STP Features
- Configuring EtherChannels
- Configuring IGMP Snooping and Filtering
- Configuring IPv6 MLD Snooping
- Configuring 802.1Q and Layer 2 Protocol Tunneling
- Configuring CDP
- Configuring LLDP and LLDP-MED
- Configuring UDLD
- Configuring Unidirectional Ethernet
- Configuring Layer 3 Interfaces
- Configuring Cisco Express Forwarding
- Configuring Unicast Reverse Path Forwarding
- Configuring IP Multicast
- Configuring ANCP Client
- Configuring Policy-Based Routing
- Configuring VRF-lite
- Configuring Quality of Service
- Configuring Voice Interfaces
- Configuring Private VLANs
- Configuring 802.1X Port-Based Authentication
- Configuring PPPoE Intermediate Agent
- Configuring Web-Based Authentication
- Configuring Port Security
- Configuring Control Plane Policing
- Configuring DHCP Snooping, IP Source Guard, and IPSG for Static Hosts
- Configuring Dynamic ARP Inspection
- Configuring Network Security with ACLs
- IPv6
- Port Unicast and Multicast Flood Blocking
- Configuring Storm Control
- Configuring SPAN and RSPAN
- Configuring System Message Logging
- Configuring SNMP
- Configuring NetFlow
- Configuring Ethernet CFM and OAM
- Configuring Y.1731 (AIS and RDI)
- Configuring Call Home
- Configuring Cisco IOS IP SLAs Operations
- Configuring RMON
- Performing Diagnostics
- Configuring WCCP Version 2 Services
- ROM Monitor
- Configuring MIB Support
- Acronyms
- About NetFlow Statistics Collection
- Information Derived from Hardware
- Information Derived from Software
- Assigning the Input and Output Interface and AS Numbers
- Feature Interaction of NetFlow Statistics with UBRL and Microflow Policing
- VLAN Statistics
- Checking for Required Hardware
- Enabling NetFlow Statistics Collection
- Configuring Switched/Bridged IP Flows
- Exporting NetFlow Statistics
- Managing NetFlow Statistics Collection
- Configuring an Aggregation Cache
- Configuring a NetFlow Minimum Prefix Mask for Router-Based Aggregation
- Configuring NetFlow Aging Parameters
Configuring NetFlow
Note Supervisor Engine 6-E and Catalyst 4900M chassis do not support Netflow; it is only supported on Supervisor Engine IV, Supervisor Engine V, Supervisor Engine V-10GE, or WS-F4531.
This chapter describes how to configure NetFlow Statistics on the Catalyst 4500 series switches. It also provides guidelines, procedures, and configuration examples.
Note To use the NetFlow feature, you must have the Supervisor Engine V-10GE (the functionality is embedded in the supervisor engine), or the NetFlow Services Card (WS-F4531) and either a Supervisor Engine IV or a Supervisor Engine V.
Note For complete syntax and usage information for the switch commands used in this chapter, first look at the Cisco Catalyst 4500 Series Switch Command Reference and related publications at this location:
http://www.cisco.com/en/US/products//hw/switches/ps4324/index.html
If the command is not found in the Catalyst 4500 Command Reference, it will be found in the larger Cisco IOS library. Refer to the Cisco IOS Command Reference and related publications at this location:
http://www.cisco.com/en/US/products/ps6350/index.html
Note Refer to the NetFlow Solutions Guide for more detailed information on NetFlow usage and management.
About NetFlow Statistics Collection
A network flow is defined as a unidirectional stream of packets between a given source and destination —both defined by a network-layer IP address and transport-layer port number. Specifically, a flow is identified as the combination of the following fields: source IP address, destination IP address, source port number, destination port number, protocol type, type of service, and input interface.
NetFlow Statistics is a global traffic monitoring feature that allows flow-level monitoring of all IPv4-routed traffic through the switch using NetFlow Data Export (NDE). Collected statistics can be exported to an external device (NetFlow Collector/Analyzer) for further processing. Network planners can selectively enable NetFlow Statistics (and NDE) on a per-device basis to gain traffic performance, control, or accounting benefits in specific network locations.
NetFlow exports flow information in UDP datagrams in one of two formats. The version 1 format was the initial released version, and version 5 is a later enhancement to add Border Gateway Protocol (BGP) autonomous system (AS) information and flow sequence numbers. In version 1 and version 5 format, the datagram consists of a header and one or more flow records. The first field of the header contains the version number of the export datagram.
This section contains the following subsections:
- Information Derived from Hardware
- Information Derived from Software
- Assigning the Input and Output Interface and AS Numbers
- Feature Interaction of NetFlow Statistics with UBRL and Microflow Policing
- VLAN Statistics
NDE Versions
The Catalyst 4500 series switch supports NDE versions 1 and 5 for the captured statistics. NetFlow aggregation requires NDE version 8.
Depending on the current flow mask, some fields in the flow records might not have values. Unsupported fields contain a zero (0).
The following tables describe the supported fields for NDE version 5:
- Table 54-1 —Version 5 header format
- Table 54-2 —Version 5 flow record format
|
|
|
---|---|---|
|
|
|
|
|||||
---|---|---|---|---|---|---|---|---|
|
|
Source |
Source Interface |
|
Interface |
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
SysUptime at the time the last packet of the flow was received |
|
|
|
|
|
|
||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
Autonomous system number of the source, either origin or peer |
|
|
|
|
|
|
||
Autonomous system number of the destination, either origin or peer |
|
|
|
|
|
|
||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
Information Derived from Hardware
Information available in a typical NetFlow record from hardware includes the following:
Information Derived from Software
Information available in a typical NetFlow record from software includes the following:
Assigning the Input and Output Interface and AS Numbers
Assigning the Inferred Fields
The Catalyst 4500 series switch collects netflow flows in hardware. The hardware collects a sub-set of all the NetFlow flow fields. The rest of the fields are then filled in by the software when the software examines the routing state.
The NetFlow Services Card does not provide enough information to accurately and consistently determine the input interface, output interface and other routing information associated with NetFlow flows. The Catalyst 4500 series switch has a software mechanism to compensate for this. The mechanism is described in the next paragraph.
Assigning the Output Interface and Output-Related Inferred Fields
Software determines the output interface information by looking up the Forwarding Information Base (FIB) entry in the default FIB table (based on the destination IP address). From this FIB entry, the software gains access to the destination AS number for this destination IP address, as well as the appropriate adjacency that stores the interface information. The output interface is based solely on the destination IP address. If load balancing is enabled on the switch, the load balancing hash, instead of looking at the adjacency in the FIB entry, is applied to access the appropriate FIB path and access the appropriate adjacency. Although this process typically yields correct results, an inaccuracy can occur when using a PBR that shares IP addresses with the default FIB table. Under these circumstances, there would then be multiple FIB table entries and associated adjacencies for the same destination IP address.
Assigning the Input Interface and Input-Related Inferred Fields
Similarly, the input interface and the source AS number for the source IP address are determined by looking up the FIB entry in the default FIB table based on the source IP address. The input interface is based solely on the source IP address and a reverse lookup is done to determine to which interface a packet with this IP destination address needs to be routed. This process assumes that the forwarding paths are symmetrical. However, if this process yields multiple input interfaces, a deterministic algorithm is applied to pick one of them the one with the lowest IP address. Although this process typically yields correct values, there are scenarios where the values are inaccurate:
- If load balancing is being applied by an upstream adjacent switch, one input interface must be chosen arbitrarily out of the multiple input interfaces available. This action is necessary because the input interface that would be used depends on the type of load balancing algorithm being deployed by the adjacent upstream switch. It is not always feasible to know the algorithm. All flow statistics are attributed to one input interface. Software selects the interface with the lowest IP subnet number.
- In an asymmetric routing scheme in which the traffic for an IP subnet might be received on one interface and sent on another, the inferences noted previously for selecting an input interface, based on a reverse lookup, would be incorrect and cannot be verified.
- If PBR or VRF is enabled on the switch and the flow is destined to an address that resides in the PBR or VRF range or is sourced from an address that resides in the PBR or VRF range, the information is incorrect. The input and output interface most likely points to the default route (if configured) or have no value at all (NULL)
- If VRF is enabled on the switch on some interfaces and the flow comes from a VRF interface, the information is incorrect. The input and output interface most likely points to the default route (if configured) or have no value (NULL).
Note The Supervisor Engine V-10GE provides the input interface information by using hardware, improving the accuracy of NetFlow information.
Feature Interaction of NetFlow Statistics with UBRL and Microflow Policing
On systems with Supervisor Engine V-10GE, there is a feature interaction between NetFlow Statistics and UBRL (User Based Rate Limiting). As part of correctly configuring UBRL on a given interface, the class map must specify a flow mask. In turn, this flow mask is used to create hardware-based NetFlow statistics for the flow. By default, for traditional full-flow NetFlow statistics, the full-flow mask is used. With UBRL, however, the masks can differ. If UBRL is configured on a given interface, the statistics are collected based on the mask configured for UBRL. Consequently, the system does not collect full-flow statistics for traffic transiting an interface configured with UBRL. For more details, refer to the “Configuring User-Based Rate-Limiting” section.
VLAN Statistics
With NetFlow support, you can report Layer 2 output VLAN statistics, as well as VLAN statistics for routed traffic in and out of a VLAN.
The following example shows the CLI output for a specific VLAN:
Note NetFlow support has hardware limitations that restrict the platform support to a subset of all NetFlow fields. Specifically, TCP Flags and the ToS byte (DSCP) are not supported.
Configuring NetFlow Statistics Collection
To configure NetFlow switching, complete the tasks in these sections:
- Checking for Required Hardware
- Enabling NetFlow Statistics Collection
- Configuring Switched/Bridged IP Flows
- Exporting NetFlow Statistics
- Managing NetFlow Statistics Collection
- Configuring an Aggregation Cache
- Configuring a NetFlow Minimum Prefix Mask for Router-Based Aggregation
- Configuring NetFlow Aging Parameters
Checking for Required Hardware
To ensure that the necessary hardware is enabled, enter the show module command, as follows:
Note Enabling this feature does not impact the hardware-forwarding performance of the switch.
The effective size of the hardware flow cache table is 65,000 flows. (The hardware flow cache for the Supervisor Engine V-10GE is 85,000 flows.) If more than 85,000 flows are active simultaneously, statistics may be lost for some of the flows.
The effective size of the software flow table is 256, 000 flows. The NetFlow software manages the consistency between the hardware and software tables, keeping the hardware table open by purging inactive hardware flows to the software table.
User-configured timeout settings dictate when the flows are purged and exported through NDE from the software cache. Hardware flow management ensures consistency between hardware flow purging and the user-configured timeout settings.
Software-forwarded flows are also monitored. Moreover, statistics overflow if any flow receives traffic at a sustained rate exceeding 2 gigabits per second. Generally, this situation should not occur because a port cannot transmit at a rate higher than 1 gigabit per second.
Note By design, even if the timeout settings are high, flows automatically “age out” as they approach their statistics limit.
Note First and last-seen (start and end times) flow timestamp accuracy is within 3 seconds.
Enabling NetFlow Statistics Collection
Note NetFlow Flow Statistics are disabled by default.
To enable NetFlow switching, first configure the switch for IP routing as described in the IP configuration chapters in the Cisco IOS IP and IP Routing Configuration Guide. After you configure IP routing, perform one of these tasks:
|
|
---|---|
Enables NetFlow with inferred input/output interfaces and source/destination BGP as information. The inter-fields option must be configured for AS information to be determined. |
Configuring Switched/Bridged IP Flows
NetFlow is defined as a collection of routed IP flows created and tracked for all routed IP traffic. In switching environments, considerable IP traffic is switched within a VLAN and is not routed. This traffic is termed switched/bridged IP traffic; the associated flow is termed switched/bridged IP flows. NetFlow hardware is capable of creating and tracking this type of flow. The NetFlow Switched IP Flows feature allows you to create, track, and export switched IP flows (that is, it creates and tracks flows for IP traffic that is being switched and not routed).
- Switched IP flow collection cannot be enabled in isolation on Catalyst 4500 series switches. You need to enable both routed flow and switched flow collection to start collecting switched IP flows.
- Generally, the input and output interface information are NULL. If the traffic is being switched on a VLAN that is associated with an SVI, the input and output interface information points to the same Layer 3 interface.
- Switched flows are exported according to regular export configurations; a separate export CLI does not exist.
- In the main cache, because of a hardware limitation, IP flows and routed IP flows are indistinguishable.
Note To enable switched IP flow collection on all interfaces, you need to enter both the ip flow ingress and
ip flow ingress layer2-switched commands.
Note To enable a user-based rate limiting policy on the switched IP flow traffic, you need to enter the
ip flow ingress layer2-switched command, but not the ip flow ingress command. See “Configuring User-Based Rate-Limiting” section.
To configure the NetFlow cache and enable switched IP flow collection, perform this task:
|
|
|
---|---|---|
This example shows how to display the contents of an IP flow cache that contains switch IP flows:
Exporting NetFlow Statistics
To configure the switch to export NetFlow Statistics to a workstation when a flow expires, perform one of these tasks:
Managing NetFlow Statistics Collection
You can display and clear NetFlow Statistics, including IP flow switching cache information and flow information, such as the protocol, total flow, flows per second, and so forth. You can also use the resulting information to obtain information about your switch traffic.
To manage NetFlow switching statistics, perform one or both of following tasks:
|
|
---|---|
Configuring an Aggregation Cache
Aggregation of NetFlow Statistics is typically performed by NetFlow collection tools on management workstations. By extending this support to the Catalyst 4500 series switch, you can do the following:
- Reduce the required bandwidth between the switch and workstations, because fewer NDE packets are exported.
- Reduce the number of collection workstations required.
- Provide visibility to aggregated flow statistics at the CLI.
To configure an aggregation cache, you must enter the aggregation cache configuration mode, and you must decide which type of aggregation scheme you would like to configure: autonomous system, destination prefix, protocol prefix, or source prefix aggregation cache. Once you define the aggregation scheme, define the operational parameters for that scheme. More than one aggregation cache can be configured concurrently.
To configure an aggregation cache, perform this task:
Verifying Aggregation Cache Configuration and Data Export
To verify the aggregation cache information, perform this task:
|
|
---|---|
To confirm data export, perform the following task:
|
|
---|---|
Displays the statistics for the data export including the main cache and all other enabled caches. |
Configuring a NetFlow Minimum Prefix Mask for Router-Based Aggregation
The minimum prefix mask specifies the shortest subnet mask that is used for aggregating flows within one of the IP-address based aggregation caches (source-prefix, destination-prefix, prefix). In these caches, flows are aggregated based upon the IP address (source, destination, or both, respectively) and masked by the longer of the Minimum Prefix mask and the subnet mask of the route to the source/destination host of the flow (as found in the switch routing table).
Note The default value of the minimum mask is zero. The configurable range for the minimum mask is from 1 to 32. You should chose an appropriate value depending on the traffic. A higher value for the minimum mask provides more detailed network addresses, but it may also result in increased number of flows in the aggregation cache.
To configure a minimum prefix mask for the Router-Based Aggregation feature, perform the tasks described in the following sections. Each task is optional.
Configuring the Minimum Mask of a Prefix Aggregation Scheme
To configure the minimum mask of a prefix aggregation scheme, perform this task:
|
|
|
---|---|---|
Configuring the Minimum Mask of a Destination-Prefix Aggregation Scheme
To configure the minimum mask of a destination-prefix aggregation scheme, perform this task:
|
|
|
---|---|---|
Switch(config)# ip flow-aggregation cache destination-prefix |
||
Configuring the Minimum Mask of a Source-Prefix Aggregation Scheme
To configure the minimum mask of a source-prefix aggregation scheme, perform this task:
|
|
|
---|---|---|
Monitoring and Maintaining Minimum Masks for Aggregation Schemes
To view the configured value of the minimum mask, use the following commands for each aggregation scheme, as needed:
Configuring NetFlow Aging Parameters
You can control when flows are purged from the software flow cache (and, if configured, reported through NDE) with the configuration aging parameters, Active and Inactive, of the ip flow-cache timeout command.
Active Aging specifies the period of time in which a flow should be removed from the software flow cache after the flow is created. Generally, this parameter is used to periodically notify external collection devices about active flows. This parameter operates independently of existing traffic on the flow. Active timeout settings are usually measured in minutes (default is 30 minutes).
Inactive Aging specifies how long to wait before removing a flow after the last packet is seen. The inactive parameter clears the flow cache of stale flows, which prevents new flows from starving (due to lack of resources). Inactive timeout settings are generally on the order of seconds (default is 15 seconds).
NetFlow Statistics Collection Configuration Example
The following example shows how to modify the configuration to enable NetFlow switching. It also shows how to export the flow statistics for further processing to UDP port 9991 on a workstation with the IP address of 40.0.0.2. In this example, existing NetFlow Statistics are cleared, which ensures that the show ip cache flow command displays an accurate summary of the NetFlow switching statistics:
NetFlow Configuration Examples
This section provides the following basic configuration examples:
- NetFlow Enabling Scheme Examples
- NetFlow Aggregation Configuration Examples
- NetFlow Minimum Prefix Mask Router-Based Aggregation Scheme Examples
NetFlow Enabling Scheme Examples
Note Enabling NetFlow on a per- interface basis is not supported on a Catalyst 4500 switch.
This example shows how to enable NetFlow globally:
This example shows how to enable NetFlow with support for inferred fields:
NetFlow Aggregation Configuration Examples
This section provides the following aggregation cache configuration examples:
Autonomous System Configuration
This example shows how to configure an autonomous system aggregation cache with an inactive timeout of 200 seconds, a cache active timeout of 45 minutes, an export destination IP address of 10.42.42.1, and a destination port of 9992:
Destination Prefix Configuration
This example shows how to configure a destination prefix aggregation cache with an inactive timeout of 200 seconds, a cache active timeout of 45 minutes, an export destination IP address of 10.42.42.1, and a destination port of 9992:
Prefix Configuration
This example shows how to configure a prefix aggregation cache with an inactive timeout of 200 seconds, a cache active timeout of 45 minutes, an export destination IP address of 10.42.42.1, and a destination port of 9992:
Protocol Port Configuration
This example shows how to configure a protocol port aggregation cache with an inactive timeout of 200 seconds, a cache active timeout of 45 minutes, an export destination IP address of 10.42.42.1, and a destination port of 9992:
Source Prefix Configuration
This example shows how to configure a source prefix aggregation cache with an inactive timeout of 200 seconds, a cache active timeout of 45 minutes, an export destination IP address of 10.42.42.1, and a destination port of 9992:
NetFlow Minimum Prefix Mask Router-Based Aggregation Scheme Examples
This section provides examples for the NetFlow minimum prefix mask aggregation cache configuration:
Prefix Aggregation Scheme
it is an example of a prefix aggregation cache configuration:
In this example, assume the following configuration:
Both routes have a 27-bit subnet mask in the routing table on the switch.
Flows travelling from the 118.42.20.160 subnet to the 122.16.93.160 subnet whose source IP addresses match with a mask of 27 bits and whose destination IP addresses match with a mask of 28 bits are aggregated together in the cache statistics.
Destination-Prefix Aggregation Scheme
it is an example of a destination-prefix aggregation cache configuration:
Source-Prefix Aggregation Scheme
it is an example of a source-prefix aggregation cache configuration: