What is BGP (Border Gateway Protocol)?
- What is Border Gateway Protocol?
- Why is the Border Gateway Protocol important?
- How does the Border Gateway Protocol work?
- What are the types of Border Gateway Protocol?
- How does the Border Gateway Protocol handle scale?
- How does the border gateway protocol establish a BGP neighbor relationship?
- Border Gateway Protocol History
- How can AWS support your BGP routing protocol requirements?
What is Border Gateway Protocol?
The Border Gateway Protocol (BGP) is a set of rules that determines the best network routes for data transmission on the Internet. The internet consists of thousands of private, public, corporate, and government networks linked together through standardized protocols, devices, and communication technologies. When you browse the internet, data travels across multiple networks before reaching its destination. BGP's responsibility is to examine all available paths data could take and select the best route. For instance, when a user in the United States loads an application with origin servers in Europe, BGP makes that communication quick and efficient.
Why is the Border Gateway Protocol important?
The Border Gateway Protocol (BGP) makes the Internet work through data routing. BGP routing is critical because, at its core, the Internet is made of hundreds of thousands of autonomous systems.
An autonomous system is a smaller network under the control of a single administrative entity. You can uniquely identify such networks by their autonomous system number assigned by the Internet Assigned Numbers Authority (IANA). Data travels between autonomous systems as it moves from source to destination.
BGP supports every autonomous system to do the following.
Find the best route
As data travels across the internet from source to destination, each autonomous system along the way must decide where the data packet should go next.
The decision is based on several attributes such as the number of networks the data passes through, preferred exit points, and preferred entry points. BGP routing considers these factors and helps determine the next best autonomous system so that data travels on the best route from source to destination, based on policy.
Discover network connection changes
The structure of the internet is dynamic. New autonomous systems are being added, and old ones are being removed constantly. Every autonomous system must stay updated with information regarding new and obsolete routes. BGP helps systems to discover and remain updated on such network changes.
Administer network policies
BGP has the flexibility to allow autonomous system administrators to implement their own routing policies.
For example, you can configure a router running BGP to distinguish between the routes that are internal and external to the autonomous system. The administrator can set rules to determine whether data should be routed internally or externally.
Add a layer of network security
BGP supports security in your network management. For example, BGP can validate route origin authorization using the Resource Public Key Infrastructure (RPKI). RPKI helps to prevent route hijacking.
BGP ensures a consistent routing policy across autonomous systems
The Border Gateway Protocol allows each autonomous system to apply its own routing policy, helping to specifically determine how traffic moves between multiple networks. Instead of having to follow a singular global ruleset, the BGP protocol lets you control how connections select and advertise routes.
Defining your own routing policies will make sure that any BGP routing decisions align directly with any internal business requirements. A policy-driven approach to connectivity using the Border Gateway Protocol (BGP) gives you a predictable and optimized way of routing traffic between autonomous systems while maintaining full control at the border gateway.
How does the Border Gateway Protocol work?
The Border Gateway Protocol (BGP) works using a mechanism called peering. Administrators assign specific routers as BGP speakers, which establish sessions with BGP neighbors, to form connections to other neighboring routers. These peers sit at the edge of an autonomous system, sharing information. They can share information with external networks using external BGP (eBGP) with other autonomous systems, or internally with iBGP within the same autonomous system.
Two peers need to establish a reliable TCP connection, during which each shares key parameters, such as its system number and router ID (also known as a BGP identifier). Once the session is active, they can begin exchanging information.
BGP peers perform several main functions.
Route discovery
BGP peers exchange routing information with neighboring BGP peers through network-layer reachability information (NLRI) and path attributes. NLRI includes connectivity information about neighbors and how to reach a particular destination network. Path attributes include AS path, next hop, local preference, and other BGP attributes.
After they exchange information, each BGP peer can then construct a Routing Information Base (RIB) of network connections to determine reachability.
Route storage
During the discovery process, every BGP router collects route advertisement information and stores it in the form of routing tables. It uses the routing table for path selection and also updates it frequently.
For instance, a BGP router may receive keepalive messages every 60 seconds from neighboring routers, updating the stored routes accordingly.
Path selection
BGP routers use the stored information in a routing table to route traffic. Path selection follows routing policies with sequential rules-based decision-making. BGP route factors, such as origin, AS path, local preference, and router ID, help determine a best path. When a destination is reachable from multiple paths, BGP selects the best path by sequentially evaluating path attributes according to the path selection algorithm.
What are the types of Border Gateway Protocol?
Border Gateway Protocol (BGP) is classified as internal and external, depending on where the data is being routed.
External BGP routers connect an autonomous system to the global Internet. However, large autonomous systems are themselves made up of smaller networked systems within them. Internal BGP routes data within a system.
External BGP vs. internal BGP
The main difference between internal and external BGP peering is the way the BGP route received from one peer is propagated by default to other peers. Here’s an explanation:
- New routes learned from an external BGP peer are re-advertised to all peers
- New routes learned from an internal BGP peer are re-advertised to all external peers, but not internal peers
Additionally, organizations must use external BGP to connect their corporate network to the Internet.
In contrast, there is no obligation to use internal BGP. You can choose from several internal routing protocols based on your organization's networking requirements.


