Until now, we have learned about many different types of network protocols such as OSPF, RIP, EIGRP, etc. All of these were Interior Gateway protocols. In this blog, we are going to learn about the Border Gateway Protocol (BGP).
Note: If you haven’t read the previous blog of our CCNA 200-301 series, I highly recommend you do so.
The Border Gateway Protocol (BGP) is an Exterior Gateway Protocol! To be precise, it is a Path-Vector Routing protocol. However, you must know that it is a dynamic routing protocol. Since it is a routing protocol, it is used to control how data flows from point A through points B and C and arrives at the destination point D.
As you are aware that the Internet is nothing but a bunch of networks together, BGP is the routing protocol that tells networks about another networks and where they reside.
BGP is referred to as an exterior gateway protocol because it is used to exchange routing information between two or more than two autonomous system numbers. To configure BGP, it is very important to have Autonomous Systems (ASs). We will learn about them in detail in this blog. We will also learn how BGP works in this blog.
Without any further ado, let us begin learning about Border Gateway Protocol (BGP)!
What is Meant By BGP in Networking?
- BGP is an exterior gateway routing protocol that uses path vector routing.
- It is a dynamic routing protocol.
- Its main function is to enable inter-AS routing. AS here stands for Autonomous Systems.
- BGP consists of a few elements, the most important being the Autonomous System Number (ASN).
- ASN is a unique number given to every single Internet Service Provider (ISP) so that they can be identified.
- The standard ASN is 50300.
- Therefore, when BGP pairings are established which is talking to other Internet Providers in order to exchange traffic, it is that number that identifies us around the world.
- Therefore, a BGP peering session is established.
- This session is established on a certain IP address.
- Currently, we use the BGP version 4.
- The whole purpose of BGP is not just to help networks talk to each other but is also, to better connectivity.
- There are two types of Autonomous Systems:
- Public AS
- Private AS
- There are two types of BGP sessions:
- eBGP (Exterior BGP)
- iBGP (Interior BGP)
Let us look into these types of BGP sessions!
- An iBGP works within an Autonomous System.
- The administrative distance (AD) in iBGP is 200.
- An eBGP works between different Autonomous Systems.
- The Administrative Distance (AD) of BGP in this case is 20.
What are the Different Types of Autonomous Systems?
Since the BGP helps in routing between different autonomous systems, it is important to learn about different types of autonomous systems:
1. Stub AS:
- There is only one connection to another AS in the Stub AS.
- Data traffic cannot pass through a stub autonomous system.
- The traffic can move within an autonomous system.
- A stub is either a source or a sink.
2. Multi-Homed AS:
- It has more than one connection to other Autonomous Systems.
- Still, it is still one source or sink for data traffic.
- There is no transient traffic.
3. Transit AS:
- It is a multi-homed autonomous system that allows transit traffic.
- For example, ISP (Internet Backbone) is a transit AS.
How Does the BGP Work?
Now that you know about autonomous systems, let us learn how BGP selects the best path! The concept behind BGP is the best path selection. You can imagine the similarity of BGP to Google Maps. You put in the destination and it knows your current location, then, it tells you the best path. The BGP works in the same way but for the Internet.
- When a network router wants to connect to a network, it has to send data via the best path.
- This is when the BGP considers all the different peering options the router has and it chooses the shortest path to the router.
- The routing information is then communicated by each of the potential peers.
- This information is stored within a Routing Information Base (RIB).
- BGCP then receives this information, accesses it and chooses the best path.
What are the Different Types of Packets in BGP?
There are four different types of packets that are sent by the BGP:
- Keep Alive
- When one router wants to connect to another router and wants to create a neighborhood relation, it uses the open message.
- It is used in two situations:
- It is used to withdraw a destination that has been previously advertised.
- It is also used to announce a route to a new destination.
3. Keep Alive:
- Such a message is exchanged regularly.
- It is used to tell other routers if they are alive or not.
- For example, ‘Hello’ packets.
- It is sent by a router when there is an error condition.
- It is also sent by the router when it wants to close a connection.
This marks the end of our BGP in networking blog. It is the only protocol that is an exterior gateway protocol. It is a kind of protocol that uses Autonomous Systems to build connections and send traffic.
In this blog, we have learned how the BGP works and what are the different autonomous states in a BGP connection. At last, we have also learned about the different types of packets sent by routers in a BGP connection.
This marks the end of our routing protocols. You can learn other routing protocols such as OSPF, EIGRP, RIP, etc. in the full CCNA course series.
Stay tuned for more blogs in our CCNA series.