Introduction to the
Border Gateway Protocol (BGP)
Paul Ferguson
pferguson@cisco.com
Consulting Engineer
Internet Service Providers
cisco Systems, Inc.
BGP
 What
 Why
 Who
 When
 Where
BGP version 4
 RFC 1771
 Intelligent route selection based
on most specific prefix and shortest Autonomous System (AS) path
 Classless Inter Domain Routing (CIDR) support
 Current Internet standard for
inter-domain (AS) exterior routing
Border Gateway Protocol (BGP)
 BGP version 4 is the current
de facto exterior routing protocol
in the Internet
 BGP- 4 is required for CIDR
Introduction
 Used for carrying routing information between AS’s
 Path vector protocol
 Incremental
 Runs over TCP (port 179)
 Conveys information about AS
path topology
BGP Between AS’s
PPT Slide
General Operation
 Learns multiple paths via internal
and external BGP speakers
 Picks the best path and installs in
the IP forwarding table
 Policies applied by influencing the
best path selection
When should I use BGP?
 Dual- or multi-homed
 Providing partial or full Internet
routing to a downstream customer
 Anytime the AS path information is required
 Multi-Homed AS
 AS 100
 AS 200
 AS 300
 A
 B
 C
 D
BGP is not needed...
 ... if singularly homed
 … if not providing downstream routing
 Use a default route!
 PPT Slide
 Default Route
 Static Route
 204.10.0/23
 Upstream
 Provider
 AS100
BGPAttributes
 What is an attribute?
 AS path
 Next hop
 Local preference
 Multi-exit discriminator (MED)
 Others
What Is an Attribute?
 Describes the characteristics of a particular prefix
 Transitive or non-transitive
 13 attributes
 Some are mandatory
BGPAttributes—AS Path
 Sequence of AS’s a route has traversed
 Loop detection
 Apply policy
 AS-Path
 AS 100
 AS 300
 AS 200
 AS 500
 AS 400
 170.10.0.0/16
 180.10.0.0/16
 150.10.0.0/16
 180.10.0.0/16 300 200 100
 170.10.0.0/16 300 200
 150.10.0.0/16 300 400
 180.10.0.0/16 300 200 100
 170.10.0.0/16 300 200
BGPAttributes—Next Hop
 Next hop to reach a network
 Usually the local net is the next hop
in eBGP session
 Third party next hop in iBGP session
 eBGP and Next Hop
 160.10.0.0/16
 150.10.0.0/16
 150.10.1.1
 150.10.1.2
 AS 100
 AS 300
 AS 200
 150.10.0.0/16 150.10.1.1
 160.10.0.0/16 150.10.1.1
 A
 B
BGPAttributes—Next Hop (Cont.)
 Next hop of external routes not changed when
announced to iBGP neighbors
 iBGP and Next Hop
 160.10.0.0/16
 150.10.0.0/16
 150.10.1.1
 150.10.1.2
 AS 100
 AS 300
 AS 200
 150.10.0.0/16 150.10.1.1
 160.10.0.0/16 150.10.1.1
 B
 C
 A
BGPAttributes—Next Hop (Cont.)
 IGP should carry route to next hops
 Recursive route look-up
 Decouples BGP from actual physical topology
BGPAttributes—Local Preference
 Local to AS
 Used to influence BGP path selection
 Path with highest local preference wins
 Local Preference
 AS 400
 AS 200
 160.10.0.0/16
 AS 100
 AS 300
 A
 B
 C
 D
 E
 160.10.0.0/16 500
 > 160.10.0.0/16 800
 500
 800
Multi-Exit Discriminator (MED)
 Non-transitive
 Used to convey the relative preference of entry points
 Influences best path selection
 Comparable if paths are from same AS
 IGP metric can be conveyed as MED
 Multi-Exit Discriminator
 AS 201
 AS 200
 A
 C
 B
 192.68.1.0/24
 192.68.1.0/24 1000
 192.68.1.0/24 2000
Applying Policy with BGP
 Policy based on AS path, community
or the network
 Rejecting/accepting selected routes
 Set attributes to influence path selection
Communities
 BGP attribute
 Used to group destinations
 Represented as an integer
 Each destination could be member
of multiple communities
 Community attribute carried across AS’s
 Useful in applying policies
Community Attribute
 RFC1997, RFC1998
 Optional attribute
 Range: 0 to 4,294,901,760
 Method to group destinations
