What is the Border Gateway Protocol(BGP)?
BGP
Border Gateway Protocol or BGP is an exterior gateway routing protocol or EGP. Exterior Gateway Routing Protocols are routing protocols used to route between autonomous systems. An autonomous system is just a way of saying a set of routers under a single administration. So, BGP is used to route between different autonomous systems, like between service providers as an example. BGP also can be used within an AS, which is referred to as iBGP and has different behavior than eBGP, which is used to route between different AS's. The image below, from vmware docs, shows what we are talking about with eBGP. The clouds represent a single autonomous system and the links between clouds are eBGP links allowing the exchange of routing information between AS's.
Autonomous system numbers are how we represent each administrative domain. These numbers were 16-bit decimal numbers ranging from 0 - 65535 until RFC 4893, BGP Support for Four-Octet AS Number Space came out extending it to 32-bit numbers to allow for more AS's. These numbers are handed out by the Internet Assigned Numbers Authority (IANA).
BGP works differently than the traditional IGP. BGP is a path vector routing protocol and uses TCP port 179 to establish a session before forming a neighbor. The term path vector means that BGP keeps track of the path(AS's) that a network prefix has traversed. BGP keeps track of this information in the AS_PATH attribute. Routers that are running a BGP process are known as BGP speakers and when two routers form a TCP session with the intent to exchange routing information they are known as neighbors or peers.
BGP uses four different message types to communicate with its peers.
- Open
- Keepalive
- Update
- Notification
Originators BGP version
- Local AS number
- Hold Time
- BGP Identifier
- Optional Parameters
The Update message type is used to actually send routing information. The routing information that is sent with BGP is known as Network Layer Reachability Information(NLRI). These messages contain prefixes that BGP wishes to advertise along with path attributes. An update message can be for either new prefixes or for routing information that BGP no longer needs to know about(withdrawn routes).
The Notification message type is used when errors are detected. This is a way of ending a BGP session(gracefully close) whenever there are errors, configuration incompatibilities, etc.
BGP uses these four message types to effectively establish and maintain sessions, exchange information, and tear down sessions. Along with these four message types BGP also has six states that neighbors or peers go through.
- Idle
- Connect
- Active
- OpenSent
- OpenConfirmed
- Established
There is a lot more to say about BGP but I will save that to discuss in another post. BGP is used as the routing protocol of the internet and it is essential for us to be able to communicate over the internet. I will write about how BGP chooses the best path with path attributes in another blog. If you are more interested in BGP I recommend reading the Cisco books : TCP/IP Volume II and Internet Routing Architecture. Until next time.
Very well said Sir. Keep at it
ReplyDelete