Flat 60% off
Flat 60% off
Summer sale on All Video Courses.
Day
Hr
Min
Sec
Get Flat 60%
USD ($)
$
United States Dollar
India Rupee

BGP in Networking - Full-Form, Uses and Benefits

Created by Thrilok Thallapelly in Articles 23 May 2025
Share
«What is OSPF? Full-Form, Working and ...

BGP full form in networking is Border Gateway Protocol. It is one of the most important components for the working of the Internet and is a widely used protocol for routing over the Internet.

In this article, we will learn about the BGP protocol and understand how it works. We will also look at different BGP states, uses, advantages, and disadvantages

In our IT infrastructure training, we have explained various internet protocols like BGP with their practical implementations on real networking devices. If you are interested in building a career in IT networking, you can check out these courses. 

What is BGP in Networking?

Border Gateway Protocol (BGP) is a standardized exterior gateway protocol that allows for the exchange of routing information among Autonomous Systems (AS) on the Internet. 

It operates as a path-vector protocol and makes routing decisions based on paths, policies, and rules set by network administrators.


Types of BGP Protocol

The two main types of Border Gateway Protocol (BGP)- EBGP and IBGP.

1. External BGP (EBGP)

EBGP is used to exchange routing information between different autonomous systems on the Internet. In EBGP, routers in different AS establish BGP sessions with each other to exchange routing information and establish the best path to a destination. 

The Administrative Distance (AD) value of eBGP is 20.

2. Internal BGP (IBGP)

IBGP is used to exchange routing information within the same autonomous system (AS). IBGP routers are typically used to propagate routing information between different parts of the same AS or to provide redundancy within an AS. IBGP routers do not need to be directly connected, they can be connected via other BGP routers.

Administrative Distance (AD) value of iBGP is 200.



Live CCNP Enterprise TrainingEnroll in live CCNP Enterprise course to advance skills and get valid certification.Explore course
custom banner static image

What is an Autonomous System (AS)?

An Autonomous System (AS) is a group of networks managed by one organization, like a business or university, and connected to the Internet. Each AS has a unique identifier called an Autonomous System Number (ASN). Originally, ASNs were 2 bytes long, but since those are used up, the Internet Engineering Task Force (IETF) introduced 4-byte ASNs.

There are three types of Autonomous systems:

1. Multi-Home AS: Connected to two or more Autonomous Systems.

2. Stub AS: Connected to only one Autonomous System.

3. Transit AS: Acts as a link between two or more Autonomous Systems.

banner image

BGP Routing

The BGP protocol picks the best route to a destination using route qualities and path information. Internet BGP routers share these routes with each other across different autonomous systems. They use this information to create a routing table that shows the most direct route to each destination.

What is the BGP Port Number? BGP is an application-layer protocol that uses TCP at the transport layer. Its TCP port number is 179.

How BGP Works?

BGP routers establish a session, called a BGP neighbor or peer relationship. When two BGP routers establish a neighbor relationship, they exchange their full routing tables with each other.

Each router then uses the information it receives to construct a routing table that shows the best path to each destination. BGP routers use a combination of metrics called BGP attributes to determine the best path to a destination.

BGP Neighbors or Peers

Internet routers should know each other before sharing any information. BGP (Border Gateway Protocol) neighbors, or peers, are routers that establish a connection to exchange routing information. 

Routers become peers after clearing the BGP authentication(MD5 method). You may also be required to perform troubleshooting, and only then will they start sharing routing information effectively.

BGP Path Attributes

The optimum route to a destination is chosen by BGP routers via a technique known as BGP Best Path Selection.

Route attributes like the Weight, AS PATH, the origin code, the MED, etc., are used to determine which route to choose. The optimum path is determined by the router to be the one with the lowest metric.

BGP Best Path Selection Criteria

The BGP best path selection criteria are based on the attributes associated with each route. Here are some criteria that BGP uses to find best path:

1. Weight: It's a Cisco-specific attribute; a route with a higher weight is preferred. It is local to a router. 

2. Local Preference: It determines the preference of a route within an AS. A BGP route with a higher preference value is preferred. The default local preference value is 500.

3. AS Path Length: An AS is prepended when a route is traversed through various BGP autonomous systems. A BGP route with a shorter AS Path length is preferred.

