What is BGP (Border Gateway Protocol)?
Updated: 3 days ago

BGP, or Border Gateway Protocol, is the routing protocol autonomous systems use to exchange information about which IP prefixes they can reach and the paths associated with those routes. It is the protocol that allows independently operated networks such as broadband providers, content networks, cloud platforms and transit providers to build a working view of internet reachability.
The crucial distinction is that BGP does not move your packets itself and it does not simply choose the geographically shortest route. BGP exchanges reachability and path information. Routers then use selected routes to forward traffic according to network policy.
What does BGP mean?
Border Gateway Protocol is an inter Autonomous System routing protocol. RFC 4271 defines BGP 4 as the protocol used to exchange network reachability information between BGP systems, including information about the list of Autonomous Systems that reachability information has traversed. RFC 4271: A Border Gateway Protocol 4 (BGP 4)
An Autonomous System, usually shortened to AS, is a network or group of networks operated under a coherent routing policy and identified by an Autonomous System Number, or ASN. BGP lets one AS tell neighbouring BGP speakers which destination prefixes it can reach and attach attributes that help those networks decide whether and how to use the route.
Why does the internet need BGP?
The internet is not one centrally controlled network. It is a collection of independently operated networks connected through peering, IP transit and other interconnection arrangements. Each network needs a scalable way to advertise reachability and apply its own routing policy.
Without interdomain routing, a UK broadband provider could know how to reach its own customers but would have no practical global mechanism for learning which external networks can reach the millions of destination prefixes beyond its own infrastructure.
BGP in one sentence
BGP exchanges IP prefix reachability and path attributes between autonomous systems so each network can apply policy and select routes towards destinations across the wider internet.
How BGP works
At a simplified level, two BGP speakers establish a session, exchange routing information and then send UPDATE messages when relevant reachability changes. A route advertisement combines a destination prefix with path attributes.
Two BGP speakers establish a session and identify themselves using information that includes their Autonomous System numbers.
A speaker advertises reachable IP prefixes using BGP UPDATE messages.
The UPDATE carries path attributes such as AS_PATH and NEXT_HOP alongside the Network Layer Reachability Information, or NLRI.
The receiving network applies import policy and its BGP decision process to eligible routes.
A selected route can be installed for forwarding and, subject to export policy, advertised onwards to other BGP peers.
If reachability changes, BGP can advertise a replacement route or withdraw a route that is no longer feasible.
This control plane process is separate from packet forwarding. For the broader distinction between choosing a path and actually moving packets, see What is Routing?.
What is a BGP route?
A BGP route is not simply a line saying where a website lives. It associates a destination IP prefix with path information and attributes. For example, 203.0.113.0/24 represents an IPv4 documentation prefix containing 256 addresses, while the accompanying attributes describe information relevant to reaching that prefix.
BGP works with prefixes rather than individual websites. A single service may use multiple prefixes, a prefix can host many services, and modern content delivery can involve anycast and multiple locations.
What is AS_PATH?
AS_PATH is a well known mandatory BGP path attribute. RFC 4271 says it identifies the autonomous systems through which the routing information in an UPDATE has passed. When a route is advertised to an external BGP peer, the advertising AS normally prepends its own AS number to the path.
AS_PATH is important for loop detection and route selection, but a shorter AS_PATH is not a universal definition of a better internet path. Networks can apply local policy and other attributes before AS path length becomes decisive.
Important BGP path attributes
BGP carries several attributes that influence how routes are represented and selected. Important examples include:
ORIGIN: indicates the origin of the path information using the BGP defined origin categories.
AS_PATH: records the AS path associated with the advertisement and supports loop detection.
NEXT_HOP: identifies the next hop associated with the route.
LOCAL_PREF: a well known attribute used inside an AS to express preference. Higher local preference is normally preferred in the RFC 4271 decision process.
MULTI_EXIT_DISC, or MED: an optional non transitive attribute that can be used to discriminate among multiple entry or exit points to a neighbouring AS, subject to policy and comparison rules.
These attributes are one reason BGP should not be described as a shortest path protocol. The decision is policy aware.
BGP does not simply choose the shortest route
A common misconception is that the internet finds the route with the fewest routers or the shortest physical distance. BGP is designed around reachability and policy between autonomous systems. A network may prefer a customer route over a peer or transit route, prefer one upstream for commercial or engineering reasons, or deliberately steer traffic across different interconnections.
That means a route with fewer visible hops is not automatically preferable, and a lower AS path count does not guarantee lower latency.
The infographic below brings together the central BGP idea: prefixes are advertised between autonomous systems with attributes, while policy determines which eligible route a network prefers.

