blog posts

What Is A Border Gateway Protocol And What Is Its Role In The World Of Computer Networks?

What Is a Border Gateway Protocol

The Border Gateway Protocol (BGP) Enables Communication Between Standalone Systems, and it is also known as the Internet Protocol. 

Border Gateway Protocol: While Protocols Such As OSPF And IS-IS Set A Limit On The Number Of Routers In A Given Area, The BGP Protocol Does Not Have This Limit Because It Does Not Require Two Routers To Communicate Directly With Each Other In A Network.

BGP consists of several independent systems and is used by network edge routers. This vector-based routing protocol can send packets via specific BGP messages exchanged between routers during TCP sessions in a communication network. It has led to good routing performance, as it uses a variety of criteria to select the best route. However, an essential factor that has made this protocol popular is its configuration.

The protocol can be configured to work according to specific policies. For example, it can avoid using a particular router or commanding a group of routers to select a specific route when different routes are available.

BGP is typically used as an advanced routing vector protocol. It stores dynamic route information beyond adjacent routers, including active routes that may be used in the future. Compatibility and scalability have led to the above protocol being considered.

However, because various factors must be considered when calculating optimal routes, the BGP protocol is regarded as a hybrid routing protocol that combines properties of distance-vector and link-state routing protocols.

What is an autonomous network system?

The Internet is a collection of networks, and Autonomous Systems are the extensive networks that make up the Internet. More precisely, autonomous systems, called AS for short, are an expansive network or group of networks with a single routing policy.
In general, any computer or device that connects to the Internet is considered an AS. The autonomous system can be compared to the city post office.

Letters are sent from one post office to another in the city to reach their destination. This way, packets are transferred from one AS to the next across the Internet to reach the AS with the destination IP address. In the meantime, routers are responsible for sending data packets to the IP address.

It should be noted that each AS is responsible for controlling a specific set of IP addresses. In the same way, each city’s post office is responsible for delivering letters to all the addresses in its town.

The range of IP addresses controlled by an AS is called the IP Address Space.

Typically, autonomous systems connect to other autonomous systems to form large networks.

If an autonomous system connects to only one independent system and shares the same routing policy, it is considered a sub-network and a subset of the first autonomous system.
Typically, each AS is operated by a large organization, such as an Internet Service Provider (ISP), a large technology company, a university, or a government agency. Typically, autonomous systems connect to other autonomous systems to form large networks.

If an autonomous system connects to only one independent system and shares the same routing policy, it is considered a sub-network and a subset of the first autonomous system.

Typically, each AS is operated by a large organization, such as an Internet Service Provider (ISP), a large technology company, a university, or a government agency. Typically, autonomous systems connect to other autonomous systems to form large networks.

If an autonomous system connects to only one independent system and shares the same routing policy, it is considered a sub-network and a subset of the first autonomous system.
Typically, each AS is operated by a large organization, such as an Internet Service Provider (ISP), a large technology company, a university, or a government agency.

What is BGP?

The Border Gateway Protocol (BGP) is an autonomous system routing protocol that interfaces with other protocols. The term “autonomous” here refers to a network or group of networks managed and controlled through a common management mechanism that shares standard routing policies. BGP is also used to exchange routing information and is a protocol used by Internet service providers.

Typically, consumer networks, such as universities and corporations, use the Internal Gateway Protocol (RIP), or OSPF, to exchange routing information within the web and send inbound traffic to the Internet service provider. This protocol interacts with the IGP protocol. Finally, the ISP uses BGP to exchange traffic and route packets correctly. One of the main features of BGP is its scalability.

This protocol does not have this limitation compared to other protocols, such as OSPF and EIGRP, which are available only on a limited number of routers in a domain and are used to connect large networks. BGP is divided into two types: internal (iBGP) and external (BGP).

If autonomous systems use BGP, it is called external BGP (eBGP). If a service provider uses BGP to exchange routes within an autonomous system, this internal BGP protocol is called iBGP.

BGP is a powerful and flexible routing protocol, making it one of the key Internet protocols. In addition, communication between routers on different networks is done through the BGP protocol and a Full Mesh. The loop prevention rule prevents a router from propagating routes received via iBGP within the same iBGP instance. 

