Border Gateway Protocol (BGP) — Meaning, Operation, and Core Concepts
Border Gateway Protocol (BGP) is the primary routing protocol that enables interdomain routing on the Internet. BGP is designed for scalability and policy control: instead of computing shortest paths hop-by-hop like many intra-domain protocols, BGP is a path vector protocol that communicates the reachable path (via attributes such as AS-PATH) and then applies routing policies to select what to install in the routing table. Autonomous System (AS) numbers identify the administrative boundary for BGP decisions, and BGP speakers exchange reachability information between ASes.
A useful way to model BGP is:
- neighbors exchange route advertisements (NLRI + attributes),
- each speaker uses those attributes and its policy rules to decide the “best” route,
- the selected routes are installed and propagated accordingly.
Footnotes
-
RFC 4271 — A Border Gateway Protocol 4 (BGP-4) - Defines BGP-4 and key concepts like route advertisements, attributes, and interdomain operation. ↩
BGP Basics (Path Vector, Attributes, Best Path)
Core vocabulary you must recognize
BGP is often discussed using a small set of technical terms:
- BGP neighbor: a peer session between two routers.
- BGP session: typically over TCP, with keepalives and hold timers.
- Route advertisement: includes NLRI and BGP path attributes (e.g., AS-PATH).
- AS-PATH: used to prevent loops and inform policy.
Many “how BGP works” questions reduce to understanding route attributes and the best-path decision process.
How BGP learns and selects a route (high-level)
- 1Step 1
BGP speakers form a neighbor relationship and exchange messages so each side can synchronize route information.
- 2Step 2
Each advertisement carries a prefix (NLRI) plus path attributes; attributes like AS-PATH help identify how the route was reached.
- 3Step 3
BGP uses AS-PATH and configured policies to avoid creating routing loops and to enforce business/engineering preferences.
- 4Step 4
For each prefix, BGP compares candidate routes using a defined decision process (attributes + policy), then selects one.
- 5Step 5
The selected route is installed in the local routing table, and any newly chosen/changed routes are advertised to neighbors.
Message types and timers (what makes BGP “stable enough”)
BGP maintains a persistent session with liveness detection. Typical BGP behavior includes:
- exchanging initial routing information after session establishment (often described as “open/keepalive” and then update exchange),
- continuously monitoring neighbor reachability with keepalive messages,
- using a hold timer mechanism that triggers session reset when the neighbor stops responding.
In well-designed networks, convergence and stability depend not only on BGP’s mechanics but also on how networks configure policies and route filtering.
BGP decision inputs (conceptual weighting)
A conceptual view of what commonly influences BGP best-path decisions—policy and attributes dominate over pure hop count.
Why BGP is policy-driven (not just “best route”)
Traditional shortest-path routing (like many link-state or distance-vector approaches) aims to minimize some cost metric. BGP, however, is explicitly built to let network operators control routing outcomes. That’s why the protocol:
- carries rich path attributes,
- selects routes using a best-path procedure that can be influenced heavily by policy inputs (e.g., local preference and filtering),
- cleanly separates administrative domains via AS boundaries.
This policy orientation is essential for traffic engineering, redundancy, traffic contracts, and regulatory/business constraints across different networks.
Footnotes
-
Border Gateway Protocol — Wikipedia - Overview of BGP’s path-vector nature, ASes, and policy-driven route selection. ↩
Pro Tip: AS-PATH is central
If you’re learning BGP, start by learning what AS-PATH means and how it helps prevent loops and guide policy decisions. Many BGP troubleshooting clues come from spotting the AS-PATH behavior.
Warning: “Reachable” does not mean “chosen”
BGP can learn multiple routes to the same prefix from different neighbors, but it may select only one based on policy and attributes. Always distinguish between received routes vs the installed “best” route.
Relationship to other routing layers
To situate BGP in an end-to-end routing system:
- IGP (Interior Gateway Protocol) handles routing inside an AS (e.g., between routers and subnets within the domain).
- BGP handles routing between ASes (interdomain), exchanging reachability and applying policy.
- If BGP selects a next hop that is reachable via an IGP, the forwarding plane can then send traffic accordingly.
This layered approach is what makes BGP practical at Internet scale: internal topology dynamics can change frequently, while interdomain decisions can remain policy-consistent.
Common misconceptions & quick clarifications
BGP Terms to Master
Knowledge Check
Which statement best describes BGP?