Learning Center / What is BGP?
What is BGP (Border Gateway Protocol)?
Border Gateway Protocol (BGP) is the routing protocol that keeps the global Internet connected. It coordinates how independent networks exchange routing information so that data can find the best path from source to destination.
BGP Internet routing Networking Border Gateway Protocol
Every time you visit a website, stream a video or use a cloud application, your data travels across multiple independent networks. BGP is the protocol that allows these networks to communicate with one another and decide which path traffic should take.
In this article, we explain what BGP is, how it works, the difference between iBGP and eBGP, and the main use cases and security considerations for modern infrastructures.
What is BGP?
Border Gateway Protocol (BGP) is a standardised routing protocol used to exchange reachability information between large networks called Autonomous Systems (AS) on the Internet.
BGP allows networks to:
- Announce which IP prefixes (IP address ranges) they can reach
- Learn paths to distant networks through their neighbours
- Apply routing policies to choose the preferred path
Because nearly all interconnection between ISPs, cloud providers and large enterprises relies on BGP, it is often described as the “routing protocol of the Internet”.
Why is BGP important for the Internet?
BGP is essential because it transforms thousands of independent networks into a single, globally reachable Internet.
Global reachability
Each Autonomous System announces the IP prefixes it can deliver traffic to. BGP propagates these announcements across the Internet so that routers can build a global routing table and deliver packets to almost any destination.
Network stability
When a link fails or a network goes offline, BGP updates the routes and converges towards an alternative path. This dynamic behaviour helps to maintain service availability and avoid large-scale outages.
Traffic engineering
BGP is a policy-based protocol. Network operators can adjust preferences to:
- Use low-latency paths for critical applications
- Avoid expensive or congested links
- Distribute traffic across multiple providers
Core BGP concepts
Autonomous Systems (AS) and AS numbers
An Autonomous System (AS) is a group of IP networks and routers under a single administrative control, such as an ISP, a cloud provider or a large enterprise. Each AS is identified by an Autonomous System Number (ASN), assigned by a regional Internet registry.
IP prefixes and routes
A BGP route describes how to reach a specific IP prefix, such as
203.0.113.0/24. Each route contains:
- The destination IP prefix
- The AS path (the sequence of ASNs the route has traversed)
- Additional attributes used in path selection
Key BGP attributes
When multiple routes exist for the same prefix, BGP uses attributes to select the best path. Common attributes include:
- AS_PATH – the list of ASNs a route has passed through
- LOCAL_PREF – local preference value inside an AS
- MED (Multi-Exit Discriminator) – suggests a preferred entry point
- Communities – tags used to apply flexible policy rules
How does BGP work?
BGP peers (also called neighbours) are configured manually between routers. They establish a TCP session, usually on port 179, and then exchange routing information.
The basic steps are:
- Session establishment – two routers open a TCP connection and exchange BGP OPEN messages.
- Initial table exchange – each router sends the routes it knows to its neighbour.
- Path selection – the router compares all available routes for each prefix and selects a single best path, based on attributes and local policies.
- Routing table update – the best path is installed in the forwarding table so traffic can be sent to the chosen next hop.
- Incremental updates – after the initial exchange, only changes (new routes, modified attributes, withdrawals) are sent.
Types of BGP: iBGP vs eBGP
External BGP (eBGP)
eBGP is used between different Autonomous Systems. Typical examples include:
- Between an ISP and a customer network
- Between two ISPs at an Internet Exchange Point
- Between a cloud provider and a transit provider
Internal BGP (iBGP)
iBGP is used inside a single AS. It distributes routes learned via eBGP (or from other internal routers) throughout the AS so all edge routers have a consistent view of external destinations.
Large networks often combine iBGP with an interior gateway protocol (such as OSPF or IS-IS) that provides internal reachability information.
Benefits of using BGP
- Scalability: designed to handle hundreds of thousands of routes.
- Policy control: fine-grained control over inbound and outbound traffic.
- Redundancy: support for multi-homing with multiple ISPs.
- Flexibility: easy integration with VPNs, data centres and cloud networks.
BGP challenges and security risks
BGP was designed in a more trusted phase of the Internet and has limited built-in security. Misconfigurations or malicious announcements can have a global impact.
BGP hijacking
BGP hijacking occurs when a network improperly announces IP prefixes it does not own. Traffic can then be redirected, intercepted or dropped.
Route leaks
A route leak happens when routes learned from one peer or provider are mistakenly advertised to another, violating routing policy and potentially causing sub-optimal paths or outages.
Best practices to secure BGP
- Apply strict route filters per neighbour
- Use RPKI and route origin validation where possible
- Set max-prefix limits to protect against route table floods
- Monitor BGP announcements and paths for anomalies
Common BGP use cases
Multi-homing with multiple ISPs
Organisations that require high availability often connect to two or more ISPs and use BGP to maintain Internet connectivity even if one provider fails.
Traffic engineering and load balancing
With techniques such as AS path prepending, MEDs and BGP communities, operators can steer traffic over preferred links and balance loads across different connections.
Data centre and cloud interconnection
Cloud providers, content delivery networks and data centre operators rely on BGP to connect multiple sites, peer with other networks and implement anycast routing for distributed services.
BGP and modern cloud networking
In cloud and hosting environments, BGP is commonly used at the network edge to connect data centres to the Internet, to build private interconnects and to secure redundant VPN or SD-WAN topologies.
Understanding how BGP policies influence routing decisions helps you optimise latency, availability and resilience for your applications.
FAQ: BGP in brief
What is BGP in simple terms?
BGP is like a global navigation system for the Internet. It tells large networks which paths to use so that data can travel from one network to another.
Is BGP the same as OSPF?
No. OSPF is an interior gateway protocol used inside a single organisation’s network. BGP is an exterior gateway protocol used between different networks (ISPs, cloud providers, enterprises) on the global Internet.
Do small businesses need BGP?
Most small businesses that use a single ISP and private addressing do not need BGP. BGP becomes relevant when you have your own public IP ranges, an ASN or multiple upstream providers.
Is BGP secure?
BGP itself does not offer strong security features. It should be combined with authentication on BGP sessions, strict filtering, RPKI and continuous monitoring to reduce the risk of hijacks and route leaks.
Need BGP-ready connectivity?
Contact our team to discuss IP transit, colocation and cloud connectivity options tailored to your infrastructure.
Contact sales
Deutch
Français