BGP Basics

How BGP keeps the internet connected by letting networks announce routes, choose paths, and recover from failures.

2 min read

The Border Gateway Protocol, usually called BGP, is the routing protocol that connects the internet together. While protocols such as OSPF or IS-IS help routers find paths inside a single organisation, BGP is designed to exchange reachability information between separate networks.

What BGP does

The internet is made of thousands of independently operated networks called autonomous systems, or ASes. Each AS has its own number, routing policy, customers, providers, and peers. BGP allows these systems to tell one another which IP prefixes they can reach and which path traffic should take to get there.

For example, if a cloud provider owns a block such as 203.0.113.0/24, it can advertise that prefix to its upstream carriers using BGP. Those carriers can then pass the route to other networks, allowing users around the world to send traffic toward that destination.

Why BGP is policy based

BGP is not just looking for the shortest path. It is a policy-driven protocol. Network operators can prefer customer routes, avoid expensive transit links, filter unwanted announcements, or steer traffic through specific partners. This makes BGP well suited to business relationships as well as technical routing.

How BGP chooses a route

When several routes exist for the same prefix, BGP applies a decision process. Common factors include local preference, AS path length, origin type, MED, eBGP versus iBGP, and router ID. Operators usually influence route choice with attributes such as local preference and AS path prepending.

eBGP and iBGP

External BGP, or eBGP, runs between different autonomous systems. Internal BGP, or iBGP, runs inside one autonomous system to distribute externally learned routes across the provider or enterprise backbone. Large networks often combine BGP with an internal routing protocol and route reflectors to scale efficiently.

Why BGP can be risky

BGP was created in a more trusting era of the internet. By default, it does not prove that a network is authorised to announce a prefix. Mistakes or malicious announcements can cause route leaks, hijacks, and outages. Modern protections such as prefix filtering, RPKI, route origin validation, and careful monitoring reduce these risks.

Where BGP is used

BGP is most visible at internet exchanges, service providers, cloud platforms, data centres, and large enterprises with multiple upstream connections. It is also used inside modern infrastructure for anycast services, Kubernetes networking, data-centre fabrics, and traffic engineering.

Key takeaway

BGP is the internet’s control-plane language. It lets independent networks exchange routes, apply business and engineering policy, and keep global connectivity working even when links, providers, or paths change.