There are over 90,000 registered BGP-related routes in Internet BGP routing tables. BGP uses many routing parameters, called attributes, to achieve scalability at this level, define routing, and create a stable routing environment.

In addition, BGP uses classless routing properties, abbreviated as CIDRs, to reduce the size of Internet routing tables. When a TCP connection is established between neighbors, BGP neighbors exchange complete routing information.

When changes to the routing table are detected, BGP routers only send routes to their neighbors that have changed. They do not send routing updates periodically; they send only routed changes.

When changes to the routing table are detected, BGP routers only send routes to their neighbors that have changed. When changes to the routing table are detected, BGP routers only send updates to their neighbors that have changed.

BGP index features

BGP paths have many similarities, making it the best choice when multiple routes are available. For this reason, network administrators must have a thorough understanding of BGP features to apply the most appropriate design pattern. The following features of this protocol should be mentioned:

  • Extensibility: IGP sub-protocols are designed for in-house applications and do not work well in large networks such as the Internet. There may be millions or even billions of routing paths, and these protocols may not manage all of them. BGP is a protocol designed to overcome this problem and perform the routing process associated with these routes. So when the number of ways increases, or when we perform routing in data centers, BGP is the best option. The BGP protocol is not limited to the Internet and is used in urban or long-distance projects such as connecting branches.
  • Independent, autonomous systems: BGP is flexible with IGP protocols. As mentioned, you can use IGP protocols (OSPF, EIGRP, and similar) at in-house centers, and BGP at an urban or national scale for routing.
  • Routing Based on Definitive Policies: Network administrators can use their routing policies instead of the default settings. This approach directly reduces costs, especially when choosing the shortest, cheapest route.
  • Weight: A unique feature of routers. This means that each router has its own eight. If the router has multiple routes to the same destination, it chooses the route with the highest weight. For example, in Figure 1, you can see the weight assigned to the two ways to the network 172.16.1.0 for routers B and C. When router A receives information from router B, the corresponding weight is 50.
    When router A receives information from router C, the related weight is 100. Both paths for the 172.16.1.0 network are recorded in the BGP routing table. Next, the course with the highest weight in the IP Routing table is selected.

When router A receives information from router C, the related weight is 100. Both paths for the 172.16.1.0 network are recorded in the BGP routing table. Next, the course with the highest weight in the IP Routing table is selected.figure 1

Local Preference: The Local Preference property is used to select the exit point for the Local Autonomous System (Local AS). Unlike the weight attribute, the Local Preference attribute is not unique to the local autonomy system and is available in a distributed form. If there are multiple exit points from the autonomous system, the Local Preference attribute specifies a specific route to select the exit point.

In Figure 2, the AS 100 receives two paths for the 172.16.1.0 network from the AS 200. When router A gets information for the 172.16.1.0 network, it sets the corresponding Local Preference to 50. When Router B receives the information for the 172.16.1.0 network, it sets the corresponding Local Preference to 100. This information is then shared via BGP between routers A and B.

In Figure 2, the AS 100 receives two paths for the 172.16.1.0 network from the AS 200. When router A gets information for the 172.16.1.0 network, it sets the corresponding Local Preference to 50. When Router B receives the information for the 172.16.1.0 network, it sets the corresponding Local Preference to 100. This information is then shared via BGP between routers A and B.

figure 2

Multi-Exit Discriminator: The Multi-Exit Discriminator (MED), as some sources use the term, selects the best path for an external autonomous system. In Figure 3, the multi-output identifier of router C indicates the route to 172.16.1.0 with metric 10, while router D suggests the route to 172.16.1.0 with metric 5. The lower the measured value, the higher the priority, so AS 100 uses AS 200 to reach router D for the network with the address 172.16.1.0. It should be noted that MEDs are distributed in a local autonomous system.

In Figure 3, the multi-output identifier of router C indicates the route to 172.16.1.0 with metric 10, while router D suggests the route to 172.16.1.0 with metric 5.

