New Batch Starts on 16th Oct.
Module: Network Fundamentals (L2 L3 Protocol Testing)
Timing: 07:00 AM to 08:00 AM IST (Weekdays)
Sign Up Now !

How BGP Works ?

Table of Contents


An Overview of BGP’s Working, IGP and EGP Peering:

In the previous chapter, “BGP Protocol,” we learned about the basics of BGP. Now, let’s see how BGP manages the complex web of routes that make up the internet’s backbone.

How BGP Works?

The Border Gateway Protocol (BGP) operates by managing how data is routed between autonomous systems (AS) over the internet. This section will break down the key stages of BGP’s functioning, including how sessions are established, how routes are exchanged and selected, the role of the path vector mechanism, and how BGP maintains network stability. Understanding these components will give you a clearer picture of how BGP ensures reliable and efficient communication across complex networks.

1. Establishment of BGP Sessions:

The BGP process starts when BGP peers establish a session by sending an OPEN message. This initial step is like setting the terms for a conversation before getting into a deep discussion. It ensures both routers are in sync, agreeing on parameters like BGP version and autonomous system numbers, which sets the stage for secure and reliable communication.

2. Exchange of Routing Information:

Once the session is established, BGP routers exchange vital routing information through UPDATE messages. These messages act as messengers, carrying new and updated routes along with detailed attributes and prefixes. By keeping the network’s routing tables current, these updates guide data packets along the most efficient paths to their destinations

3. Route Selection Process:

BGP acts as a decision-maker, selecting the optimal routes based on predefined policies and various attributes like AS path, origin code, and next-hop reachability. This strategic selection ensures that the network uses only the most efficient and reliable routes, enhancing overall performance

4. Path Vector Mechanism:

BGP uses a unique path vector mechanism to record each AS a route has passed through, maintaining a detailed travel log. This comprehensive path information enables informed routing decisions that avoid potential loops and meet specific network policies and efficiency standards

5. Keeping the Network Stable:

Regular KEEPALIVE messages exchanged between BGP peers maintain stability within the network. These crucial communications confirm that the connection remains active, preventing unnecessary session drops due to timeouts and ensuring all active routes are valid and operational


What is IBGP and EBGP?

When BGP peers with a router within the same autonomous system, it’s called IBGP peering. Conversely, when it peers with a router in another autonomous system, it’s classified as EBGP peering. These distinctions are crucial for applying path attributes and routing policies differently across various segments of the network, directly impacting how routing strategies are formulated and implemented.

How BGP works in IBGP peering:

IBGP distributes routing information within a single autonomous system. In this setting, routers using IBGP do not change the AS path attribute when exchanging routes. This consistency ensures that if a router learns about a route from an IBGP peer, it assumes the route is valid throughout the local AS. Operational aspects include:

Route Reflection:

To scale the full mesh requirement, route reflection is often used. This technique allows certain routers, known as route reflectors, to redistribute routes they’ve learned to other IBGP peers without needing direct connections, thereby simplifying management and reducing overhead.

Full Mesh Peering Requirement:

IBGP requires a full mesh topology among all routers within the AS to ensure consistent routing information across the entire AS and to prevent routing loops.


How BGP works in EBGP peering:

EBGP connects different autonomous systems and is vital for the internet’s global connectivity. It allows different networks to share routing information and access each other. Key operational features include:

Policy Enforcement:

EBGP is heavily influenced by routing policies. Networks use policies to control route advertisement and acceptance based on business agreements and regulatory requirements, which can dictate the flow of traffic across AS boundaries.

AS Path:

EBGP uses the AS path attribute, which gets updated as routes pass between ASes. This attribute helps prevent routing loops by allowing routers to see if a route has passed through their AS before.

Link Efficiency:

Typically, EBGP runs on direct, point-to-point links between routing devices in different ASes. This setup minimizes latency and maximizes the efficiency of data routing between ASes.


Next >>> BGP Protocol Peering and States

Previous >>> Introduction to BGP Protocol

Further reading: RFC 4271


We’d love to hear your feedback and suggestions about this article. Feel free to reach out to us using the WhatsApp number below.

Sajith Achipra has been a trainer and testing consultant at Zframez Technologies since 2009. With 15+ years of experience, he specializes in networking, Python, development, and testing. He conducts online courses to help students and professionals enhance their skills. You can reach him on WhatsApp at +91 8884 884 844 for your training and testing requirements.