4. Origin Code: IGP routes are preferred over EGP, and EGP routes are preferred over incomplete routes.

5. Multi-Exit Discriminator (MED): It determines the preferred exit point for traffic leaving the AS. A lower BGP MED attribute configuration value is preferred.

Read our detailed article on BGP Best Path Selection to learn all BGP path selection criteria.

What are BGP States?

BGP states are the different phases in the process of routers becoming BGP neighbors. The 6 BGP states are:

1. Idle

2. Connect

3. Active

4. OpenSent

5. OpenConfirm

6. Established

How AS PATH Attribute is Handled by eBGP and iBGP

It’s important to remember that although the two types of BGP are utilized in various ways, they share a common protocol and perform similarly. The way EBGP and IBGP handle the AS PATH parameter is the major distinction between the two protocols.

When a route is learned in EBGP, the AS PATH attribute is updated to include the router’s AS number. It helps in loop avoidance in eBGP. While the AS number is not assigned to the AS PATH element in iBGP.

What is Split Horizon in BGP?

Split horizon is a mechanism used in iBGP to avoid routing loops. If an iBGP router receives a route from its iBGP peer, then the iBGP router does not propagate that route to its other iBGP peer. Routes are not passed on to the other peer, creating a routing issue. There are some solutions to this problem:

1. Full Mesh: All routers in an AS form IBGP peering with each other.

2. Route Reflector: All routers form iBGP peering with a Route Reflector (RR).

3. Confederation: A Large AS is divided into sub-AS

What is a BGP Prefix List?

A prefix list is a route filtering mechanism used in BGP and with other protocols based on IP address prefixes. A prefix list is created by a name and with a sequence number, for example


!

ip prefix-list TEST-LIST seq 10 permit 10.0.0.0/8

ip prefix-list TEST-LIST seq 20 permit 20.0.0.0/8

!

In this prefix list, there is a default implicit deny statement at the end of the prefix list. These prefix lists can be directly used in the BGP neighbor statement, inbound or outbound, to filter IP address prefixes. As an example, below is the BGP configuration.


!

router bgp 100

  neighbor 192.168.1.1 remote-as 101

  neighbor 192.168.1.1 prefix-list TEST-LIST out

!

In the above configuration, prefix-list TEST-LIST is applied outbound to allow only the IP address prefixes present in the TEST-LIST prefix list to its BGP neighbor 192.168.1.1

What is the BGP Route Map?

The prefix list can also be called from a route map, for example, below, there may be many other parameters, such as local preference, weight, access-list, med, etc. can be called from a route map. The route map statements are also permitted and denied with a sequence number. 


!

route-map MY-ROUTE-MAP permit 10

 ip address prefix-list TEST-LIST

!

Now, this route map can be applied to the neighbor statement under the BGP process. 


!

router bgp 100

  neighbor 192.168.1.1 remote-as 101

  neighbor 192.168.1.1 route-map MY-ROUTE-MAP out

!

In this configuration, the route map also has an implicit deny statement at the end. The route-map is applied on neighbor 192.168.1.1 outbound, this route-map has a prefix list which permits 10.0.0.0/8 and 20.0.0.0/8 only to its neighbor. 

Note: In the above case, the result achieved by both, i.e., directly applying the prefix list and using route-map are same. 

BGP routers also exchange information about the reachability of a destination. This is done through the use of routing updates, which are sent to inform other routers about changes to the routing table.

These updates can include information about new routes that have become available or routes that have become unavailable.

What is BGP Community?

BGP community is a 32-bit attribute, represented as a 16-bit pair value, for example 65000:101, the first 16-bit value is the AS number, and the other 16-bit value is assigned by an administrator. There are the following types of communities.

1. Transitive vs. Non-transitive: Transitive communities are propagated to BGP neighbors, while non-transitive communities are not. The default behavior is transitive.

2. Well-Known Communities: There are a few well-known BGP communities with predefined meanings. For example:

No-Export: Prevents the route from being advertised to external BGP peers.

No-Advertise: Prevents the route from being advertised to any BGP peer.

3. Custom Communities: Network administrators can define and use custom communities based on their specific needs. These communities can be used to implement various policies or convey information about the route.

Uses of BGP

Border Gateway Protocol (BGP) is used in several types of networks, including:

