Module F – BGP Finite State Machine
The BGP Finite State Machine (FSM) describes the progression of a BGP peer relationship from initialisation to an Established session. The six states are Idle, Connect, Active, OpenSent, OpenConfirm and Established.
| State | Meaning / activity |
|---|---|
| Idle | BGP process initialises resources and waits for a start event; no session is established. |
| Connect | BGP is waiting for the TCP connection to complete. |
| Active | BGP is attempting to establish TCP connectivity or retrying after a failure. |
| OpenSent | TCP is established and an OPEN message has been sent; the router awaits/validates the peer OPEN. |
| OpenConfirm | OPEN exchange succeeded; the router waits for a KEEPALIVE or handles a NOTIFICATION. |
| Established | The BGP session is operational and UPDATE messages can be exchanged. |
Simplified state progression
Idle -> Connect -> OpenSent -> OpenConfirm -> Established
| failure
v
Active -- retry --> Connect
The simplified diagram omits event-specific transitions and implementation details. A TCP success leads toward OpenSent; a valid OPEN leads to OpenConfirm; a valid KEEPALIVE leads to Established.
Connect vs Active
| Interview-critical distinction Connect means the router is waiting for TCP connection completion. Active means BGP is trying to establish or re-establish the TCP connection. Active does not mean the BGP session is Established. |
|---|
State-based troubleshooting
| Observed state | Initial investigation |
|---|---|
| Idle | Check whether the neighbour is configured, administratively disabled, or affected by local BGP process/configuration conditions. |
| Connect | Check peer IP reachability, TCP/179, ACLs/firewalls and TCP handshake. |
| Active | Investigate repeated TCP failures, wrong peer address, missing route, ACL, interface or source-address issues. |
| OpenSent | Check remote-AS, OPEN parameters, capabilities, BGP identifier and notification details. |
| OpenConfirm | Check KEEPALIVE exchange, negotiated hold time and whether a NOTIFICATION or timer expiry occurs. |
| Established | Investigate route policy, address families, UPDATE exchange, prefix filtering, next-hop reachability and RIB installation. |
Troubleshooting workflow
Useful commands
show ip bgp summary
show ip bgp neighbors
show tcp brief
show ip route <peer-address>
ping <peer-address>
show logging
QA test ideas
Student Knowledge Assessment – Module F
Q1. How many BGP FSM states are defined?
A. 4
B. 5
C. 6
D. 7
Correct answer: C. 6 Explanation: The six states are Idle, Connect, Active, OpenSent, OpenConfirm and Established.
Q2. Which state indicates that the BGP router is waiting for TCP connection completion?
A. Idle
B. Connect
C. OpenSent
D. Established
Correct answer: B. Connect Explanation: Connect is the TCP connection-waiting state.
Q3. What does Active mean in the BGP FSM?
A. The session is fully operational
B. The router is attempting/retrying TCP establishment
C. The route is best
D. The peer is administratively up
Correct answer: B. The router is attempting/retrying TCP establishment Explanation: Active represents TCP connection attempts/retries, not an Established session.
Q4. In which state has TCP connected and the local OPEN been sent?
A. Connect
B. OpenSent
C. OpenConfirm
D. Idle
Correct answer: B. OpenSent Explanation: OpenSent follows TCP establishment and OPEN transmission.
Q5. What normally follows successful OPEN validation?
A. Idle
B. Connect
C. OpenConfirm
D. Active
Correct answer: C. OpenConfirm Explanation: A valid OPEN moves the FSM to OpenConfirm.
Q6. Which message normally moves a peer from OpenConfirm to Established?
A. UPDATE
B. KEEPALIVE
C. TCP FIN
D. ARP
Correct answer: B. KEEPALIVE Explanation: A valid KEEPALIVE completes the transition to Established.
Q7. What is the first transport check for a peer stuck in Connect/Active?
A. TCP/179 reachability
B. DNS MX record
C. NTP stratum
D. VLAN name
Correct answer: A. TCP/179 reachability Explanation: Check TCP port 179 and the underlying IP reachability.
Q8. Which issue commonly causes an OPEN validation failure?
A. Wrong remote-AS
B. High interface bandwidth
C. A valid route-map description
D. Correct peer IP
Correct answer: A. Wrong remote-AS Explanation: A remote-AS mismatch can cause the OPEN to be rejected.
Q9. What does Established prove?
A. All expected prefixes are installed
B. The BGP session is up
C. All traffic is forwarding
D. The peer has no filters
Correct answer: B. The BGP session is up Explanation: Established confirms the BGP session, not successful route installation or forwarding.
Q10. Which command quickly displays neighbour FSM states?
A. show ip bgp summary
B. show ip interface brief
C. show mac address-table
D. show version
Correct answer: A. show ip bgp summary
Explanation: show ip bgp summary displays peer states.
Q11. What should be checked if a session is Established but no expected prefixes appear?
A. Only the TCP handshake
B. Address family, advertisements, route policies and filters
C. Only the hostname
D. Only console logging
Correct answer: B. Address family, advertisements, route policies and filters Explanation: An Established session can exchange no usable routes because of AFI/SAFI, policy or advertisement issues.
Q12. What should be verified after repairing a BGP session?
A. Only that configuration was accepted
B. Established state, prefix exchange, RIB and forwarding
C. Only router uptime
D. Only interface description
Correct answer: B. Established state, prefix exchange, RIB and forwarding Explanation: End-to-end validation includes session, routes, RIB and forwarding.