eBGP and iBGP are different
External BGP, commonly called eBGP, is used between BGP speakers in different autonomous systems. Internal BGP, or iBGP, distributes BGP information between speakers inside the same AS. The distinction matters because route propagation and attributes behave differently across external and internal relationships.
Large networks commonly use route reflectors or other internal designs to avoid requiring a full mesh of iBGP sessions between every router. Those designs are an internal scaling mechanism rather than a replacement for eBGP between autonomous systems.
How BGP relates to peering and transit
BGP is the routing mechanism commonly used to implement both peering and transit relationships, but the commercial relationships are different. With peering, two networks exchange agreed traffic directly. With transit, a customer pays a provider for broader internet reachability.
For UK context, the London Internet Exchange, LINX, defines peering as traffic exchange between autonomous systems using BGP4 to convey the internet addresses for which each network will accept traffic. LINX Peering Bandwidth service terms provide a concrete example of BGP at a major UK Internet Exchange Point.
A practical UK broadband BGP path
A home broadband user normally does not run BGP. Their device sends traffic to the home router, then through the access network into the ISP. BGP becomes important deeper in the provider and interconnection environment, where the ISP decides how external destination prefixes should be reached.
A simplified path could be: home device → router → access network → ISP edge → ISP core → peering or transit interconnection → destination network. The precise architecture varies by ISP, access network, destination, location and product.
The access technology, such as FTTP over GPON or XGS PON, does not determine the complete internet route. Two customers on similar fibre access can see different end to end performance because their providers have different interconnection, capacity and routing policies.
Techie Broadband path analysis: fewer network relationships do not guarantee lower latency
Techie Broadband analysis: consider two theoretical routes to the same destination. Route A crosses three autonomous systems but takes a geographically efficient path with uncongested interconnection. Route B crosses two autonomous systems but takes a longer physical path or encounters congestion at an interconnect.
The AS count is 3 versus 2, so Route B has 33.3% fewer ASes in this simplified example. That does not establish that Route B has 33.3% lower latency. AS_PATH describes autonomous system traversal in routing information, not fibre distance, queueing delay, propagation delay or end to end performance.
This is why BGP data, traceroute, round trip time, packet loss and throughput measurements answer different questions.
What happens when a BGP route changes?
When reachability or policy changes, BGP speakers can send UPDATE messages. A previously selected route may be replaced, or a prefix may temporarily become unreachable if no usable alternative exists. Networks then converge on their current routing state.
A single route change is normal. Repeated instability is different. Route flapping describes repeated changes in advertised reachability or path information, which can generate routing churn and repeated convergence.
BGP, asymmetric routing and traffic engineering
The route from A to B does not have to mirror the route from B to A. Each autonomous system applies its own policies, so internet paths are commonly asymmetric. BGP traffic engineering can also influence inbound or outbound route preference using attributes, communities, selective advertisements and interconnection choices.
This matters when troubleshooting because a traceroute from a UK broadband connection reveals one direction of the path. The return direction can differ, so a problem visible in round trip performance may not sit on the exact sequence of routers shown by one forward traceroute.
BGP route leaks and route hijacks are not the same thing
A BGP route leak is the propagation of routing announcements beyond their intended scope. RFC 7908 defines route leaks in terms of announcements violating intended routing policies and notes that they are often caused by accidental misconfiguration. RFC 7908: Problem Definition and Classification of BGP Route Leaks
A route hijack is a different concept, generally involving unauthorised origination or attraction of traffic for prefixes. The terms should not be used interchangeably. Both can disrupt routing, but the underlying policy failure and security problem can differ.
Does BGP make the internet secure?
Classic BGP was not designed with a complete cryptographic mechanism for proving that every route announcement is authorised. Modern routing security therefore adds mechanisms around BGP. Resource Public Key Infrastructure, RPKI, can support Route Origin Validation by allowing networks to check whether an AS is authorised to originate a prefix.
Origin validation is valuable, but it does not prove that the complete AS path is legitimate and it does not by itself prevent every route leak. BGP security is therefore a layered operational problem rather than a single switch.
Can BGP affect broadband performance?
Yes, indirectly. Your access line can remain perfectly healthy while a routing change alters the external path towards a game server, cloud platform, streaming service or other destination. That can change latency, jitter, packet loss exposure or reachable capacity elsewhere on the end to end path.
Equally, poor performance does not prove a BGP problem. WiFi, Ethernet negotiation, router processing, access network contention, network congestion, remote server load and many other factors can create similar symptoms.
How to investigate a suspected routing problem
Most home users cannot inspect their ISP's complete BGP control plane, but they can gather evidence that separates a local broadband problem from a wider path problem.
Test over wired Ethernet to remove WiFi variability.
Confirm the broadband connection itself is stable and that the router is not repeatedly reconnecting.
Measure latency and packet loss to several unrelated destinations, not just one service.
Run traceroute towards the affected destination and save the result.
Repeat the test at different times to see whether the route or performance changes.
Compare IPv4 and IPv6 where both are available because they can use different routing and interconnection.
Remove a VPN or tunnel temporarily because it changes the effective path and destination seen by the ISP.
Compare results from another connection or network where practical.
If the problem is destination specific, look for evidence of a route change, interconnection issue or remote network problem rather than assuming the access line is at fault.
Give the ISP timestamps, destination IPs, traceroutes and repeatable measurements if escalation is required.
Asterisks or a non responding intermediate hop in traceroute are not by themselves proof of packet loss. Routers can rate limit or decline diagnostic responses while continuing to forward transit traffic.
Common BGP misconceptions
BGP is not the protocol that carries your web page or video data. It exchanges routing information.
BGP does not automatically choose the geographically shortest path.
The shortest AS_PATH does not guarantee the lowest latency.
More router hops do not automatically mean a worse route.
A BGP route change does not necessarily cause a visible outage.
A traceroute is not a direct dump of the BGP AS_PATH.
Peering and transit both commonly use BGP, but they are not the same commercial relationship.
RPKI origin validation improves routing security but does not validate every aspect of an AS path.
BGP FAQs
What does BGP stand for?
BGP stands for Border Gateway Protocol. It is the interdomain routing protocol used to exchange reachability information between autonomous systems.
Is BGP used by home broadband routers?
Normally no. A typical home router uses a default route towards the ISP. BGP is generally used deeper in ISP, data centre, enterprise, content and interconnection networks, although specialist users and organisations with their own ASN and address space can run BGP.
What port does BGP use?
BGP uses TCP port 179 for its transport connection. TCP provides the reliable transport session, while BGP defines the routing messages exchanged over that session.
Is BGP a distance vector protocol?
BGP is commonly described as a path vector routing protocol because it carries path information such as AS_PATH rather than using a simple scalar distance metric such as hop count.
Does BGP choose the fastest internet route?
Not directly. BGP selects routes according to attributes and network policy. The selected path may perform well, but BGP does not measure application throughput or end to end latency and simply choose the numerically fastest result.
What is a BGP prefix?
A prefix represents a block of IP addresses, such as an IPv4 /24 or an IPv6 prefix. BGP advertises reachability for prefixes rather than individual domain names.
What is the difference between BGP and OSPF?
BGP is designed primarily for routing between autonomous systems and policy based interdomain routing. OSPF is an interior gateway protocol designed for routing within an autonomous system. They solve different routing problems.
Can BGP problems affect only one website or service?
Yes. Routing is prefix specific, and different destinations can use different networks and interconnections. A route problem can therefore affect one service or group of prefixes while unrelated destinations remain reachable.
Key takeaway
BGP is the protocol that lets autonomous systems tell each other which IP prefixes they can reach and attach path information that supports policy based route selection. It is fundamental to internet interconnection, but it should not be mistaken for packet forwarding, a shortest path algorithm or a direct measure of broadband performance.
For a UK broadband user, BGP usually operates out of sight beyond the access connection. Its decisions still matter because peering, transit, route policy and convergence can change the wider path between an otherwise healthy broadband line and the services being used.
To explore the related technical concepts used in this BGP (Border Gateway Protocol) guide, visit our broadband terminology guide.