into communities and apply
routing decisions (accept, prefer,
redistribute, etc.) using route-maps
Community attribute (cont.)
 Format -- aa:nn
 `aa’ -- ASN
 `nn’ -- 1 to 4,294,901,760
 BGP Communities
 Community 10:200
 Community 10:300
 Community 10:200
 Community 10:300
Load Balancing
 BGP does not load-balance traffic;
it chooses & installs a “best” route.
 BGP Load Balancing Problem
 “Since BGP picks a „best‟ route based upon most specific prefix and shortest
AS_PATH,
it becomes non-trivial to figure out how to manually direct specific portions of
internal traffic (prefixes) in a distributed fashion across multiple external
gateways.”
eBGP Multihop
BGP Multipath
Difficulties in Load Balancing
Internal BGP (iBGP)
 Same routing protocol as BGP,
different application
 iBGP should be used when AS_PATH information must
remain intact between multiple eBGP peers
 All iBGP peers must be fully meshed, logically; an iBGP
peer will not advertise
a route learned by one iBGP peer to another iBGP peer
(readvertisement restriction to prevent looping)
 PPT Slide
 AS 1
 AS 2
 eBGP
 eBGP
 eBGP
 iBGP
 iBGP
 Upstream
 Provider B
 AS200
 Upstream
 Provider A
 AS100
iBGP
Scaling the iBGP mesh
 Two methods:
BGP Confederations
BGP Route Reflectors
BGP Confederations
 Method to subdivide a single AS into multiple, internal
sub-AS’s, yet still advertise a single AS to external peers
 Reduces iBGP mesh
 BGP Confederation
 AS10
 AS20
 AS30
 AS300
BGP Route Reflectors (RR)
 Another method to reduce iBGP mesh
 iBGP re-advertisement restrictions
are relaxed
 Single iBGP peer advertises (reflects) routes to
subordinate iBGP peers
 Clients must not peer with RR’s
outside of cluster
 Route Reflectors
 (RR)
 AS300
 (RR)
 (RR)
Asymmetric Routing Paradigm
 In the Internet, it is impossible
to control end-to-end routing
and paths traversed
 Packets may not always traverse
same downstream path as they
do when forwarded upstream
Asymmetric Routing
Achieving stability
 Using loopbacks
 BGP/IGP Interaction
 Peer groups
 Route-flap dampening
 BGP soft reconfiguration
Stable iBGP Peering
 Peer with loop-back addresses
 iBGP session is not dependent
on a single interface
 Loop-back interface does not go down
 Peering to Loop-Back Address
 AS 100
Relationship with IGP
 BGP carries full Internet routing table
 IGP’s are used to carry next hop and interior network
information
 Routes are never redistributed from BGP into IGP (and
vice versa)
 Recursive route lookup
Peer Groups
 iBGP neighbors receive same update
 Group peers with same outbound policy
 Updates are generated once per group
 Makes configuration easier
 Members could have different
inbound policy
 eBGP neighbors
Route Flap Dampening
 Route flap
Going up and down of path
Change in attribute
 Ripples through the entire Internet
 Consumes CPU
 Reduce scope of route flap propagation
Route Flap Dampening (Cont.)
 Fast convergence for normal
route changes
 History predicts future behavior
 Suppress oscillating routes
 Advertise stable suppressed routes
Flap Dampening: Terminology
 Penalty
 Decay
 Half-life time
 Suppress-limit
 Reuse-limit
 Suppress

 Route Flap Dampening
 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
 0
 1
 2
 3
 4
 Suppress-Limit
 Reuse-Limit
 Penalty
 Time
Flap Dampening: Operation
 Add penalty for each flap
 Exponentially decay penalty
 Penalty above suppress-limit—
do not advertise up route
 Penalty decayed below reuse-limit—advertise route
 History path
Flap Dampening: Operation (Cont.)
 Done only for external path
 Alternate paths still usable
 Suppress-limit, reuse-limit and half-life time give
control
 Less overhead
BGP soft reconfig
 Soft reconfig allows BGP policies to be configured &
activated without clearing the BGP session
 Does not invalidate forwarding cache, hence no short-
term interruptions
 Outbound preferable over inbound reconfig
Cisco IOS™ Version Information
 Peer-groups—10.2
 Communities—10.3
 Route-reflectors—10.3
 Confederation—10.3
 Route flap dampening—11.0
 BGP Multipath, Soft Reconfig—11.2
