BGP Fundamentals: A Beginner’s Guide to Understanding Dynamic Routing
1. What Is BGP?
BGP (Border Gateway Protocol) is a dynamic routing protocol that allows routers to exchange information about which networks they can reach.
It is commonly used to connect different organizations, Internet Service Providers (ISPs), and large enterprise networks.
Simple Definition:
BGP is a routing protocol that helps routers learn about other networks and select the best available path to reach them.
Real-Life Example
Imagine you want to travel from one city to another.
There may be multiple roads available. A navigation system helps you choose a suitable route.
Similarly, BGP helps routers select a preferred network path using routing information and policies.
2. Why Do We Need BGP?Routers need routing information to forward data between different networks.
In small networks, administrators can manually configure static routes.
However, when networks become larger or multiple connections are available, manually managing all routes becomes difficult.
BGP allows routers to exchange routing information dynamically.

- Automatic Route Learning: Routers learn network routes from their BGP neighbors.
- Best Path Selection: BGP selects a preferred route when multiple paths are available.
- Scalability: Supports communication between large networks.
- Routing Control: Allows administrators to control which routes are shared.
- Redundancy: Can provide alternative routing paths when multiple connections exist.
Consider two offices connected through routers.
- Office A has its own network.
- Office B has a different network.
- Both offices want to communicate.
Initially, each router knows about its own directly connected network.
BGP allows both routers to exchange information about their networks.
BGP Working Process
Step 1: Establish Connection
The routers establish a BGP session with each other.
Step 2: Exchange Routes
Each router informs the other about the networks it can reach.
Step 3: Learn Networks
Both routers learn the available network routes.
Step 4: Select the Best Path
BGP selects the preferred route based on available paths and routing policies.
Step 5: Forward Traffic
The routers use the selected routes to forward traffic toward the destination.
Remember: BGP exchanges routing information. The router’s forwarding table is ultimately used to forward data packets.
4. What Is an Autonomous System?An Autonomous System (AS) is a group of networks managed by a single organization or routing administration.
Every Autonomous System has an identifying number called an Autonomous System Number (ASN).

Imagine three companies:
- Company A manages its own network.
- Company B manages its own network.
- Company C manages its own network.
Each company can operate its own Autonomous System.
BGP helps these organizations exchange routing information.
Local ASThe Autonomous System to which your router belongs.
Remote ASThe Autonomous System to which your neighboring router belongs.
5. Types of BGPThere are two main types of BGP.

eBGP is used to exchange routing information between different Autonomous Systems.
Example: A company exchanging routing information with its Internet Service Provider.
Internal BGP (iBGP)iBGP is used to exchange routing information between routers within the same Autonomous System.
Example: Multiple routers exchanging BGP routes inside a large enterprise network.
Easy Way to Remember- eBGP: Different Autonomous Systems.
- iBGP: Same Autonomous System.
A BGP Neighbor is another router with which a router establishes a BGP session to exchange routing information.
Before routers can exchange routes, they must establish a connection.
BGP uses TCP port 179 for communication.

- Both routers are configured as BGP neighbors.
- They establish a TCP connection.
- They exchange BGP session information.
- The BGP session becomes Established.
- Both routers can begin exchanging routing updates.
Important: The BGP neighbor state should be Established for normal route exchange.
7. What Is Route Advertisement?Route Advertisement is the process of informing neighboring routers about reachable networks.

For example:
Router A informs Router B that it can reach Network A.
Router B informs Router A that it can reach Network B.
Once the routes are accepted and usable, both routers can forward traffic toward the remote networks.
This process is called BGP Route Advertisement.
8. What Is BGP Prefix Filtering?Prefix Filtering controls which network routes a router accepts or advertises.
It helps administrators control routing information.

Controls which routes a router accepts from its BGP neighbor.
Simple Meaning: Which network routes am I allowed to learn?
Outbound Prefix FilteringControls which routes a router advertises to its BGP neighbor.
Simple Meaning: Which network routes am I allowed to share?
Permit and Deny- Permit: Allows matching routes.
- Deny: Blocks matching routes.
Prefix filtering improves routing control and helps prevent unwanted route exchange.
9. What Is BGP Best Path Selection?Sometimes a router learns multiple routes to the same destination.
BGP evaluates these routes and selects a preferred path using routing attributes and policies.

Some commonly used factors include:
- Local Preference
- AS Path
- MED
- Next-Hop Reachability
Imagine a company has connections through two ISPs.
Both ISPs provide routes to a destination.
BGP evaluates the available routes and determines which path should be preferred.
If the preferred path becomes unavailable, another valid route may be selected.
Remember: BGP selects paths based on routing policies and attributes, not simply the fastest connection.
10. Where Is BGP Used?
ISPs use BGP to exchange routing information with other networks.
Enterprise NetworksLarge organizations use BGP to connect different network environments.
Multi-ISP ConnectivityCompanies use BGP to manage routing through multiple internet providers.
Data CentersBGP helps exchange routing information in large data center networks.
SD-WAN NetworksBGP can be used to exchange routes between SD-WAN gateways and other routers.
BGP itself does not establish SD-WAN tunnels or encrypt traffic.
11. BGP vs Static Routing
In static routing, administrators manually configure the path to reach a destination network.
It is suitable for small networks with simple routing requirements.
BGP Dynamic RoutingIn BGP, routers exchange information about reachable networks.
It is useful when multiple networks, routing policies, or external connections need to be managed.
Key Difference: Static routes are entered manually, while BGP dynamically exchanges routing information with configured neighbors.
12. Important BGP Terms
- BGP: Protocol used to exchange routing information.
- Autonomous System: Group of networks under common routing administration.
- ASN: Number identifying an Autonomous System.
- BGP Neighbor: Router configured to exchange BGP information.
- eBGP: BGP between different Autonomous Systems.
- iBGP: BGP within the same Autonomous System.
- Route Advertisement: Sharing network reachability information.
- Inbound Filter: Controls received routes.
- Outbound Filter: Controls advertised routes.
- Next Hop: Router used to reach a destination.
- Best Path: Preferred route selected by BGP.
- Established: State indicating an operational BGP session.
Border Gateway Protocol is a dynamic routing protocol that allows routers to exchange information about reachable networks.
BGP is especially useful in environments where multiple organizations, ISPs, or enterprise networks need to communicate.

For beginners, understanding these five concepts is enough to build a strong foundation:
- Autonomous System: Identifies a network administration.
- BGP Neighbor: A router that exchanges routing information.
- Route Advertisement: Shares information about reachable networks.
- Prefix Filtering: Controls which routes are accepted or advertised.
- Best Path Selection: Determines the preferred route to a destination.
The most important thing to remember: BGP tells routers which networks are reachable and helps them choose the preferred path to those networks.