What is BGP? The Internet's Routing Protocol Explained

The Border Gateway Protocol, or BGP, is the routing protocol that holds the internet together. Every time you load a webpage, send an email, or stream a video, BGP is working behind the scenes to figure out how your data should travel across dozens of independent networks to reach its destination.

How the Internet is Organized

The internet is not a single network — it is a network of networks. Thousands of organizations, from large ISPs like AT&T and Deutsche Telekom to cloud providers like Amazon (AS16509) and Google (AS15169), each operate their own independent network. These individual networks are called Autonomous Systems (ASes), and each one is identified by a unique number called an ASN.

BGP is the protocol these autonomous systems use to exchange routing information with each other. It tells each network: "I can reach these IP address ranges, and here is the path to get there."

How BGP Works

BGP is a path vector protocol. When a network wants to announce that it owns a block of IP addresses (called a prefix), it sends a BGP announcement to its neighbors. Each neighbor that accepts the announcement prepends its own AS number to the AS path and forwards it to its neighbors, and so on.

For example, when Google announces the prefix 8.8.8.0/24 (which contains their famous 8.8.8.8 DNS server), the announcement might travel through several networks:

Each router along the way uses the AS path (among other attributes) to decide the best route to reach that prefix. Generally, shorter AS paths are preferred, but network operators can apply complex routing policies to influence path selection.

BGP Sessions and Peering

BGP routers establish sessions with each other over TCP (port 179). There are two types of BGP sessions:

Networks connect to each other through peering (direct interconnection, often at Internet Exchange Points) or by purchasing transit from a larger provider. You can explore these relationships by looking up any ASN — for example, Cloudflare (AS13335) shows its upstream and downstream neighbors.

Why BGP Matters

BGP is often called the "postal system of the internet." Without it, your ISP would have no idea how to reach servers hosted on other networks. But BGP's design also makes it fragile in some ways:

These issues have caused notable outages. In 2021, Facebook's BGP routes were withdrawn, making the entire platform unreachable for hours. In 2008, Pakistan Telecom accidentally hijacked YouTube's IP space, taking the site offline worldwide.

To address these security concerns, the internet community has developed RPKI (Resource Public Key Infrastructure), which allows networks to cryptographically verify that a BGP announcement is authorized by the legitimate holder of the IP address space.

A Brief History

BGP was first defined in 1989 in RFC 1105. The current version, BGP-4, was standardized in RFC 4271 (2006) and supports Classless Inter-Domain Routing (CIDR), which allows flexible allocation of IP address space. BGP-4 has been the backbone of internet routing for over two decades, handling the growth from a few thousand prefixes to over a million today.

See BGP in Action

You can explore real BGP routing data using a BGP Looking Glass. Try looking up any IP address or ASN to see the live BGP routes, AS paths, and origin information:

See BGP routing data in real time

Open Looking Glass
More Articles
What is an Autonomous System (AS)?
What is a BGP Looking Glass?
How to Look Up an IP Address's BGP Route
Understanding BGP AS Paths
What is RPKI? Securing BGP Routing
What is DNS? The Internet's Phone Book
What is an IP Address?
IPv4 vs IPv6: What's the Difference?
What is a Network Prefix (CIDR)?
What is an Internet Exchange Point (IXP)?
What is Peering? How Networks Interconnect
How Does Traceroute Work?
What is a CDN? Content Delivery Networks Explained
What is DNS over HTTPS (DoH)?
What is a BGP Hijack?
What are TLDs? Top-Level Domains Explained
What is Anycast? One IP, Many Servers
What is a Subnet? IP Subnetting Explained