Doc Session 4 1 BGP Intro
Doc Session 4 1 BGP Intro
Doc Session 4 1 BGP Intro
1
Border Gateway Protocol
• A Routing Protocol used to exchange routing information
between different networks
– Exterior gateway protocol
• Described in RFC4271
– RFC4276 gives an implementation report on BGP
– RFC4277 describes operational experiences using BGP
• The Autonomous System is the cornerstone of BGP
– It is used to uniquely identify networks with a common routing policy
2
BGP
• Path Vector Protocol
• Incremental Updates
• Many options for policy enforcement
• Classless Inter Domain Routing (CIDR)
• Widely used for Internet backbone
• Autonomous systems
3
Path Vector Protocol
• BGP is classified as a path vector routing
protocol (see RFC 1322)
– A path vector protocol defines a route as a pairing
between a destination and the attributes of the
path to that destination.
AS Path
4
Path Vector Protocol
AS11268
AS6337
AS7018
AS500
AS6461
AS600
5
Definitions
• Transit – carrying traffic across a network,
usually for a fee
• Peering – exchanging routing information and
traffic
• Default – where to send traffic when there is
no explicit match in the routing table
6
Default Free Zone
provider A
Backbone IXP-East
IXP-West Provider D
provider B
provider C
• A and B can peer, but need transit
arrangements with D to get packets
to/from C
8
Autonomous System (AS)
AS 100
11
Configuring BGP in Cisco IOS
• This command enables BGP in Cisco IOS:
router bgp 100
• For ASNs > 65535, the AS number can be entered in either
plain or dot notation:
router bgp 131076
or
router bgp 2.4
• IOS will display ASNs in plain notation by default
– Dot notation is optional:
router bgp 2.4
bgp asnotation dot
12
BGP Basics
Peering
A C
AS 100 AS 101
B D
E
• Runs over TCP – port 179
• Path vector protocol AS 102
• Incremental updates
• “Internal” & “External” BGP
13
Demarcation Zone (DMZ)
A C
DMZ
AS 100 Network AS 101
B D
AS 102
15
Constructing the Forwarding Table
• BGP in process
– receives path information from peers
– results of BGP path selection placed in the BGP table
– best path flagged
• BGP out process
– announces best path information to peers
• Best path stored in Routing Table (RIB)
• Best paths in the RIB are installed in forwarding table (FIB) if:
– prefix and prefix length are unique
– lowest protocol distance
16
Constructing the Forwarding Table
discarded
BGP in
in
process accepted
everything
best paths
BGP out forwarding
out table
process
17
eBGP & iBGP
• BGP used internally (iBGP) and externally
(eBGP)
• iBGP used to carry
– Some/all Internet prefixes across ISP backbone
– ISP s customer prefixes
• eBGP used to
– Exchange prefixes with other ASes
– Implement routing policy
18
BGP/IGP model used in ISP networks
• Model representation
19
External BGP Peering (eBGP)
AS 100 AS 101
C
ip address on
ethernet interface
Router A in AS100
ip address on
ethernet interface
Router C in AS101
23
Internal BGP Peering (iBGP)
AS 100
B
A
C
• Topology independent
• Each iBGP speaker must peer with every other iBGP speaker
in the AS
24
Peering between Loopback Interfaces
AS 100
C
A
ip address on
loopback interface
Router A in AS100
interface loopback 0
ip address 105.3.7.1 255.255.255.255
!
router bgp 100 Local ASN
network 100.100.1.0
neighbor 105.3.7.2 remote-as 100 Local ASN
neighbor 105.3.7.2 update-source loopback0
neighbor 105.3.7.3 remote-as 100
neighbor 105.3.7.3 update-source loopback0
!
ip address of Router
B loopback interface
26
Configuring Internal BGP
ip address on
loopback interface
Router B in AS100
interface loopback 0
ip address 105.3.7.2 255.255.255.255
!
router bgp 100 Local ASN
network 100.100.1.0
neighbor 105.3.7.1 remote-as 100 Local ASN
neighbor 105.3.7.1 update-source loopback0
neighbor 105.3.7.3 remote-as 100
neighbor 105.3.7.3 update-source loopback0
!
ip address of Router
A loopback interface
27
Inserting prefixes into BGP
• Two ways to insert prefixes into BGP
– redistribute static
– network command
28
Inserting prefixes into BGP –
redistribute static
• Configuration Example:
router bgp 100
redistribute static
ip route 102.10.32.0 255.255.254.0 serial0
29
Inserting prefixes into BGP –
redistribute static
• Care required with redistribute!
– redistribute <routing-protocol>
means everything in the <routing-protocol> will be
transferred into the current routing protocol
– Will not scale if uncontrolled
– Best avoided if at all possible
– redistribute normally used with route-
maps and under tight administrative control
30
Inserting prefixes into BGP –
network command
• Configuration Example
router bgp 100
network 102.10.32.0 mask 255.255.254.0
ip route 102.10.32.0 255.255.254.0 serial0
31
Configuring Aggregation
• Three ways to configure route aggregation
– redistribute static
– aggregate-address
– network command
32
Configuring Aggregation
• Configuration Example:
router bgp 100
redistribute static
ip route 102.10.0.0 255.255.0.0 null0 250
34
Configuring Aggregation –
aggregate-address command
• Configuration Example:
router bgp 100
network 102.10.32.0 mask 255.255.252.0
aggregate-address 102.10.0.0 255.255.0.0 [summary-only]
• Requires more specific prefix in BGP table before aggregate is
announced
• summary-only keyword
– Optional keyword which ensures that only the summary is announced if a
more specific prefix exists in the routing table
Summary
BGP neighbour status
Router6>sh ip bgp sum
BGP router identifier 10.0.15.246, local AS number 10
BGP table version is 16, main routing table version 16
7 network entries using 819 bytes of memory
14 path entries using 728 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 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 using 1795 total bytes of memory
BGP activity 7/0 prefixes, 14/0 paths, scan interval 60 secs
38
Acknowledgement and Attribution
This presentation contains content and information
originally developed and maintained by the following
organisation(s)/individual(s) and provided for the
African Union AXIS Project
www.apnic.net
Introduction to BGP
End
40