BGP States | Finite State Machine | BGP Part-2

Summary Insights:
- BGP States also called BGP finite state machine (FSM).
- The term “Peer” is used for the neighbor relation between two BGP routers same like neighbor is used in other IGP protocol. BGP is not using broadcast or multicast but using unicast mode to configure peer with other BGP device.
- The key point in BGP is that the peer will established with directly & indirectly connected devices, in IGP for neighbor directly connection is necessary for neighboring.
- BGP will passes through different BGP states to establish BGP peer & share routes with each other.
Interview Questions & Answer:
- How many states in BGP?
- What will be the reason if BGP is stuck in idle state?
- Which message is sending in open sent state?
- Open message contain which parameters?
- BGP is working in broadcast/multicast/unicast ?
- How many version of BGP?
- Why BGP in connect & active state?
- BGP is working which protocol in tranpost layer?
- What in BGP update message ?
- BGP attributes are sending in which message type?
- Keepalive message is send in which state of BGP?
- BGP Port number?
- If two device indirectly connect how to configure BGP?
Today I will explain about BGP states & the reason when stuck in any BGP states.
BGP States:

Below are the six BGP States:
- Idle
- Connect
- Active
- Open sent
- Open confirm
- Established
Keep in mind that BGP is TCP base protocol on transport layer. After TCP process completed then will start BGP negotitaiton. That’s why the first three states consist of TCP processes & last three are BGP.
BGP State Transition Flow chart:

Idle State :
This is first state of BGP in this if no neighbor is configured or tries to initiate TCP session b/w to BGP nodes.
Reason to stay in Idle state:
Connect State:
When neighbor IP address is reachable then next Initiate TCP connection process.
Reason to stay in Connect state:
Active State:
Start another TCP three way handshake after TCP is failed in Connect state.
Reason to stay in Active state:
Open Sent State:
After TCP session is up in connect or active state the BGP state will change to open sent. In this open message with all parameters will send as we discussed in part-1 BGP message types.
Reason to stay in Open sent state:
Open Confirm State:
After verification of all parameters i-e version , AS number etc and Open message received from peer side, the state will shift to Open confirm state.
Reason to stay in Open confirm state:
Established State:
Keepalive message is exchanged & state changed to established.in this state update & keepalive message advertising b/w peer to built routing.
Reason to stay in Established state:
BGP States & troubleshooting steps:
Understanding of BGP states & message type is very important for Network engineer to troubleshoot BGP. During project implementation some time BGP is stuck in different state & routing table is not sharing.
Below points need to check:
BGP States learning is very important during troubleshooting of big Network Design.
To learn BGP in more details you can check BGP Packet types to learn about all five BGP message types, Without BGP attributes BGP understanding is incomplete , there are multiple attributes in BGP to manipulate traffic as per Network requirments.
