BGP 2
BGP 2
BGP 2
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2
BGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3
AS Path
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 4
Path Vector Protocol
AS11268
AS6337
AS7018
AS500
AS6461
AS600
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5
Definitions
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6
Default Free Zone
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 7
provider A
IXP-East
IXP- Backbone
West Provider D
provider B
provider C
AS 100
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 9
A C
DMZ
AS 100 Network AS 101
B D
AS 102
Peering
A C
AS 100 AS 101
B D
E
BGP speakers are
AS 102
called peers
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 11
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 12
Constructing the Forwarding Table
discarded
BGP in
in
process accepted
everything
best paths
BGP out
out
process
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 14
External BGP Peering (eBGP)
AS 100 AS 101
C
Router A in AS100
interface ethernet 5/0
ip address 222.222.10.2 255.255.255.240
router bgp 100
network 220.220.8.0 mask 255.255.252.0
neighbor 222.222.10.1 remote-as 101
neighbor 222.222.10.1 prefix-list RouterC-in in
neighbor 222.222.10.1 prefix-list RouterC-out out
Router C in AS101
interface ethernet 1/0/0
ip address 222.222.10.1 255.255.255.240
router bgp 101
network 220.220.16.0 mask 255.255.240.0
neighbor 222.222.10.2 remote-as 100
neighbor 222.222.10.2 prefix-list RouterA-in in
neighbor 222.222.10.2 prefix-list RouterA-out out
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 16
Internal BGP (iBGP)
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 17
AS 100
D
A
B
E
• Topology independent
• Each iBGP speaker must peer with
every other iBGP speaker in the AS
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 18
Peering to Loop-back Address
AS 100
Router B
interface loopback 0
ip address 215.10.7.2 255.255.255.255
router bgp 100
network 220.220.5.0
neighbor 215.10.7.1 remote-as 100
neighbor 215.10.7.1 update-source loopback0
neighbor 215.10.7.3 remote-as 100
neighbor 215.10.7.3 update-source loopback0
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 20
Inserting prefixes into BGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 21
• Configuration Example:
router bgp 100
redistribute static
ip route 222.10.32.0 255.255.254.0 serial0
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 23
• Configuration Example
router bgp 100
network 222.10.32.0 mask 255.255.254.0
ip route 222.10.32.0 255.255.254.0 serial0
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 24
Configuring Aggregation
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 25
Configuring Aggregation
• Configuration Example:
router bgp 100
redistribute static
ip route 222.10.0.0 255.255.0.0 null0 250
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 26
Configuring Aggregation –
Network Command
• Configuration Example
router bgp 100
network 222.10.0.0 mask 255.255.0.0
ip route 222.10.0.0 255.255.0.0 null0 250
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 27
Configuring Aggregation –
aggregate-address command
• Configuration Example
router bgp 100
network 222.10.32.0 mask 255.255.252.0
aggregate-address 222.10.0.0 255.255.0.0 [ summary-only ]
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 28
Historical Defaults – Auto Summarisation
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 30
Summary
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 31
Introduction to BGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 32
BGP Attributes and Policy
Control
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1
Agenda
• BGP Attributes
• BGP Path Selection
• Applying Policy
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2
BGP Attributes
The “tools” available for the job
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3
What Is an Attribute?
Next
... Hop AS Path MED ... ...
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 4
AS-Path
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5
AS 200 AS 100
170.10.0.0/16 180.10.0.0/16
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6
Next Hop
150.10.1.1 150.10.1.2
AS 200
A B AS 300
150.10.0.0/16
150.10.0.0/16 150.10.1.1
160.10.0.0/16 150.10.1.1
Next Hop
150.10.1.1 150.10.1.2
iBGP C
AS 200
150.10.0.0/16 A B
eBGP AS 300
150.10.0.0/16 150.10.1.1
160.10.0.0/16 150.10.1.1
AS 100
160.10.0.0/16
Next hop not changed for iBGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 8
iBGP Next Hop
220.1.2.0/23
220.1.1.0/24
iBGP C
Loopback
220.1.254.3/32
Loopback B
220.1.254.2/32
AS 300
D
220.1.1.0/24 220.1.254.2
220.1.2.0/23 220.1.254.3
Next hop is ibgp router loopback address
Recursive route look-up
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 9
AS 200
192.68.1.0/24 150.1.1.3
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 11
Origin
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 12
Aggregator
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 13
Local Preference
AS 100
160.10.0.0/16
AS 200 AS 300
D 500 800 E
A B
160.10.0.0/16 500
AS 400
> 160.10.0.0/16 800
C
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 14
Local Preference
• Local to an AS – non-transitive
local preference set to 100 when heard from
neighbouring AS
• Used to influence BGP path selection
determines best path for outbound traffic
• Path with highest local preference wins
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 15
Local Preference
• Configuration of Router B:
router bgp 400
neighbor 220.5.1.1 remote-as 300
neighbor 220.5.1.1 route-map local-pref in
!
route-map local-pref permit 10
match ip address prefix-list MATCH
set local-preference 800
!
ip prefix-list MATCH permit 160.10.0.0/16
ip prefix-list MATCH deny 0.0.0.0/0 le 32
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 16
Multi-Exit Discriminator (MED)
AS 200
A B
192.68.1.0/24
AS 201
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 17
Multi-Exit Discriminator
• Inter-AS – non-transitive
metric attribute not announced to next AS
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 18
MED & IGP Metric
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 19
Multi-Exit Discriminator
• Configuration of Router B:
router bgp 400
neighbor 220.5.1.1 remote-as 200
neighbor 220.5.1.1 route-map set-med out
!
route-map set-med permit 10
match ip address prefix-list MATCH
set metric 1000
!
ip prefix-list MATCH permit 192.68.1.0/24
ip prefix-list MATCH deny 0.0.0.0/0 le 32
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 20
Weight
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 21
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 23
Community
ISP 2
160.10.0.0/16 300:1
X 170.10.0.0/16 300:1
200.10.0.0/16 AS 400
E
200.10.0.0/16 300:9
D ISP 1
AS 300
160.10.0.0/16 300:1 C
170.10.0.0/16 300:1
A B
AS 100 AS 200
160.10.0.0/16 170.10.0.0/16
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 24
Well-Known Communities
• no-export
do not advertise to eBGP peers
• no-advertise
do not advertise to any peer
• local-AS
do not advertise outside local AS (only used with
confederations)
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 25
No-Export Community
170.10.0.0/16
170.10.X.X No-Export
170.10.X.X D
A
170.10.0.0/16
AS 100 AS 200 G
B E
C F
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 26
No-Export Community
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 27
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 28
BGP Path Selection Algorithm
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 29
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 31
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 32
Applying Policy with BGP
How to use the “tools”
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 33
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 34
Policy Control – Prefix List
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 35
Prefix-list Command
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 36
Prefix Lists – Examples
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 37
• Example Configuration
router bgp 200
network 215.7.0.0
neighbor 220.200.1.1 remote-as 210
neighbor 220.200.1.1 prefix-list PEER-IN in
neighbor 220.200.1.1 prefix-list PEER-OUT out
!
ip prefix-list PEER-IN deny 218.10.0.0/16
ip prefix-list PEER-IN permit 0.0.0.0/0 le 32
ip prefix-list PEER-OUT permit 215.7.0.0/16
ip prefix-list PEER-OUT deny 0.0.0.0/0 le 32
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 39
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 40
Policy Control – Regular Expressions
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 41
• Simple Examples
.* match anything
.+ match at least one character
^$ match routes local to this AS
_1800$ originated by AS1800
^1800_ received from AS1800
_1800_ via AS1800
_790_1800_ via AS1800 and AS790
_(1800_)+ multiple AS1800 in sequence
(used to match AS-PATH prepends)
_\(65530\)_ via AS65530 (confederations)
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 42
Policy Control – Regular Expressions
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 43
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 44
Route Maps – Caveats
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 45
• Example
omitting the third line below means that
prefixes not matching list-one or list-two are
dropped
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 47
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 49
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 50
Policy Control – Route Maps
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 51
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 52
Policy Control –
Matching Communities
• Example Configuration
router bgp 100
neighbor 220.200.1.2 remote-as 200
neighbor 220.200.1.2 route-map filter-on-community in
!
route-map filter-on-community permit 10
match community 1
set local-preference 50
!
route-map filter-on-community permit 20
match community 2 exact-match
set local-preference 200
!
ip community-list 1 permit 150:3 200:5
ip community-list 2 permit 88:6
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 53
Policy Control –
Setting Communities
• Example Configuration
router bgp 100
network 215.7.0.0
neighbor 220.200.1.1 remote-as 200
neighbor 220.200.1.1 send-community
neighbor 220.200.1.1 route-map set-community out
!
route-map set-community permit 10
match ip address prefix-list NO-ANNOUNCE
set community no-export
!
route-map set-community permit 20
match ip address prefix-list EVERYTHING
!
ip prefix-list NO-ANNOUNCE permit 172.168.0.0/16 ge 17
ip prefix-list EVERYTHING permit 0.0.0.0/0 le 32
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 54
Aggregation Policies
• Suppress Map
Used to suppress selected more-specific
prefixes (e.g. defined through a route-map)
in the absence of the summary-only
keyword.
• Unsuppress Map
Used to unsuppress selected more-
specific prefixes per BGP peering when the
summary-only keyword is in use.
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 55
Aggregation Policies –
Suppress Map
• Example
router bgp 100
network 220.10.10.0
network 220.10.11.0
network 220.10.12.0
network 220.10.33.0
network 220.10.34.0
aggregate-address 220.10.0.0 255.255.0.0 suppress-map block-net
neighbor 222.5.7.2 remote-as 200
!
route-map block-net permit 10
match ip address prefix-list SUPPRESS
!
ip prefix-list SUPPRESS permit 220.10.8.0/21 le 32
ip prefix-list SUPPRESS deny 0.0.0.0/0 le 32
!
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 56
Aggregation Policies –
Suppress Map
router1#sh ip bgp
BGP table version is 11, local router ID is 222.5.7.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 220.10.0.0/16 0.0.0.0 32768 i
s> 220.10.10.0 0.0.0.0 0 32768 i
s> 220.10.11.0 0.0.0.0 0 32768 i
s> 220.10.12.0 0.0.0.0 0 32768 i
*> 220.10.33.0 0.0.0.0 0 32768 i
*> 220.10.34.0 0.0.0.0 0 32768 i
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 57
Aggregation Policies –
Suppress Map
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 58
Aggregation Policies –
Unsuppress Map
• Example
router bgp 100
network 220.10.10.0
network 220.10.11.0
network 220.10.12.0
network 220.10.33.0
network 220.10.34.0
aggregate-address 220.10.0.0 255.255.0.0 summary-only
neighbor 222.5.7.2 remote-as 200
neighbor 222.5.7.2 unsuppress-map leak-net
!
route-map leak-net permit 10
match ip address prefix-list LEAK
!
ip prefix-list LEAK permit 220.10.8.0/21 le 32
ip prefix-list LEAK deny 0.0.0.0/0 le 32
!
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 59
Aggregation Policies –
Unsuppress Map
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 60
Aggregation Policies –
Unsuppress Map
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 61
Aggregation Policies –
Aggregate Address
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 62
BGP Attributes and Policy
Control
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 63
BGP Communities
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 1
Problem: Scale Routing Policy
Solution: COMMUNITY
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 2
ISP 3 ISP 4
0.0.0.0
Customer 1 Customer 2
(No Default, (Uses Default,
Wants
RST-2003
Full Routes) Wants Your Routes)
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 3
Problem: Scale Routing Policy
Solution: COMMUNITY
Communities: Set Community
1:100—Customer Routes 1:80
1:80—ISP Routes ISP 2
Match Community
ISP 1 1:100
Match Community
Match Community
1:100 1:80
1:100
ISP 3 ISP 4
Set Community
1:100 0.0.0.0
Customer 1 Customer 2
(No Default, (Uses Default,
Wants
RST-2003
Full Routes) Wants Your Routes)
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 4
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 5
BGP Attributes: COMMUNITY (Cont.)
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 6
Community Filters
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 7
Community Filters
• Example 1:
Mark some prefixes as part of the 1:120 community (+remove
existing community!)
• Configuration:
router bgp 1
neighbor 10.0.0.1 remote-as 2
neighbor 10.0.0.1 send-community
neighbor 10.0.0.1 route-map set_community out
!
route-map set_community 10 permit
match ip address 1
set community 1:120
!
access-list 1 permit 10.10.0.0 0.0.255.255
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 8
Community Filters
• Example 2:
Set LOCAL_PREF depending on the community that the
prefix belongs to
• Configuration:
router bgp 1
neighbor 10.0.0.1 remote-as 2
neighbor 10.0.0.1 route-map filter_on_community in
!
route-map filter_on_community 10 permit
match community 1
set local-preference 150
!
ip community-list 1 permit 2:150
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 9
RST-2003
8109_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 10
Deploying iBGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1
Guidelines for Stable IBGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3
Using Peer Groups
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5
Why Route Reflectors?
Avoid n(n-1)/2 IBGP mesh
13 Routers =>
78 IBGP
Sessions!
n=1000 => nearly
half a million
ibgp sessions!
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6
Backbone
RR RR
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 8
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 10
Router id
RR
1.3.1.1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 11
BGP Attributes: ORIGINATOR_ID
• ORIGINATOR_ID
Router ID of IBGP speaker that reflects RR
client routes to non-clients
Overridden by: bgp cluster-id x.x.x.x
• Useful for troubleshooting and
loop detection
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 12
• CLUSTER_LIST
String of ORIGINATOR_IDs through which the
route has passed
• Useful for troubleshooting and
loop detection
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 13
So Far…
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 14
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 15
Deploying eBGP
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1
Customer Issues
• Steps
Configure BGP (use session passwords!)
Generate a stable aggregate
Set inbound policy
Set output policy
Configure loadsharing/multihoming
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2
Connecting to an ISP
AS 2
• AS 100 is a customer of AS 200
10.0.0.0
Router B: .1 A
router bgp 100
aggregate-address 10.60.0.0 255.255.0.0 as-set summary-only
neighbor external remote-as 2
neighbor external description ISP connection
neighbor external remove-private-AS
10.200.0.0
neighbor external version 4
neighbor external prefix-list ispout out
neighbor external route-map ispout out .2 B
neighbor external route-map ispin in
10.60.0.0/16
neighbor external password 7 020A0559
neighbor external maximum-prefix 65000 [warning-only] AS1
neighbor 10.200.0.1 peer-group external
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3
What Is Aggregation?
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 4
How to Aggregate
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5
Why Aggregate?
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6
BGP Attributes
Atomic Aggregate
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 7
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 8
Aggregate Attributes
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 9
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 10
Why Outbound Policy?
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 11
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 12
Load-Sharing—Single Path
Router A:
interface loopback 0
ip address 1.0.0.1 255.255.255.255
!
router bgp 1
neighbor 2.0.0.1 remote-as 2
neighbor 2.0.0.1 update-source loopback0
neighbor 2.0.0.1 ebgp-multi-hop 2
Loopback 0
A 2.0.0.1
AS2
AS1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 13
Router A:
router bgp 1
neighbor 2.0.0.1 remote-as 2
neighbor 2.0.0.1 remote-as 2
maximum-paths 2 ; can configure up to 6
A AS 2
AS 1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 14
What Is Multihoming?
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 15
Types of Multihoming
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 16
Default from All ISPs
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 17
Customer
AS 4
4.0.0.0/8
ISP ISP
AS 2 AS 3
D E
0.0.0.0 0.0.0.0
A B
AS 1
C Chooses Lowest
C IGP Metric to Default
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 18
Customer+Default from All ISPs
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 19
Customer
AS 4
4.0.0.0/8
ISP ISP
AS 2 AS 3
D E
A B
C Chooses
AS 1
Shortest AS Path
C
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 20
Customer Routes from All ISPs
Customer
AS 4
4.0.0.0/8
ISP
ISP
AS 2 AS 3
D 800 E
Tier 2 ISP
Tier 2 ISP AS3
AS 2 D E
A B
AS 1
AS400 Takes Sub-
Optimal AS Path C
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 22
Full Routes from All ISPs
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 23
Tier 2 ISP
Tier 2 ISP
AS3
AS 2
D E
A B
AS 1
C Chooses
Shortest AS Path C
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 24
Controlling Inbound Traffic?
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 25
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 26
Using AS-PATH Prepend
10.1.0.0/16 3 1 1
10.1.0.0/16 2 1 (best)
Customer 10.2.0.0/16 3 1 (best)
to
10.1/16 AS 100 10.2.0.0/16 2 1 1
ISP
ISP
AS 2 AS 3
30.0.0.1
D E
router bgp 1
neighbor 30.0.0.1 remote-as 3
A B
neighbor 30.0.0.1 route-map AS3out out
AS 1 ip prefix-list AS1 permit 10.1.0.0/16
route-map AS3out permit 10
10.1/16 C 10.2/16
match ip address prefix-list AS1
set as-path prepend 1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 27
Using an Advertise-Map
R2 R4
10.15.7/24
1.10.6/24
1.10.6.1
10.15.7.4
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 28
So Far…
• Stability through:
Aggregation
Multihoming
Inbound/outbound filtering
• Scalability of memory/CPU:
Default, customer routes, full routes
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 29
Summary
• Scalability:
Use attributes, especially community
Use peer groups and route reflectors
• Stability:
Use loopback addresses for IBGP
Generate aggregates
Apply passwords
Always filter inbound and outbound
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 30
Summary
• Simplicity—standard solutions:
Three multihoming options
Group customers into communities
Apply standard policy at the edge
Avoid “special configs”
Script your config generation
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 31
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 32
BGP Scaling Techniques
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2
BGP Scaling Techniques
• Dynamic reconfiguration
• Peer groups
• Route flap damping
• Route reflectors
• (Confederations)
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3
Dynamic Reconfiguration
Route Refresh and
Soft Reconfiguration
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 4
Route Refresh
Problem:
• Hard BGP peer reset required after every
policy change because the router does not
store prefixes that are rejected by policy
• Hard BGP peer reset:
Consumes CPU
Severely disrupts connectivity for all networks
Solution:
• Route Refresh
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6
Dynamic Reconfiguration
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 7
Soft Reconfiguration
discarded
peer normal BGP in
process accepted
soft BGP in
table
received BGP
received and used table
peer
BGP out
process
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 9
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 10
Managing Policy Changes
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 11
Peer Groups
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 12
Peer Groups
• Solution – peer-groups
Group peers with the same outbound policy
Updates are generated once per group
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 13
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 14
Configuring a Peer Group
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 16
Peer Groups
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 17
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 18
Route Flap Damping
• Route flap
Going up and down of path or change in attribute
BGP WITHDRAW followed by UPDATE = 1 flap
eBGP neighbour going down/up is NOT a flap
Ripples through the entire Internet
Wastes CPU
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 19
• Requirements
Fast convergence for normal route changes
History predicts future behaviour
Suppress oscillating routes
Advertise stable routes
• Implementation described in RFC 2439
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 20
Operation
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 21
Operation
4000
Suppress limit
3000
Penalty
2000
Reuse limit
1000
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Time
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 23
Configuration
Fixed damping
router bgp 100
bgp dampening [<half-life> <reuse-value> <suppress-
penalty> <maximum suppress time>]
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 24
Operation
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 25
Configuration
• Examples – û
bgp dampening 30 750 3000 60
reuse-limit of 750 means maximum possible penalty is
3000 – no prefixes suppressed as penalty cannot exceed
suppress-limit
• Examples – ü
bgp dampening 30 2000 3000 60
reuse-limit of 2000 means maximum possible penalty is
8000 – suppress limit is easily reached
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 26
Configuration
• Examples – û
bgp dampening 15 500 2500 30
reuse-limit of 500 means maximum possible penalty is
2000 – no prefixes suppressed as penalty cannot exceed
suppress-limit
• Examples – ü
bgp dampening 15 750 3000 45
reuse-limit of 750 means maximum possible penalty is
6000 – suppress limit is easily reached
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 27
Maths!
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 28
Enhancements
• Variable damping
recommendations for ISPs
http://www.ripe.net/docs/ripe-229.html
• Flap statistics
show ip bgp neighbor <x.x.x.x> [dampened-routes |
flap-statistics]
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 29
Route Reflectors
Scaling the iBGP mesh
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 30
Scaling iBGP mesh
Two solutions
Route reflector – simpler to deploy and run
Confederation – more complex, has corner case advantages
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 31
Route Reflector
AS 100
B C
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 32
Route Reflector
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 33
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 34
Route Reflectors:
Loop Avoidance
• Originator_ID attribute
Carries the RID of the originator of the route in the local
AS (created by the RR)
• Cluster_list attribute
The local cluster-id is added when the update is sent by
the RR
Cluster-id is router-id (address of loopback)
Do NOT use bgp cluster-id x.x.x.x
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 35
Route Reflectors:
Redundancy
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 36
Route Reflector: Benefits
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 37
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 38
Route Reflector: Migration
AS 300
A
B C
AS 100
D
E G
F
AS 200
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 40
BGP Scaling Techniques
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 41
BGP Confederations
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 42
Confederations
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 43
Confederations
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 44
Confederations
Sub-AS
65530
AS 200
Sub-AS
65531
B
• Configuration (rtr B): Sub-AS
65532
router bgp 65532
bgp confederation identifier 200
bgp confederation peers 65530 65531
neighbor 141.153.12.1 remote-as 65530
neighbor 141.153.17.2 remote-as 65531
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 45
Sub-
Sub-AS
65002
180.10.0.0/16 180.10.11.1
A
Sub-AS
Sub-
Sub-AS AS 200
65003 B C 65001 D E
Confederation 100
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 46
Confederation: Principle
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 47
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 48
Confederations: AS-Sequence
180.10.0.0/16 200
A
Sub-AS
65002
B
180.10.0.0/16 {65004 65002} 200 180.10.0.0/16 {65002} 200
Sub-AS
65004
Sub-AS G D E Sub-AS
H 65003 F 65001
Confederation
180.10.0.0/16 100 200
100
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 49
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 50
Confederations (cont.)
• Example (cont.):
BGP table version is 78, local router ID is 141.153.17.1
Status codes: s suppressed, d damped, h history, * valid, >
best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0 141.153.14.3 0 100 0 (65531) 1 i
*> 141.153.0.0 141.153.30.2 0 100 0 (65530) i
*> 144.10.0.0 141.153.12.1 0 100 0 (65530) i
*> 199.10.10.0 141.153.29.2 0 100 0 (65530) 1 i
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 51
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 52
Confederations: Benefits
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 53
Confederations: Caveats
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 54
RRs or Confederations
Anywhere Medium
Confederations in the Yes Yes Medium
to High
Network
Route Anywhere
Reflectors in the Yes Yes Very High Very Low
Network
Most new service provider networks now deploy Route Reflectors from Day One
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 55
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 56
Troubleshooting BGP
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 1
Before We Begin…
• My assumptions
Operational experience with BGP
Intermediate to advanced knowledge of
the protocol
• What can you expect to get from this
presentation?
Learn how to use show commands and
debugs to troubleshoot BGP problems
Go through various real world examples
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 2
Agenda
• Peer Establishment
• Missing Routes
• Inconsistent Route Selection
• Loops and Convergence Issues
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 3
Peer Establishment
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 4
Common Problems
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 5
Peer Establishment—Diagram
1.1.1.1 2.2.2.2
iBGP
? R1 R2 eBGP
3.3.3.3
AS 1
R3
?
AS 2
R2#sh run | begin ^router bgp
router bgp 1
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 1
neighbor 3.3.3.3 remote-as 2
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 6
Peer Establishment—Symptoms
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 7
Peer Establishment
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 8
Peer Establishment—iBGP
• Assume that IP connectivity has been checked
• Check TCP to find out what connections we are accepting
We Are Listening for TCP Connections for Port 179 for the
Configured Peering Addresses Only!
R2#debug ip tcp transactions
TCP special event debugging is on
R2#
TCP: sending RST, seq 0, ack 2500483296
TCP: sent RST to 4.4.4.4:26385 from 2.2.2.2:179
Peer Establishment—iBGP
What about Us?
R2#debug ip bgp
BGP debugging is on
R2#
BGP: 1.1.1.1 open active, local address 4.4.4.5
BGP: 1.1.1.1 open failed: Connection refused by remote host
R2#
router bgp 1
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 update-source Loopback0
neighbor 3.3.3.3 remote-as 2
neighbor 3.3.3.3 update-source Loopback0
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 11
Peer Establishment—Diagram
1.1.1.1 2.2.2.2
iBGP
R1 R2 eBGP
3.3.3.3
AS 1
R3
?
AS 2
• R1 is established now
• The eBGP session is still having trouble!
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 12
Peer Establishment—eBGP
Peer Establishment—eBGP
R2#ping ip
Target IP address: 3.3.3.3
Extended commands [n]: y
Source address or interface: 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 14
Peer Establishment—eBGP
• Assume R3 added a route to 2.2.2.2
• Still having problems…
R2#sh ip bgp neigh 3.3.3.3
BGP neighbor is 3.3.3.3, remote AS 2, external link
BGP version 4, remote router ID 0.0.0.0
BGP state = Idle
Last read 00:00:04, hold time is 180, keepalive interval is 60 seconds
Received 0 messages, 0 notifications, 0 in queue
Sent 0 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 0
Index 2, Offset 0, Mask 0x4
0 accepted prefixes consume 0 bytes
Prefix advertised 0, suppressed 0, withdrawn 0
Connections established 0; dropped 0
Last reset never
External BGP neighbor not directly connected.
No active TCP connection
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 15
Peer Establishment—eBGP
R2#
router bgp 1
neighbor 3.3.3.3 remote-as 2
neighbor 3.3.3.3 ebgp-multihop 255
neighbor 3.3.3.3 update-source Loopback0
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 17
Peer Establishment—eBGP
R2#debug ip bgp events
14:06:37: BGP: 3.3.3.3 open active, local address 2.2.2.2
14:06:37: BGP: 3.3.3.3 went from Active to OpenSent
14:06:37: BGP: 3.3.3.3 sending OPEN, version 4
14:06:37: BGP: 3.3.3.3 received NOTIFICATION 2/2
(peer in wrong AS) 2 bytes 0001
14:06:37: BGP: 3.3.3.3 remote close, state CLOSEWAIT
14:06:37: BGP: service reset requests
14:06:37: BGP: 3.3.3.3 went from OpenSent to Idle
14:06:37: BGP: 3.3.3.3 closing
AS 1 AS 2
eBGP
R1 R2
Layer 2
ATM or FR
Small Packets Cloud
Large Packets
• Small packets are ok
• Large packets are lost in the cloud
• BGP session flaps
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 19
Flapping Peer
• Enable “bgp log-neighbor-changes” so you get
a log message when a peer flaps
• R1 and R2 are peering over ATM cloud
R2#
%BGP-5-ADJCHANGE: neighbor 1.1.1.1 Down BGP
Notification sent
%BGP-3-NOTIFICATION: sent to neighbor 1.1.1.1 4/0
(hold time expired) 0 bytes
R2#show ip bgp neighbor 1.1.1.1 | include Last reset
Last reset 00:01:02, due to BGP Notification sent,
hold time expired
• We are not receiving keepalives from the other side!
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 20
Flapping Peer
• Let’s take a look at our peer!
R1#show ip bgp sum
BGP router identifier 172.16.175.53, local AS number 1
BGP table version is 10167, main routing table version 10167
10166 network entries and 10166 paths using 1352078 bytes of memory
1 BGP path attribute entries using 60 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 10166/300 prefixes, 10166/0 paths, scan interval 15 secs
Flapping Peer
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/21/24 m
R1#ping ip
Target IP address: 2.2.2.2
Repeat count [5]:
Datagram size [100]: 1500
Timeout in seconds [2]:
Extended commands [n]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
• Things to check
MTU values
Traffic shaping
Rate-limiting parameters
• Looks like a Layer 2 problem
• At this point we have verified that BGP
is not at fault
• Next step is to troubleshoot layer 2…
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 23
Flapping Peer—Diagram
AS 1 AS 2
eBGP
R1 R2
Layer 2
ATM or FR
Small Packets Cloud
Large Packets
• Extended ping/traceroute
allow you to verify
Loopback to loopback IP connectivity
TTL issues
• “show ip bgp summary”
Displays the state of all peers
• “show ip bgp neighbor”
Gives a lot of information regarding the peer
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 25
Troubleshooting Tips
• “debug ip bgp”
Should give you a good hint as to why a peer
will not establish
• “debug ip bgp events”
Displays state transitions for peers
• “show ip bgp neighbor | include Last
reset”
Will show you the last reset reason for
all peers
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 26
Agenda
• Peer Establishment
• Missing Routes
• Inconsistent Route Selection
• Loops and Convergence Issues
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 27
Quick Review
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 28
Quick Review
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 29
Missing Routes—Agenda
• Route Origination
• UPDATE Exchange
• Filtering
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 30
Route Origination—Example I
Route Origination—Example I
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 32
Route Origination—Example II
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 33
Route Origination—Example II
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 34
Route Origination—Example III
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 35
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 37
Missing Routes
• Route Origination
• UPDATE Exchange
• Filtering
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 38
Missing Routes—Example I
• Two RR clusters
• R1 is a RR for R3
• R2 is a RR for R4
R1 R2
• R4 is advertising
7.0.0.0/8 R3 R4
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 39
Missing Routes—Example I
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 40
Missing Routes—Example I
• Time to debug!!
access-list 100 permit ip host 7.0.0.0 host 255.0.0.0
R1# debug ip bgp update 100
Missing Routes—Example I
• One RR cluster
R1 R2
• R1 and R2 are RRs
• R3 and R4 are RRCs
• R4 is advertising R3 R4
7.0.0.0/8
R2 has it
R1#show run | include cluster
R1 and R3 do not bgp cluster-id 10
R2#show run | include cluster
bgp cluster-id 10
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 43
Missing Routes—Example II
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 44
Missing Routes—Example II
• Time to debug!!
access-list 100 permit ip host 7.0.0.0 host 255.0.0.0
R1# debug ip bgp update 100
Troubleshooting Tips
• “show ip bgp neighbor x.x.x.x advertised-routes”
Lets you see a list of NLRI that you sent a peer
Note: The attribute values shown are taken from the BGP
table; attribute modifications by outbound route-maps will
not be shown
• “show ip bgp neighbor x.x.x.x routes”
Displays routes x.x.x.x sent to us that made it through our
inbound filters
• “show ip bgp neighbor x.x.x.x received-routes”
Can only use if “soft-reconfig inbound” is configured
Displays all routes received from a peer, even those that
were denied
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 46
Troubleshooting Tips
• “clear ip bgp x.x.x.x soft in”
Ask x.x.x.x to resend his UPDATEs to us
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 47
Missing Routes
• Route Origination
• UPDATE Exchange
• Filtering
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 48
Update Filtering
• Type of filters
Prefix filters
AS_PATH filters
Community filters
Route-maps
• Applied incoming and/or outgoing
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 49
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 50
Missing Routes—Update Filters
R1 R2
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 51
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 52
Missing Routes—Update Filters
R2#sh ip as-path 1
AS path access list 1
permit ^$
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 53
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 54
Missing Routes—Update Filters
Nothing matches again! Let’s use the up arrow key to see where the
cursor stops
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 56
Missing Routes—Update Filters
R1#show run | include neighbor 2.2.2.2
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 route-map POLICY in
R1#show route-map POLICY
route-map POLICY, permit, sequence 10
Match clauses:
ip address (access-lists): 100 101
as-path (as-path filter): 1
Set clauses:
Policy routing matches: 0 packets, 0 bytes
R1#show access-list 100
Extended IP access list 100
permit ip host 10.0.0.0 host 255.255.0.0
R1#show access-list 101
Extended IP access list 101
permit ip 200.1.0 0.0.0.255 host 255.255.255.0
R1#show ip as-path 1
AS path access list 1
permit ^12$
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 57
R1 R2
R1#
4d00h: BGP(0): 2.2.2.2 rcvd UPDATE w/ attr: nexthop 2.2.2.2, origin i,
metric 0, path 12
4d00h: BGP(0): 2.2.2.2 rcvd 10.0.0.0/8 -- DENIED due to: route-map;
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 58
Missing Routes—Update Filters
R1#sh run | include neighbor 2.2.2.2
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 route-map POLICY in
R1#sh route-map POLICY
route-map POLICY, permit, sequence 10
Match clauses:
ip address (access-lists): 100 101
as-path (as-path filter): 1
Set clauses:
Policy routing matches: 0 packets, 0 bytes
R1#sh access-list 100
Extended IP access list 100
permit ip host 10.0.0.0 host 255.255.0.0
R1#sh access-list 101
Extended IP access list 101
permit ip 200.1.1.0 0.0.0.255 host 255.255.255.0
R1#sh ip as-path 1
AS path access list 1
permit ^12$
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 59
• Should be
Extended IP access list 100
permit ip host 10.0.0.0 host 255.0.0.0
• “show ip as-path-access-list”
Displays the filter
• “show ip bgp filter-list”
Displays BGP paths that match the filter
• “show ip bgp regexp”
Displays BGP paths that match the as-path
regular expression; handy for troubleshooting
filter-list issues
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 61
Troubleshooting Tips
• “show ip community-list”
Displays the filter
• “show ip bgp community-list”
Displays BGP paths that match the filter
• “show ip prefix-list”
Displays the filter
Prefix-list are generally easier to use than ACLs
• “show ip bgp prefix-list”
Displays BGP paths that match the filter
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 62
Troubleshooting Tips
• “show route-map”
Displays the filter
• “show ip bgp route-map”
Displays BGP paths that match the filter
• “show access-list”
Displays the filter
• debug ip bgp update ACL
After going through the config, debug!
Don’t forget the ACL
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 63
Agenda
• Peer Establishment
• Missing Routes
• Inconsistent Route Selection
• Loops and Convergence Issues
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 64
Inconsistent Route Selection
Inconsistent—Example I
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 66
Inconsistent—Example I
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 67
Symptom I—Diagram
AS 3 AS 10
10.0.0.0/8
R3
R2
MED 30
MED 20 RouterA
AS 2
AS 1
MED 0
• RouterA will have three paths
• MEDs from AS 3 will not be compared to R1
MEDs from AS 1
• RouterA will sometimes select the path from R1 as best and but may
also select the path from R3 as best
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 68
Inconsistent—Example I
• Initial State
Path 1 beats Path 2—Lower MED
Path 3 beats Path 1—Lower Router-ID
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 69
Inconsistent—Example I
RouterA#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 40
Paths: (3 available, best #3, advertised over iBGP, eBGP)
1 10
1.1.1.1 from 1.1.1.1
Origin IGP, metric 0, localpref 100, valid, internal
3 10
2.2.2.2 from 2.2.2.2
Origin IGP, metric 20, localpref 100, valid, internal
3 10
3.3.3.3 from 3.3.3.3
Origin IGP, metric 30, valid, external, best
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 71
Deterministic MED—Result
RouterA#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 40
Paths: (3 available, best #1, advertised over iBGP, eBGP)
1 10
1.1.1.1 from 1.1.1.1
Origin IGP, metric 0, localpref 100, valid, internal, best
3 10
2.2.2.2 from 2.2.2.2
Origin IGP, metric 20, localpref 100, valid, internal
3 10
3.3.3.3 from 3.3.3.3
Origin IGP, metric 30, valid, external
AS 3 AS 10
10.0.0.0/8
R3
R2
MED 30
MED 20 RouterA
AS 2
AS 1
MED 0
R1
• RouterA will have three paths
• RouterA will consistently select the path from R1 as best!
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 73
Deterministic MED—Summary
AS 10 AS 20
• The bestpath changes
every time the peering R1 R2
is reset
R3
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 75
Inconsistent—Example II
R3#show ip bgp 7.0.0.0
BGP routing table entry for 7.0.0.0/8, version 17
Paths: (2 available, best #2)
Not advertised to any peer
20 100
2.2.2.2 from 2.2.2.2
Origin IGP, metric 0, localpref 100, valid, external
10 100
1.1.1.1 from 1.1.1.1
Origin IGP, metric 0, localpref 100, valid, external, best
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 77
Inconsistent—Example III
• Path is from an internal peer which means the path
must be synchronized by default
• Check to see if sync is on or off
R1# show run | include sync
R1#
• Sync is still enabled, check for IGP path:
R1# show ip route 11.0.0.0
% Network not in table
• CSCdr90728 “BGP: Paths are not marked as not
synchronized”—Fixed in 12.1(4)
• Path 1 is not synchronized
• Router made the correct choice
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 78
Troubleshooting Tips
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 79
Agenda
• Peer Establishment
• Missing Routes
• Inconsistent Route Selection
• Loops and Convergence Issues
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 80
Route Oscillation
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 81
Route Oscillation—Diagram
R3
R1
AS 3 R2
142.108.10.2
AS 4
AS 12
• Watch for:
Table version number incrementing rapidly
Number of networks/paths or external/internal
routes changing
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 83
Route Oscillation—Troubleshooting
• Pick a route from the RIB that has changed within
the last minute
• Monitor that route to see if it changes every minute
R3#show ip route 156.1.0.0
Routing entry for 156.1.0.0/16
Known via "bgp 3", distance 200, metric 0
Routing Descriptor Blocks:
* 1.1.1.1, from 1.1.1.1, 00:00:53 ago
Route metric is 0, traffic share count is 1
AS Hops 2, BGP network version 474
Route Oscillation—Troubleshooting
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 86
Route Oscillation—Troubleshooting
• BGP nexthop is known via BGP
• Illegal recursive lookup
• Scanner will notice and install the other path in the RIB
R3#sh debug
BGP events debugging is on
BGP updates debugging is on
IP routing debugging is on
R3#
BGP: scanning routing tables
BGP: nettable_walker 142.108.0.0/16 calling revise_route
RT: del 142.108.0.0 via 142.108.10.2, bgp metric [200/0]
BGP: revise route installing 142.108.0.0/16 -> 1.1.1.1
RT: add 142.108.0.0/16 via 1.1.1.1, bgp metric [200/0]
RT: del 156.1.0.0 via 142.108.10.2, bgp metric [200/0]
BGP: revise route installing 156.1.0.0/16 -> 1.1.1.1
RT: add 156.1.0.0/16 via 1.1.1.1, bgp metric [200/0]
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 87
Route Oscillation—Troubleshooting
R3#
BGP: scanning routing tables
BGP: ip nettable_walker 142.108.0.0/16 calling revise_route
RT: del 142.108.0.0 via 1.1.1.1, bgp metric [200/0]
BGP: revise route installing 142.108.0.0/16 -> 142.108.10.2
RT: add 142.108.0.0/16 via 142.108.10.2, bgp metric [200/0]
BGP: nettable_walker 156.1.0.0/16 calling revise_route
RT: del 156.1.0.0 via 1.1.1.1, bgp metric [200/0]
BGP: revise route installing 156.1.0.0/16 -> 142.108.10.2
RT: add 156.1.0.0/16 via 142.108.10.2, bgp metric [200/0]
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 88
Route Oscillation—Step by Step
R3
R1
AS 3 R2
142.108.10.2
AS 4
AS 12
• R3 naturally prefers routes from AS 12
• R3 does not have an IGP route to 142.108.10.2 which is the next-hop for
routes learned via AS 12
• R3 learns 142.108.0.0/16 via AS 4 so 142.108.10.2 becomes reachable
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 89
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 91
Route Oscillation—Solution
R3
R1
AS 3 R2
142.108.10.2
AS 4
AS 12
1.1.1.1
R1
• Traffic loops between
10.0.0.0/8
R3, R4, and R2 SubAS 65002
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 93
Routing Loop
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 95
Routing Loop
Routing Loop
• What is R3 advertising?
R3# show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 3
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to non peer-group peers:
5.5.5.5 2.2.2.2
(65001 65002)
1.1.1.1 (metric 5031) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, confed-external, best, multipath
(65001 65002)
1.1.1.1 (metric 5031) from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, confed-external, multipath
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 99
Troubleshooting Tips
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 100
Troubleshooting Tips
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 101
Convergence Problems
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 102
Convergence Problems
• Have been trying to converge for 10 minutes
• Peers keep dropping so we never converge?
RR# show ip bgp summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
20.3.1.160 4 100 10 5416 9419 0 0 00:00:12 Closing
20.3.1.161 4 100 11 4418 8055 0 335 00:10:34 0
20.3.1.162 4 100 12 4718 8759 0 128 00:10:34 0
20.3.1.163 4 100 9 3517 0 1 0 00:00:53 Connect
20.3.1.164 4 100 13 4789 8759 0 374 00:10:37 0
20.3.1.165 4 100 13 3126 0 0 161 00:10:37 0
20.3.1.166 4 100 9 5019 9645 0 0 00:00:13 Closing
20.3.1.167 4 100 9 6209 9218 0 350 00:10:38 0
• Check the log to find out why
RR#show log | i BGP
*May 3 15:27:16: %BGP-5-ADJCHANGE: neighbor 20.3.1.118 Down— BGP Notification sent
*May 3 15:27:16: %BGP-3-NOTIFICATION: sent to neighbor 20.3.1.118 4/0 (hold time expired) 0 bytes
*May 3 15:28:10: %BGP-5-ADJCHANGE: neighbor 20.3.1.52 Down— BGP Notification sent
*May 3 15:28:10: %BGP-3-NOTIFICATION: sent to neighbor 20.3.1.52 4/0 (hold time expired) 0 bytes
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 103
Convergence Problems
• We are either missing hellos or our peers are not sending them
• Check for interface input drops
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 105
Convergence Problems
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 106
Convergence Problems
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 107
Convergence Problems
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 108
Convergence Problems
Summary/Tips
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 110
References
• Standards
RFC 1771, 1997, etc…
http://www.rfc-editor.org/rfcsearch.html
http://search.ietf.org/search/brokers/internet-drafts/query.html
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 111
RST-343
5386_05_2002_c1 © 2002, Cisco Systems, Inc. All rights reserved. 112
BGP New Features
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 1
Assumptions
• New Features
• Multipath
• Graceful Restart
• Protocol Issues
• Convergence and Scalability
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 3
New Features—Agenda
Continue Statement
• continue statement for route-maps
• Provides the ability to jump to a specific step within the current
route-map
• 12.0(24)S—CSCdx90201
! New way
! Old way route-map foo-new permit 10
route-map foo-old permit 10 match ip address 1
match ip address 1 set community 100:57
set community 100:57 continue 30
set as-path prepend 100 100 !
! route-map foo-new permit 20
route-map foo-old permit 20 match ip address 2
match ip address 2 set community 100:58
set community 100:58 continue 30
set as-path prepend 100 100 !
! route-map foo-new permit 30
set as-path prepend 100 100
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 6
Policy Configuration
• Peer-groups are used to group peers with common
outgoing policy
No exceptions in the outgoing policy are allowed
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 7
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 8
BGP Peer Templates
• 12.0(24)S
• Two types of templates
• Session template
Can inherit from one session-template
Used to configure AFI (address-family-identifier)
independent parameters
remote-as, ebgp-multihop, passwords, etc.
• Peer/policy template
Can inherit from multiple peer/policy templates
Used to configure AFI dependant parameters
Filters, next-hop-self, route-reflector-client, etc.
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 9
Session Template
router bgp 100
!
template peer-session all-sessions
version 4
!
timers 10 30
no synchronization
exit-peer-session
bgp log-neighbor-changes
!
neighbor 1.1.1.1 inherit peer-session iBGP-session
template peer-session iBGP-session
neighbor 1.1.1.2 inherit peer-session iBGP-session
remote-as 100
neighbor 1.1.1.3 inherit peer-session iBGP-session
password 7
neighbor 10.1.1.1 remote-as 1442
022F021B12091A61484B0A0B1C07064B180C2338642C26
neighbor 10.1.1.1 inherit peer-session eBGP-session
272B1D
neighbor 10.1.1.2 remote-as 6445
description iBGP peer
neighbor 10.1.1.2 inherit peer-session eBGP-session
update-source Loopback0
no auto-summary
inherit peer-session all-sessions
!
exit-peer-session
!
template peer-session eBGP-session
description eBGP peer
ebgp-multihop 2
inherit peer-session all-sessions
exit-peer-session
!
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 11
Policy Template
!
template peer-policy foo Router#show ip bgp neighbors 10.1.1.3 policy
filter-list 100 out Neighbor: 10.1.1.3, Address-Family: IPv4
prefix-list foo-filter out
inherit peer-policy all-peers 10
Unicast
exit-peer-policy Inherited polices:
! prefix-list deny-martians in
template peer-policy bar prefix-list bar-filter out
prefix-list bar-filter out filter-list 100 out
exit-peer-policy Router#
!
template peer-policy seq_example
inherit peer-policy bar 20
inherit peer-policy foo 10
exit-peer-policy
!
neighbor 10.1.1.3 remote-as 200
neighbor 10.1.1.3 inherit peer-policy seq_example
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 12
BGP Update Groups
• 12.0(24)S
• The problem: peer-groups help BGP scale
but customers do not always use peer-
groups, especially with eBGP peers
• The solution: treat peers with a common
outbound policy as if they are in a peer-group
• An “update group” is a group of peers with a
common outbound policy which will be
converged as if they are in a peer-group
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 13
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 16
BGP Update Groups
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 17
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 18
BGP Custom Decision Algorithm
Solution
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 19
Cost Community
Format
+-------------------------------+
| Type TBD (2 octets) |
Value of the Path Attribute
+-------------------------------+
after which this Community
| Point of Insertion (1 octet) | Should Be Considered
during the Best Path
+-------------------------------+
Selection Process
| Community-ID (1 octet) |
+-------------------------------+ Multiple Communities May
Be Used
| Cost (4 octet) |
+-------------------------------+ Locally Significant Cost;
Lower Cost Is Preferred;
Default Value Is 0x7fffffff
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 20
BGP Custom Decision Algorithm
Operation
• The Cost and Point of Insertion are assigned by the
local administrator
All Cost Communities should be advertised throughout the
local AS
The Cost is considered at the Point of Insertion specified
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 21
• per-peer/per-address-family
Sent/Rcvd #s for all message types
Per inbound/outbound filter #s for number of prefixes denied
# of automatically denied prefixes
# of bestpaths/multipaths recevied
# of explicit/implicit withdraws sent/rcvd
# of routes advertised
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 24
BGP Improved Counters
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 25
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
* route-map: 0 0
* filter-list: 0 0
* prefix-list 0 0
* Ext Community: n/a 0
* AS_PATH too long: n/a 0
* AS_PATH loop: n/a 0
* AS_PATH confed info: n/a 0
* AS_PATH contains AS 0: n/a 0
* NEXT_HOP Martian: n/a 0
* NEXT_HOP non-local: n/a 0
* NEXT_HOP is us: n/a 0
* CLUSTER_LIST loop: n/a 0
* ORIGINATOR loop: n/a 6
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 26
BGP Improved Counters
* unsuppress-map: 0 n/a
* advertise-map: 0 n/a
* VPN Imported prefix: 0 n/a
* Well-known Community: 0 n/a
* SOO loop: 0 n/a
* Bestpath from this peer: 2 n/a
* Suppressed due to dampening: 0 n/a
* Bestpath from iBGP peer: 0 n/a
* Incorrect RIB for CE: 0 n/a
* BGP distribute-list: 0 n/a
Total: 2 6
Number of NLRIs in the update sent: max 7, min 0
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 27
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 29
Agenda
• New Features
• Multipath
• Graceful Restart
• Protocol Issues
• Convergence and Scalability
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 30
Multipath Review
• Previously only supported for eBGP peers in the same
Neighbor AS
• Multiple eBGP paths can be flagged as multipath as long as the
paths are similar
• Similar means that all relevant BGP attributes are a tie and that
there is no significant difference between
the paths
If paths 1 and 2 both have a local-pref of 200, MED of 300, etc…but the
router-IDs are different then paths 1 and 2 are eligible for multipath
• These paths are installed in the RIB/FIB to load-balance
outbound traffic
• Multipath is the correct approach to a difficult problem but
not terribly useful because it can only be used in one
specific topology
iBGP multipath and link-BW will help correct this
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 31
iBGP Multipath
R2 R4
AS 200
R1 10.0.0.0/8
AS 100
R3 R5
iBGP Multipath
• R1 has two R2 R4
paths for AS 200
10.0.0.0/8 R1 10.0.0.0/8
AS 100
• Both paths R3 R5
are flagged as
“multipath”
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 34
iBGP Multipath
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 35
iBGP Multipath
T1
R2 R4
T2 AS 200
R1 L1 10.0.0.0/8
AS 100 L2 R3 R5
4M
R2 1M
R4
AS 200
R1 R5 10.0.0.0/8
AS 100
R3 10M R6
R1#
router bgp 100
bgp dmzlink-bw
maximum-paths ibgp 6
R2#
router bgp 100
bgp dmzlink-bw
maximum-paths 6
neighbor 1.1.1.1 send-community extended
neighbor 4.4.4.4 dmzlink-bw
neighbor 5.5.5.5 dmzlink-bw
R3#
router bgp 100
neighbor 1.1.1.1 send-community extended
neighbor 6.6.6.6 dmzlink-bw
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 40
Link BW—Ext Community
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 41
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 42
Agenda
• New Features
• Multipath
• Graceful Restart
• Protocol Issues
• Convergence and Scalability
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 43
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 44
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 45
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 46
Non-Stop Forwarding
• Some mechanism to
recover forwarding
information at the control
plane must be used in B
conjunction with NSF,
such as routing protocols
graceful restart
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 47
Non-Stop Forwarding
• The switching
components in the
router continue FIB
forwarding information
based on the last good
known FIB information
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 48
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 49
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 50
Non-Stop Forwarding
Non-Stop Forwarding
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 53
NSF—Operation
• Once the switchover is complete…
Routing protocol is restarted
Signal sent to neighbors indicating the process is
restarting
Avoids adjacencies from being reset
Exchange of routing information (re-sync)
Route selection is done once re-sync is complete
FIB is updated
Any remaining “dirty” routes must be removed
• Transient routing loops or black holes may be
introduced if the network topology changes
before the FIB is updated
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 54
BGP Graceful Restart
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 55
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 57
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 58
BGP Graceful Restart
Graceful Restart Capability Fields
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 59
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 60
BGP Graceful Restart
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 61
Agenda
• New Features
• Multipath
• Graceful Restart
• Protocol Issues
• Convergence and Scalability
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 62
Protocol Issues—Agenda
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 63
minRouteAdvertisementInterval
“MinRouteAdvertisementInterval
determines the minimum amount
of time that must elapse between
advertisement of routes to a
particular destination from a single
BGP speaker.”
Draft-ietf-idr-bgp4-13
Section 9.2.3.1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 64
minRouteAdvertisementInterval
• *Studies show the effects of the
minRouteAdvertisementInterval on BGP
convergence
• In a nutshell
Keeping the timer per peer instead of per prefix has
some negative effects
The default MinAdvInterval of 30 seconds may be
too long
TX loop detection should be implemented
Using an outbound filter to prevent advertising
routes to a peer that will deny them due to AS_PATH
loop detection
*“An Experimental Study of Internet Routing Convergence”
—Labovitz, Ahuja, Bose, Jahanian
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 65
minRouteAdvertisementInterval
AS 300
AS 200
10.0.0.0/8
AS 400 AS 100
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 66
BGP Convergence Example
—Slide “Borrowed” from Labovitz Presentation
R
AS2 AS3
AS0 AS1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 69
minRouteAdvertisementInterval—
Conclusions
• Default behavior takes
almost 1 minute to
converge
• Using a
MinAdvInterval of 0
results results in a
flurry of messages
(43) for a single route-
flap (see test 4)
• Using TX loop
detection reduces the
number of messages
sent (see tests 6,
8, and 10)
• Best results are in
test 10 which uses TX
loop detection with
Min Adv Interval of
1 second
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 70
minRouteAdvertisementInterval—
Conclusions
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 71
NEXT_HOP Reachability
• The NEXT_HOP must be reachable for the BGP
path to be valid
Reachability should be provided by the IGP
• Other route characteristics also important for
best path selection
IGP metric to NEXT_HOP
• Change in the reachability characteristics of the
NEXT_HOP (availability, cost) may impair the
ability to forward traffic and/or cause black holes
or routing loops
BGP depends on the underlying IGP to provide fast and
consistent notification of any change
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 72
NEXT_HOP Reachability
• R1 and R2 advertise
routes to R3 with R3
1.1.1.1
NEXT_HOPs of 1.1.1.1
and 2.2.2.2 R1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 73
R3 AS 3
1.1.1.1
R1 2.1.1.1
R2
2.2.2.2
AS 4 AS 12
• Watch for:
Table version number incrementing rapidly
Number of networks/paths or external/internal
routes changing
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 75
Route Oscillation—Troubleshooting
• Pick a route from the RIB that has changed within
the last minute
• Monitor that route to see if it changes every minute
R3#show ip route 156.1.0.0
Routing entry for 156.1.0.0/16
Known via "bgp 3", distance 200, metric 0
Routing Descriptor Blocks:
* 1.1.1.1, from 1.1.1.1, 00:00:53 ago
Route metric is 0, traffic share count is 1
AS Hops 2, BGP network version 474
Route Oscillation—Troubleshooting
• Lets take a closer look at the nexthop
R3#show ip route 2.2.2.2
Routing entry for 2.0.0.0/8
Known via "bgp 3", distance 200, metric 0
Routing Descriptor Blocks:
* 2.2.2.2, from 2.1.1.1, 00:00:50 ago
Route metric is 0, traffic share count is 1
AS Hops 1, BGP network version 476
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 78
Route Oscillation—Troubleshooting
• BGP nexthop is known via BGP
• Illegal recursive lookup
• Scanner will notice and install the other path in the RIB
R3#sh debug
BGP events debugging is on
BGP updates debugging is on
IP routing debugging is on
R3#
BGP: scanning routing tables
BGP: nettable_walker 2.0.0.0/8 calling revise_route
RT: del 2.0.0.0 via 2.2.2.2, bgp metric [200/0]
BGP: revise route installing 2.0.0.0/8 -> 1.1.1.1
RT: add 2.0.0.0/8 via 1.1.1.1, bgp metric [200/0]
RT: del 156.1.0.0 via 2.2.2.2, bgp metric [200/0]
BGP: revise route installing 156.1.0.0/16 -> 1.1.1.1
RT: add 156.1.0.0/16 via 1.1.1.1, bgp metric [200/0]
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 79
Route Oscillation—Troubleshooting
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 80
Route Oscillation—Step by Step
R3 AS 3
R1
R2
2.2.2.2
AS 4 AS 12
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 82
NEXT_HOP Reachability
• Three solutions
• Option 1—carry the R1 and R2 eBGP peering links in the IGP
Adds extra routes to the IGP
Carrying customer links adds instability to the IGP
Most unattractive option
• Option 2—do “redistribute connected” and “redistribute static”
into BGP on R1 and R2
Adds a lot of extra routes to BGP; connected subnets of any router with an
eBGP peer are now carried in the IGP and BGP
Carrying customer links adds instability to BGP
BGP will know how to get to its BGP NEXT_HOPs via BGP; illegal recursive
lookups can easily led to severe route churn
Two recursive lookups have to be done to resolve the outbound interface;
traffic forwarding is not effected but troubleshooting multiple recursive
lookups becomes complex
AS carries more NEXT_HOPs than it has exit points; creates extra attribute
combinations in the BGP table
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 83
NEXT_HOP Reachability
• Option 3—do “neighbor x.x.x.x next-hop-self” on the iBGP
sessions from R1 and R2 to R3
Adds 0 routes to the IGP
Adds 0 routes to BGP
Promotes IGP/BGP stability by leaving customer links out of
the picture
BGP will have an IGP route to BGP NEXT_HOPs; route churn due to
illegal recursive lookups is no longer an issue
NEXT_HOPs accessed via a single recursive lookup which makes
troubleshooting easier
Ideal option
Dampening
Suppress-Limit
3
Penalty
2 Reuse-Limit
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Time
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 86
Dampening
• A route can only be suppressed when receiving an
advertisement
Not when receiving a WITHDRAW
Attribute changes count as a flap (1/2)
Dampening—Deployment
• Configurable parameters:
Half-life—the number of minutes it takes for
the penalty to decay by 1/2
Reuse-limit—if a route is suppressed the
penalty must decay to this value to be
unsuppressed
Suppress-limit—the penalty must be greater
than this threshold when an advertisement is
received for a route to be suppressed
Max-suppress-time—the maximum number of
minutes a route may be suppressed
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 88
Dampening—Deployment
• Calculated parameters:
Max-penalty—the maximum penalty a route may
have that will allow the penalty to decay to reuse-
limit within max-suppress-time
max-penalty = reuse-limit * 2^(max-suppress-
time/half-life)
If half-life is 30, reuse-limit is 800, and max-
suppress-time is 60 then the max-penalty would
be 3200; if we allowed the penalty to reach 3201
it would be impossible for the penalty to decay
to 800 within 60 minutes
Dampening—Example
• Small suppress window:
Half-life of 30 minutes, reuse-limit of 800,
suppress-limit of 3000, and
max-suppress-time of 60
Max-penalty is 3200
• Advertisement must be received while
penalty is decaying from 3200 down to
3000 for the route to be suppressed
A 3 min 45 second (rough numbers) window
exist for an advertisement to be received while
decaying from 3200 to 3000
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 90
Dampening—Example II
• No window:
Half-life of 30 minutes, reuse-limit of 750, suppress-
limit of 3000, and max-suppress-time of 60
Max-penalty = 750 * 2^(60/30) = 3000
Here the max-penalty is equal to the suppress-limit
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 91
Dampening—Example III
• Medium window
Half-life of 15 minutes, reuse-limit of 750,
suppress-limit of 3000, and
max-suppress-time of 45
Max-penalty = 750 * 2^(45/15) = 6000
Provides a 15 minute window
• RIPE publishes recommendations
http://www.ripe.net/ripe/docs/ripe-210.html
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 92
Deterministic MED
Deterministic MED
• Inconsistent route selection may cause
problems
Routing loops
Convergence loops—i.e. the protocol continuously
sends updates in an attempt to converge
Changes in traffic patterns
• Difficult to catch and troubleshoot
• It is best to avoid the problem in the
first place
bgp deterministic-med
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 94
Inconsistent Bestpath—Diagram
AS 3 AS 10
R3 10.0.0.0/8
R2
MED 30
MED 20
RouterA
AS 2
MED 0 AS 1
• RouterA will have three paths
R1
• MEDs from AS 3 will not be compared to
MEDs from AS 1
• RouterA will sometimes select the path from R1 as best and but may
also select the path from R3 as best
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 95
Inconsistent Bestpath—Diagram
• Initial state
Path 1 beats path 2—lower MED
Path 3 beats path 1—lower router-ID
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 96
Inconsistent Bestpath—Diagram
RouterA#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 40
Paths: (3 available, best #3, advertised over iBGP, eBGP)
1 10
1.1.1.1 from 1.1.1.1
Origin IGP, metric 0, localpref 100, valid, internal
3 10
2.2.2.2 from 2.2.2.2
Origin IGP, metric 20, localpref 100, valid, internal
3 10
3.3.3.3 from 3.3.3.3
Origin IGP, metric 30, valid, external, best
Deterministic MED—Operation
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 98
Deterministic MED—Result
RouterA#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 40
Paths: (3 available, best #1, advertised over iBGP, eBGP)
1 10
1.1.1.1 from 1.1.1.1
Origin IGP, metric 0, localpref 100, valid, internal, best
3 10
2.2.2.2 from 2.2.2.2
Origin IGP, metric 20, localpref 100, valid, internal
3 10
3.3.3.3 from 3.3.3.3
Origin IGP, metric 30, valid, external
Solution—Diagram
AS 3 AS 10
R3 10.0.0.0/8
R2
MED 30
MED 20
RouterA
AS 2
MED 0 AS 1
R1
• RouterA will have three paths
• RouterA will consistently select the path from R1 as best!
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 100
Deterministic MED—Summary
MED Churn
• RFC 3345
• Two types of MED Churn
• Type I—occurs in networks with a single
tier of RRs or Sub-ASs
Can be solved by following deployment
guidelines
• Type II—occurs in networks with more
than one tier of RRs or Sub-ASs
Cannot solve without always comparing MEDs
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 102
Type II MED Churn—Example <todo –
distinguish by other than color>
SubAS 65000 Step 1
= Advertisement
—E Selects Y1
C D = Withdrawal
2
40 40 AS_PATH MED IGP
SubAS 65001 SubAS 65002
C
B E
10 3 2 D
A F G E X 3
AS Y
AS X
AS Y * Y 1 2
MED 0 MED 1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 103
AS Y
AS X
AS Y * Y 1 2
MED 0 MED 1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 104
Type II MED Churn—Example
SubAS 65000 Step 3
= Advertisement
—D Selects Y0
C D = Withdrawal
2
40 40 AS_PATH MED IGP
SubAS 65001 SubAS 65002
C * Y 0 50
B E Y 1 44
10 3 2 D * Y 0 52
Y 1 42
A F G E X 3
AS Y
AS X
AS Y * Y 1 2
MED 0 MED 1
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 105
Possible Solutions
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 112
Agenda
• New Features
• Multipath
• Graceful Restart
• Protocol Issues
• Convergence and Scalability
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 113
Software Improvements
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 116
peer-groups/update-groups
• Update-groups were introduced in 12.0(24)S
Treats peers with common outbound policy as if they are in a
peer-group
UPDATE generate for those peers is as if they are configured in a
peer-group
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 117
peer-groups/update-groups
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 118
TCP Path MTU Discovery
• Default MSS (Max Segment Size) for a TCP
session is 536 bytes
• Inefficient for today’s POS/Ethernet networks
Ethernet MTU—1500
POS MTU—4470
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 120
Input Queues
• The problem
If a BGP speaker is pushing a full Internet table to a large number of
peers, convergence is degraded due to enormous numbers of drops
(100k+) on the interface input queue; ISP Foo gets ~½ million drops
in 15 minutes on their typical route reflector
• Complicated solution
Make the input queues big enough to hold all of the TCP Acks that
would be generated if all of your peers were to Ack their entire
window size of data at the exact same time
The result is that BGP will converge much faster because we are no
longer dropping tons of packet on the interface input queues; we
also have the benefit of keeping our input queues at
reasonable depths
• Easy solution
Just set your input queues or SPD headroom to 1000
1000 is deep enough for the # of routes/peers that we see on a
heavily loaded box today
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 121
Input Queues
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 122
Input Queues and PMTU
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 123
References
• TAC BGP pages—very nice
http://www.cisco.com/cgi-
bin/Support/PSP/psp_view.pl?p=Internetworking:BGP
• BGP Case Studies
http://www.cisco.com/warp/public/459/bgp-toc.html
• Internet Routing Architectures
http://www.ciscopress.com/book.cfm?series=1&book=155
• Standards
RFC 1771, 1997, etc…
http://www.rfc-editor.org/rfcsearch.html
http://search.ietf.org/search/brokers/internet-drafts/
query.html
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 124
RST-3003
8178_05_2003_c1 © 2003, Cisco Systems, Inc. All rights reserved. 125