Mastering Cisco BGP
BGP Fundamentals
The Internet’s Postal Service
The internet isn't a single, monolithic entity. It’s a massive collection of independent networks, all interconnected. Think of it like a global map made of different countries, each with its own road system. For a package to get from a city in one country to a city in another, the postal services of those countries need to cooperate. They need to know which paths are available and which are best.
In the world of computer networks, these “countries” are called Autonomous Systems, and the protocol they use to coordinate traffic is the Border Gateway Protocol, or BGP. BGP is the postal service of the internet, ensuring data packets find their way across the globe from one network to another.
BGP is the path vector routing protocol that glues the Internet together.
Each of these independent networks has its own set of rules and routing policies. BGP’s job isn't just to find a path, but to find a path that respects the policies of every network along the way.
Autonomous Systems
An Autonomous System (AS) is a large network or group of networks managed by a single organization. A university campus network, a large corporation like Google, or an Internet Service Provider (ISP) like Comcast are all examples of Autonomous Systems.
Autonomous System
noun
A collection of connected Internet Protocol (IP) routing prefixes under the control of one or more network operators on behalf of a single administrative entity or domain that presents a common, clearly defined routing policy to the internet.
To keep track of them all, each AS is assigned a unique number, called an Autonomous System Number (ASN). This number, which can range from 1 to 4294967295, acts as a globally unique identifier. When data travels across the internet, BGP uses these ASNs to chart a course from the source network to the destination network.
This process of routing between different Autonomous Systems is called inter-domain routing. BGP is the standard for it.
Establishing a Connection
Before two Autonomous Systems can exchange routing information, the routers at their edges—called border routers—must establish a direct connection. This connection is known as a BGP session or a peering.
These sessions are established over the Transmission Control Protocol (TCP) on port 179, which ensures a reliable and stable connection for exchanging critical routing data. Once the session is active, the routers become "neighbors" or "peers" and can begin sharing information about the networks they can reach. There are two main types of BGP sessions.
External BGP (eBGP): A session between routers in different Autonomous Systems. This is how the global internet is connected.
Internal BGP (iBGP): A session between routers within the same Autonomous System. This is used to share routes learned from external peers with all routers inside the local network, ensuring everyone has the same map.
Choosing the Best Path
Unlike other routing protocols that simply look for the shortest or fastest path, BGP makes decisions based on policy. When a BGP router learns about multiple paths to the same destination, it uses a complex decision-making process to select the single best one. This process relies on a set of characteristics attached to each route, known as BGP path attributes.
Think of these attributes as notes attached to a travel itinerary. One note might list every country you'll pass through. Another might specify the airline. Another might say, "Avoid flying through this region due to high fees." BGP uses these notes to pick the route that best fits its own network's policies.
Path attributes provide BGP with the flexibility to implement custom routing policies, which is essential for managing traffic flow on the vast and complex internet.
Here are a few of the most important path attributes:
| Attribute | Description |
|---|---|
| AS_PATH | A list of all Autonomous System Numbers a route has passed through. It’s the primary way BGP avoids routing loops. Shorter AS_PATHs are generally preferred. |
| NEXT_HOP | The IP address of the next router to send a packet to in order to reach the destination. |
| LOCAL_PREF | A number used within a single AS to signal which exit point is preferred for outbound traffic. A higher value is more preferred. |
| MED | Short for Multi-Exit Discriminator, this attribute is used to suggest to an external neighbor which entry point it should prefer for traffic coming into your AS. A lower value is more preferred. |
By evaluating these attributes and others in a specific order, a BGP router can determine the optimal path for its traffic. This policy-based approach allows network administrators to control costs, improve performance, and ensure reliability in a way that simpler routing protocols cannot.
Let's check your understanding of these core concepts.
What is the primary role of the Border Gateway Protocol (BGP) in the internet's architecture?
An Internet Service Provider (ISP) like Comcast or a large tech company like Google would each be considered a single __________.
Understanding these fundamentals is the first step. BGP is the protocol that allows different parts of the internet to function as a cohesive whole, guiding data on its complex journey across the world.