What Is BGP?
Author: Domeny.ForSale editorial team Published
In brief: BGP (Border Gateway Protocol) is a protocol that allows the networks making up the internet to exchange information about available routes to IP addresses. It lets operators choose which networks traffic should pass through according to their policies and agreements, rather than connection speed alone. An error in this information can make an otherwise working website inaccessible to some users.
What role does BGP play on the internet?
The internet consists of many interconnected networks managed by telecommunications operators, hosting companies, universities and cloud providers. The basic unit in BGP routing is an autonomous system (AS): a network or group of networks governed by a common route selection policy. It is identified by an ASN.
Routing means selecting the paths along which data packets can be sent. Routers using BGP advertise the reachability of IP prefixes, or blocks of addresses, to one another. In simple terms, an advertisement says: “You can reach this range of addresses through my network.”
BGP does not transmit website content or email messages. It provides information that routers use to build routing tables, which in turn are used to direct packets. It is the layer that organises the communication path, not the service running at its endpoint.
How does BGP select a route?
Routers establish BGP sessions: connections used to exchange route information. When a new route appears or an existing one becomes unavailable, they can announce the change or withdraw an earlier advertisement. They do not have to send the entire set of known routes each time.
Besides the prefix, an advertisement contains attributes describing the route. One of these is AS_PATH, a list of the autonomous system numbers through which the route information has passed. Among other things, it helps detect loops: a network can reject a route if it sees its own number on this list.
BGP does not automatically look for the path with the lowest latency. An operator may prefer a particular provider because of cost, an agreement or its own traffic management policies. A shorter AS_PATH can be a selection criterion, but it is neither the only one nor always the most important; the exact process depends on the configuration and implementation.
There are two distinct uses of the same protocol:
- eBGP — exchanging routes between different autonomous systems;
- iBGP — distributing BGP information within a single autonomous system.
iBGP does not replace all internal routing mechanisms. In larger networks, it works alongside protocols that ensure routers are reachable within the operator’s infrastructure.
Example: hosting with two internet connections
Suppose a hosting company has its own autonomous system and connects to two operators: A and B. It advertises its block of IP addresses to both operators through BGP. This allows other networks to learn about more than one path to the hosting servers.
The hosting company can configure operator A as the preferred option for outgoing traffic and treat B as a backup. If the connection to A fails and the relevant routes are withdrawn, traffic can pass through B. The change is not necessarily immediate: detecting the failure and recalculating routes takes time, and some packets may be lost during the switchover.
The return path does not have to be the same. The route from the user to the hosting company is also determined by other networks applying their own rules. Two connections therefore do not automatically mean an even distribution of traffic or full control over its flow.
What causes BGP failures and security threats?
Basic BGP does not, on its own, provide reliable confirmation that a network is authorised to advertise a particular prefix. Misconfiguration or deliberate action can therefore affect traffic beyond the network where the problem originated.
Prefix hijacking, known as BGP hijacking, involves the unauthorised advertisement of someone else’s address space. A route leak is the propagation of route information beyond what the policy governing connections between networks should permit. Both situations can make services unavailable and, in some cases, direct traffic through an unwanted network.
One safeguard is RPKI, an infrastructure that allows an autonomous system’s authority to advertise a prefix to be cryptographically verified. Operators can use it to validate route origins and reject invalid advertisements. However, it does not validate the entire AS_PATH or protect against every route leak; filters, configuration checks and monitoring are also needed.
What does BGP mean for a website owner?
If you use standard hosting, you usually do not configure BGP yourself. It is the responsibility of the infrastructure provider or its network operators. Simply buying a domain name, a TLS certificate or a VPS does not require your own ASN.
BGP is sometimes confused with DNS, the system that translates domain names into IP addresses. DNS helps determine the server’s address, while routing makes it possible to reach it. A correct DNS response therefore does not prove that the network connection is working.
If a website opens over mobile internet but not through your home connection, test it from both networks and note when the problem occurred. Send the hosting provider your results and, if you know how, a traceroute or MTR measurement showing the connection’s path. A difference in availability does not prove a BGP failure, but it gives administrators a concrete starting point for investigating routing.
