BGP Message Types
Border Gateway Protocol (BGP) is a critical component of the Internet, responsible for exchanging routing and reachability information among autonomous systems (ASes). To accomplish this, BGP uses a variety of message types to establish and maintain neighbor relationships, exchange routing information, and handle errors and other events.
I would also advise reading the BGP states article side to side to understand the BGP process completely.
In this blog post, we’ll take a detailed look at the different types of BGP messages and how they are used.
- BGP Open Message
- BGP Keepalive Message
- BGP Update Message
- BGP Notification Message
1. BGP Open message
The BGP Open message is used to establish a BGP neighbor relationship between two routers. A BGP router sends it to initiate the establishment of a BGP connection with a neighbor router. The BGP Open message contains information about the BGP version being used, the autonomous system number (ASN) of the sending router, the hold time (the maximum amount of time that can pass without receiving a BGP update message), and other optional parameters.
The BGP Open Message carries the following fields:
- BGP version number – It should match between neighbors.
- Local AS number – It should match between neighbors.
- Holdtime – BGP-speaking routers agree on the lowest value between neighbors.
- BGP RID (Router-Identifier).
- Optional parameters.
2. BGP Keepalive message
Once a BGP connection has been established, the two routers will begin exchanging BGP Keepalive messages to maintain the connection. These messages are sent at regular intervals (usually every 60 seconds) to ensure that the connection is still active. If a router does not receive a Keepalive message within the hold time, it will assume that the connection has been lost and will attempt to re-establish the connection.
BGP Holdtime interval is the time it takes for one BGP-speaking router to tell another that it’s still there to make sure the connection is still active (the default is 180 seconds).
When two BGP-speaking routers are connected, they will send each other a message to see who has the lowest hold time value and then use that value to calculate when to send keepalive messages.
3. BGP Update message
The BGP Update message is used to exchange routing information between BGP routers. It contains information about the reachability of various network prefixes, including the next hop router and any attributes associated with the route. BGP Update messages can be sent to add new routes to the routing table, withdraw routes that are no longer valid or modify existing routes.
BGP does not send periodic updates; instead, it uses triggered updates when available. For internal peers, these updates are sent every 5 seconds, and for external peers, every 30 seconds.
4. BGP Notification message
If there is an error or problem with the BGP connection, the routers can send BGP Notification messages to inform the other router of the issue. This can cause the BGP connection to be terminated. BGP Notification messages contain information about the type of error that occurred and can be used to troubleshoot BGP issues.
In summary, BGP uses a variety of message types to establish and maintain neighbor relationships, exchange routing information, and handle errors and other events. Understanding these message types is critical for network engineers who want to learn about BGP and become proficient in configuring and troubleshooting BGP networks.