The internet is a network of networks

When you open a website, your traffic may cross several networks before it reaches the server. Your internet provider, a transit provider, and the network hosting the website can each make separate decisions about how to carry that traffic. Border Gateway Protocol, or BGP, is the main way these networks exchange information about which destinations they can reach.

In BGP terminology, an independently administered network is an autonomous system, or AS. Each AS has an autonomous system number used to identify it in route announcements. An AS might belong to an internet provider, cloud platform, university, or large organization. BGP does not send a map of every cable and router across the internet. Instead, it shares reachability information between networks and lets each network apply its own routing policies.

What a BGP route announces

A BGP route identifies an IP address range, called a prefix, that can be reached through a particular path. For example, a network might announce a prefix such as 203.0.113.0/24 to a neighboring network. That prefix is reserved for documentation, but it illustrates the notation: the /24 indicates how much of the address is fixed and, therefore, the size of the range.

An announcement also carries attributes that help other networks evaluate the route. The AS path lists the autonomous systems the announcement has passed through. A next-hop value indicates where traffic should be sent to use the route. Other attributes can express preferences. A router uses the announcement to decide where to forward packets destined for that prefix; BGP itself does not carry the website request or other application data.

BGP speakers exchange routes with configured neighbors, often called peers. When those neighbors belong to different autonomous systems, the connection uses external BGP, or eBGP. Internal BGP, or iBGP, can distribute BGP-learned routes among routers within one AS. Neither type automatically tells every router about every possible route: what is shared depends on the network’s design and policy.

How policies shape the route traffic takes

Imagine that a small network can reach a destination through two providers. It may learn one route with fewer ASes in its AS path and another with more. The shorter path can be useful information, but BGP does not simply choose the fewest hops in all cases. The network may prefer one provider because of its own routing policy, and other route attributes can influence the decision.

A network can also control what it announces to each neighbor. It may advertise its own prefixes to both providers so that traffic has more than one potential way in. It may choose not to advertise routes learned from one provider to another, depending on its agreements and intended role. These import and export decisions are why internet routing is often described as policy-based: each AS decides which routes to accept, prefer, and share.

This also explains a common source of confusion. BGP’s selected route is not necessarily the geographically shortest path, the lowest-latency path, or the path with the most spare capacity. It is the best eligible route under the router’s configured selection process. Other tools and measurements are needed to assess the performance a user actually experiences.

What happens when routes change

If a connection fails or a network withdraws a prefix, its neighbors can update their BGP information and select another available route. Those updates may spread across multiple networks. A backup path can keep a destination reachable, but the change is not necessarily instantaneous: routers need time to process announcements and withdrawals, and a usable alternative must exist.

For learners, a useful distinction is between reachability and delivery. A BGP route says that a path to an address range is available according to the information a network has received. It does not guarantee that an application is running at the destination, that every packet will arrive, or that the path will remain stable. If a site is unreachable, BGP is one possible place to investigate, not an automatic explanation.

Why route filtering matters

Because BGP relies on announcements exchanged between networks, mistakes can have effects beyond the network where they begin. A route leak can spread routes to neighbors that were not meant to receive them. An incorrect announcement of someone else’s prefix can draw traffic toward the wrong network. The result may be disrupted connectivity or traffic taking an unintended path.

Operators reduce these risks with practices such as filtering routes from neighbors, setting limits on how many prefixes a neighbor may announce, and checking whether an AS is authorized to originate a prefix. Resource Public Key Infrastructure, or RPKI, provides data that can support that last check, though it does not validate every aspect of a route. For a learner or small team, the central lesson is straightforward: BGP makes independently run networks work together, but its announcements need careful policy and validation.

Back to category ↗