How does the Border Gateway Protocol handle scale?
Given the billions of devices connected to the internet, how is it possible for one Border Gateway Protocol (BGP) router to connect with thousands of potential peers? Several approaches are used to manage scale and accommodate the expansion of the internet. Subdivision is used at every level so that the number of peers each router has to remember remains manageable.
Here are a few ways that BGP handles scale.
Route reflectors
Route reflectors (RRs) reduce the number of connections in internal BGP. A single router can act as a central hub, peering with an internal cluster of routers.
You can divide your network into multiple clusters and RRs. The RRs communicate with each other and with external BGP routers, with client routers peering only to a single RR, rather than all routers in the autonomous system.
Confederations
Confederations are a way to scale internal BGP by dividing up an autonomous system into multiple sub-parts. A confederation is the set of autonomous systems with a single Autonomous System Number (ASN) seen by the rest of the Internet.
For example, internet service providers (ISPs) of several European countries may group to form a European confederation. The outside world will see a single ASN for several countries.
Route aggregation
Route reflectors and confederations help reduce the number of global BGP networks. However, the top level of global peers is also continuing to grow.
In an attempt to prevent an eventual routing table exhaustion, ISPs cooperate to keep the global routing table as small as possible. They use Classless Inter-Domain Routing (CIDR) to allocate IP addresses more efficiently. They also use route aggregation to represent several networks in a single routing table entry.
How does the border gateway protocol establish a BGP neighbor relationship?
A BGP neighbor relationship is a connection that forms between two routers running BGP, letting them exchange routing information. In the Border Gateway Protocol, a neighbor relationship defines which configured routes can share reachability data for a destination network across different autonomous systems. It helps to coordinate routing between multiple networks on the Internet.
BGP establishes this relationship by starting a transport protocol (TCP) connection to a configured peer address over port 179, using the other router’s autonomous system number to identify it. As the Border Gateway Protocol is an exterior routing protocol, it makes use of TCP to form a stable BGP session. The two routers will exchange BGP messages, confirming any necessary parameters, like the router ID, before they then share routes.
As a trusted neighbor can advertise a BGP route, the neighbor peering process helps network operators maintain stable routing decisions and enforce policy across interconnected networks.
Border Gateway Protocol History
Before the Border Gateway Protocol was invented in 1989, the smaller-scale Internet was connected through the Exterior Gateway Protocol (EGP). As more independent networks formed their own autonomous system structures, people needed a more scalable routing protocol to reliably exchange routing information between these systems. The original BGP protocol was made as a path vector protocol, which would let each autonomous system advertise its reachable IP prefixes while preventing any routing loops.
The border gateway architecture has steadily evolved to support a more policy-based routing system between organizations, even including internet service providers. Improvements to the border gateway protocol introduced routing policy controls, improved existing BGP attributes, and allowed for better handling of multiple paths and determining the best route to a destination network. Classless inter-domain routing was added to reduce growth in the global routing table and improve scalability.
The border gateway protocol has grown with additional features, such as support for internal BGP within large networks, scalability features such as route reflectors, and BGP confederations. On a technical level, small iterations have refined how keepalive messages maintain a stable BGP neighbor relationship, how BGP messages signal errors, and how you form a BGP session over a TCP connection.
These improvements have led to the foundational routing protocol on the edge routers of autonomous systems today.
How can AWS support your BGP routing protocol requirements?
Amazon Web Services (AWS) offers AWS Transit Gateway and AWS Direct Connect to support your Border Gateway Protocol (BGP) routing protocol requirements.
Transit Gateway
Transit Gateway connects your Amazon Virtual Private Clouds (VPCs) and on-premises networks through a central hub, using route tables. This connection simplifies your network and puts an end to complex peering relationships.
Transit Gateway acts as a highly scalable cloud router where each new connection is made only once. It supports BGP over VPN to simplify branch connectivity through native integration of network virtual appliances. Any third-party appliances that support BGP work with Transit Gateway.
AWS Direct Connect
Similarly, AWS Direct Connect is the shortest path to your AWS resources. While in transit, your network traffic remains on the AWS global network and never touches the public internet.
You can use an AWS Direct Connect gateway attached with one or more transit virtual interfaces to interface with up to three transit gateways in any supported AWS Regions. You can establish one IPv4 BGP session and one IPv6 BGP session over a single transit virtual interface.
Get started with BGP routing between your AWS resources and your corporate network by creating a free account today.
Browse all cloud computing concepts
Browse all cloud computing concepts content here:
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages