Broder Gateway Protocol (BGP)Broder Gateway Protocol (BGP)
“Border gateway protocol is how the internet routes traffic”
1969 – First Internet MSG (Login->Lo), 1984 – EGP when cisco Found, 1988 – RIP, 1990 & 1995 - BGP
K.Satheesh
CCIE R/S
Senior Network Consultant
At the End of this Presentation
Will be able to understand
• What is BGP?
• Why BGP?
• BGP Peer Relationships
• Configuration of BGP
• BGP attributes and Path Selection
• BGP use cases
Why Routing protocol ?
• Routing: Enable communication between two
different Networks.
• To Exchange network reachability information
• To have resiliency when failure occur
• Have multipath and optimize path
• Etc ..
What is BGP
• Broder Gateway Protocol – BGP
• Defined by IETF RFC 1771
• Work Based on Autonomous System No – AS#
– 2 Byte : 2^16 -> 0 – 65535
– 4 Byte : 2^32 -> 0 - 4294967295
• Version 4 is the latest for both IPv4 and IPv6
• It works on top of TCP
AS# Ranges
2 Byte AS till 2009 / 0 to 65535
• 0: reserved.
• 1-64495: public AS numbers.
• 64496 – 64511 – reserved to use in documentation.
• 64512 – 65534 – private AS numbers.
• 65535 – reserved
4 Byte AS after 2009 / 65536 to 4294967295
• Private: 4200000000 - 4294967294
4200000000 - 4294967294
4200000000 - 4294967294
BGP
• Path Vector Protocol
• Incremental Updates
• Many options for policy enforcement
• Classless Inter Domain Routing (CIDR)
• Widely used for Internet backbone
• Autonomous systems
BGP Routing Table Size
Autonomous System - AS
AS 100
• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and
administrative control
Path Vector and AS-PATH
• Path Vector Protocol – Define a route as parting
between destination and it’s attributes.
12.6.126.0/24 207.126.96.43 1021 0 6461 7018 6337 11268 i
Path Vector and 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
AS PATH LOOP DETECTION
AS 100
AS 300
AS 200
AS 500
170.10.0.0/16 180.10.0.0/16
180.10.0.0/16300 200 100
180.10.0.0/16100
170.10.0.0/16300 200
140.10.0.0/16300
140.10.0.0/16500 300
170.10.0.0/16500 300 200
140.10.0.0/16
180.10.0.0/16 is not announced to
AS100 as AS500 sees that it is
originated from AS100, and that
AS100 is the neighbouring AS –
loop detection in action
BGP General Operations
180.10.0.0/16300 200 100
180.10.0.0/16100
170.10.0.0/16300 200
140.10.0.0/16300
• Learns multiple paths via internal and external
BGP speakers
• Picks the best path and installs in
the forwarding table
• Policies applied by influencing the
best path selection
BGP Peering
AS
100
AS
101
AS
102
E
B D
A C
Peering
BGP speakers are called
peers
External BGP Peering(eBGP)
• Between BGP speakers in different AS
• Should be directly connected
• Do not run an IGP between eBGP peers
AS
100
AS
101C
A
B
Internal BGP Peering(iBGP)
• Topology independent
• Each iBGP speaker must peer with every
other iBGP speaker in the AS
AS
100
A
E
B
D
iBGP Rules
• BGP peer within the same AS
• Not required to be directly connected
• iBGP speakers need to be fully meshed
– they originate connected networks
– they do not pass on prefixes learned
from other iBGP speakers
BGP Messages
Type Name Functional Overview
1 OPEN Sets up and establishes BGP adjacency
2 UPDATE
Advertises, updates, or withdraws
routes
3 NOTIFICATION
Indicates an error condition to a BGP
neighbor
4 KEEPALIVE
Ensures that BGP neighbors are still
alive
BGP Timers
• 30s Keep Alive and 180s Hold Timer
• BGP Advertisement Timer
– 30s for eBGP
– 0s for iBGP
BGP States
BGP forms tcp session between routers- Peers
 Idle: Try to initiate tcp connection and listen
 Connect: tcp 3-way handshake establish
 Active: New tcp 3-wak handshake, if timer expires
 OpenSent: Send an Open message and wait for same
o Compare Ver, AS#, Authentication, IP and AUTH
 OpenConfirm : wait for Keep Alive, then move to EST
 Established: Exchange routes via Update Msgs
eBGP Configuration
R1(config)#router bgp 1
R1(config-router)#neighbor 11.0.0.2 remote-as 2
R2(config)#router bgp 2
R2(config-router)#neighbor 11.0.0.1 remote-as 1
192.168.1.0/24 172.16.19.0/24
R1(config)#router bgp 1
R1(config-router)#network 192.168.1.0 mask 255.255.255.0
R2(config)#router bgp 1
R2(config-router)#network 172.16.19.0 mask 255.255.255.0
BGP Attributes and Path Selection
• Weight : Local to Router
• Local preference : Local to AS
• AS_path
• Origin
• Multi-exit discriminator
• Community
Routes learned via BGP have associated properties that
are used to determine the best route to a destination
when multiple paths exist to a particular destination.
BGP Attributes and Path Selection
BGP Attributes and Path Selection
BGP Attributes and Path Selection
BGP Use Cases
• Multihoming / Provider redundancy
• Equipment / Port redundancy
• Peering (typically larger ASes)
• Connectivity quality (better paths)
Bgp

