© 2005 Cisco Systems, Inc. All rights reserved. BGP v Route Selection Using Attributes Using AS-Path Prepending
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Outline Overview Return Path Selection in a Multihomed AS AS-Path Prepending AS-Path Prepending Design Considerations Configuring AS-Path Prepending Monitoring AS-Path Prepending AS-Path Filtering Concerns with AS-Path Prepending BGP Hide Local-Autonomous System Summary
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Return Path Selection in a Multihomed AS Requirement: The return traffic to the customer must arrive over the highest-speed access link.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Default Return Path Result: The return traffic flows over the path with the shortest AS-path length.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Proper Return Path Selection Q: How do you select the proper return path from AS 387? A: Use local preference in AS 387. Q: Will the administrator of AS 387 configure it? A: Unlikely.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v BGP Route Selection Rules BGP route selection uses the following criteria: –Prefer largest weight. –Prefer largest local preference. –Prefer routes that the router originated. –Prefer shorter AS paths. –Use other route selection rules. Manipulating the outgoing AS-path length could result in proper return path selection.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Prepending Manual manipulation of AS-path length is called AS-path prepending. The AS path should be extended with multiple copies of the AS number of the sender. AS-path prepending is used to: –Ensure proper return path selection –Distribute the return traffic load for multihomed customers
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Prepending (Cont.) Result: The return traffic flows over the desired return path.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Prepending (Cont.) Prepend the AS path with the AS number of the sender, not the AS number of the receiver.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Prepending Design Considerations There is no exact mechanism to calculate the required prepended AS-path length. If a primary and backup scenario is desired: –Use a long prepended AS path over the backup link to ensure that the primary AS path will always be shorter. –A long backup AS path consumes memory on every Internet router. –Experiment with various AS-path lengths until the backup link is idle. –Add a few more AS numbers for additional security (unexpected changes in the Internet). If traffic load distribution is desired: –Start with a short prepended AS path, monitor link use, and extend the prepended path length as needed. –Continuously monitor the link use and change the prepended AS-path length if required.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Configuring AS-Path Prepending route-map name permit sequence match condition set as-path prepend as-number [ as-number … ] route-map name permit sequence match condition set as-path prepend as-number [ as-number … ] router(config)# Prepends the specified AS number sequence to the routes matched by the route-map entry AS numbers prepended to the AS path from the BGP table; the AS number of the sender always prepended to the end result neighbor address route-map name out router(config-router)# Applies the route-map to outgoing updates sent to the specified BGP neighbor
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Configuring AS-Path Prepending (Cont.)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Monitoring AS-Path Prepending AS-path prepending cannot be monitored or debugged on the sending router. –debug ip bgp updates displays the BGP entry prior to route- map processing. –show route-map does not display how many routes have matched a route-map entry. Results of AS-path prepending can be observed on the receiving router.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v show ip bgp regexp regular-expression router> Displays all BGP routes with AS paths matching a regular expression Monitoring AS-Path Prepending (Cont.)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Service providers usually use AS-path filters to control incoming BGP updates from their customers. AS-Path Filtering ConcernsAS-Path Prepending
© 2005 Cisco Systems, Inc. All rights reserved. BGP v The incoming AS-path filters of the service provider need to be modified to support AS-path prepending. To support AS-path prepending, service providers should implement regular expression variables to create a uniform AS-path filter for all customers. –Example: ^([0-9]+)(_\1)*$ AS-Path Filtering ConcernsAS-Path Prepending (Cont.)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Filtering ConcernsAS-Path Prepending (Cont.)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v AS-Path Filtering ConcernsAS-Path Prepending (Cont.)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v BGP Hide Local-Autonomous System Feature Allows you to transparently change the AS number for the entire BGP network Ensures that routes can be propagated throughout the AS neighbor local-as command in address family or router configuration mode allows customization of the AS number for EBGP peer groupings
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Summary If the preferred path for incoming (return) traffic is not configured, the likely result is an asymmetrical traffic flow as well as suboptimal performance of the return traffic. AS-path prepending is performed on outgoing EBGP updates over the nondesired return path or the path where the traffic load should be reduced. You should use a long prepended AS path over the backup link to ensure that the primary AS path will always be shorter. However, care should be taken because a long backup AS path consumes memory. Manual manipulation of the AS-path attribute (prepending) is configured using a route-map with the set as-path prepend command. Monitoring AS-path prepending is best accomplished on the router that is receiving the prepended routes because the prepended path will not be visible on the prepending router.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Summary (Cont.) You can use the show ip bgp regexp command to find all the routes on the receiving router with prepended AS paths. Service providers with customers that use AS-path prepending must create new AS-path filters using specific AS-path entries or with regular expression variables to accommodate AS-path lengths greater than one AS number. The BGP Hide Local-Autonomous System feature allows you to transparently change the AS number for the entire BGP network and ensure that routes can be propagated throughout the AS, while the AS number transition is incomplete.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v