BGP Neighbor States – IDLE – CONNECT – ACTIVE

In IDLE state BGP refuses all incoming connection. After that BGP initialize all BGP resources and initiate a TCP Connection to the neighbor, also listen on 179 port for incoming connection, initialize the CONNECT_RETRY timer and go to CONNECT state.

In CONNECT state, BGP process waits for the TCP connection to be completed. If TCP Connection is successful then it sends a OPEN message and go to OPEN SENT. If the CONNECT_RETRY times expires while in CONNECT state, it remains in connect state. If TCP Connection Ope Failed occur then it goes to ACTIVE state. For any other input error events it goes back to idle.

In ACTIVE state BGP tries to Initiate a TCP Connection to the Neighbor and also listen on Port 179 for incoming TCP request. If BGP fails to initiate a TCP connection to the neighbor(IE5 - TCP Connection Open Failed) or neighbor tries to open TCP connection using an invalid IP then BGP remains in ACTIVE state. In case the CONNECT_RETRY Timer expires while in ACTIVE state then BGP goes back to the connect state. For any other Input Error Events like BGP STOP(IE2), BGP Transport Connection Closed(IE4), BGP Transport Fatal Error(IE6) then BGP goes back to IDLE state.

From this explanation we might understand that a BGP process remains in ACTIVE state is due to TRANSPORT ERROR means the BGP process is unable to initiate a TCP Connection to the Neighbor. Refer the below flow chart where it explains the FSM transitions of three states IDLE, CONNECT and ACTIVE. In real-time BGP never remain in an particular state other than ESTABLISHED. Actually it flaps between IDLE, CONNECT and ACTIVE.

BGP Stuck in IDLE

Input Events 1 & 13 causes the IDLE state remain in IDLE state. IE1 is BGP START event and IE13 is BGP Notification Received. Also IE 2, 4, 6, 8, 9, 13 causes other BGP states to transit back to IDLE. So the possible reason for a BGP router remain in IDLE is mentioned below.

  • Neighbor Route is not present in Routing Table.
  • TCP 179 is not open.
  • BGP Configuration Error like wrong AS in running-config causes the BGP to set a NOTIFICATION which lead to the FSM fail back to IDLE.


Input Event 5 cause the ACTIVE state to remain in ACTIVE state. Which is BGP TCP Open Failed. In a situation where neighbor tries to open a TCP connection using invalid or wrong IP address causes BGP to stuck in ACTIVE. The possible reasons are mentioned below.

  • Peer address configured incorrectly on either router.
  • AS number configured incorrectly on either router.
  • Update Source configured incorrectly.
  • Both the peers are in passive Transport mode or both are in active Transport mode.
  • Link flapping, reverse route not present, network congestion.
Wireshark Capture test.xml open in new tab  


For the simulation of the topology we have misconfigured one router.


Leave a Reply