What is BGP
BGP is EGP (Exterior Gateway Protocol). A routing protocol that allows routing information to be exchanged between different autonomous systems (AS). BGP leaves the routing within the AS to the IGP.
BGP started its history with BGPv1, which only supported classful routing. Currently, BGPv4, which is mainly used, supports route summarization and VLSM and is widely used.
Reliable TCP is used for BGP communication and session establishment.
Let's take a look at some of the features of BGP.
- CIDR (classless routing)
- VLSM support
- Unlimited number of pops
- Differential update
- Manual aggregation
- Route control by path attribute
- Neighbor Discovery and Adjacency Maintenance
BGP is only a protocol for routing between ASes, and has complicated movements. Use path attributes for routing. As such, it is a difficult protocol to master.
RIP, IGRP, EIGRP, and OSPF are IGPs (Interior Gateway Protocols), which are routing protocols for routing within an AS, and cannot perform routing between ASs. However, BGP allows routing between different ASes.
Now let's talk about AS. An AS is a collection of networks under the same management, and one AS may consist of multiple IGPs and one EGP.
BGP performs routing in two forms: internal BGP (iBGP) for intra-AS routing and external BGP (eBGP) for inter-AS routing.
Inside the AS, iBGP operates and peers with BGP speakers within the same AS, and between external ASes, eBGP establishes peers with the BGP speakers of each AS.
Here, the BGP term "BGP speaker" came up, so I'll explain it in Capturing. A BGP speaker is a term that refers to a router running BGP.
BGP is a complex routing protocol that routes based on policy. BGP has various path attributes, such as local preference, to determine routes under complex conditions.
In addition, the route information received by BGP is enormous, so it puts a heavy load on the router. In order to reduce the load on the router, it is necessary to reduce the load on the BGP router by performing route summarization or using a route reflector.
BGP (Neighborhood Formation)
BGP first forms a proximity relationship (peer relationship) and then communicates. To form peer relationships with neighboring BGP speakers, BGP speakers session with each other using TCP port number 179.
*A router running BGP is called a BGP speaker.
BGP speakers go through the following six states to peer in order to form a neighbor relationship. The figure below shows a simple state transition.
Once in the Established state, negotiations with all BGP speakers are completed and routing information is exchanged.
Now let me briefly explain each state.
● 6 states of negotiation
|Idle state||State at the start of a BGP session.|
|Connection state||Waiting state for TCP connection.|
|Active state||A state in which a session is about to be started with a peering BGP speaker.|
|Open sent state||Waiting for an OPEN message from the remote BGP speaker.|
|OpenConfirm state||Waiting for a KEEPALIVE message from a remote BGP speaker.|
|Established state||Completed negotiation with all BGP speakers.|
BGP speakers send and receive UPDATE messages and KEEPALIVE messages to check the existence of neighboring routers. A neighboring router is considered dead if it does not receive a message within the defined hold time.
The hold time is reset to 0 when an UPDATE or KEEPALIVE message is received.
● Messages exchanged by BGP
The messages exchanged with BGP include:
|OPEN message||A message sent when a TCP session is formed. In OpenSent state, it waits to receive an OPEN message.|
|KEEPALIVE message||A message to confirm the existence of a connection between peers|
|UPDATE message||Update information containing BGP routing information|
|NOTIFICATION message||A message announcing the error.|
By the way, you can also set the hold time to 0. If set to 0, KEEPALIVE messages will not be sent and the connection will always be established.
To communicate with BGP, peer formation is required. You will specify with commands which router to establish a peer relationship with.