Summary
 Use BGP only when needed!
 IGP and conventional BGP
network problems
 BGP gives flexibility and control
 Route reflectors and confederations helps iBGP mesh
scale
Questions?
Thanks for attending!

Bgp

  • 1.
    Introduction to the BorderGateway Protocol (BGP) Paul Ferguson pferguson@cisco.com Consulting Engineer Internet Service Providers cisco Systems, Inc. BGP  What  Why  Who  When  Where BGP version 4  RFC 1771  Intelligent route selection based on most specific prefix and shortest Autonomous System (AS) path  Classless Inter Domain Routing (CIDR) support  Current Internet standard for inter-domain (AS) exterior routing Border Gateway Protocol (BGP)  BGP version 4 is the current de facto exterior routing protocol in the Internet  BGP- 4 is required for CIDR Introduction  Used for carrying routing information between AS’s  Path vector protocol
  • 2.
     Incremental  Runsover TCP (port 179)  Conveys information about AS path topology BGP Between AS’s PPT Slide General Operation  Learns multiple paths via internal and external BGP speakers  Picks the best path and installs in the IP forwarding table  Policies applied by influencing the best path selection When should I use BGP?  Dual- or multi-homed  Providing partial or full Internet routing to a downstream customer  Anytime the AS path information is required  Multi-Homed AS  AS 100  AS 200  AS 300  A  B  C
  • 3.
     D BGP isnot needed...  ... if singularly homed  … if not providing downstream routing  Use a default route!  PPT Slide  Default Route  Static Route  204.10.0/23  Upstream  Provider  AS100 BGPAttributes  What is an attribute?  AS path  Next hop  Local preference  Multi-exit discriminator (MED)  Others What Is an Attribute?  Describes the characteristics of a particular prefix
  • 4.
     Transitive ornon-transitive  13 attributes  Some are mandatory BGPAttributes—AS Path  Sequence of AS’s a route has traversed  Loop detection  Apply policy  AS-Path  AS 100  AS 300  AS 200  AS 500  AS 400  170.10.0.0/16  180.10.0.0/16  150.10.0.0/16  180.10.0.0/16 300 200 100  170.10.0.0/16 300 200  150.10.0.0/16 300 400  180.10.0.0/16 300 200 100  170.10.0.0/16 300 200 BGPAttributes—Next Hop  Next hop to reach a network  Usually the local net is the next hop in eBGP session  Third party next hop in iBGP session
  • 5.
     eBGP andNext Hop  160.10.0.0/16  150.10.0.0/16  150.10.1.1  150.10.1.2  AS 100  AS 300  AS 200  150.10.0.0/16 150.10.1.1  160.10.0.0/16 150.10.1.1  A  B BGPAttributes—Next Hop (Cont.)  Next hop of external routes not changed when announced to iBGP neighbors  iBGP and Next Hop  160.10.0.0/16  150.10.0.0/16  150.10.1.1  150.10.1.2  AS 100  AS 300  AS 200  150.10.0.0/16 150.10.1.1  160.10.0.0/16 150.10.1.1  B  C  A BGPAttributes—Next Hop (Cont.)  IGP should carry route to next hops  Recursive route look-up
  • 6.
     Decouples BGPfrom actual physical topology BGPAttributes—Local Preference  Local to AS  Used to influence BGP path selection  Path with highest local preference wins  Local Preference  AS 400  AS 200  160.10.0.0/16  AS 100  AS 300  A  B  C  D  E  160.10.0.0/16 500  > 160.10.0.0/16 800  500  800 Multi-Exit Discriminator (MED)  Non-transitive  Used to convey the relative preference of entry points  Influences best path selection  Comparable if paths are from same AS  IGP metric can be conveyed as MED
  • 7.
     Multi-Exit Discriminator AS 201  AS 200  A  C  B  192.68.1.0/24  192.68.1.0/24 1000  192.68.1.0/24 2000 Applying Policy with BGP  Policy based on AS path, community or the network  Rejecting/accepting selected routes  Set attributes to influence path selection Communities  BGP attribute  Used to group destinations  Represented as an integer  Each destination could be member of multiple communities  Community attribute carried across AS’s  Useful in applying policies Community Attribute
  • 8.
     RFC1997, RFC1998 Optional attribute  Range: 0 to 4,294,901,760  Method to group destinations into communities and apply routing decisions (accept, prefer, redistribute, etc.) using route-maps Community attribute (cont.)  Format -- aa:nn  `aa’ -- ASN  `nn’ -- 1 to 4,294,901,760  BGP Communities  Community 10:200  Community 10:300  Community 10:200  Community 10:300 Load Balancing  BGP does not load-balance traffic; it chooses & installs a “best” route.  BGP Load Balancing Problem  “Since BGP picks a „best‟ route based upon most specific prefix and shortest AS_PATH, it becomes non-trivial to figure out how to manually direct specific portions of internal traffic (prefixes) in a distributed fashion across multiple external gateways.”
  • 9.
    eBGP Multihop BGP Multipath Difficultiesin Load Balancing Internal BGP (iBGP)  Same routing protocol as BGP, different application  iBGP should be used when AS_PATH information must remain intact between multiple eBGP peers  All iBGP peers must be fully meshed, logically; an iBGP peer will not advertise a route learned by one iBGP peer to another iBGP peer (readvertisement restriction to prevent looping)  PPT Slide  AS 1  AS 2  eBGP  eBGP  eBGP  iBGP  iBGP  Upstream  Provider B  AS200  Upstream  Provider A  AS100 iBGP
  • 10.
    Scaling the iBGPmesh  Two methods: BGP Confederations BGP Route Reflectors BGP Confederations  Method to subdivide a single AS into multiple, internal sub-AS’s, yet still advertise a single AS to external peers  Reduces iBGP mesh  BGP Confederation  AS10  AS20  AS30  AS300 BGP Route Reflectors (RR)  Another method to reduce iBGP mesh  iBGP re-advertisement restrictions are relaxed  Single iBGP peer advertises (reflects) routes to subordinate iBGP peers  Clients must not peer with RR’s outside of cluster  Route Reflectors  (RR)
  • 11.
     AS300  (RR) (RR) Asymmetric Routing Paradigm  In the Internet, it is impossible to control end-to-end routing and paths traversed  Packets may not always traverse same downstream path as they do when forwarded upstream Asymmetric Routing Achieving stability  Using loopbacks  BGP/IGP Interaction  Peer groups  Route-flap dampening  BGP soft reconfiguration Stable iBGP Peering  Peer with loop-back addresses  iBGP session is not dependent on a single interface
  • 12.
     Loop-back interfacedoes not go down  Peering to Loop-Back Address  AS 100 Relationship with IGP  BGP carries full Internet routing table  IGP’s are used to carry next hop and interior network information  Routes are never redistributed from BGP into IGP (and vice versa)  Recursive route lookup Peer Groups  iBGP neighbors receive same update  Group peers with same outbound policy  Updates are generated once per group  Makes configuration easier  Members could have different inbound policy  eBGP neighbors Route Flap Dampening  Route flap
  • 13.
    Going up anddown of path Change in attribute  Ripples through the entire Internet  Consumes CPU  Reduce scope of route flap propagation Route Flap Dampening (Cont.)  Fast convergence for normal route changes  History predicts future behavior  Suppress oscillating routes  Advertise stable suppressed routes Flap Dampening: Terminology  Penalty  Decay  Half-life time  Suppress-limit  Reuse-limit  Suppress 
  • 14.
     Route FlapDampening  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  0  1  2  3  4  Suppress-Limit  Reuse-Limit  Penalty  Time
  • 15.
    Flap Dampening: Operation Add penalty for each flap  Exponentially decay penalty  Penalty above suppress-limit— do not advertise up route  Penalty decayed below reuse-limit—advertise route  History path Flap Dampening: Operation (Cont.)  Done only for external path  Alternate paths still usable  Suppress-limit, reuse-limit and half-life time give control  Less overhead BGP soft reconfig  Soft reconfig allows BGP policies to be configured & activated without clearing the BGP session  Does not invalidate forwarding cache, hence no short- term interruptions  Outbound preferable over inbound reconfig
  • 16.
    Cisco IOS™ VersionInformation  Peer-groups—10.2  Communities—10.3  Route-reflectors—10.3  Confederation—10.3  Route flap dampening—11.0  BGP Multipath, Soft Reconfig—11.2 Summary  Use BGP only when needed!  IGP and conventional BGP network problems  BGP gives flexibility and control  Route reflectors and confederations helps iBGP mesh scale Questions? Thanks for attending!