Guest

Cisco IOS Software Releases 12.3 T

Egress NetFlow Accounting

Table Of Contents

Egress NetFlow Accounting

Contents

Prerequisites for NetFlow Egress Support

Restrictions for NetFlow Egress Support

Information About NetFlow Egress Support

NetFlow Egress Support

Benefits of NetFlow Egress Support

How to Configure NetFlow Egress Support

Configuring NetFlow Egress Support

Configuration Examples for NetFlow Egress Support

NetFlow Egress Support Configuration: Example

Verifying NetFlow Egress Support Configuration: Example

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Command Reference

flow-sampler

ip flow egress

ip flow-egress input-interface

match (NetFlow)

show ip cache flow

show ip cache verbose flow

show ip flow interface


Egress NetFlow Accounting


NetFlow is a technology that provides highly granular per-flow statistics on traffic in a Cisco router. The NetFlow Egress Support feature allows NetFlow accounting to be implemented for egress (outgoing) traffic on an interface or subinterface.

Feature History for the NetFlow Egress Support Feature

Release
Modification

12.3(11)T

This feature was introduced.


Finding Support Information for Platforms and Cisco IOS Software Images

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.

Contents

Prerequisites for NetFlow Egress Support

Restrictions for NetFlow Egress Support

Information About NetFlow Egress Support

How to Configure NetFlow Egress Support

Configuration Examples for NetFlow Egress Support

Additional References

Command Reference

Prerequisites for NetFlow Egress Support

On of the following switching features must be enabled before the NetFlow Egress Support feature can be implemented:

Cisco Express Forwarding (CEF) switching must be enabled in global configuration mode.
or

Distributed Cisco Express Forwarding (dCEF) switching must be enabled in global configuration mode.
or

Fast switching must be enabled on an interface in interface configuration mode.

Restrictions for NetFlow Egress Support

Locally generated traffic (traffic that is generated by the router on which the NetFlow Egress Support feature is configured) will not be counted as flow traffic for the NetFlow Egress Support feature.

The NetFlow Egress Support 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 an MPLS packet and underwent label disposition.

Information About NetFlow Egress Support

To configure the NetFlow Egress Support feature, you should understand the following concepts:

NetFlow Egress Support

Benefits of NetFlow Egress Support

NetFlow Egress Support

NetFlow is a technology that collects traffic flow statistics on routing devices. NetFlow has been used for a variety of applications, including traffic engineering, usage-based billing, and denial of service (DoS) attack monitoring.

Previous versions of NetFlow allow statistics to be gathered only on traffic that is entering the router, or ingress traffic. The NetFlow Egress Support feature allows NetFlow statistics to be gathered on traffic that is exiting the router, or egress traffic.

Benefits of NetFlow Egress Support

The NetFlow Egress Support feature greatly simplifies NetFlow configuration for some accounting scenarios. The following example shows such a scenario.

In Figure 1 and Figure 2, both incoming and outgoing (ingress and egress) flow statistics are required for the server. The server is attached to Router B. The "cloud" in the figure represents the core of the network and includes Multiprotocol Label Switching (MPLS) Virtual Private Networks (VPNs).

All traffic denoted by the arrows must be accounted for. The solid arrows represent IP traffic and the dotted arrows represent MPLS VPNs.

Figure 1 shows how the flow traffic would have to be tracked before the introduction of the NetFlow Egress Support feature. Since only ingress flows could be tracked before the NetFlow Egress Support feature was introduced, the following NetFlow configurations would have to be implemented to track both ingress and egress flows from Router B:

NetFlow would be enabled on an interface on Router B to track ingress IP traffic from Router A to Router B.

NetFlow would be enabled on an interface on Router D to track ingress IP traffic from Router B to Router D.

NetFlow would be enabled on an interface on Router A to track ingress traffic from the MPLS VPN from Router B to Router A.

NetFlow would be enabled on an interface on Router B to track ingress traffic from the MPLS VPN from Router D to Router B.

Figure 1 Ingress-Only NetFlow Example

A configuration such as the one used in Figure 1 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 2 utilizes NetFlow, the NetFlow Egress Support feature and the MPLS Egress NetFlow Accounting feature to capture ingress and egress flow statistics for Router B, thus obtaining the required flow statistics for the server.

In Figure 2, the following NetFlow configurations would be applied to Router B:

NetFlow would be enabled on an interface on Router B to track ingress IP traffic from Router A to Router B.

The NetFlow Egress Support feature will be enabled on an interface on Router B to track egress IP traffic from Router B to Router D.

NetFlow would be enabled on an interface on Router B to track ingress traffic from the MPLS VPN from Router B to Router D.

NetFlow would be enabled on an interface on Router B to track ingress traffic from the MPLS VPN from Router B to Router A.

After the NetFlow configurations have been entered for Router B, all NetFlow statistics for the server can be captured by entering the show ip cache flow command or the show ip cache verbose flow command for Router B.

Figure 2 NetFlow Egress Support Example

How to Configure NetFlow Egress Support

This section contains the following procedure:

Configuring NetFlow Egress Support

Configuring NetFlow Egress Support

The NetFlow Egress Support feature must be configured before you can start gathering egress flow statistics for the router.

SUMMARY STEPS

1. enable

2. configure terminal

3. ip cef

or

ip cef distributed

or

