BGP Tutorial
BGP Tutorial
BGP Tutorial
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 1
• Will be available on
Location will be provided
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
1
2/7/14
• BGP Basics
• Scaling BGP
• Using Communities
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
BGP Basics
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
2
2/7/14
• What is BGP?
• BGP Attributes
• BGP Path Selection Algorithm
• Applying Policy with BGP
• BGP Capabilities
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
What is BGP?
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
3
2/7/14
• Described in RFC4271
RFC4276 gives an implementation report on BGP
RFC4277 describes operational experiences using BGP
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
4
2/7/14
• Two ranges
0-65535 (original 16-bit range)
65536-4294967295 (32-bit range - RFC4893)
• Usage:
0 and 65535 (reserved)
1-64495 (public Internet)
64496-64511 (documentation - RFC5398)
64512-65534 (private use only)
23456 (represent 32-bit range in 16-bit world)
65536-65551 (documentation - RFC5398)
65552-4294967295 (public Internet)
• 32-bit range representation specified in RFC5396
Defines “asplain” (traditional format) as standard notation
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
5
2/7/14
Peering
A C
AS 100 AS 101
B D
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
A C
DMZ
AS 100 Network AS 101
B D
AS 102
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
6
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
7
2/7/14
• Model representation
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
AS 100 AS 101
C
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
8
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
AS 100
B
A
C
• Topology independent
• Each iBGP speaker must peer with every other iBGP
speaker in the AS
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
9
2/7/14
AS 100
BGP Attributes
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
10
2/7/14
Loop detection
Path Selection 180.10.0.0/16 300 200 100
170.10.0.0/16 300 200
Applying policy AS 300
AS 400
150.10.0.0/16
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
11
2/7/14
AS 200 AS 100
170.10.0.0/16 180.10.0.0/16
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
150.10.1.1 150.10.1.2
iBGP C
AS 200
A B
150.10.0.0/16 eBGP AS 300
150.10.0.0/16 150.10.1.1
160.10.0.0/16 150.10.1.1
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
12
2/7/14
120.1.2.0/23
120.1.1.0/24
iBGP C
Loopback
120.1.254.3/32
Loopback B
120.1.254.2/32
AS 300
D
120.1.1.0/24 120.1.254.2
• Next hop is iBGP router loopback address 120.1.2.0/23 120.1.254.3
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
120.68.1.0/24
AS 201
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
13
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
14
2/7/14
• Historical attribute
Used in transition from EGP to BGP
• Transitive and Mandatory Attribute
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
15
2/7/14
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
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
• Local to an AS – non-transitive
Default local preference is 100 (Cisco IOS)
• Used to influence BGP path selection
determines best path for outbound traffic
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
16
2/7/14
C D
AS 201
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
17
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
• 32 bit integer
Represented as two 16 bit integers (RFC1998)
Common format is <local-ASN>:xx
0:0 to 0:65535 and 65535:0 to 65535:65535 are reserved
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
18
2/7/14
A B
AS 100 AS 200
160.10.0.0/16 170.10.0.0/16
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
A B
AS 100 AS 200
160.10.0.0/16 170.10.0.0/16
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
19
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 39
105.7.0.0/16
105.7.X.X No-Export
105.7.X.X D
A
105.7.0.0/16
AS 100 AS 200 G
B E
C F
• AS100 announces aggregate and subprefixes
Intention is to improve loadsharing by leaking subprefixes
• Subprefixes marked with no-export community
• Router G in AS200 does not announce prefixes with no-export
community set
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
20
2/7/14
105.7.0.0/16 upstream
105.7.X.X No-Peer D C&D&E are
peers e.g.
Tier-1s
105.7.0.0/16
upstream
E
A
upstream
B
• Sub-prefixes marked with no-peer community are not sent to bi-lateral peers
They are only sent to upstream providers
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41
• Solutions:
Use “private ASN” for the first 16 bits
Use AS_TRANS (23456) for the first 16 bits
RFC5668 – 4-Octet AS Specific Extended Community.
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 42
21
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 43
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 44
22
2/7/14
• Do not consider a path that has the maximum possible MED (232-1)
• Shortest AS path
Skipped if bgp bestpath as-path ignore configured
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 45
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 46
23
2/7/14
• Shortest Cluster-List
Client must be aware of Route Reflector attributes!
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 47
• In multi-vendor environments:
Make sure the path selection processes are understood for each brand of
equipment
Each vendor has slightly different implementations, extra steps, extra features,
etc.
Watch out for possible MED confusion
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 48
24
2/7/14
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 49
• External relationships:
Control who they peer with
Control who they give transit to
Control who they get transit from
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 50
25
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 51
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 52
26
2/7/14
BGP Capabilities
Extending BGP
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 53
• Documented in RFC2842
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 54
27
2/7/14
See www.iana.org/assignments/capability-codes
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 55
• Multiprotocol extensions
This is a whole different world, allowing BGP to support more than IPv4
unicast routes
Examples include: v4 multicast, IPv6, v6 multicast, VPNs
Another tutorial (or many!)
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 56
28
2/7/14
Scaling BGP
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 57
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 58
29
2/7/14
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 59
• Original BGP specification and implementation was fine for the Internet
of the early 1990s
But didn’t scale
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 60
30
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 61
Dynamic Reconfiguration
Route Refresh
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 62
31
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 63
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 64
32
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 65
Route Reflectors
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 66
33
2/7/14
ibgp sessions!
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 67
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 68
34
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 69
• 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
Best to set cluster-id is from router-id (address of loopback)
(Some ISPs use their own cluster-id assignment strategy – but needs to be
well documented!)
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 70
35
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 71
PoP3
AS 100
PoP1 PoP2
Cluster One
Cluster Two
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 72
36
2/7/14
• Easy migration
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 73
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 74
37
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 75
AS 300
A
B C
AS 100
D
E G
F
AS 200
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 76
38
2/7/14
BGP Confederations
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 77
• Described in RFC5065
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 78
39
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 79
Sub-AS
65530
AS 200
A
Sub-AS
Sub-AS
65532
65531
C B
• Configuration (Router C):
router bgp 65532
bgp confederation peers
65530
65531
!
bgp confederation identifier 200
neighbor 10.10.1.1
remote-as 65530
!
neighbor 10.10.2.2
remote-as 65531
!
!
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 80
40
2/7/14
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
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 81
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 82
41
2/7/14
Most new service provider networks now deploy Route Reflectors from Day One
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 83
• Can ease “absorbing” other ISPs into you ISP – e.g., if one ISP buys
another
Or can use AS masquerading feature available in some implementations to do
a similar thing
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 84
42
2/7/14
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 85
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 86
43
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 87
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 88
44
2/7/14
• Community assignments:
IXP connection: community 100:2100
Private peer: community 100:2200
• Customer who buys local connectivity (via IXP) is put in community
100:2100
• Customer who buys peer connectivity is put in community
100:2200
• Customer who wants both IXP and peer connectivity is put in
100:2100 and 100:2200
• Customer who wants “the Internet” has no community set
We are going to announce his prefix everywhere
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 89
CORE
Aggregation Router
Border Router
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 90
45
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 91
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 92
46
2/7/14
• Community assignments:
Customer prefix: community 100:3000
IXP prefix: community 100:3100
Private peer prefix: community 100:3200
• BGP customer who buys local connectivity gets 100:3000
• BGP customer who buys local and IXP connectivity receives
community 100:3000 and 100:3100
• BGP customer who buys full peer connectivity receives community
100:3000, 100:3100, and 100:3200
• Customer who wants “the Internet” gets everything
Gets default route originated by aggregation router
Or pays money to get all 450k+ prefixes
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 93
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 94
47
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 95
48
2/7/14
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 97
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 98
49
2/7/14
aut-num: AS702
descr: Verizon Business EMEA - Commercial IP service provider in Eur
remarks: VzBi uses the following communities with its customers:
702:80 Set Local Pref 80 within AS702
702:120 Set Local Pref 120 within AS702
702:20 Announce only to VzBi AS'es and VzBi customers
702:30 Keep within Europe, don't announce to other VzBi AS
702:1 Prepend AS702 once at edges of VzBi to Peers
702:2 Prepend AS702 twice at edges of VzBi to Peers
702:3 Prepend AS702 thrice at edges of VzBi to Peers
Advanced communities for customers
702:7020 Do not announce to AS702 peers with a scope of
National but advertise to Global Peers, European
Peers and VzBi customers.
702:7001 Prepend AS702 once at edges of VzBi to AS702
peers with a scope of National.
702:7002 Prepend AS702 twice at edges of VzBi to AS702
peers with a scope of National.
(more)
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 99
(more)
702:7003 Prepend AS702 thrice at edges of VzBi to AS702
peers with a scope of National.
702:8020 Do not announce to AS702 peers with a scope of
European but advertise to Global Peers, National
Peers and VzBi customers.
702:8001 Prepend AS702 once at edges of VzBi to AS702
peers with a scope of European.
702:8002 Prepend AS702 twice at edges of VzBi to AS702
peers with a scope of European.
702:8003 Prepend AS702 thrice at edges of VzBi to AS702
peers with a scope of European.
--------------------------------------------------------------
Additional details of the VzBi communities are located at:
http://www.verizonbusiness.com/uk/customer/bgp/
--------------------------------------------------------------
mnt-by: WCOM-EMEA-RICE-MNT
source: RIPE
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 100
50
2/7/14
aut-num: AS5400
descr: BT Ignite European Backbone
remarks:
remarks: Community to Community to
remarks: Not announce To peer: AS prepend 5400
remarks:
remarks: 5400:1000 All peers & Transits 5400:2000
remarks:
remarks: 5400:1500 All Transits 5400:2500
remarks: 5400:1501 Sprint Transit (AS1239) 5400:2501
remarks: 5400:1502 SAVVIS Transit (AS3561) 5400:2502
remarks: 5400:1503 Level 3 Transit (AS3356) 5400:2503
remarks: 5400:1504 AT&T Transit (AS7018) 5400:2504
remarks: 5400:1506 GlobalCrossing Trans(AS3549) 5400:2506
remarks:
remarks: 5400:1001 Nexica (AS24592) 5400:2001
remarks: 5400:1002 Fujitsu (AS3324) 5400:2002
remarks: 5400:1004 C&W EU (1273) 5400:2004
<snip>
notify: notify@eu.bt.net And many
mnt-by: CIP-MNT
source: RIPE many more!
© 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 101
aut-num: AS3356
descr: Level 3 Communications
<snip>
remarks: -------------------------------------------------------
remarks: customer traffic engineering communities - Suppression
remarks: -------------------------------------------------------
remarks: 64960:XXX - announce to AS XXX if 65000:0
remarks: 65000:0 - announce to customers but not to peers
remarks: 65000:XXX - do not announce at peerings to AS XXX
remarks: -------------------------------------------------------
remarks: customer traffic engineering communities - Prepending
remarks: -------------------------------------------------------
remarks: 65001:0 - prepend once to all peers
remarks: 65001:XXX - prepend once at peerings to AS XXX
<snip>
remarks: 3356:70 - set local preference to 70
remarks: 3356:80 - set local preference to 80
remarks: 3356:90 - set local preference to 90
remarks: 3356:9999 - blackhole (discard) traffic
<snip> And many
mnt-by: LEVEL3-MNT
many more!
source:
© 2010 Cisco and/or its affiliates. All rights reserved. RIPE Cisco Confidential 102
51
2/7/14
Thank you.
52