BGP Neighbor States

 

BGP is designed for handle large amount of routing information and Complex Networks, BGP enable routers create TCP connection with neighbor that is called BGP Peers.
BGP neighbors are manually configured, when we configure BGP neighbor, it goes through different stages before it reaches the desired state (Established State).
 
BGP Session goes through following stages:
1)    Idle state: In this state, BGP enable router detects start event (start event occur when we configure new neighbor or reset already established neighbor peering), and tries to initiates a TCP connection to the BGP peer, and also listening new BGP peer router, who tries to establish new connection.

If successful, BGP state changes to connect state, if any error cause in this state, BGP router again back to the idle state, the ConnectRetryTime is set to 60 secs, and re-initiate connection when decrement to zero. Further failure results doubling ConnectRetryTime in the length from previous time.
 
  2)    Connect state: In this state, BGP is waiting for the TCP connection (3-way handshake) to be completed.

 If successful, it sends Open message to the neighbor and then state changes to Opensent. If the ConnectRetry Timers expires before 3-way handshake complete. The ConnectRetry Timer is reset, and try to new TCP connection, and the state is moved to Active.
If any other cause like resetting BGP, the state is jump back to idle.
 
Note: Higher IP address router manage TCP connection. To check the active TCP session between routers, use show tcp brief command.
 
3)    Active State:  In this state, BGP starts a new 3-way handshake. If a connection is established, it sends open message, and the state changes to Opensent. If fails, state jump back to connect state, and resets the ConnectRetry Timer. If any other cause like resetting BGP, the state is jump back to idle.
 
4)    OpenSent: In this state, an Open message has been send and now waiting for Open message from the other router. After the receives of Open message, both Open messages are checked for errors.

Below mentioned are the item to be compared:
·         BGP version must match.
·         Source IP of the Open message checked that is configured for the neighbor.
·         As Number must be match that is configured for the neighbor.
·         Router ID must be unique.
·         Authentication must match.

If successful, BGP hold timer negotiate to lower value between router, and keep alive message sent. And the state changes to OpenConfirm.

If any error found during open message checking, notification message is sent, and the state jump back to idle.
 
5)    OpenConfirm: In this state, BGP waits for Keepalive or Notification message. After received of keepalive BGP state changes to Established.

If any error (Like Hold time expire, any Notification received) the state jump back to Idle.

6)    Established: In this state, session is established. Now BGP routers exchange Update messages.

BGP router reset hold timer when any update or Keepalive receives. If any error (Like Hold time expire, any Notification received) the state jump back to Idle.
 

 

 

 

 

Comments

Popular posts from this blog

BGP Dynamic Peering

MBGP vs BGP

Troubleshooting BGP Neighbor States