What is BGP (Border Gateway Protocol)? Simple and Easy Guide Explained – 2024

What is BGP and How Does Border Gateway Protocol Work?

Border Gateway Protocol

The Border Gateway Protocol (BGP) is a path vector routing protocol specifically designed as an Exterior Gateway Protocol (EGP). BGP version 4 is currently deployed. This protocol builds routes between autonomous systems rather than within an autonomous system. It works on the internet where different AS are deployed. BGP maintains a separate routing table depending on the shortest AS path, as opposed to cost and distance. Further, BGP assigns an Autonomous System Number 16-bit long, ranging from 1 to 65535. BGP uses TCP port 179 for the reliable transfer of its packets.

How BGP works?

BGP is unnecessary for internal networks where fault tolerance or redundancy is required. Instead, OSPF and EIGRP are the best protocols to handle this traffic. Also, it is not for a single Autonomous System working on the internet; it is used when multiple interconnected autonomous systems are working together.

BGP is deployed under these circumstances:

• Several connections exist to external AS via different providers.

• Multiple connections exist to external AS via the same provider but with different routing policies.

BGP Peers

BGP routers are called Speakers that form neighbor relationships called peers. There are two types of BGP neighbor relationships:

• iBGP Peers – BGP neighbors within the same AS.

• eBGP Peers – BGP neighbors link separate autonomous systems.

In this figure, Router B and Router C form an iBGP peer relationship. Furthermore, Router A (AS 100) and Router B (AS 200) form an eBGP peer relationship. Once full convergence is achieved, BGP shares the full routing table, and only changes will be forwarded to peers. The administrative distance for routes within the AS is 200, and for those outside the AS, it is 20.

BGP Peer Messages

BGP forms neighbor relationships through a series of messages:

OPEN – Firstly, an OPEN message is sent between peers to start the session. The OPEN message includes the BGP version, Local AS Number, and BGP Router ID.

KEEPALIVE – Messages are sent periodically every 60 seconds. If the remote peer is not alive, it waits for the hold time period of 180 seconds before declaring the router as dead.

UPDATE – This indicates that routes are being exchanged between peers.

As the BGP session forms, it will pass through several states:

Idle – The initial BGP state.

Connect – Waiting for a TCP connection with the remote peer.

Active – Attempting to initiate a TCP connection with the remote peer.

OpenSent – BGP has now established the TCP connection and is waiting for a reply.

OpenConfirm – BGP listens for a reply Keepalive message.

Established – Now, the network is fully converged.

Configuring Basic BGP Neighbors

The first command to enable the BGP session is:

RouterB(config)# router bgp 100

To configure Router B to establish relationships with both iBGP and eBGP peers:

RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 10.1.1.1 remote-as 100
RouterB(config-router)# neighbor 172.16.1.2 remote-as 900

To specify the source interface for updates:

RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 update-source lo0

Router C must point to Router B, assuming the neighbor address is 1.1.1.1/24:

RouterB(config)# router bgp 900
RouterB(config-router)# neighbor 1.1.1.1 remote-as 100

What is BGP Route Reflectors?

It is necessary to fully mesh the iBGP peers to connect with other eBGP peers. Route reflectors eliminate this restriction. Route-reflector clients form neighbor relationships with the route reflector server. In this way, BGP updates flow from the server to the client directly without the clients communicating with each other.

What are BGP Peer Groups?

Peer groups are simply a way to configure a group of neighbors. This pattern reduces bandwidth usage and CPU load by sending updates to the group as opposed to individual neighbors.

What are the BGP Attributes?

BGP uses several attributes to determine the best path to reach a destination:

  • AS-Path: Lists all paths to reach a particular destination.
  • Next-Hop: Picks out the next hop to reach the destination.
  • Origin: Identifies the originator of the route.
  • Local Preference: Adds preference to find the best path.
  • Atomic Aggregate: Identifies routes to be summarized or aggregated.
  • Aggregator: Identifies the BGP routers that form address aggregation.
  • Community: Tags routes that share common characteristics into communities.
  • Multi-Exit Discriminator (MED): Adds preference to eBGP to specify inbound traffic.
  • Weight (Cisco Proprietary): Adds local weight to specify the route for outbound traffic.

OSPF (Open Shortest Path First) Routing Protocol | Best Explained with Design & Configurations Guide

BGP Summarization

Routes that are redistributed in BGP will be automatically summarized.

BGP Route Dampening

BGP Route Dampening is the process where routes are suppressed to avoid unnecessary updates. If any route flaps (goes up and down), it is assigned a penalty. The penalty starts at 0, and the default penalty is 100.

A Few Border Gateway Protocol Commands:

Router# show ip bgp
Router# clear ip bgp * (Resets the BGP session)
Router# clear ip bgp * soft (Forcefully resets the BGP session)
Router# show ip bgp summary (Views the BGP summary)

This Post Has One Comment

Leave a Reply