Figure 3

  • Origin attribute: This shows how BGP was notified of a particular route. Origin can have one of three values:
  • IGP: In fact, it shows the internal path to the autonomous system’s origin. This value is set when the network router configuration command explicitly enters the BGP course.
  • EGP: The path is found through the Exterior Gateway Protocol (EGP).
  • Incomplete: Indicates that the origin of the path is unknown or obtained through undefined methods. A vague source problem occurs when a route is redistributed in BGP.
  • AS_path attribute: When the routing table passes through an autonomous system, the AS number is added to a custom list of independent system numbers associated with the routing table. Figure 4 shows the state in which a path passes through three autonomous systems.

AS_path attribute: When the routing table passes through an autonomous system, the AS number is added to a custom list of independent system numbers associated with the routing table. Figure 4 shows the state in which a path passes through three autonomous systems.

Figure 4

AS 1 starts its path to 172.16.1.0 and specifies it along the AS 2 and AS 3 paths in AS_path. AS 3 responds using the AS_path {3,1 attribute, and AS 2 responds using the AS_path {2,1. Attribute. In this case, AS 1 will ignore the mentioned routes if it identifies its AS number in the route publication list.

BGP uses this mechanism to identify routing loops. AS 2 and AS 3 publish their routes to each other, with their AS numbers added to the AS route attribute. The IP Routing table does not enable these routes because AS 2 and AS 3 use their shorter AS-Path list to reach 172.16.1.0 via AS 1.

Next-Hop attribute: The Next-Hop point indicates the IP address used to reach the target router. This attribute is the same as the Peer’s connection IP address. In the context of the BGP protocol, the following address is passed to the local autonomous system. EBGP synchronization is a crucial feature of the BGP protocol on the Internet. eBGP manages the process of exchanging network prefixes between standalone systems.

In Figure 5, Router C announces the 172.16.1.0 network with a Next Hop of 10.1.1.1. When router A publishes this path in its autonomous system, it stores Next-Hop information. If router B does not have routing information about the Next Hop, this route will be skipped.

In Figure 5, Router C announces the 172.16.1.0 network with a Next Hop of 10.1.1.1. When router A publishes this path in its autonomous system, it stores Next-Hop information. If router B does not have routing information about the Next Hop, this route will be skipped.

Figure 5

Community attribute: The solution used to group destinations is called a community. Routing decisions (such as acceptance, preferences, and redistribution) are more accessible in this case. Route maps are used to set the Community attribute. This feature has several predefined settings as follows:

  1. No-export: This path should not be published with Peer GBP counterparts.
  2. No-advertise: This path should not be published to any peers.
  3. Internet: This path should be published for the Internet Community, as all ways belonging to external networks are eventually connected to the Internet. Figure 6 shows the BGP no-advertise Community feature.

Internet: This path should be published for the Internet Community, as all ways belonging to external networks are eventually connected to the Internet. Figure 6 shows the BGP no-advertise Community feature.

Figure 6

AS 1, with the Community No-Export attribute, publishes the address 172.16.1.0 for AS 2 (Figure 7). In Figure 8, like Figure 1, the Community No-Advertise attribute publishes the address 172.16.1.0 for AS 2. Figure 8 shows the Internet Community feature. Note that there are no restrictions on routes from AS 1 here.

AS 1, with the Community No-Export attribute, publishes the address 172.16.1.0 for AS 2 (Figure 7)

Figure 7

In Figure 8, like Figure 1, the Community No-Advertise attribute publishes the address 172.16.1.0 for AS 2. Figure 8 shows the Internet Community feature. Note that there are no restrictions on routes from AS 1 here.

Figure 8

FAQ

What is BGP?

BGP is a path-vector routing protocol that shares reachability and routing information among autonomous systems (AS) — large networks operated by ISPs or organizations.

How does BGP make routing decisions?

It chooses paths based on rules, policies, and attributes (like AS-path, next-hop, local preference), not just simple metrics; this allows for flexible, policy-driven routing.

What are the main types of BGP?

External BGP (eBGP) — between different autonomous systems. Internal BGP (iBGP) — within the same autonomous system.