Introduction
Routing inside a single organization is one kind of problem. Routing across the Internet is a much bigger one. Inside a company, routers usually work under one administrative control, follow common internal rules, and use protocols such as RIP, OSPF, or EIGRP. The Internet is different because it is made of many independent networks that still need to talk to each other.
That is where BGP becomes important. Border Gateway Protocol is the routing protocol used to exchange reachability information between independent networks on the Internet. It does not simply help a router find a destination. It helps one network tell another network which IP prefixes it can reach and which path should be considered.
Why the Internet Needs BGP
If internal routing protocols already exist, it is fair to ask why we need another protocol.
The reason is scale and administration. Internal routing protocols are mainly designed to work within one autonomous system. The Internet is not one centrally managed network. It is a collection of service providers, enterprises, cloud platforms, universities, and backbone operators, all running their own policies.
So the routing question changes.
Inside a network: Which internal path is best?
Across the Internet: Which external network can carry traffic toward the destination?
Main job of BGP: Exchange reachability information between separately managed networks.
Without BGP, the Internet would not work as a connected network of networks.
Autonomous Systems and ASN
BGP works mainly between Autonomous Systems, usually called AS.
An Autonomous System is a network, or group of networks, that appears to the outside world as one routing domain with a clearly defined routing policy. In practical terms, it is often a network operated by one provider or one organization.
Each AS is identified by an ASN, which stands for Autonomous System Number.
Examples of organizations that may operate their own AS include:
Internet service providers
Cloud providers
Large enterprises
Universities
Backbone networks
This structure keeps Internet routing organized. Instead of every router dealing with the whole Internet directly, BGP handles routing at the AS level.
What BGP Actually Advertises
At a basic level, BGP advertises reachable IP prefixes. A network tells its neighbors which destination networks it can reach.
But BGP does more than advertise reachability. It also carries path-related information and route attributes that help routers decide whether a route should be preferred, avoided, or filtered.
A simple way to think about it is:
Prefix advertisement => Path information => Policy evaluation => Best route choice
That is why BGP is more than a destination lookup protocol. It is also a decision-making protocol for inter-domain routing.
Border Gateway Protocol
eBGP and iBGP
BGP is usually discussed in two forms.
Type | Full Form | Used Where | Main Purpose |
|---|---|---|---|
eBGP | External BGP | Between different autonomous systems | Exchange routes across AS boundaries |
iBGP | Internal BGP | Within the same autonomous system | Distribute BGP-learned routes inside the AS |
eBGP
eBGP is used when two different autonomous systems exchange routes. For example, one ISP can exchange routes with another ISP, or an enterprise can exchange routes with a cloud provider.
iBGP
iBGP is used inside the same autonomous system. Its purpose is not to replace internal protocols like OSPF. Instead, it helps distribute externally learned BGP routes across the organization so that routing policy remains consistent.
Why BGP Is Called a Path Vector Protocol
BGP is classified as a path vector routing protocol.
This means BGP does not advertise only a destination and a next hop. It also carries information about the path taken through autonomous systems. That path information is very important because Internet routing is not based only on shortest distance.
A network operator may care about:
Which provider a route passes through
Whether the path follows business agreements
Whether the route should be preferred or avoided
Whether the route may create a loop
That path awareness is what makes BGP different from a simple distance-based protocol.
Understanding AS_PATH
One of the most important BGP attributes is AS_PATH.
AS_PATH records the sequence of autonomous systems that a route advertisement has passed through. This gives routers a useful view of the inter-domain path toward a destination.
AS_PATH helps in two major ways:
Path visibility: A router can see the AS-level route being advertised.
Loop prevention: If a router sees its own AS already present in the path, it can reject that route and avoid looping.
You can think of AS_PATH as the route history attached to a prefix advertisement.
Basic Working of BGP
The complete BGP protocol is advanced, but the basic workflow is easy to follow:
Peer setup: Two BGP routers are configured to form a peering relationship.
Session establishment: They create a TCP connection using port 179.
Route exchange: Each peer advertises reachable prefixes and related path attributes.
Multiple path learning: A router may learn several possible routes to the same destination from different peers.
Policy evaluation: BGP compares those routes using path information and configured policy.
Best route installation: The preferred route is placed into the routing table and used for forwarding.
This is why BGP does not behave like a simple shortest-path protocol. The final choice depends on policy as well as reachability.
Policy-Based Routing in BGP
One of the biggest differences between BGP and many internal routing protocols is that BGP is policy based.
Protocols such as RIP and OSPF mainly focus on efficient internal path selection. BGP works in an environment where administrative and business decisions matter just as much as pure technical distance.
A BGP route may be preferred or rejected because of:
Business relationships: Provider, customer, or peering arrangements
Traffic engineering: Steering traffic in a desired direction
Administrative control: Local routing preferences set by the organization
Path attributes: Route information carried inside BGP updates
This policy-driven behavior is one reason BGP is so important for Internet-scale routing.
Summary
Border Gateway Protocol is the protocol that allows independent networks to exchange routing information across the Internet. It works between autonomous systems, advertises reachable prefixes, carries path information through AS_PATH, and uses policy-based decisions to choose routes.
The most important ideas to remember are Autonomous Systems, ASN, eBGP, iBGP, path vector routing, and AS_PATH. Once these are clear, the bigger picture becomes simple: BGP is the protocol that helps the Internet function as one connected system, even though it is made of many separate networks.
Be the first to add a comment.