What is Border Gateway Protocol (BGP)
The Border Gateway Protocol (BGP) is the routing protocol for the Internet. BGP looks at all of the available paths and picks the most efficient routes for delivering Internet traffic (like the postal service of the Internet). It is the language spoken by routers.
BGP is the protocol that makes the Internet work by enabling data routing.
Border Gateway Protocol (BGP) works using a mechanism called peering. Administrators assign certain routers as BGP peer or BGP speaker routers. You can think of peers as devices on the edge or boundary of an autonomous system.
What is an Autonomous System
An Autonomous System (AS) is a smaller network under the control of a single administrative entity. You can uniquely identify such networks by their autonomous system number assigned by the Internet Assigned Numbers Authority (IANA). Data travels between autonomous systems as it moves from source to destination.
Every AS must be kept up to date with information regarding new routes as well as obsolete routes. This is done through peering sessions where each AS connects to neighboring ASes with a TCP/IP connection for the purpose of sharing routing information. Using this information, each AS is equipped to properly route outbound data transmissions coming from within.
iBGP vs eBGP
- iBGP: internal BGP. For traffic within an AS.
- eBGP: external BGP. For traffic between AS (i.e. over the Internet).
The main difference between internal and external BGP peering is the way the BGP route received from one peer is propagated by default to other peers.
- New routes learned from an external BGP peer are re-advertised to all peers
- New routes learned from an internal BGP peer are re-advertised to all external peers only
Additionally, organizations must use external BGP to connect their corporate network to the internet.
In contrast, there is no obligation to use internal BGP. You can choose from several internal routing protocols based on your organization's networking requirements.
BGP vs IGP
- Interior Gateway Protocols (IGP):
- used for Transport, Underlay purposes.
- used usually just for IPv4 and IPv6 Unicast purposes.
- Border Gateway Protocols (BGP):
- used for Service Layer, the Overlay mechanism.
- used for IPv4 unicast, IPv4 multicast, IPv4 unicast, IPv6 multicast, EVPN, L2VPN, Security, Quality of Service, Multicast, and many other purposes.