What is Border Gateway Protocol(BGP) in Computer Network?

BGP stands for Border Gateway Protocol. It is a standardized gateway protocol that exchanges routing information across autonomous systems (AS). When one network router is linked to other networks, it cannot decide which network is the best network to share its data to by itself.

Border Gateway Protocol considers all peering partners that a router has and sends traffic to the router closest to the data’s destination. This communication is possible because, at boot, BGP allows peers to communicate their routing information and then stores that information in a Routing Information Base (RIB).

The main goal of BGP is to find any path to the destination that is loop-free. This is different from intradomain routing protocols’ common goals: finding an optimal route to the destination based on a specific link metric.

The routers that connect other ASs are called border gateways. The task of the border gateways is to forward packets between ASs. Each AS has at least one BGP speaker. BGP speakers exchange reachability information among ASs.

Path-Vector Routing

RIP (Routing Information Protocol) and OSPF (Open Shortest Path First) are not applicable for interdomain routing protocols. Distance vector routing can send data to each of a router’s neighbours, and then every router develops up a routing database. Routing is not familiar with the identity of routers in any specific direction.

Every router sends its connection cost to all various routers and then starts routing computations. Two problems can emerge in link-state routing. First, different independent systems can use multiple costs and have multiple drawbacks.

The link-state protocol enables a router to create the topology, and its metrics can be different for each independent system. In this method, it is impossible to generate a reliable routing algorithm. Second, when flood routing appears, the use of an interdomain routing protocol across the independent system can be ambiguous.


The types of BGP are as follows −

Internal BGP

Routes are exchanged, and traffic is transmitted over the Internet using external BGP or eBGP. Autonomous systems can also use an internal BGP version to route through their internal networks, known as internal BGP.

It should be noted that using internal BGP is NOT a requirement for using external BGP. Autonomous systems can choose from several internal protocols to connect the routers on their internal network.

External BGP

External BGP is like international shipping; some specific standards and guidelines need to be followed when shipping a piece of mail internationally. Once that piece of mail reaches its destination country, it has to go through its local mail service to reach its final destination.

Each country has its internal mail service that doesn’t necessarily follow the same guidelines as other countries. Similarly, each autonomous system can have its internal routing protocol for routing data within its network.