interface type [number | slot/port]
ip route-cache

4. interface type [number | slot/port]

5. ip flow egress

or

flow-sampler sampler-map-name egress

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

ip cef


or

ip cef distributed

or

interface type [number | slot/port]

ip route-cache

Example:

Router(config)# ip cef

or

Example:

Router(config)# ip dcef

or

Example:

Router(config)# ip route-cache

Router(config)# interface ethernet 3/0

Enables CEF,

or

Enables dCEF

or

Enables fast switching

Step 4 

interface type [number | slot/port]

Example:

Router(config)# interface ethernet 3/0

Configures an interface type and enters interface configuration mode.

Step 5 

ip flow egress

or

flow-sampler sampler-map-name egress

Example:

Router(config-if)# ip flow egress

Enables the NetFlow Egress Support feature on the interface.

The flow-sampler sampler-map-name command enables sampling for NetFlow accounting. The egress keyword added to the flow-sampler sampler-map-name command enables egress support for sampled IP and MPLS-aware NetFlow accounting.

Configuration Examples for NetFlow Egress Support

This section provides the following configuration examples:

NetFlow Egress Support Configuration: Example

Verifying NetFlow Egress Support Configuration: Example

NetFlow Egress Support Configuration: Example

The following example shows a sample configuration for the NetFlow Egress Support feature.

enable
 configure terminal
interface Ethernet0/0
ip flow egress
exit
 exit
exit

Verifying NetFlow Egress Support Configuration: Example

The following example displays the output of the show ip cache flow command.

Router# show ip cache flow

