Feedback
|
Table Of Contents
BGP Policy Accounting Output Interface Accounting
Prerequisites for BGP PA Output Interface Accounting
Information About BGP PA Output Interface Accounting
BGP PA Output Interface Accounting
Benefits of BGP PA Output Interface Accounting
How to Configure BGP PA Output Interface Accounting
Specifying the Match Criteria for BGP PA
Classifying the IP Traffic and Enabling BGP PA
Verifying BGP Policy Accounting
Configuration Examples for BGP PA Output Interface Accounting
Specifying the Match Criteria for BGP Policy Accounting: Example
Classifying the IP Traffic and Enabling BGP Policy Accounting: Example
Feature Information for BGP Policy Accounting Output Interface Accounting
BGP Policy Accounting Output Interface Accounting
First Published: 2005Last Updated: May 4, 2009Border Gateway Protocol (BGP) policy accounting (PA) measures and classifies IP traffic that is sent to, or received from, different peers. Policy accounting was previously available on an input interface only. The BGP Policy Accounting Output Interface Accounting feature introduces several extensions to enable BGP PA on an output interface and to include accounting based on a source address for both input and output traffic on an interface. Counters based on parameters such as community list, autonomous system number, or autonomous system path are assigned to identify the IP traffic.
Finding Feature Information
For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for BGP Policy Accounting Output Interface Accounting" section.
Use Cisco Feature Navigator to find information about platform support and Cisco IOS XE software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Contents
•
Prerequisites for BGP PA Output Interface Accounting
•
Information About BGP PA Output Interface Accounting
•
How to Configure BGP PA Output Interface Accounting
•
Configuration Examples for BGP PA Output Interface Accounting
•
Feature Information for BGP Policy Accounting Output Interface Accounting
Prerequisites for BGP PA Output Interface Accounting
Before using the BGP Policy Accounting Output Interface Accounting feature, you must enable BGP and Cisco Express Forwarding or distributed CEF on the router.
Information About BGP PA Output Interface Accounting
•
BGP PA Output Interface Accounting
•
Benefits of BGP PA Output Interface Accounting
BGP PA Output Interface Accounting
Policy accounting using BGP measures and classifies IP traffic that is sent to, or received from, different peers. Originally, BGP PA was available on an input interface only. BGP PA output interface accounting introduces several extensions to enable BGP PA on an output interface and to include accounting based on a source address for both input and output traffic on an interface. Counters based on parameters such as community list, autonomous system number, or autonomous system path are assigned to identify the IP traffic.
Using the BGP table-map command, prefixes added to the routing table are classified by BGP attribute, autonomous system number, or autonomous system path. Packet and byte counters are incremented per input or output interface. A Cisco policy-based classifier maps the traffic into one of eight possible buckets that represent different traffic classes.
Using BGP PA, you can account for traffic according to its origin or the route it traverses. Service providers (SPs) can identify and account for all traffic by customer and can bill accordingly. In Figure 1, BGP PA can be implemented in Router A to measure packet and byte volumes in autonomous system buckets. Customers are billed appropriately for traffic that is routed from a domestic, international, or satellite source.
Figure 1 Sample Topology for BGP Policy Accounting
BGP policy accounting using autonomous system numbers can be used to improve the design of network circuit peering and transit agreements between Internet service providers (ISPs).
Benefits of BGP PA Output Interface Accounting
Accounting for IP Traffic Differentially
BGP policy accounting classifies IP traffic by autonomous system number, autonomous system path, or community list string, and increments packet and byte counters. Policy accounting can also be based on the source address. Service providers can account for traffic and apply billing according to the origin of the traffic or the route that specific traffic traverses.
Efficient Network Circuit Peering and Transit Agreement Design
Implementing BGP policy accounting on an edge router can highlight potential design improvements for peering and transit agreements.
How to Configure BGP PA Output Interface Accounting
•
Specifying the Match Criteria for BGP PA (required)
•
Classifying the IP Traffic and Enabling BGP PA (required)
•
Verifying BGP Policy Accounting (optional)
Specifying the Match Criteria for BGP PA
The first task in configuring BGP PA is to specify the criteria that must be matched. Community lists, autonomous system paths, or autonomous system numbers are examples of BGP attributes that can be specified and subsequently matched using a route map. Perform this task to specify the BGP attribute to use for BGP PA and to create the match criteria in a route map.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip community-list {standard-list-number | expanded-list-number [regular-expression] | {standard | expanded} community-list-name} {permit | deny} {community-number | regular-expression}
4.
route-map map-name [permit | deny] [sequence-number]
5.
match community-list community-list-number [exact]
6.
set traffic-index bucket-number
7.
exit
DETAILED STEPS
Classifying the IP Traffic and Enabling BGP PA
After a route map has been defined to specify match criteria, you must configure a way to classify the IP traffic before enabling BGP policy accounting.
Using the table-map command, BGP classifies each prefix that it adds to the routing table according to the match criteria. When the bgp-policy accounting command is configured on an interface, BGP policy accounting is enabled.
Perform this task to classify the IP traffic and enable BGP policy accounting.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
router bgp as-number
4.
table-map route-map-name
5.
network network-number [mask network-mask]
6.
neighbor ip-address remote-as as-number
7.
exit
8.
interface type number
9.
ip address ip-address mask
10.
bgp-policy accounting [input | output] [source]
11.
exit
DETAILED STEPS
Verifying BGP Policy Accounting
Perform this task to verify that BGP policy accounting is operating.
SUMMARY STEPS
1.
show ip cef [network [mask]] [detail]
2.
show ip bgp [network] [network-mask] [longer-prefixes]
3.
show cef interface [type number] policy-statistics [input | output]
4.
show cef interface [type number] [statistics] [detail]
DETAILED STEPS
Step 1
show ip cef [network [mask]] [detail]
Enter the show ip cef command with the detail keyword to learn which accounting bucket is assigned to a specified prefix.
In this example, the output is displayed for the prefix 192.168.5.0. It shows that accounting bucket number 4 (traffic_index 4) is assigned to this prefix.
Router# show ip cef 192.168.5.0 detail192.168.5.0/24, version 21, cached adjacency to POS7/20 packets, 0 bytes, traffic_index 4via 10.14.1.1, 0 dependencies, recursivenext hop 10.14.1.1, POS7/2 via 10.14.1.0/30valid cached adjacencyStep 2
show ip bgp [network] [network-mask] [longer-prefixes]
Enter the show ip bgp command for the same prefix used in Step 1—192.168.5.0—to learn which community is assigned to this prefix.
In this example, the output is displayed for the prefix 192.168.5.0. It shows that the community of 100:197 is assigned to this prefix.
Router# show ip bgp 192.168.5.0BGP routing table entry for 192.168.5.0/24, version 2Paths: (1 available, best #1)Not advertised to any peer10010.14.1.1 from 10.14.1.1 (32.32.32.32)Origin IGP, metric 0, localpref 100, valid, external, bestCommunity: 100:197Step 3
show cef interface [type number] policy-statistics [input | output]
Enter the show cef interface policy-statistics command to display the per-interface traffic statistics.
In this example, the output shows the number of packets and bytes that have been assigned to each accounting bucket:
Router# show cef interface policy-statistics inputGigabitEthernet1/0/0 is up (if_number 6)Corresponding hwidb fast_if_number 6Corresponding hwidb firstsw->if_number 6BGP based Policy accounting on input is enabledIndex Packets Bytes1 9999 9999002 0 03 0 04 0 05 0 06 0 07 0 08 0 09 0 010 0 011 0 012 0 013 0 014 0 015 0 016 0 017 0 018 0 019 0 020 0 021 0 022 0 023 0 024 0 025 0 026 0 027 0 028 0 029 0 030 0 031 0 032 0 033 0 034 1234 12340035 0 036 0 037 0 038 0 039 0 040 0 041 0 042 0 043 0 044 0 045 1000 10000046 0 047 0 048 0 049 0 050 0 051 0 052 0 053 0 054 5123 119878255 0 056 0 057 0 058 0 059 0 060 0 061 0 062 0 063 0 064 0 0Step 4
show cef interface [type number] [statistics] [detail]
Enter the show cef interface command to display the state of BGP policy accounting on a specified interface.
In this example, the output shows that BGP policy accounting has been configured to be based on input traffic at Gigabit Ethernet interface 1/0/0:
Router# show cef interface Gigabit Ethernet 1/0/0GigabitEthernet1/0/0 is up (if_number 6)Corresponding hwidb fast_if_number 6Corresponding hwidb firstsw->if_number 6Internet address is 10.1.1.1/24ICMP redirects are always sentPer packet load-sharing is disabledIP unicast RPF check is disabledInbound access list is not setOutbound access list is not setIP policy routing is disabledBGP based policy accounting on input is enabledBGP based policy accounting on output is disabledHardware idb is GigabitEthernet1/0/0 (6)Software idb is GigabitEthernet1/0/0 (6)Fast switching type 1, interface type 18IP Distributed CEF switching enabledIP Feature Fast switching turbo vectorIP Feature CEF switching turbo vectorInput fast flags 0x100, Output fast flags 0x0, Flags 0x0ifindex 7(7)Slot 1 Slot unit 0 VC -1Transmit limit accumulator 0xE8001A82 (0xE8001A82)IP MTU 1500
Configuration Examples for BGP PA Output Interface Accounting
•
Specifying the Match Criteria for BGP Policy Accounting: Example
•
Classifying the IP Traffic and Enabling BGP Policy Accounting: Example
Specifying the Match Criteria for BGP Policy Accounting: Example
In the following example, BGP communities are specified in community lists, and a route map named set_bucket is configured to match each of the community lists to a specific accounting bucket using the set traffic-index command:
ip community-list 30 permit 100:190ip community-list 40 permit 100:198ip community-list 50 permit 100:197ip community-list 60 permit 100:296!route-map set_bucket permit 10match community-list 30set traffic-index 2!route-map set_bucket permit 20match community-list 40set traffic-index 3!route-map set_bucket permit 30match community-list 50set traffic-index 4!route-map set_bucket permit 40match community-list 60set traffic-index 5Classifying the IP Traffic and Enabling BGP Policy Accounting: Example
In the following example, BGP policy accounting is enabled on POS interface 2/0/0. The policy accounting criteria is based on the source address of the input traffic, and the table-map command is used to modify the bucket number when the IP routing table is updated with routes learned from BGP.
router bgp 65000table-map set_bucketnetwork 10.15.1.0 mask 255.255.255.0neighbor 10.14.1.1 remote-as 65100!ip classlessip bgp-community new-format!interface POS2/0/0ip address 10.15.1.2 255.255.255.0bgp-policy accounting input sourceno keepalivecrc 32clock source internalAdditional References
The following sections provide references related to the BGP policy accounting output interface accounting feature.
Related Documents
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
MIBs MIBs LinkCISCO-BGP-POLICY-ACCOUNTING-MIB
To locate and download MIBs for selected platforms, Cisco IOS XE software releases, and feature sets, use Cisco MIB Locator found at the following URL:
RFCs
RFCs TitleNo new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.
—
Technical Assistance
Feature Information for BGP Policy Accounting Output Interface Accounting
Table 1 lists the features in this module and provides links to specific configuration information.
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS XE software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Note
Table 1 lists only the Cisco IOS XE software release that introduced support for a given feature in a given Cisco IOS XE software release train. Unless noted otherwise, subsequent releases of that Cisco IOS XE software release train also support that feature.
Glossary
AS—autonomous system. An IP term to describe a routing domain that has its own independent routing policy and is administered by a single authority.
BGP—Border Gateway Protocol. Interdomain routing protocol that exchanges reachability information with other BGP systems.
CEF—Cisco Express Forwarding.
dCEF—distributed Cisco Express Forwarding.
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1005R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.
© 2005-2009 Cisco Systems, Inc. All rights reserved.
Feedback