1. Internet Service Providers (ISPs): ISPs use BGP to communicate routing data among several Internet autonomous systems. 

2. Enterprise networks: In industrial networks, BGP is also used to exchange routing data across several sites or regions. 

3. Data center networks: BGP is used in data center networks to exchange routing information between different parts of the same data center or between different data centers.

4. Service Provider networks: BGP is used by Service providers for efficient traffic routing between different networks and to provide redundancy.

5. Inter-domain routing: BGP is the routing protocol used between different domains of the internet; it’s the only protocol that can be used to exchange routing information between different autonomous systems (AS).

How to Learn BGP?

Now that you have the basic concepts on what BGP is and how BGP works, you can go ahead and study more in-depth on the topics covered here and beyond. There are several ways to learn Border Gateway Protocol (BGP), including:

1. Online Courses: There are many online courses available that cover BGP, several institutes such as Cisco, and renowned platforms like Uninets.

2. Books: There are also several books available on BGP, but I recommend the following books, which I have personally read, and I consider them the best books on the BGP Routing Protocol.

● Internet Routing Architectures by Sam Halabi

● Routing TCP/IP Volume II by Jeff Doyle

These books provide in-depth explanations of the BGP protocol and its configuration and can be used as a reference guide.

3. Training centers: Some training centers also offer BGP training courses. These courses are usually taught by certified instructors and provide hands-on experience with BGP.

4. Self-study: You can also learn BGP by studying on your own using the Cisco documentation and other resources available online.

5. Labs: Practical experience is crucial to master BGP. You can use software-based router emulators like Uninets Virtual Labs, GNS3, VIRL, or Eve-NG to set up your lab and practice different BGP scenarios.

Conclusion

BGP is essential for internet routing, connecting different networks through Autonomous Systems (AS). It uses path attributes and best path selection criteria to ensure optimal routing.

Understanding BGP's states, neighbor relationships, and tools like Prefix Lists and Route Maps is crucial for network stability. Continuous learning about BGP helps maintain efficient network infrastructures.

BGP States: Troubleshoot Active Neighbor»
Thrilok Thallapelly

Thrilok Thallapelly is a senior network consultant who has dedicated his career to the field of networking. He completed Bachelor's degree in Technology in Computer Science from a reputed university in the country. He has always been fascinated by the world of networking and pursued his passion by learning everything he could about routing and ...

More... | Author`s Bog | Book a Meeting

Related Articles

#Explore latest news and articles

What is the BGP Best Path Selection? 12 Nov 2024

What is the BGP Best Path Selection?

Understand BGP best path selection criteria & algorithm based on prefix attributes using weight configuration scenarios on Cisco routers. Read More!
What is VRF lite and How to Configure it? 21 Apr 2025

What is VRF lite and How to Configure it?

What is VRF Lite? Understand step by step configuration of vrf lite on Cisco routers with a practical scenario example. Read More!
BGP Authentication and Troubleshooting 11 Nov 2024

BGP Authentication and Troubleshooting

Learn to Configure BGP Authentication and Troubleshooting Steps on a Scenario based BGP Lab at UniNets.

FAQ

BGP (Border Gateway Protocol) is an exterior gateway protocol used to exchange routing and reachability information among autonomous systems (AS) on the Internet, ensuring efficient packet routing
BGP is considered a Layer 7 protocol because it operates at the application layer, utilizing TCP for reliable communication, although it interacts with multiple OSI layers
The main difference between OSPF and BGP is that OSPF is an interior gateway protocol used within a single AS, while BGP is designed for routing between different ASes
BGP is primarily classified as a Layer 4 protocol since it operates on top of TCP, which is a Layer 4 protocol in the OSI model
The benefits of BGP include its ability to provide redundancy by quickly adapting to route failures and its support for policy-based routing, allowing network administrators to control routing decisions based on defined rules

Comments (0)

Thrilok Thallapelly

Thrilok Thallapelly

Ex Network Engineer & Instructor @UniNets Instructor role
★★★★★ 4.98
Faithful User
Expert Vendor
Golden Classes
King Seller
Fantastic Support
Loyal Writer
+91 8383 96 16 46

Enquire Now

Captcha
Share to your friends

Share

Share this post with others

Contact learning advisor

Captcha image