IP packet size distribution (35 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, 278544 bytes
  0 active, 4096 inactive, 3 added
  52 ager polls, 0 flow alloc failures
  Active flows timeout in 30 minutes
  Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 17416 bytes
  0 active, 1024 inactive, 3 added, 3 added to flow
  0 alloc failures, 0 force free
  1 chunk, 2 chunks added
  last clearing of statistics never
Protocol         Total    Flows   Packets Bytes  Packets Active(Sec) Idle(Sec)
--------         Flows     /Sec     /Flow  /Pkt     /Sec     /Flow     /Flow
ICMP                 3      0.0        11   100      0.0       1.6      15.5
Total:               3      0.0        11   100      0.0       1.6      15.5

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP  Pkts
Et0/0         10.0.0.1        Et0/0*        10.0.1.1        01 0000 0000    5
Et0/1         10.0.0.2        Et0/1         10.0.1.2        01 0000 0000    5

The asterisk (*) immediately following the "DstIf" field indicates that the flow being shown is an egress flow.


Note Although the asterisk will be used to show egress flows, no changes will be made for the display of aggregation cache flows.


For more information on the output fields, refer to the documentation for the show ip cache flow command.

Additional References

The following sections provide references related to NetFlow Egress Support.

Related Documents

Related Topic
Document Title

General NetFlow Overview

NetFlow Overview section of the Cisco IOS Switching Configuration Guide, Release 12.3

MPLS-Aware NetFlow feature

MPLS-Aware NetFlow feature module

MPLS Egress NetFlow Accounting feature

MPLS Egress NetFlow Accounting feature module


Standards

Standards
Title

There are no new or modified standards associated with this feature.

 

MIBs

MIBs
MIBs Link

There are no new or modified MIBs associated with this feature.

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFCs
Title

There are no new or modified RFCs associated with this feature.

 

Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 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.

http://www.cisco.com/public/support/tac/home.shtml


Command Reference

This section documents new and modified commands only.

flow-sampler

ip flow egress

ip flow-egress input-interface

match (NetFlow)

show ip cache flow

show ip cache verbose flow

show ip flow interface

flow-sampler

To enable a flow sampler, use the flow-sampler command in interface configuration mode. To disable a flow sampler, use the no form of this command.

flow-sampler sampler-map-name

no flow-sampler sampler-map-name

Syntax Description

sampler-map-name

Name of the flow sampler map to apply to the interface.


Defaults

Flow samplers are disabled.

Command Modes

Interface configuration

Command History

Release
Modification

12.3(2)T

This command was introduced.

12.0(26)S

This command was integrated into Cisco IOS Release 12.0(26)S.


Usage Guidelines

You must disable full NetFlow before enabling Statistical Sampling NetFlow Export.

Disabling Statistical Sampling NetFlow Export on an interface does not enable full NetFlow. This restriction prevents the transition to full NetFlow from overwhelming the interface. You must explicitly enable full NetFlow if desired.

Examples

The following example shows how to enable a flow sampler. In this example, a flow sampler map named mysampler1 is applied to Ethernet interface 1:

Router(config)# interface ethernet 1
Router(config-if)# flow-sampler mysampler1

Related Commands

Command
Description

debug flow-sampler

Enables debugging output for Statistical Sampling NetFlow Export flow sampler activity.

flow-sampler-map

Defines a Statistical Sampling NetFlow Export flow sampler map.

ip flow-export

Enables the export of information in NetFlow cache entries.

mode (flow sampler map)

Specifies a Statistical Sampling NetFlow Export flow sampling mode and packet interval.

show flow-sampler

Displays the Statistical Sampling NetFlow Export flow samplers (including mode, packet interval, and number of packets matched for each flow sampler).

show ip flow export

Displays the statistics for the NetFlow data export.


ip flow egress

To configure egress support for NetFlow on an interface or subinterface, use the ip flow egress command in interface configuration mode or subinterface configuration mode. To disable egress support for NetFlow on an interface or subinterface, use the no form of this command.

ip flow egress

no ip flow egress

Syntax Description

This command has no arguments or keywords.

Defaults

This command is disabled by default.

Command Modes

Interface configuration
Subinterface configuration

Command History

Release
Modification

12.3(11)T

This command was introduced.


Usage Guidelines

Use this command to configure egress support for NetFlow on an interface or subinterface.

Examples

The following example shows how to configure NetFlow on a Fast Ethernet subinterface 6/3.0:

Router(config)# interface FastEthernet6/3.0
Router(config-subif)# ip flow egress

Related Commands

Command
Description

flow-sampler

Enables a flow sampler.

ip route-cache flow

Configures ingress NetFlow on an interface or subinterface.

show ip cache flow

Displays a summary of NetFlow statistics.

show ip flow interface

Displays NetFlow configuration on interfaces.


ip flow-egress input-interface

To remove the flow key that specifies an output interface and to add a flow key that specifies an input interface for NetFlow egress statistics, use the ip flow-egress input-interface command in interface configuration mode or subinterface configuration mode. To change the flow key back from an input interface to an output interface for NetFlow egress statistics, use the no form of this command.

ip flow-egress input-interface

no ip flow-egress input-interface

Syntax Description

This command has no arguments or keywords.

Defaults

NetFlow egress statistics use the output interface as part of the flow key by default.

Command Modes

Global configuration

Command History

Release
Modification

12.3(11)T

This command was introduced.


Usage Guidelines

When the NetFlow Egress Support feature is configured, by default it uses the output interface as part of the flow key. The ip flow-egress input-interface command changes the key for egress flows so that the ingress interface is used instead of the output interface. This command is used to create a new flow for each input interface.

Examples

In the following example, the following action is performed:

The key for NetFlow reporting of egress traffic is changed from the output interface to the input interface.

Router> enable
Router# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# ip flow-egress input-interface

Related Commands

Command
Description

ip flow egress

Configures egress support for NetFlow on an interface or subinterface.

show ip flow interface

Displays NetFlow configuration on interfaces.


match (NetFlow)

To specify match criteria for the NetFlow MIB and Top Talkers feature, use the match command in NetFlow top talkers configuration mode. To remove match criteria for the NetFlow MIB and Top Talkers feature, use the no form of this command.

match [[source address | destination address | nexthop address] [ip-address] [mask | /nn]] [[source port | destination port] [port-number | min port | max port | min port max port]] [[source as | destination as] as-number] [[input-interface | output-interface] interface] [tos [tos-value dscp dscp-value | precedence precedence-value]] [protocol [protocol-number | tcp | udp]] [flow-sampler flow-sampler-name] [class-map class] [packet-range | byte-range [[min-range-number max-range-number] [min minimum-range | max maximum-range | min minimum-range max maximum-range] [direction [ingress | egress]]]

no match [[[source address | destination address | nexthop address]] [ip-address] [mask | /nn]] [[[source port | destination port]] [port-number | min port | max port | min port max port]] [[[source as | destination as]] as-number] [[[input-interface | output-interface]] interface] [[tos] [tos-value | [dscpdscp-value | [precedenceprecedence-value]] [[protocol] [protocol-number | [tcp | udp]]] [[flow-sampler] flow-sampler-name] [[class-mapclass] [[packet-range | byte-range] [[min-range-number max-range-number] [min minimum-range | max maximum-range | min minimum-range max maximum-range] [direction [ingress | egress]]]

Syntax Description

source address

(Optional) The match criterion is based on the source IP address.

destination address

(Optional) The match criterion is based on the destination IP address.

nexthop address

(Optional) The match criterion is based on the next-hop IP address.

ip-address

(Optional) IP address of the source, destination, or next-hop address to be matched.

mask

(Optional) Address mask, in dotted decimal format.

/nn

(Optional) Address mask as entered in Classless InterDomain Routing (CIDR) format. An address mask of 255.255.255.0 is equivalent to a /24 mask in CIDR format.

source port

(Optional) The match criterion is based on the source port.

destination port

(Optional) The match criterion is based on the destination port.

port-number

(Optional) The match criterion is based on the port number.

min port

(Optional) Minimum port number to be matched. Any port number equal to or greater than this number constitutes a match. Range: 0 to 65535.

max port

(Optional) Maximum port number to be matched. Any port number equal to or less than this number constitutes a match. Range: 0 to 65535.

min port max port

(Optional) Range of port numbers to be matched. Range: 0 to 65535.

source as

(Optional) The match criterion is based on the source autonomous system.

destination as

(Optional) The match criterion is based on the destination autonomous system.

as-number

(Optional) Autonomous system number to be matched.

input-interface

(Optional) The match criterion is based on the input interface.

output-interface

(Optional) The match criterion is based on the output interface.

interface

(Optional) Interface to be matched.

tos

(Optional) The match criterion is based on type of service (ToS).

tos-value

(Optional) ToS to be matched.

dscp dscp-value

(Optional) Differentiated services code point (DSCP) value to be matched.

precedence precedence-value

(Optional) Precedence value to be matched.

protocol

(Optional) The match criterion is based on protocol.

protocol-number

(Optional) Protocol number to be matched. Range: 0 to 255.

tcp

(Optional) Protocol number to be matched as TCP.

udp

(Optional) Protocol number to be matched as UDP.

flow-sampler

(Optional) The match criterion is based on top talker sampling.

flow-sampler-name

(Optional) Name of the top talker sampler to be matched.

class-map

(Optional) The match criterion is based on a class map.

class

(Optional) Name of the class map to be matched.

packet-range

(Optional) Protocol number to be matched on a range of packets.

byte-range

(Optional) Protocol number to be matched on a range of bytes.

min-range-number max-range-number

(Optional) Range of bytes or packets to be matched. Range: 1 to 4294967295.

min minimum-range

(Optional) Minimum number of bytes or packets to be matched. Range: 1 to 4294967295.

max maximum-range

(Optional) Maximum number of bytes or packets to be matched. Range: 1 to 4294967295.

min minimum-range max maximum-range

(Optional) Range of bytes or packets to be matched. Range: 1 to 4294967295.

direction

(Optional) Direction of the flow to be matched.

ingress

(Optional) The match criterion is based on ingress flows.

egress

(Optional) The match criterion is based on egress flows.


Defaults

No matching criteria are specified by default. All top talkers will be displayed.

Command Modes

NetFlow top talkers configuration

Command History

Release
Modification

12.2(25)S

This command was introduced.

12.3(11)T

This command was integrated into Cisco IOS Release 12.3(11)T. The direction, ingress, and egress keywords were added.


Usage Guidelines

Use this command to specify match criteria for the NetFlow MIB and Top Talkers feature. Using matching criteria is useful to restrict the list of top talkers.

If you are using a MIB and using simple network management protocol (SNMP) commands to configure this feature, refer to the following table for a mapping of the command-line interface (CLI) commands to the MIB SNMP commands:

Table 1 Router CLI Commands and Equivalent SNMP Commands 

Router CLI Command
SNMP Command

match source address [ip-address] [mask | /nn]

cnfTopFlowsMatchSrcAddress ip-address

cnfTopFlowsMatchSrcAddressType type1

cnfTopFlowsMatchSrcAddressMask mask

match destination address [ip-address] [mask | /nn]

cnfTopFlowsMatchDstAddress ip-address

cnfTopFlowsMatchDstAddressType type1

cnfTopFlowsMatchDstAddressMask mask

match nexthop address] [ip-address] [mask | /nn]]

cnfTopFlowsMatchNhAddress ip-address

cnfTopFlowsMatchNhAddressType type1

cnfTopFlowsMatchNhAddressMask mask

match source port min port

cnfTopFlowsMatchSrcPortLo port

match source port max port

cnfTopFlowsMatchSrcPortHi port

match destination port min port

cnfTopFlowsMatchDstPortLo port

match destination port max port

cnfTopFlowsMatchDstPortHi port

match source as as-number

cnfTopFlowsMatchSrcAS as-number

match destination as as-number

cnfTopFlowsMatchDstAS as-number

match input-interface interface

cnfTopFlowsMatchInputIf interface

match output-interface interface

cnfTopFlowsMatchOutputIf interface

match  tos [tos-value dscp dscp-value | precedence precedence-value]

cnfTopFlowsMatchTOSByte tos-value2

match protocol [protocol-number | tcp | udp]

cnfTopFlowsMatchProtocol protocol-number

match flow-sampler flow-sampler-name

cnfTopFlowsMatchSampler flow-sampler-name

match class-map class

cnfTopFlowsMatchClass class

match packet-range min minimum-range

cnfTopFlowsMatchMinPackets minimum-range

match packet-range max maximum-range

cnfTopFlowsMatchMaxPackets maximum-range

match byte-range min minimum-range

cnfTopFlowsMatchMinBytes minimum-range

match byte-range max maximum-range

cnfTopFlowsMatchMaxPackets maximum-range

direction [ingress | egress]

cnfTopFlowsMatchDirection [flowDirNone(0) | flowDirIngress(1) | flowDirEgress(2)]

1 The only IP version type that is currently supported is IPv4 (type 1).

2 The tos-value argument consists of 6 bits for DSCP, 3 bits for precedence, and 8 bits (one byte) for ToS.


Examples

The following example enters NetFlow top talkers configuration mode and specifies that the top talkers will contain the following characteristics:

The list of top talkers will have an IP address of 10.1.1.1 with a subnet mask of 255.255.255.240 (/28).

The list of top talkers will have an autonomous system number of 64512.

Router(config)# ip flow-top-talkers
Router(config-flow-top-talkers)# match source address 10.1.1.1/28
Router(config-flow-top-talkers)# match destination as 64512

Related Commands

Command
Description

cache-timeout

Specifies the length of time for which the list of top talkers is retained.

ip flow-top-talkers

Enters NetFlow top talkers configuration mode.

show ip flow top-talkers

Displays the list of top talkers.

sort-by

Specifies the sorting criterion for the NetFlow MIB and Top Talkers feature.

top

Specifies the maximum number of top talkers to be displayed.


show ip cache flow

To display a summary of the NetFlow switching statistics, use the show ip cache flow command in user EXEC or privileged EXEC mode.

show ip cache flow

Syntax Description

This command has no keywords or arguments.

Command Modes

User EXEC
Privileged EXEC

Command History

Release
Modification

11.1

This command was introduced.

11.1 CA

The information display for the command was updated.

12.3(4)T, 12.3(6), 12.2(20)S

The execute-on command was implemented on the Cisco 7500 platforms to include the remote execution of the show ip cache flow command.

12.3(11)T

Support for egress flow accounting was added, and the [prefix mask] and [type number] arguments were removed.


Usage Guidelines

Some of the content in the display of the show ip cache flow command uses multi-line headings and multi-line data fields. Figure 4 shows how to associate the headings with the correct data fields when there are two lines of headings and two lines of data fields. The first line of the headings is associated with the first line of data fields. The second line of the headings is associated with the second line of data fields.

When other features such as IP Multicast are configured the number of lines in the headings and data fields will increase. The method for associating the headings with the correct data fields remains the same.

Figure 3 How to use the multi-line headings and multi-line data fields in the display output of the show ip cache flow command

Displaying Detailed NetFlow Cache Information on Platforms Running Distributed Cisco Express Forwarding (dCEF)

On platforms running Distributed Cisco Express Forwarding (dCEF), NetFlow cache information is maintained on each line card or Versatile Interface Processor. To display this information on a distributed platform by use of the show ip cache flow command, you must enter the command at a line card prompt.

Cisco 7500 Series Platform

To display NetFlow cache information using the show ip cache flow command on a Cisco 7500 series router that is running dCEF, enter the following sequence of commands:

Router# if-con slot-number
LC-slot-number# show ip cache 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 NetFlow cache information:

Router# execute-on slot-number show ip cache flow 

Cisco 12000 Series Platform

To display NetFlow cache information using the show ip cache flow command on a Cisco 12000 Series Internet router, enter the following sequence of commands:

Router# attach slot-number
LC-slot-number# show ip cache 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 NetFlow cache information:

Router# execute-on slot-number show ip cache flow 

Examples

The following is a sample display of a main cache using the show ip cache flow command:

Router# show ip cache flow 

IP packet size distribution (230151 total packets):
   1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480
   .999 .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 .000 .000 .000 .000 .000 .000 .000

The preceding output shows the percentage distribution of packets by size range. In this display, 99.9 percent of the packets fall in the size range from 1 to 32 bytes.


IP Flow Switching Cache, 4456448 bytes
  65509 active, 27 inactive, 820628747 added
  955454490 ager polls, 0 flow alloc failures
  Exporting flows to 1.1.15.1 (2057)
  820563238 flows exported in 34485239 udp datagrams, 0 failed
  last clearing of statistics 00:00:03

Protocol         Total    Flows   Packets Bytes  Packets Active(Sec) Idle(Sec)
--------         Flows     /Sec     /Flow  /Pkt     /Sec     /Flow     /Flow
TCP-BGP             71      0.0         1    49      0.0       2.5      15.8
UDP-other           17      0.0         1   328      0.0       0.0      15.7
ICMP             18966      6.7        10    28     72.9       0.1      22.9
Total:           19054      6.7        10    28     72.9       0.1      22.9

SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop              B/Pk  Active
Et1/1          52.52.52.1      Fd4/0          42.42.42.1      01 55  10    3748 
0000 /8  50                    0000 /8  40    202.120.130.2          28    17.8
Et1/2          52.52.52.1      Fd4/0          42.42.42.1      01 CC  10    3568 
0000 /8  50                    0000 /8  40    202.120.130.2          28    17.8
Et1/2          10.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1124 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          11.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1157 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.7
Et1/2          14.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1149 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          15.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1127 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.7
Et1/2          12.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1204 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          13.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1159 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          18.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1223 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          19.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1264 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          16.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1170 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          17.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1167 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          22.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1193 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.8
Et1/2          23.1.3.2        Fd4/0          42.42.42.1      01 C0  10    1212 
0000 /0  0                     0000 /8  40    202.120.130.2          28    17.7
Et1/1          50.50.50.1      Local          31.31.31.1      06 C0  18       2 
00B3 /32 0                     2AF8 /32 0     0.0.0.0                49    10.1
Et1/0          8.8.8.8         Et0/0*         9.9.9.9         01 00  10       3 
0000 /8  302                   0800 /8  300   3.3.3.3               100     0.1


Note The very last entry in the "DstIf" field has an asterisk (*) next to the destination interface. The asterisk (*) immediately following the "DstIf" field indicates that the flow being shown is an egress flow.


Table 2 describes the significant fields shown in the flow switching cache lines of the display.

  

Table 2 show ip cache flow Field Descriptions in Flow Switching Cache Display 

Field
Description

bytes

Number of bytes of memory used by the NetFlow cache.

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 were not currently assigned to a specific flow at the time this command was entered.

added

Number of flows created since the start of the summary period.

ager polls

Number of times the NetFlow code looked at the cache to cause entries to expire (used by Cisco for diagnostics only).

flow alloc failures

Number of times the NetFlow code tried to allocate a flow but could not.

Exporting flows

IP address and User Datagram Protocol (UDP) port number of the workstation to which flows are exported.

flows exported in udp datagrams

Total number of flows exported and the total number of UDP datagrams used to export the flows to the workstation.

failed

Number of flows that could not be exported by the router because of output interface limitations.

last clearing of statistics

Standard time output (hh:mm:ss) since the clear ip flow stats privileged EXEC command was executed. This time output changes to hours and days after the time exceeds 24 hours.


   

Table 3 describes the significant fields shown in the activity by protocol lines of the display.

 

Table 3 show ip cache flow Field Descriptions in Activity by Protocol Display 

Field
Description

Protocol

IP protocol and the well-known port number as described in RFC 1340.

Total Flows

Number of flows for this protocol since the last time statistics were cleared.

Flows/Sec

Average number of flows for this protocol seen per second; equal to total flows/number of seconds for this summary period.

Packets/Flow

Average number of packets observed for the flows seen for this protocol. Equal to total packets for this protocol or number of flows for this protocol for this summary period.

Bytes/Pkt

Average number of bytes observed for the packets seen for this protocol (total bytes for this protocol or total number of packet for this protocol for this summary period).

Packets/Sec

Average number of packets for this protocol per second (total packets for this protocol) or total number of seconds for this summary period.

Active(Sec)/Flow

Sum of all the seconds from the first packet to the last packet of an expired flow (for example, TCP FIN, timeout, and so on), in seconds or total flows for this protocol for this summary period.

Idle(Sec)/Flow

Sum of all the seconds from the last packet seen in each nonexpired flow for this protocol until the time at which this command was entered, in seconds or total flows for this protocol for this summary period.


 

Table 4 describes the significant fields in the NetFlow record lines of the display.

Table 4 show ip cache verbose flow Field Descriptions in NetFlow Record Display 

Field
Description

SrcIf

Interface on which the packet was received.

Port Msk AS

Source Border Gateway Protocol (BGP) autonomous system. This is always set to 0 in MPLS flows.

SrcIPaddress

IP address of the device that transmitted the packet.

DstIf

Interface from which the packet was transmitted. 

Note If an asterisk (*) immediately follows the "DstIf" field, the flow being shown is an egress flow.

Port Msk AS

Destination BGP autonomous system. This is always set to 0 in MPLS flows.

DstIPaddress

IP address of the destination device.

NextHop

Specifies the BGP next-hop address. This is always set to 0 in MPLS flows.

Pr

IP protocol well-known port number as described in RFC 1340, displayed in hexadecimal format.

B/Pk

Average number of bytes observed for the packets seen for this protocol (total bytes for this protocol or the total number of flows for this protocol for this summary period).

Flgs

TCP flags (result of bitwise OR of TCP flags from all packets in the flow).

Active

Number of active flows in the NetFlow cache at the time this command was entered.

Pkts

Number of packets switched through this flow.


Related Commands

Command
Description

clear ip flow stats

Clears the NetFlow switching statistics.

ip flow egress

Configures egress support for NetFlow on an interface or subinterface.

ip route-cache

Controls the use of high-speed switching caches for IP routing.


show ip cache verbose flow

To display a detailed summary of NetFlow statistics, use the show ip cache verbose flow command in privileged EXEC mode.

show ip cache verbose flow

Syntax Description

This command has no keywords or arguments.

Command Modes

Privileged EXEC

Command History

Release
Modification

11.1

This command was introduced.

11.1 CA

The information display for the command was updated.

12.3(1)

The command output was updated to display additional NetFlow fields.

12.0(24)S

MPLS flow records were added to the command output.

12.3(4)T, 12.3(6), 12.2(20)S

The execute-on command was implemented on the Cisco 7500 platforms to include the remote execution of the show ip cache verbose flow command.

12.3(8)T

MPLS flow records were added to the command output for Cisco IOS Release 12.3(8)T.

12.3(11)T

Support for egress flow accounting was added, and the [prefix mask] and [type number] arguments were removed.


Usage Guidelines

Use the show ip cache verbose flow command to display flow record fields in the NetFlow cache in addition to the fields that are displayed with the show ip cache flow command. The values in the additional fields that are shown depend on the NetFlow features that are enabled and the flags that are set in the flow.


Note The flags, and therefore the fields, might vary from flow to flow.


Some of the content in the display of the show ip cache verbose flow command uses multi-line headings and multi-line data fields. Figure 4 shows how to associate the headings with the correct data fields when there are two lines of headings and two lines of data fields. The first line of the headings is associated with the first line of data fields. The second line of the headings is associated with the second line of data fields.

When other features such as IP Multicast are configured the number of lines in the headings and data fields will increase. The method for associating the headings with the correct data fields remains the same.

Figure 4 How to use the multi-line headings and multi-line data fields in the display output of the show ip cache verbose flow command

When the NetFlow Multicast Support feature is enabled, this command displays the number of replicated packets and the packet byte count for NetFlow multicast accounting. When you configure the NetFlow Version 9 Export Format feature, this command displays additional NetFlow fields in the header.

When you configure the MPLS-aware NetFlow feature, you can use the show ip cache verbose flow command to display both IP and MPLS portions of MPLS flows in the NetFlow cache on a router line card. To display only the IP portion of the flow record in the NetFlow cache when MPLS-aware NetFlow is configured, use the show ip cache flow command.

Displaying Detailed NetFlow Cache Information on Platforms Running Distributed Cisco Express Forwarding (dCEF)

On platforms running Distributed Cisco Express Forwarding (dCEF), NetFlow cache information is maintained on each line card or Versatile Interface Processor. To display this information on a distributed platform by use of the show ip cache verbose flow command, 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 Cisco Express Forwarding (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 

Cisco 12000 Series Platform

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 

Examples

The following example shows output from the show ip cache verbose flow command:

Router# show ip cache verbose flow

IP packet size distribution (6 total packets):
   1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480
   .000 .833 .166 .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 .000 .000 .000 .000 .000 .000 .000

The preceding output shows the percentage distribution of packets by size. In this display, 83.3 percent of the packets fall in the 64-byte size range and 16.6 percent fall in the 96-byte range.

The next section of the output can be divided into three sections. The section and the table corresponding to each are as follows:

NetFlow cache statistics lines (Table 5)

Protocol statistics (Table 6)

NetFlow record display (Table 7)

IP Flow Switching Cache, 278544 bytes
  1 active, 4095 inactive, 2 added
  25 ager polls, 0 flow alloc failures
  Active flows timeout in 30 minutes
  Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 17096 bytes
  1 active, 1023 inactive, 2 added, 2 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-BGP              1      0.0         4    57      0.0       0.3      15.4
Total:               1      0.0         4    57      0.0       0.3      15.4


SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop              B/Pk  Active
BGP: BGP NextHop
Et0/0          3.3.3.3         Local          3.3.3.4         06 C0  18       2
2AF8 /24 0                     00B3 /24 0     0.0.0.0                49     0.2
BGP: 0.0.0.0

Table 5 describes the significant fields shown in the NetFlow cache lines of the display.

Table 5 show ip cache verbose flow Field Descriptions in the NetFlow Cache Display 

Field
Description

bytes

Number of bytes of memory used by the NetFlow cache.

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

Number of flows created since the start of the summary period.

ager polls

Number of times the NetFlow code caused entries to expire (used by Cisco for diagnostics only).

flow alloc failures

Number of times the NetFlow code tried to allocate a flow but could not.

last clearing of statistics

Standard time output (hh:mm:ss) since the clear ip flow stats privileged EXEC command was last executed. This time output changes to hours and days after the time exceeds 24 hours.


Table 6 describes the significant fields shown in the activity by protocol lines of the display.

Table 6 show ip cache verbose flow Field Descriptions in Activity by Protocol Display 

Field
Description

Protocol

IP protocol and the well-known port number. (Refer to http://www.iana.org, Protocol Assignment Number Services, for the latest RFC values.)

Note Only a small subset of all protocols is displayed.

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 (for example, TCP connection close request [FIN], timeout, and so on) divided by the 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 this command was entered divided by the total flows for this protocol for this summary period.


Table 7 describes the significant fields in the NetFlow record lines of the display.

Table 7 show ip cache verbose flow Field Descriptions in NetFlow Record Display 

Field
Description

SrcIf

Interface on which the packet was received.

Port Msk AS

Source port number (displayed in hexadecimal format), IP address mask, and autonomous system number. This is always set to 0 in MPLS flows.

SrcIPaddress

IP address of the device that transmitted the packet.

DstIf

Interface from which the packet was transmitted. 

Note If an asterisk (*) immediately follows the "DstIf" field, the flow being shown is an egress flow.

Port Msk AS

Destination port number (displayed in hexadecimal format), IP address mask, and autonomous system. This is always set to 0 in MPLS flows.

DstIPaddress

IP address of the destination device.

NextHop

The BGP next-hop address. This is always set to 0 in MPLS flows.

Pr

IP protocol "well-known" port number, displayed in hexadecimal format. (Refer to http://www.iana.org, Protocol Assignment Number Services, for the latest RFC values.)

TOS

Type of Service, displayed in hexadecimal format.

B/Pk

Average number of bytes observed for the packets seen for this protocol.

Flgs

TCP flags, shown in hexadecimal format (result of bitwise OR of TCP flags from all packets in the flow).

Pkts

Number of packets in this flow.

Active

Time the flow has been active.


The following example shows the NetFlow output of the show ip cache verbose cache 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 Modular QoS CLI (MQC), the display includes the class ID. If any general flags are set, the output includes the flags.

...
SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop              B/Pk  Active
BGP: BGP NextHop
Et1/0          8.8.8.8         Et0/0*         9.9.9.9         01 00  10       3 
0000 /8  302                   0800 /8  300   3.3.3.3               100     0.1
BGP: 2.2.2.2         Sampler: 1  Class: 1  FFlags: 01  

Table 8 describes the significant fields shown in the NetFlow output for a sampler, for an MQC policy class, and for general flags.

Table 8 show ip cache verbose flow Field Descriptions for a NetFlow Sampler, an MCQ Policy Class, and General Flags 

Field
Description

Sampler: 1

Shows the ID of the sampler that captured the flow. The sampler ID in this example is 1.

Class: 1

Shows the ID of the MQC traffic class. The class ID in this example is 1.

FFlag: 01

Shows the general flow flag (shown in hexadecimal format), which is the bitwise OR of one or more of the following:

01 indicates an output (or egress) flow. (If this bit is not set, the flow is an input [or ingress] flow.)

02 indicates a flow that was dropped (for example, by an access control list [ACL]).

04 indicates a Multiprotocol Label Switching (MPLS) flow.

08 indicates an IP version 6 (IPv6) flow.

The flow flag in this example is 01 (an egress flow).


The following example shows the NetFlow output for the show ip cache verbose flow command when NetFlow BGP next-hop accounting is enabled:

Router# show ip cache verbose flow 
...
SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs   Pkts 
Port Msk AS                    Port Msk AS    NextHop              B/Pk   Active 
MUL:M_Opaks  M_Obytes BGP:BGP_NextHop 
Et0/0/2        12.0.0.2        Et0/0/4        13.0.0.5        01 00  10      20 
0000 /8  0                     0800 /8  0     11.0.0.6              100     0.0 
BGP:26.0.0.6 
Et0/0/2        12.0.0.2        Et0/0/4        15.0.0.7        01 00  10      20 
0000 /8  0                     0800 /8  0     11.0.0.6              100     0.0 
BGP:26.0.0.6 
Et0/0/2        12.0.0.2        Et0/0/4        15.0.0.7        01 00  10      20 
0000 /8  0                     0000 /8  0     11.0.0.6              100     0.0 
BGP:26.0.0.6

Table 9 describes the significant fields shown in the NetFlow BGP next-hop accounting lines of the display.

Table 9 show ip cache verbose flow Field Descriptions in NetFlow BGP Next-Hop Accounting Display

Field
Description

M_Opaks

Displays the number of multiprotocol BGP next-hop output packets.

M_Obytes

Displays the number of multiprotocol BGP next-hop output bytes.

BGP:BGP_NextHop

Destination address for the BGP next hop.


The following example shows the NetFlow output for the show ip cache verbose flow command when NetFlow multicast accounting is configured:

Router# show ip cache verbose flow 

...
SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs  Pkts 
Port Msk AS                    Port Msk AS    NextHop              B/Pk  Active 
IPM:OPkts    OBytes 
IPM:    0       0 
Et1/1/1        11.0.0.1        Null           227.1.1.1       01 55  10     100 
0000 /8  0                     0000 /0  0     0.0.0.0                28     0.0 
IPM:  100    2800 
Et1/1/1        11.0.0.1        Se2/1/1.16     227.1.1.1       01 55  10     100 
0000 /8  0                     0000 /0  0     0.0.0.0                28     0.0 
IPM:    0       0 
Et1/1/2        12.0.0.1        Et1/1/4        227.2.2.2       01 55  10     100 
0000 /8  0                     0000 /0  0     0.0.0.0                28     0.1 
Et1/1/2        12.0.0.1        Null           227.2.2.2       01 55  10     100 
0000 /8  0                     0000 /0  0     0.0.0.0                28     0.1 
IPM:  100    2800 

Table 10 describes the significant fields shown in the NetFlow multicast accounting lines of the display.

Table 10 show ip cache verbose flow Field Descriptions in NetFlow Multicasting Accounting Display

Field
Description

OPkts

Displays the number of IP multicast (IPM) output packets.

OBytes

Displays the number of IPM output bytes.

DstIPaddress

Displays the destination IP address for the IPM output packets.


The following example shows the output for both the IP and MPLS portions of the flow record in the NetFlow cache when MPLS-aware NetFlow is enabled:

Router# show ip cache verbose flow

...             
SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop              B/Pk  Active
PO3/0          10.1.1.1        PO5/1          10.2.1.1        01 00  10       9
0100 /0  0                     0200 /0  0     0.0.0.0               100     0.0
Pos:Lbl-Exp-S 1:12305-6-0 (LDP/10.10.10.10) 2:12312-6-1

Table 11 describes the significant fields shown in the display.

Table 11 show ip cache verbose flow Field Descriptions 

Field
Description

Pos

Position of the MPLS label in the label stack, starting with 1 as the top label.

Lbl

Value given to the MPLS label by the router.

Exp

Value of the experimental bit.

S

Value of the end-of-stack bit. Set to 1 for the oldest entry in the stack and to zero for all other entries.

LDP/10.10.10.10

Type of MPLS label and associated IP address for the top label in the MPLS label stack.


Related Commands

Command
Description

ip flow-cache mpls label-positions

Enables MPLS-aware NetFlow.

ip route-cache flow

Enables ingress NetFlow data collection on the interface.

show ip cache flow

Displays a summary of the NetFlow switching statistics.


show ip flow interface

To display NetFlow configuration on interfaces, use the show ip flow interface command in privileged EXEC mode.

show ip flow interface

Syntax Description

This command has no keywords or arguments.

Command Modes

Privileged EXEC

Command History

Release
Modification

12.3(7)T

This command was introduced.

12.3(11)T

Support for egress NetFlow accounting was added.


Usage Guidelines

Use this command to display the type of NetFlow configuration that is used on the router interfaces.

Examples

The following example shows that the following interface configurations have been applied:

NetFlow accounting for egress flows has been enabled on interface Ethernet 0/0.

The "my_medium_sampling" flow sampler map has been applied to interface Ethernet 0/0.

NetFlow accounting has been enabled on interface Ethernet 1/0.

The "my_high_sampling" policy map has been applied to interface Ethernet 1/0:

Router# show ip flow interface

Ethernet0/0
  ip flow egress
  flow-sampler my_medium_sampling
Ethernet1/0
  ip route-cache flow
  netflow-sampler my_high_sampling

Related Commands

Command
Description

ip flow egress

Configures egress support for NetFlow on an interface or subinterface.

ip route-cache flow

Configures ingress NetFlow on an interface or subinterface.

show ip cache flow

Displays a summary of NetFlow statistics.