Table Of Contents
Prerequisites for NetFlow BGP Next Hop Support
Restrictions for NetFlow BGP Next Hop Support
Information About NetFlow BGP Next Hop Support
How to Configure NetFlow BGP Next Hop Support
Configuring NetFlow BGP Next Hop Accounting
Configuration Examples for NetFlow BGP Next Hop Support
Configuring NetFlow BGP Next Hop Accounting: Example
Verifying the NetFlow BGP Next Hop Configuration: Example
show ip cache flow aggregation
NetFlow BGP Next Hop Support
The NetFlow Border Gateway Protocol (BGP) Next Hop Support feature lets you measure network traffic on a per BGP next hop basis. Without the NetFlow BGP Next Hop Support feature, NetFlow exports only IP next hop information (which provides only the next router); this feature adds BGP next hop information to the data export.
The NetFlow BGP Next Hop Support feature lets you track which service provider the traffic is going through. This functionality is useful if you have arrangements with several other service providers for fault-protected delivery of traffic. The feature lets you charge customers more per packet when traffic has a more costly destination—you can pass on some of the cost associated with expensive trans-oceanic links or charge more when traffic is sent to another ISP with which you have an expensive charge agreement.
This feature uses only the NetFlow Version 9 export format for its data export.
History for NetFlow BGP Next Hop Support
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
This document includes the following sections:
•
Prerequisites for NetFlow BGP Next Hop Support
•
Restrictions for NetFlow BGP Next Hop Support
•
Information About NetFlow BGP Next Hop Support
•
How to Configure NetFlow BGP Next Hop Support
•
Configuration Examples for NetFlow BGP Next Hop Support
Prerequisites for NetFlow BGP Next Hop Support
Before you can configure the NetFlow BGP Next Hop Support feature, you must configure
•
NetFlow v9 (Version 9) data export (if only Version 5 is configured, then BGP next hop data is visible in the caches, but is not exported)
•
Cisco Express Forwarding (CEF) switching or dCEF switching (fast switching is not supported)
•
Border Gateway Protocol (BGP)
Restrictions for NetFlow BGP Next Hop Support
Recursive Load Sharing
The NetFlow cache does not capture the BGP next hop when the route to that BGP next hop is recursively load-shared via several IGP links. Instead, the NetFlow cache captures (as the BGP next hop) the effective simple next hop from a random selection of one of the load-shared routes to which the BGP route recurses.
Memory Impact
For BGP-controlled routes, the NetFlow BGP Next Hop Support feature adds 16 bytes to each NetFlow flow record. This increases memory requirements by 16 bytes times the number of flow cache entries that have BGP-controlled prefixes.
Performance Impact
Because the BGP next hop is fetched from the CEF path only once per flow, the performance impact of the NetFlow BGP Next Hop Support feature is minimal.
Information About NetFlow BGP Next Hop Support
To configure the NetFlow BGP Next Hop Support feature, you must understand the following concept:
Aggregation
The Cisco IOS NetFlow Aggregation feature summarizes NetFlow export data on a router before the data is exported to the NetFlow Collection Engine (formerly called NetFlow FlowCollector). The NetFlow BGP Next Hop Support feature provides the BGP next hop and its related aggregation scheme and provides BGP next hop information within each NetFlow record.
How to Configure NetFlow BGP Next Hop Support
See the following sections for configuration tasks for the NetFlow BGP Next Hop Support feature. Each task in the list is identified as either required or optional.
•
Configuring NetFlow BGP Next Hop Accounting (required)
•
Verifying the Configuration (optional)
•
Troubleshooting Tips (optional)
Configuring NetFlow BGP Next Hop Accounting
This section shows how to configure NetFlow BGP next hop accounting for the main cache and aggregation caches. You can enable the export of origin AS information or peer AS information, but not both.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip flow-export Version 9 [origin-as | peer-as] bgp-nexthop
4.
ip flow-aggregation cache bgp-nexthop-tos
5.
enabled
6.
end
DETAILED STEPS
Verifying the Configuration
This section shows how to verify successful configuration of NetFlow BGP next hop accounting.
SUMMARY STEPS
1.
show ip cache verbose flow
2.
show ip cache flow aggregation bgp-nexthop-tos
DETAILED STEPS
Troubleshooting Tips
If there are no BGP-specific flow records in the NetFlow cache, make sure that CEF or dCEF switching is enabled and that the destination for NetFlow data export is configured. Also check the routing table for BGP routes.
Configuration Examples for NetFlow BGP Next Hop Support
This section provides the following configuration examples:
•
Configuring NetFlow BGP Next Hop Accounting: Example
•
Verifying the NetFlow BGP Next Hop Configuration: Example
Configuring NetFlow BGP Next Hop Accounting: Example
The following example shows how to configure NetFlow BGP next hop accounting with origin AS and BGP next hop statistics:
Router> enablePassword:Router# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)# ip flow-export Version 9 origin-as bgp-nexthopRouter(config)# endRouter#3w1d:%SYS-5-CONFIG_I: Configured from console by consoleRouter# exitVerifying the NetFlow BGP Next Hop Configuration: Example
The following example shows how to use the show ip cache verbose flow command to verify that NetFlow BGP next hop accounting is enabled:
Router> show ip cache verbose flowIP packet size distribution (120 total packets):1-32 64 96 128 160 192 224 256 288 320 352 384 416 448480.000 .000 .000 1.00 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000.000512 544 576 1024 1536 2048 2560 3072 3584 4096 4608.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000IP Flow Switching Cache, 17826816 bytes8 active, 262136 inactive, 8 added26 ager polls, 0 flow alloc failuresActive flows timeout in 30 minutesInactive flows timeout in 15 secondsIP Sub Flow Cache, 1081480 bytes8 active, 65528 inactive, 8 added, 8 added to flow0 alloc failures, 0 force free1 chunk, 1 chunk addedlast clearing of statistics neverProtocol Total Flows Packets Bytes Packets Active(Sec)Idle(Sec)-------- Flows /Sec /Flow /Pkt /Sec /Flow/FlowSrcIf SrcIPaddress DstIf DstIPaddress Pr TOS FlgsPktsPort Msk AS Port Msk AS NextHop B/PkActiveMUL:M_Opaks M_Obytes BGP:BGP_NextHopEt0/0/2 12.0.0.2 Et0/0/4 13.0.0.5 01 00 10200000 /8 0 0800 /8 0 11.0.0.6 1000.0BGP:26.0.0.6Et0/0/2 12.0.0.2 Et0/0/4 15.0.0.7 01 00 10200000 /8 0 0800 /8 0 11.0.0.6 1000.0BGP:26.0.0.6Et0/0/2 12.0.0.2 Et0/0/4 15.0.0.7 01 00 10200000 /8 0 0000 /8 0 11.0.0.6 1000.0BGP:26.0.0.6Router> exitThe following example shows how to use the show ip cache flow aggregation bgp-nexthop-tos command to verify that NetFlow BGP next hop accounting is enabled:
Router> show ip cache flow aggregation bgp-nexthop-tosIP Flow Switching Cache, 278544 bytes1 active, 4095 inactive, 1 added8 ager polls, 0 flow alloc failuresActive flows timeout in 30 minutesInactive flows timeout in 15 secondsIP Sub Flow Cache, 17224 bytes1 active, 1023 inactive, 1 added, 1 added to flow0 alloc failures, 0 force free1 chunk, 1 chunk addedSrc If Src AS Dst If Dst AS TOS Flows Pkts B/PkActiveBGP NextHopEt0/0/2 0 Et0/0/4 0 00 9 36 408.2BGP:26.0.0.6Router> exitAdditional References
The following sections provide references related to NetFlow BGP Next Hop Support:
•
MIBs
•
RFCs
Related Documents
Standards
MIBs
MIB MIBs Link•
![]()
•
![]()
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:
RFCs
Technical Assistance
Command Reference
This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 T command reference publications.
•
show ip cache flow aggregation
ip flow-aggregation cache
To enable NetFlow accounting aggregation cache schemes, use the ip flow-aggregation cache command in global configuration mode. To disable NetFlow accounting aggregation cache schemes, use the no form of this command.
ip flow-aggregation cache {as | as-tos | bgp-nexthop-tos | destination-prefix | destination-prefix-tos | prefix | prefix-port | prefix-tos | protocol-port | protocol-port-tos | source-prefix | source-prefix-tos}
no ip flow-aggregation cache {as | as-tos | bgp-nexthop-tos | destination-prefix | destination-prefix-tos | prefix | prefix-port | prefix-tos | protocol-port | protocol-port-tos | source-prefix | source-prefix-tos}
Syntax Description
Command Default
This command is not enabled by default.
Command Modes
Global configuration
Command History
Usage Guidelines
You must have NetFlow accounting configured on your router before you can use this command. The export destination command supports a maximum of two concurrent export destinations.
The ToS aggregation cache scheme keywords enable NetFlow accounting aggregation cache schemes that include the ToS byte in their export records. The ToS byte is an 8-bit field in the IP header. The ToS byte specifies the quality of service for a datagram during its transmission through the Internet.
You can enable only one aggregation cache configuration scheme per command line. The following rules apply to configuring source and destination masks.
•
The source mask can only be configured in the prefix, prefix-port, prefix-tos, source-prefix and source-prefix-tos aggregation modes.
•
The destination mask can only be configured in the prefix, prefix-port, prefix-tos, destination-prefix and destination-prefix-tos aggregation modes.
•
No masks can be configured in non-prefix aggregation modes
To enable aggregation (whether or not an aggregation cache is fully configured), you must enter the enabled command in aggregation cache configuration mode. (You can use the no form of this command to disable aggregation. The cache configuration remains unchanged even if aggregation is disabled.)
Examples
The following example shows how to configure a NetFlow accounting autonomous system aggregation cache scheme:
Router(config)# ip flow-aggregation cache asRouter(config-flow-cache)# enabledThe following example shows how to configure a minimum prefix mask of 16 bits for the NetFlow accounting destination-prefix aggregation cache scheme:
Router(config)# ip flow-aggregation cache destination-prefixRouter(config-flow-cache)# mask destination minimum 16Router(config-flow-cache)# enabledThe following example shows how to configure a minimum prefix mask of 16 bits for the NetFlow accounting source-prefix aggregation cache scheme:
Router(config)# ip flow-aggregation cache source-prefixRouter(config-flow-cache)# mask source minimum 16Router(config-flow-cache)# enabledThe following example shows how to configure multiple export destinations for the NetFlow accounting autonomous system ToS aggregation cache scheme:
Router(config)# ip flow-aggregation cache as-tosRouter(config-flow-cache)# export destination 172.17.24.65 9991Router(config-flow-cache)# export destination 172.16.10.2 9991Router(config-flow-cache)# enabledRelated Commands
ip flow-export
To enable the export of information in NetFlow cache entries, use the ip flow-export command in global configuration mode. To disable the export of information, use the no form of this command.
ip flow-export [destination ip-address udp-port] | [source {ip-address | interface-name}] | [version {1 | [{5 | 9} [origin-as | peer-as] [bgp-nexthop]]}] | [template {refresh-rate packets | timeout-rate minutes} [options {export-stats | refresh-rate packets | timeout-rate minutes}]]
no ip flow-export [destination ip-address udp-port] | [source {ip-address | interface-name}] | [version {1 | [{5 | 9} [origin-as | peer-as] [bgp-nexthop]]}] | [template {refresh-rate packets | timeout-rate minutes} [options {export-stats | refresh-rate packets | timeout-rate minutes}]]
Syntax Description
Command Default
Export of information in NetFlow cache entries is disabled. You can specify origin AS accounting or peer AS export accounting, but not both.
Command Modes
Global configuration
Command History
Usage Guidelines
A NetFlow cache entry contains a lot of information. When flow switching is enabled with the ip route-cache flow command, you can use the ip flow-export command to configure the router to export the flow cache entries to a destination (such as a system running the NetFlow Collection Engine) when flows expire. This configuration can be useful for statistics, billing, and security.
Version 5 and version 9 formats include the source and destination AS addresses and source and destination prefix masks. Also, version 9 includes BGP next hop information. Because this change might appear on your router as a maintenance release, support for version 1 format is maintained with the version 1 keyword.
CautionEntering the ip flow-export or no ip flow-export command on the Cisco 12000 Series Internet routers and specifying any version format other than version 1 (in other words, entering the ip flow-export or no ip flow-export command and specifying either the version 5 or version 9 keyword) 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.
For more information on version 1 and version 5 data format, see the "NetFlow Data Format" section in the "Configuring NetFlow Switching" chapter of the Cisco IOS Switching Services Configuration Guide. For more information on version 9 data format, see the Cisco IOS NetFlow Version 9 Flow-Record Format white paper.
Examples
The following example shows how to configure the router to export the NetFlow cache entry to UDP port 125 on the workstation at 134.22.23.7 when the flow expires using version 1 format:
Router(config)# ip flow-export 134.22.23.7 125The following example shows how to configure the router to export the NetFlow cache entry to UDP port 2048 on the workstation at 134.22.23.7 when the flow expires using version 5 format and includes the peer AS information:
Router(config)# ip flow-export 134.22.23.7 2048 version 5 peer-asRelated Commands
show ip cache flow aggregation
To display the NetFlow accounting aggregation cache statistics, use the show ip cache flow aggregation command in user EXEC or privileged EXEC mode.
show ip cache [prefix mask] [type number] [verbose] flow aggregation {as | as-tos | bgp-nexthop-tos | destination-prefix | destination-prefix-tos | prefix | prefix-port | prefix-tos | protocol-port | protocol-port-tos | source-prefix | source-prefix-tos}
Syntax Description
Command Modes
User EXEC
Privileged EXECCommand History
Examples
The following is a sample display of an autonomous system aggregation cache with the show ip cache flow aggregation as command:
Router# show ip cache flow aggregation asIP Flow Switching Cache, 278544 bytes2 active, 4094 inactive, 13 added178 ager polls, 0 flow alloc failuresSrc If Src AS Dst If Dst AS Flows Pkts B/Pk ActiveFa1/0 0 Null 0 1 2 49 10.2Fa1/0 0 Se2/0 20 1 5 100 0.0The following is a sample display of an autonomous system aggregation cache for the prefix mask 10.0.0.1 255.0.0.0 with the show ip cache flow aggregation as command:
Router# show ip cache 10.0.0.1 255.0.0.0 flow aggregation asIP Flow Switching Cache, 278544 bytes2 active, 4094 inactive, 13 added178 ager polls, 0 flow alloc failuresSrc If Src AS Dst If Dst AS Flows Pkts B/Pk Activee1/2 0 Null 0 1 2 49 10.2e1/2 0 e1/2 20 1 5 100 0.0The following is a sample display of an autonomous system aggregation cache for 10.0.0.1 255.0.0.0 Ethernet1/2 with the show ip cache verbose flow aggregation as command:
Router# show ip cache 10.0.0.1 255.0.0.0 e1/2 verbose flow aggregation asIP Flow Switching Cache, 278544 bytes2 active, 4094 inactive, 13 added178 ager polls, 0 flow alloc failuresSrc If Src AS Dst If Dst AS Flows Pkts B/Pk Activee1/2 0 Null 0 1 2 49 10.2e1/2 0 e1/2 20 1 5 100 0.0The following is a sample display of an autonomous system ToS aggregation cache with the show ip cache verbose flow aggregation as-tos command:
Router# show ip cache verbose flow aggregation as-tosIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 103 added1609 ager polls, 0 flow alloc failuresSrc If Src AS Dst If Dst AS TOS Flows Pkts B/Pk ActiveEt1/2 50 Fd4/0 40 CC 1 3568 28 17.8Et1/2 0 Fd4/0 40 C0 15 17K 28 17.8Et1/1 50 Fd4/0 40 55 1 3748 28 17.8Fd4/0 0 Null 0 C0 1 2 49 0.9The following is a sample display of a protocol port ToS aggregation cache with the show ip cache verbose flow aggregation protocol-port-tos command:
Router# show ip cache verbose flow aggregation protocol-port-tosIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 102 added1584 ager polls, 0 flow alloc failuresProt Src If SrcPort Dst If DstPort TOS Flows Pkts B/Pk Active0x01 Et1/2 0000 Fd4/0 0000 C0 15 17K 28 17.80x01 Et1/2 0000 Fd4/0 0000 CC 1 3568 28 17.80x01 Et1/1 0000 Fd4/0 0000 55 1 3748 28 17.80x06 Fd4/0 00B3 Null 2AF9 C0 1 2 49 0.9The following is a sample display of a source prefix ToS aggregation cache with the show ip cache verbose flow aggregation source-prefix-tos command:
Router# show ip cache verbose flow aggregation source-prefix-tosIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 105 added1683 ager polls, 0 flow alloc failuresSrc If Src Prefix Msk AS TOS Flows Pkts B/Pk ActiveEt1/1 52.0.0.0 /8 50 55 1 3748 28 17.8Et1/2 52.0.0.0 /8 50 CC 1 3568 28 17.8Et1/2 0.0.0.0 /0 0 C0 15 17K 28 17.8Fd4/0 20.20.20.1 /32 0 C0 1 2 49 0.9The following is a sample display of a destination prefix ToS aggregation cache with the show ip cache verbose flow aggregation destination-prefix-tos command:
Router# show ip cache verbose flow aggregation destination-prefix-tosIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 86 added1480 ager polls, 0 flow alloc failuresDst If Dst Prefix Msk AS TOS Flows Pkts B/Pk ActiveLocal 31.31.31.1 /32 0 C0 1 2 49 0.9Fd4/0 42.0.0.0 /8 40 55 1 3748 28 17.8Fd4/0 42.0.0.0 /8 40 CC 1 3568 28 17.8Fd4/0 42.0.0.0 /8 40 C0 15 17K 28 17.8The following is a sample display of a prefix ToS aggregation cache with the show ip cache verbose flow aggregation prefix-tos command:
Router# show ip cache verbose flow aggregation prefix-tosIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 4 added14 ager polls, 0 flow alloc failuresSrc If Src Prefix Dst If Dst Prefix TOS Flows PktsMsk AS Msk AS B/Pk ActiveEt1/2 0.0.0.0 Fd4/0 42.0.0.0 C0 15 3933/0 0 /8 40 28 3.9Et1/1 52.0.0.0 Fd4/0 42.0.0.0 55 1 826/8 50 /8 40 28 3.9Et1/2 52.0.0.0 Fd4/0 42.0.0.0 CC 1 787/8 50 /8 40 28 3.9The following is a sample display of a prefix port aggregation cache with the show ip cache verbose flow aggregation prefix-port command:
Router# show ip cache verbose flow aggregation prefix-portIP Flow Switching Cache, 278544 bytes4 active, 4092 inactive, 105 added1679 ager polls, 0 flow alloc failuresSrc If Src Prefix Dst If Dst Prefix TOS Flows PktsPort Msk Port Msk Pr B/Pk ActiveFd4/0 20.20.20.1 Local 31.31.31.1 C0 1 200B3 /32 2AF9 /32 06 49 0.9Et1/2 0.0.0.0 Fd4/0 42.0.0.0 C0 15 17K0000 /0 0000 /8 01 28 17.8Et1/1 52.0.0.0 Fd4/0 42.0.0.0 55 1 37480000 /8 0000 /8 01 28 17.8Et1/2 52.0.0.0 Fd4/0 42.0.0.0 CC 1 35680000 /8 0000 /8 01 28 17.8Table 3 describes the significant fields shown in the output of the show ip cache verbose flow aggregation command.
Related Commands
show ip cache verbose flow
To display a detailed summary of the NetFlow accounting statistics, use the show ip cache verbose flow command in user EXEC or privileged EXEC mode.
show ip cache verbose flow
Syntax Description
This command has no keywords or arguments.
Command Modes
User EXEC
Privileged EXECCommand History
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 multiline headings and multiline data fields. Figure 1 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 increases. The method for associating the headings with the correct data fields remains the same.
Figure 1 How to Use the Multiline Headings and Multiline Data Fields in the Display Output from the show ip cache verbose flow Command
NetFlow Multicast Support
When the NetFlow Multicast Support feature is enabled, the show ip cache verbose flow 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.
MPLS-aware NetFlow
When you configure the MPLS-aware NetFlow feature, you can use the show ip cache verbose flow command to display both the 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.
NetFlow BGP Nexthop
The NetFlow bgp-nexthop command can be configured when either the Version 5 export format or the Version 9 export format is configured. The following caveats apply to the bgp-nexthop command:
•
The values for the BGP nexthop IP address are exported to a NetFlow collector only when the Version 9 export format is configured.
•
In order for the BGP information to be populated in the main cache you must either have a NetFlow export destination configured or NetFlow aggregation configured.
Displaying Detailed NetFlow Cache Information on Platforms Running Distributed Cisco Express Forwarding
On platforms running Distributed Cisco Express Forwarding (dCEF), NetFlow cache information is maintained on each line card or Versatile Interface Processor. If you want to use the show ip cache verbose flow command to display this information on a distributed platform, you must enter the command at a line card