Bgp

  • 1.
    Broder Gateway Protocol(BGP)Broder Gateway Protocol (BGP) “Border gateway protocol is how the internet routes traffic” 1969 – First Internet MSG (Login->Lo), 1984 – EGP when cisco Found, 1988 – RIP, 1990 & 1995 - BGP K.Satheesh CCIE R/S Senior Network Consultant
  • 2.
    At the Endof this Presentation Will be able to understand • What is BGP? • Why BGP? • BGP Peer Relationships • Configuration of BGP • BGP attributes and Path Selection • BGP use cases
  • 3.
    Why Routing protocol? • Routing: Enable communication between two different Networks. • To Exchange network reachability information • To have resiliency when failure occur • Have multipath and optimize path • Etc ..
  • 4.
    What is BGP •Broder Gateway Protocol – BGP • Defined by IETF RFC 1771 • Work Based on Autonomous System No – AS# – 2 Byte : 2^16 -> 0 – 65535 – 4 Byte : 2^32 -> 0 - 4294967295 • Version 4 is the latest for both IPv4 and IPv6 • It works on top of TCP
  • 5.
    AS# Ranges 2 ByteAS till 2009 / 0 to 65535 • 0: reserved. • 1-64495: public AS numbers. • 64496 – 64511 – reserved to use in documentation. • 64512 – 65534 – private AS numbers. • 65535 – reserved 4 Byte AS after 2009 / 65536 to 4294967295 • Private: 4200000000 - 4294967294 4200000000 - 4294967294 4200000000 - 4294967294
  • 6.
    BGP • Path VectorProtocol • Incremental Updates • Many options for policy enforcement • Classless Inter Domain Routing (CIDR) • Widely used for Internet backbone • Autonomous systems
  • 7.
  • 8.
    Autonomous System -AS AS 100 • Collection of networks with same routing policy • Single routing protocol • Usually under single ownership, trust and administrative control
  • 9.
    Path Vector andAS-PATH • Path Vector Protocol – Define a route as parting between destination and it’s attributes. 12.6.126.0/24 207.126.96.43 1021 0 6461 7018 6337 11268 i
  • 10.
    Path Vector andAS-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
  • 11.
    AS PATH LOOPDETECTION AS 100 AS 300 AS 200 AS 500 170.10.0.0/16 180.10.0.0/16 180.10.0.0/16300 200 100 180.10.0.0/16100 170.10.0.0/16300 200 140.10.0.0/16300 140.10.0.0/16500 300 170.10.0.0/16500 300 200 140.10.0.0/16 180.10.0.0/16 is not announced to AS100 as AS500 sees that it is originated from AS100, and that AS100 is the neighbouring AS – loop detection in action
  • 12.
    BGP General Operations 180.10.0.0/16300200 100 180.10.0.0/16100 170.10.0.0/16300 200 140.10.0.0/16300 • Learns multiple paths via internal and external BGP speakers • Picks the best path and installs in the forwarding table • Policies applied by influencing the best path selection
  • 13.
    BGP Peering AS 100 AS 101 AS 102 E B D AC Peering BGP speakers are called peers
  • 14.
    External BGP Peering(eBGP) •Between BGP speakers in different AS • Should be directly connected • Do not run an IGP between eBGP peers AS 100 AS 101C A B
  • 15.
    Internal BGP Peering(iBGP) •Topology independent • Each iBGP speaker must peer with every other iBGP speaker in the AS AS 100 A E B D
  • 16.
    iBGP Rules • BGPpeer within the same AS • Not required to be directly connected • iBGP speakers need to be fully meshed – they originate connected networks – they do not pass on prefixes learned from other iBGP speakers
  • 17.
    BGP Messages Type NameFunctional Overview 1 OPEN Sets up and establishes BGP adjacency 2 UPDATE Advertises, updates, or withdraws routes 3 NOTIFICATION Indicates an error condition to a BGP neighbor 4 KEEPALIVE Ensures that BGP neighbors are still alive
  • 18.
    BGP Timers • 30sKeep Alive and 180s Hold Timer • BGP Advertisement Timer – 30s for eBGP – 0s for iBGP
  • 19.
    BGP States BGP formstcp session between routers- Peers  Idle: Try to initiate tcp connection and listen  Connect: tcp 3-way handshake establish  Active: New tcp 3-wak handshake, if timer expires  OpenSent: Send an Open message and wait for same o Compare Ver, AS#, Authentication, IP and AUTH  OpenConfirm : wait for Keep Alive, then move to EST  Established: Exchange routes via Update Msgs
  • 20.
    eBGP Configuration R1(config)#router bgp1 R1(config-router)#neighbor 11.0.0.2 remote-as 2 R2(config)#router bgp 2 R2(config-router)#neighbor 11.0.0.1 remote-as 1 192.168.1.0/24 172.16.19.0/24 R1(config)#router bgp 1 R1(config-router)#network 192.168.1.0 mask 255.255.255.0 R2(config)#router bgp 1 R2(config-router)#network 172.16.19.0 mask 255.255.255.0
  • 21.
    BGP Attributes andPath Selection • Weight : Local to Router • Local preference : Local to AS • AS_path • Origin • Multi-exit discriminator • Community Routes learned via BGP have associated properties that are used to determine the best route to a destination when multiple paths exist to a particular destination.
  • 22.
    BGP Attributes andPath Selection
  • 23.
    BGP Attributes andPath Selection
  • 24.
    BGP Attributes andPath Selection
  • 25.
    BGP Use Cases •Multihoming / Provider redundancy • Equipment / Port redundancy • Peering (typically larger ASes) • Connectivity quality (better paths)