Skip to main content

BGP Fundamentals

·1 min

What is BGP? #

Border Gateway Protocol (BGP) is the routing protocol of the internet. It is a path-vector protocol used to exchange routing information between autonomous systems (AS).

eBGP vs iBGP #

eBGPiBGP
ScopeBetween different ASesWithin the same AS
TTL1 (directly connected)255
Next-hopChanges at each hopUnchanged by default
AD20200

BGP Path Selection Order #

BGP selects the best path using the following attributes in order:

  1. Highest Weight (Cisco proprietary, local to router)
  2. Highest Local Preference (within AS)
  3. Locally originated route
  4. Shortest AS Path
  5. Lowest Origin (IGP < EGP < Incomplete)
  6. Lowest MED
  7. eBGP over iBGP
  8. Lowest IGP metric to next-hop
  9. Lowest Router ID

Key BGP States #

Idle → Connect → Active → OpenSent → OpenConfirm → Established

The session is only exchanging routes in the Established state.

Common Use Cases #

  • ISP peering and transit
  • MPLS L3VPN (MP-BGP with VPNv4)
  • SD-WAN control plane
  • AWS Direct Connect / Azure ExpressRoute
Ryo Ueda
Author
Ryo Ueda
Cloud Network Engineer from Japan. Currently working in Toronto, Canada. Sharing my journey and knowledge in Cloud & Networking.