← Back to Part 1 Modules
PART 1 · BASIC BGP THEORY · MODULE F

Module F – BGP Finite State Machine

Lesson content presented from the approved Part 1 master documentation.

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.

StateMeaning / activity
IdleBGP process initialises resources and waits for a start event; no session is established.
ConnectBGP is waiting for the TCP connection to complete.
ActiveBGP is attempting to establish TCP connectivity or retrying after a failure.
OpenSentTCP is established and an OPEN message has been sent; the router awaits/validates the peer OPEN.
OpenConfirmOPEN exchange succeeded; the router waits for a KEEPALIVE or handles a NOTIFICATION.
EstablishedThe 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 stateInitial investigation
IdleCheck whether the neighbour is configured, administratively disabled, or affected by local BGP process/configuration conditions.
ConnectCheck peer IP reachability, TCP/179, ACLs/firewalls and TCP handshake.
ActiveInvestigate repeated TCP failures, wrong peer address, missing route, ACL, interface or source-address issues.
OpenSentCheck remote-AS, OPEN parameters, capabilities, BGP identifier and notification details.
OpenConfirmCheck KEEPALIVE exchange, negotiated hold time and whether a NOTIFICATION or timer expiry occurs.
EstablishedInvestigate route policy, address families, UPDATE exchange, prefix filtering, next-hop reachability and RIB installation.

Troubleshooting workflow

  • Check show ip bgp summary and record the exact state.
  • Verify peer address reachability and source interface/address.
  • Check TCP/179 connectivity and ACL/firewall policy.
  • Check local ASN and remote-as configuration.
  • Inspect neighbour detail and notification/error counters.
  • Capture TCP/BGP packets if required.
  • After correction, verify Established state and expected prefix exchange.
  • Verify routes in BGP table, RIB and forwarding plane separately.
  • 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

  • Block TCP/179 and observe Connect/Active behaviour.
  • Configure a wrong remote-AS and inspect OPEN validation failure/notification.
  • Shut down the peering interface and observe session teardown.
  • Restore connectivity and measure time to Established.
  • Allow session establishment but filter all prefixes; verify session state and route-table outcome separately.
  • Trigger controlled hold-timer expiry and inspect logs/packet capture.
  • 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.

    Source and assessment note

    Technical explanations, tables, examples, QA scenarios and assessments are presented from the approved Part 1 master documentation. Verify illustrative CLI syntax against the target router platform and software release before lab or production use.