What Is BGP?
The Border Gateway Protocol (BGP), defined in RFC 4271, is the routing protocol that binds the internet together. It is the only Exterior Gateway Protocol (EGP) in widespread use today, responsible for exchanging routing information between the ~75,000+ Autonomous Systems (AS) that make up the global internet.
How BGP Works
BGP is a path-vector protocol. Unlike link-state protocols (OSPF, IS-IS) that build a complete topology map, BGP routers advertise reachable network prefixes (IP address ranges) along with a list of AS numbers (AS_PATH) that must be traversed to reach them. Each BGP router applies local policies to select the best path among multiple alternatives. The global BGP routing table contains over 950,000 IPv4 routes as of 2024, growing by approximately 50,000 routes per year.
Key BGP Attributes and Path Selection
- AS_PATH: Lists the ASNs a route has traversed. Shorter AS_PATH is generally preferred (though this can be manipulated with AS path prepending). This attribute also serves as BGP loop prevention—a router discards any route containing its own ASN.
- NEXT_HOP: The IP address of the next router to forward packets to. For eBGP, this is typically the directly connected neighbor. For iBGP, the NEXT_HOP is preserved from the eBGP advertisement.
- LOCAL_PREF: Local preference is the primary attribute for influencing outbound traffic from an AS. Higher values are preferred. Typically set on routes received from preferred upstream providers or peering connections.
- Multi-Exit Discriminator (MED): Sent to neighboring ASes to influence inbound traffic. Lower MED values are preferred. If a network connects to the same provider in two locations, MED can steer inbound traffic to the preferred entry point.
eBGP vs iBGP
External BGP (eBGP) runs between different autonomous systems—between your network and your ISP, or between ISPs at peering points. Internal BGP (iBGP) runs between routers within the same AS to distribute externally learned routes. iBGP requires a full mesh of peerings (each router must peer with every other iBGP speaker) or the use of route reflectors to scale beyond a handful of routers.
BGP in Canada
Major Canadian autonomous systems include Bell Canada (AS577), Rogers Communications (AS812), Shaw Communications (AS6327), and Telus Communications (AS852). The Toronto Internet Exchange (TorIX) and the Montreal Internet Exchange (QIX) are critical peering points where Canadian networks exchange traffic without paying transit fees, reducing latency and costs for Canadian internet users. TorIX, operated by TorIX Management Inc., is one of the largest internet exchanges in North America by peered traffic.
