Free — no signup required

BGP: The Path Vector Protocol

2 min read

"I know a guy who knows a guy..."

Border Gateway Protocol (BGP) is the protocol that glues the internet together. It is the only exterior gateway protocol used on the public internet today, and it has been since BGP-4 was standardized in 1994. BGP is classified as a Path Vector protocol — a category that sits between distance-vector protocols (like RIP) and link-state protocols (like OSPF).

Here's what makes BGP different from those other protocols:

  • RIP (distance-vector): "I can reach 10.0.0.0/8 in 3 hops." It only knows the distance, not the path.
  • OSPF (link-state): "Here's a complete map of every link in the network, with speeds and costs." It knows everything about the internal topology.
  • BGP (path vector): "I can reach 10.0.0.0/8, and the path goes through AS200, AS300, AS400." It knows the full sequence of Autonomous Systems the route traverses.

When two BGP routers connect, they establish a BGP session over TCP port 179 and exchange their full routing tables. After that, they only send incremental updates when something changes. The routers are called BGP peers or BGP neighbors, and the connection between them is called a peering session.

There are two flavors of BGP:
- eBGP (External BGP): Sessions between routers in different Autonomous Systems. This is the internet-facing BGP that connects ISPs and companies.
- iBGP (Internal BGP): Sessions between routers within the same Autonomous System. Used to distribute externally learned routes to all routers inside the AS.

BGP doesn't inherently choose the fastest route or the one with the lowest latency. It chooses the "best" route based on a complex, ordered decision process driven by policy attributes configured by network engineers. This is what makes BGP powerful — and also what makes it dangerous when misconfigured.

Key Point: BGP is policy-driven, not speed-driven. The "best" BGP path is determined by business agreements and administrative configuration, not raw network performance.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free