Border Gateway Protocol (BGP)

BGP is the routing protocol networks use to share which IP addresses they can reach, so traffic can find paths between ISPs, clouds and other networks.

Border Gateway Protocol (BGP) is the routing protocol that networks use to tell each other which blocks of IP addresses they can reach. The internet connects autonomous systems, each identified by an autonomous system number (ASN) and run by internet service providers (ISPs), cloud providers, content networks and some enterprises. BGP is how those systems exchange routes and decide which path traffic should take between them. Organizations without their own ASN connect through their provider’s autonomous system. For businesses, BGP shows up when connecting to more than one internet provider, setting up private connections to cloud providers, and protecting the addresses they own.

At a glance

  • BGP exchanges reachability information between networks, called autonomous systems, and is the protocol that holds the internet’s routing together.
  • It is policy-based: each network chooses which routes to accept, prefer and pass on, not only the shortest path.
  • Enterprises use it for multihoming with several ISPs, for private cloud connections and with some SD-WAN and data center designs.
  • It trusts what neighbors announce, so filtering, RPKI validation and monitoring are needed to limit leaks and hijacks.
  • Failover speed depends on timers and configuration; it is not instant by default.

What problem it solves

The internet is made up of tens of thousands of independently run networks. No single organization has a map of all of them, yet traffic needs to find its way from any one to any other. BGP lets each network announce the address ranges, or prefixes, it can deliver to, and pass along what it has learned from others, so every network can build its own view of how to reach everything else.

For a business, BGP solves more practical problems. It lets you announce your own public IP addresses through two or more providers, so customers and remote staff can still reach your services if one provider fails. It is the standard way cloud providers exchange routes over private connections. And it gives you control over which links your traffic uses.

How it works

Sessions. Two routers, called neighbors or peers, open a BGP session and exchange routes. Sessions between different autonomous systems are external BGP (eBGP); sessions inside one network are internal BGP (iBGP).

Announcements. Each network advertises the prefixes it originates or can reach. A route carries attributes, including the AS path, the list of networks the route has passed through, which helps prevent loops.

Path selection. When a router learns several routes to the same destination, it picks one using a defined order of attributes, such as local preference set by the network itself, AS path length and others. Operators shape that choice with policies, for example preferring a cheaper peering link over paid IP transit, or making one provider primary and the other backup.

Updates. When a link fails or a route changes, routers send updates and withdraw routes, and the change ripples outward. How long that takes depends on timers and network size.

Scale. The global IPv4 routing table now holds around a million routes, plus a large and growing IPv6 table, which is why receiving a “full table” needs routers with enough memory.

When it matters for buyers

  • When you need inbound resilience. If you host VPNs, phone systems or applications that must stay reachable through a provider outage, BGP multihoming with your own addresses is the usual approach, combined with carrier diversity.
  • When connecting privately to cloud providers. Dedicated cloud connections generally use BGP to exchange routes; your team or provider must configure it.
  • When buying internet access. Ask whether the provider supports BGP sessions, which route options it offers and whether it filters what customers announce.
  • When protecting your addresses. Publishing RPKI records for addresses you hold helps other networks reject false announcements of them.
  • When DDoS mitigation is needed. Some scrubbing services use BGP to divert attack traffic through their networks.

Questions to ask vendors

  • Do you support BGP on this service, with a public or private ASN, and is there an extra charge?
  • Will you send a default route, a full table or partial routes?
  • Can we announce our own IP addresses, and what paperwork, such as a letter of authorization, do you need?
  • Do you filter customer and peer announcements and validate routes with RPKI?
  • Which BGP communities do you support for controlling how our routes are announced?
  • What failover times can we expect, and do you support Bidirectional Forwarding Detection?
  • Who configures and monitors our BGP sessions if the service is managed?

How it differs from Open Shortest Path First (OSPF)

BGP routes between networks run by different organizations. Open Shortest Path First (OSPF) is an interior gateway protocol that routes within one organization’s network. OSPF knows the full map of links inside your network and finds the lowest-cost path quickly, which suits a campus or data center. BGP exchanges policy-driven routes with outside networks and scales to the whole internet, but usually converges more slowly. Many enterprises run both: OSPF or a similar protocol inside, and BGP at the edge toward ISPs, cloud providers and WAN carriers. Our IP transit and cloud connect pages cover services where BGP is part of the setup.

Problems this helps with

  • Want two internet providers that fail over without changing our IP addresses
  • Cloud provider says our private connection needs a BGP session
  • Our traffic took a strange path or our addresses were announced by someone else
  • Not sure whether we need our own ASN and IP space

Frequently Asked Questions

Do we need BGP for two internet connections?
Not always. Many sites use two providers with an SD-WAN or firewall that fails over between them, with each provider's own IP addresses. BGP becomes useful when you want the same public IP addresses reachable through both providers, so inbound services such as VPNs or hosted applications keep working when one link fails.
Do we need our own ASN and IP addresses to use BGP?
To announce the same addresses to multiple internet providers, you generally need a public autonomous system number (ASN) and IP addresses you control, obtained from a regional internet registry or, in some cases, provided by a carrier with permission to announce them elsewhere. For a private connection to a cloud provider or a single carrier, a private ASN is often enough.
What is the difference between a full table and a default route?
With a default route, your provider tells your router to send all internet traffic its way. With a full table, the provider sends every route on the internet, which lets your router choose the best provider per destination but needs more router memory. Partial tables, such as routes for the provider's own customers, are a middle option.
Is BGP secure?
BGP was designed to trust what neighboring networks announce, so mistakes and deliberate hijacks can misdirect traffic. Route filtering, RPKI origin validation, which is now widely deployed by large networks, and monitoring reduce the risk. Path-security extensions such as BGPsec exist but have seen little deployment.
How quickly does BGP fail over?
It depends on configuration. With default timers, detecting a failed neighbor can take tens of seconds or longer; tuned timers or Bidirectional Forwarding Detection (BFD) can bring that down to around a second or less, if both sides support it. Inbound traffic from the wider internet can take longer to settle than outbound.

Get a Straight Answer in 30 Minutes

30 minutes. No pitch. Just an honest conversation about where you are, what you need, and whether working together makes sense.

By submitting, you agree to our Terms of Use and Privacy Policy.

We use your details to set up and prepare for the call, and send the newsletter only if you ask for it. We may follow up about your request; you can opt out at any time.