BGP
In plain English
Plain definition
BGP (Border Gateway Protocol) is the path-vector routing protocol that autonomous systems use to advertise, filter and select routes to one another across the internet and large private networks.
Technical definition
BGP is a path-vector routing protocol that exchanges network layer reachability information (NLRI) between BGP speakers over a persistent TCP session, conventionally established on TCP port 179. Unlike interior gateway protocols that compute shortest paths from link metrics, BGP selects a best path using policy attributes carried with each advertised route, including AS_PATH, NEXT_HOP, LOCAL_PREF, the multi-exit discriminator (MED) and communities. Two deployment modes exist: External BGP (eBGP), used between routers in different autonomous systems, and Internal BGP (iBGP), used to distribute externally learned routes consistently within a single autonomous system. BGP is specified and maintained through the IETF RFC Series, which is the authoritative publication channel for the protocol and its extensions; the exact current document number and revision status should be confirmed directly against the RFC Series before being cited in compliance or vendor-specific documentation.
Operational relevance
BGP underpins inter-domain routing across the public internet and is also used within large private and cloud environments for multi-homing, traffic engineering and route redistribution between data centre fabrics. Operations teams interact with BGP when provisioning internet transit or peering, configuring multi-homed connectivity to a cloud provider, or running BGP-speaking overlay networks such as certain Kubernetes CNI plugins that advertise pod or service routes. Because BGP route selection is policy-driven rather than metric-driven, misconfigured filters, attribute manipulation or an unintended full-table advertisement can redirect traffic paths well beyond the boundary of a single organisation, which is why route filtering, maximum-prefix limits and peer authentication are treated as operational safeguards rather than optional hardening.
Architecture relationship
BGP sits above interior gateway protocols (IGPs) such as OSPF or IS-IS in a layered routing architecture: IGPs establish reachability and shortest paths within a single autonomous system, while BGP establishes reachability and policy-based path selection between autonomous systems. Within an autonomous system, iBGP sessions — typically arranged as a full mesh or through route reflectors to avoid a full mesh at scale — distribute externally learned eBGP routes to internal routers, which then rely on the IGP to resolve the next-hop address. Each BGP speaker maintains a routing information base split conceptually into Adj-RIB-In, the Loc-RIB (the local decision process output) and Adj-RIB-Out, with import and export policies acting as the architectural control points where an organisation enforces its routing intent.
Example
The following illustrative configuration fragment shows the shape of a basic eBGP peering statement in vendor-neutral pseudo-syntax. It is provided to convey structure only; it is not a tested command sequence and must be adapted to the syntax, version and permission model of the specific platform in use, in an isolated or non-production environment first.
router bgp <local-AS>
neighbor <peer-address> remote-as <peer-AS>
address-family ipv4 unicast
neighbor <peer-address> activate
neighbor <peer-address> prefix-list <name> in
neighbor <peer-address> maximum-prefix <limit>
The table below summarises the path attributes most commonly referenced in the route selection decision described above.
| Attribute | Role |
|---|---|
| WEIGHT | Locally significant preference value, implementation-specific and often evaluated first on a given platform. |
| LOCAL_PREF | Preference shared within an autonomous system via iBGP; higher values are generally preferred. |
| AS_PATH | Sequence of autonomous systems traversed; shorter paths are generally preferred, all else equal. |
| MED | Suggests a preferred entry point into a neighbouring autonomous system that has multiple connections. |
| NEXT_HOP | Address to which traffic for the advertised prefix should be forwarded. |
Misunderstanding
A frequent misunderstanding is that BGP selects the path with the fewest hops, in the way an interior gateway protocol might. BGP’s default decision process instead evaluates attributes such as weight, local preference and AS path length in a defined order, and any of these can be overridden by policy; two networks running BGP can therefore choose different “best” paths to the same destination for entirely valid policy reasons. A second misunderstanding is that BGP is relevant only to large internet service providers; in practice, any organisation that multi-homes to more than one upstream provider, or that runs a BGP-speaking overlay network internally, is operating BGP and inherits its operational responsibilities, including prefix filtering, maximum-prefix limits and session authentication.
Related terms
- Autonomous System (AS) — the routing domain identified by an AS number that BGP treats as a single policy unit.
- Interior Gateway Protocol (IGP) — a routing protocol, such as OSPF or IS-IS, used for reachability within a single autonomous system.
- Route Reflector — a BGP role that redistributes iBGP routes without requiring a full internal mesh.
- AS_PATH — the BGP attribute recording the sequence of autonomous systems a route has traversed.
- RPKI (Resource Public Key Infrastructure) — a cryptographic framework used to validate the origin of BGP route announcements.
Further reading
- RFC Editor — RFC Series, the authoritative publication channel for the BGP specification and its extensions; consult it directly for the current document number and revision status before citing a specific RFC in operational documentation.