BGP, or Border Gateway Protocol, is an important protocol in the networking world. It is responsible for exchanging routing information between autonomous systems on the Internet. As such, it is important for network engineers to understand the basics of BGP states and how they transition between each other in the BGP finite state machine (BGP FSM).
Let’s get started.
BGP States Explained
This section will give you details related to the BGP states, and then the following section will discuss how BGP transitions between them.
First, there are six main states of a BGP session: Idle, Connect, Active, OpenSent, OpenConfirm, and Established. It is important to understand how each of these states works and how they transition between each other to utilize BGP effectively.
Idle State:
- What is Idle State: This is the initial state of a BGP session and indicates the router is not attempting a TCP connection or accepting one.
- When a BGP enters Idle State: This is the initial state. The router enters Idle on startup, after a manual reset, or following certain errors.
- What happens in BGP Idle state: BGP waits for a Start event. On Start, it initializes resources, starts the ConnectRetry timer, initiates a TCP connection to the peer, and transitions to Connect. In Idle, the router does not maintain an active TCP attempt or accept incoming sessions.
Connect State:
- What is Connect State: Connect State indicates the router is waiting for the TCP connection to be completed. If successful, an OPEN message is sent.
- When a BGP enters Connect State: After the Idle state on a Start event.
- What happens in the BGP Connect state: Routers wait for a successful TCP connection. If this is achieved, an OPEN message is sent, and the router moves to OpenSent. If the connection fails, it goes to Active. If the ConnectRetry timer expires while in Connect, the router transitions to Active, restarts ConnectRetry, and attempts TCP again.
Active State:
The router is actively trying to establish a TCP session (or waiting for an incoming one) after a previous attempt did not complete in Connect. No parameter negotiation has occurred yet in this state.
- What is Active State: Indicates the router is initiating or awaiting TCP to the neighbor after a failed or timed-out attempt in Connect.
- When a BGP enters Active State: When BGP fails to establish a connection in the Connect state or when ConnectRetry expires.
- What happens in BGP Active state: The router tries a new TCP three-way handshake with its remote peer or accepts an inbound one. If successful, it enters OpenSent. If ConnectRetry expires, it returns to Connect and continues the process.
OpenSent State:
- What is OpenSent State: After the TCP session is set up, the router waits for an OPEN message to confirm all parameters. If there are no errors, a BGP KEEPALIVE message is sent.
- When a BGP enters OpenSent State: After BGP has successfully established a TCP connection with its peer in the Connect or Active state.
- What happens in BGP OpenSent state: BGP waits for an OPEN message from the remote neighbor. If something is wrong (incorrect version numbers, wrong AS number, capability mismatch, etc.), a NOTIFICATION is sent, and BGP goes to Idle. The AS number also determines EBGP vs IBGP. If parameters are acceptable, KEEPALIVE messages follow and the Hold Timer is negotiated. If the TCP session fails, BGP goes to Active.
OpenConfirm State:
- What is OpenConfirm State: Indicates the router is waiting for a KEEPALIVE or NOTIFICATION message. If a KEEPALIVE is received, the state changes to Established; otherwise, it may change to Idle.
- When a BGP enters OpenConfirm State: After receiving an OPEN message from its peer in response to an OPEN message sent in the OpenSent state.
- What happens in BGP OpenConfirm state: BGP awaits a KEEPALIVE message from the neighbor. Once it receives the KEEPALIVE, it moves to Established and completes neighbor adjacency, resetting the Hold Timer. If a NOTIFICATION is received, BGP returns to Idle. KEEPALIVE messages are exchanged by BGP.
Established State:
- What is an Established State: Indicates peering to a neighbor is established; routing information exchange begins.
- When a BGP enters Established State: After the OpenConfirm state.
- What happens in the BGP Established state: The BGP neighbor adjacency is complete, and the routers send UPDATE messages to share routes. The negotiated Hold Time is the lower of the two peers’ values (a value of 0 disables keepalives). Receipt of a KEEPALIVE or UPDATE resets the Hold Timer. If a NOTIFICATION is received, BGP returns to Idle.
Transitioning Between BGP States – BGP FSM or Finite State Machine Diagram

Overview of BGP States transition process
The transition process between BGP states is a complex one, but it is essential to understand in order to configure and troubleshoot BGP networks properly.
The process begins with the Idle state, which is the initial state of a BGP router. From there, a Start event triggers the move to the Connect state where the router initiates an outbound TCP connection. If no connection is established, it will enter the Active state and continue attempting TCP (and accept inbound attempts). Once an OPEN message has been sent and received, the router will enter OpenSent and OpenConfirm states before finally transitioning to Established. At this point, routing can begin, and updates can be exchanged between neighbors. This flow is commonly referred to as the BGP state machine or BGP FSM.
Potential issues during BGP States transitions and Troubleshooting tips for resolving issues
Potential reasons for issues during BGP state transitions can include misconfigurations, incorrect routing information, or a lack of connectivity between neighbors. To troubleshoot, it is important first to verify the configuration of both routers and ensure that they are properly configured for BGP. For example, you can check if the neighbor address and remote-as number are configured properly. If your session is stuck in Idle or Active, focus on reachability to the neighbor, TCP connectivity, and timers like ConnectRetry.
Additionally, it is important to check the underlying routing tables of both routers to make sure that they have the correct information. Remember, BGP is an application-layer routing protocol that runs over TCP port 179, and if a neighbor is not directly connected, it needs an underlying route to form a BGP neighborship.
It is also essential to check the physical connection between the two routers and ensure that there are no problems with the link. If any of these issues are present, they must be addressed before BGP can successfully transition between states. You should also monitor the network for any signs of packet loss or routing loops.
Finally, peers generally use BGP-4; ensure key capabilities are aligned (for example, Multiprotocol extensions, Route Refresh, Graceful Restart, and 4-byte ASN support) rather than focusing on a “version mismatch.” Aligning capabilities helps prevent OpenSent vs OpenConfirm failures.
Conclusion
In conclusion, the Border Gateway Protocol is a powerful routing protocol that allows network engineers to route traffic across multiple autonomous systems. However, a BGP session has several states you must understand to configure and troubleshoot BGP networks properly. The process begins with the Idle state and progresses through Connect, Active, OpenSent, OpenConfirm, and Established states before routing can begin. By understanding each of these states, the ConnectRetry and Hold Timer behaviors, and their respective functions within the context of a BGP network, you can ensure efficient routing of data across multiple networks.
- Telecom Network Infrastructure: Complete Guide to Components & Design - January 6, 2026
- TP-Link TL-SG108E vs Netgear GS308E: Budget Smart Switches - January 5, 2026
- MikroTik CRS305-1G-4S+ Review: The Ultimate Budget SFP+ Switch Guide - December 25, 2025




