BGP · · 3 min read

What Is BGP? The Protocol That Runs the Internet

Every time you load a webpage, your traffic crosses multiple networks owned by different organizations. The protocol responsible for making that work — for stitching together tens of thousands of independently operated networks into a single functional internet — is BGP, the Border Gateway Protocol.

BGP is not like OSPF or EIGRP. Those are interior gateway protocols (IGPs) designed to route traffic within a single organization's network. BGP operates between organizations — between autonomous systems (ASes) — and it's the only protocol that does this at internet scale.

Why BGP Exists

The internet is not one network. It's a collection of over 75,000 autonomous systems, each identified by a unique AS number (ASN). ISPs, cloud providers, enterprises, universities, and content delivery networks all operate their own ASes. These organizations need a way to tell each other which IP prefixes they can reach and which path traffic should take to get there.

That's BGP's job. It's a path-vector routing protocol that exchanges network layer reachability information (NLRI) between BGP speakers. Unlike link-state protocols that build a complete topology map, BGP only knows the path — a sequence of AS numbers — that traffic would traverse to reach a destination prefix.

Autonomous Systems and ASNs

An autonomous system is a collection of IP networks under the control of a single administrative entity that presents a common routing policy to the internet. Each AS is assigned a number:

In our PingLabz BGP Lab, AS 65001 represents the enterprise HQ, AS 65002 is a branch site, and AS 65010/65020 are ISPs. These are private ASNs suitable for a lab environment. In production, public ASNs are assigned by Regional Internet Registries (RIRs) like ARIN, RIPE, or APNIC.

How BGP Differs from IGPs

If you're coming from an OSPF or EIGRP background (see our OSPF series for reference), BGP will feel fundamentally different:

FeatureIGPs (OSPF, EIGRP)BGP
ScopeWithin one ASBetween ASes (and within)
AlgorithmSPF / DUALBest path selection (13 steps)
TransportIP protocol 89/88TCP port 179
Neighbor discoveryAutomatic (multicast)Manual configuration
ScalabilityHundreds of routers950,000+ IPv4 prefixes
MetricCost / compositePath attributes
ConvergenceSub-second (with tuning)Minutes (default timers)

BGP runs over TCP (port 179), which means neighbors must be explicitly configured — there's no multicast hello mechanism. BGP converges more slowly by default, with keepalive timers of 60 seconds and hold timers of 180 seconds, though these can be tuned significantly with BFD (we'll cover this in BGP Convergence: Timers, BFD, and Reducing Failover Time).

eBGP and iBGP

BGP has two flavors depending on whether the peers are in the same or different autonomous systems:

We'll dive deep into the differences in eBGP vs iBGP: What's the Difference and When to Use Each.

BGP in the Real World

BGP is everywhere, not just at internet exchange points:

The BGP Finite State Machine

When two BGP routers attempt to form a peering session, they step through a finite state machine (FSM) with six states: Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Only in the Established state do routers actually exchange routing information. Understanding the FSM is critical for troubleshooting — a peer stuck in Active or OpenSent tells you exactly where the problem lies. We'll break this down fully in How BGP Works: Peers, Updates, and the Finite State Machine.

Key Takeaways

Read next

© 2025 Ping Labz. All rights reserved.