What Is Border Gateway Protocol?
BGP is a complex, advanced distance routing protocol. It can best be described as Exterior Gateway Protocol (EGP). It’s been referred to in many quarters as the ‘big dog’ protocol of the internet.
BGP exchanges routing information between Autonomous Systems (ASs).
Unlike Interior routing protocols such as RIP, EIGRP, and OSPF that run inside a company’s network, BGP uses the Best Path Selection Algorithm (BPSA) to choose and install the best routes into the router’s routing table. This is a different basic algorithm for building a loop-free topology than any of the above-mentioned protocols.
BGP is especially used for exchanging routing information between all of the major Internet Service Providers (ISPs), as well as between larger client sites and their respective ISPs. And, in some large enterprise networks, BGP is used to interconnect different geographical or administrative regions.
BGP is Primarily used to support the complexity of the public Internet, Cisco has added several clever and useful features to its BGP implementation (BGP 4).
Some of the primary attributes of BGP are the use of pieces of information about a known route, where it came from, and how to reach it, A BGP router will also generate an error message if it receives a missing route, these are mandatory attributes.
Types of BGP
There are different terms used when describing BGP. these including:
1. Internal BGP (iBGP) operates inside an Autonomous System (AS)
2. External BGP (eBGP), which is also known as an inter-domain routing protocol, operates outside an AS and connects one AS to another. These terms are just used to describe the same protocol the area of operation is what differs.
3. MP-BGP: An updated BGPv4 for IPv6 routing
Autonomous Systems (AS)
An autonomous system can be a company, ISP, or an entire corporate network comprised of multiple locations connecting to the network.
Each Autonomous System (AS) uses BGP to advertise routes in its network that need to be visible outside of the network; it also uses BGP to learn about the reachability and routes by listening to advertisement announcements from other autonomous systems.
Each of these enterprise networks, commercial enterprises, or ISPs must be identified by an autonomous system number (ASN). This number allows a hierarchy to be maintained when sharing route information.
There are 65,535 (from 0 to 65,535) available autonomous system numbers that can be assigned. BGP assigns 64,512 – 65,534 ASNs to be private. Being private means this ASN connects to only one other ASN (sometimes multiple ASNs) and these ASNs can’t cause a loop by themselves
BGP Update Messages
BGP has the biggest amount of additional information passed between protocol-running devices more than IGPs. This is because of the amount of routing information that must be passed.
Normally, IGPs most times use a prefix, metric, tagging, or the shortest path algorithm such as that found in the Open Shortest Path First (OSPF) protocol. The updates used by an IGP are small compared to the routing updates for BGP, which have the possibility of carrying many path attributes.
Routing Information Protocol (RIP) is a simple IGP. It carries only minimal attributes, such as metric information and the next hop.
OSPF is a much more complex routing protocol that has path attributes such as intra-area, inter-area, and external status.
BGP possesses the ability to attach many attributes to a given route. The minimum set of path attributes that can be included in an update message is the source of the update, called the ORIGIN attribute, and the hop information called the AS_PATH attribute.
When two routers running BGP begin to communicate with each other in the process of exchanging dynamic routing information, they use a TCP port at Layer 4 of the OSI Reference Model. Precisely, TCP port 179 is used.
TCP port is specifically used by BGP so that it does not have to provide a component that controls the orderly delivery of messages, recognizes when data packets have been lost, detects duplicates, and controls buffering for both ends of the reliable session
The two routers at this point are called endpoints, BGP peers or neighbors, and their communications, which are reliable connection-oriented connections, can be referred to as sessions.
When one of the BGP peers or neighboring router advertises its prefixes or routes, this router is known as a BGP speaker. The routes that it advertises are considered valid by the other endpoints until a specific message is sent that the route is no longer valid or that the TCP session is lost.
Before a session between two or more BGP routers has been initiated, the endpoints are considered to be in the Idle state.
As soon as one endpoint tries to open a TCP session, the endpoint is considered to be in the Connection state. Should there be a problem in establishing a connection between two endpoints, the router trying to initiate the session will change to the Active state, where it will periodically try to establish a TCP session.
When the TCP connection has been established, the endpoints can be assured that as long as the session is active, there is a reliable connection established a path between the endpoints. Messages between the endpoints can be sent reliably.
This connection allows BGP messages to be very simple and include only the information necessary with little overhead.
Types of BGP Messages:
+ Open: This is to establish a peering/ neighbor’s or endpoint router sessions
+ Keep-Alive: message type in a common header to allow routers to verify when sessions are active.
+ Notification: shuts down a peering session
+ Update: Announcing new routes or withdrawing previously announced routes
BGP must rely on the connection-established TCP session to provide the Connection state because BGP doesn’t use a keepalive signal but sends a message with a KEEPALIVE type in a common header to allow routers to verify when sessions are active.
Unlike the Standard keepalives signals sent from one router to another on a circuit not using a TCP session. BGP routers use these signals on circuits to verify connectivity on the circuit.
Once the TCP connection has been established, BGP sends and receives messages in a specific format. The first message is an identification message from the endpoints, peers, or BGP neighbors.
When a BGP router sends a message, the router changes to OpenSent state.
When the router receives a reply to the identification message, it changes to the OpenConfirm state.
If a connection is received and accepted by the endpoints, the Connection state becomes the Established state.
From then on, when a message is sent to the endpoint routers, the routers can respond to the sent message, update their routing table with new information in the message, or have no reaction to the sent message whatsoever.
Endpoints typically stay established until there is a loss of the session or an error. If this occurs, then the connection returns to the Idle state, and all the information that the BGP endpoints have learned from their neighboring endpoint will be purged from the BGP routing table.
Characteristics of BGP-4
The key features of BGP-4 include and are not limited to these:
• It is an advanced distance-vector protocol.
• BGP sends full routing updates at the start of the session, and trigger updates are sent afterward.
• BGP maintains a connection by sending periodic keepalives.
• It creates and maintains connections between peers, using TCP port 179.
• BGP sends a triggered update when a keepalive, an update, or a notification is not received
• It has its routing table, although it is capable of both sharing and inquiring about the interior IP routing table.
• BGP uses a very complex metric and is the source of its strength. The metric, referred to as attributes, allows great flexibility in path selection.
How to Configure BGP Using Loopback Address
How To Authenticate MD5 for BGP Peers How To Configure eBGP Multihop
External Border Gateway Protocol (eBGP) Internal Border Gateway Protocol (iBGP)