On this study notes, I will be going through in details of the 6 States on how BGP adjacency were formed. 




Objective: Understand the 6 BGP States.




Above shows the 6 BGP States in Sequence. But before, going through it on details, I have configured the topology above and will just show how the adjacencies were formed after enabling the neighbor command under BGP process.

R2(config-router)#

*Oct  6 19:31:13.242: BGP: nbr global 172.16.12.1 Active open failed – can’t get active topologies
*Oct  6 19:31:13.242: BGP: nbr global 172.16.12.1 Open active delayed 9216ms (35000ms max, 60% jitter)
R2(config-router)#
*Oct  6 19:31:18.546: BGP: 172.16.12.1 passive open to 172.16.12.2
*Oct  6 19:31:18.546: BGP: 172.16.12.1 passive went from Idle to Connect
*Oct  6 19:31:18.550: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Setting open delay timer to 60 seconds.
*Oct  6 19:31:18.562: BGP: 172.16.12.1 passive rcv message type 1, length (excl. header) 38
*Oct  6 19:31:18.562: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Receive OPEN
*Oct  6 19:31:18.566: BGP: 172.16.12.1 passive rcv OPEN, version 4, holdtime 180 seconds
*Oct  6 19:31:18.566: BGP: 172.16.12.1 passive rcv OPEN w/ OPTION parameter len: 28
*Oct  6 19:31:18.570: BGP: 172.16.12.1 passive rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Oct  6 19:31:18.570: BGP: 172.16.12.1 passive OPEN has CAPABILITY code: 1, length 4
*Oct  6 19:31:18.570: BGP: 172.16.12.1 passive OPEN has MP_EXT CAP for afi/safi: 1/1
*Oct  6 19:31:18.574: BGP: 172.16.12.1 passive rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 19
R2(config-router)#:31:18.574: BGP: 172.16.12.1 passive OPEN has CAPABILITY code: 128, length 0
*Oct  6 19:31:18.574: BGP: 172.16.12.1 passive OPEN has ROUTE-REFRESH capability(old) for all address-families
*Oct  6 19:31:18.578: BGP: 172.16.12.1 passive rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 19:31:18.578: BGP: 172.16.12.1 passive OPEN has CAPABILITY code: 2, length 0
*Oct  6 19:31:18.582: BGP: 172.16.12.1 passive OPEN has ROUTE-REFRESH capability(new) for all address-families
*Oct  6 19:31:18.582: BGP: 172.16.12.1 passive rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 19:31:18.582: BGP: 172.16.12.1 passive OPEN has CAPABILITY code: 70, length 0
*Oct  6 19:31:18.586: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Enhanced Refresh cap received in open message
*Oct  6 19:31:18.586: BGP: 172.16.12.1 passive rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Oct  6 19:31:18.590: BGP: 172.16.12.1 passive OPEN has CAPABILITY code: 65, length 4
*Oc
R2(config-router)#t  6 19:31:18.590: BGP: 172.16.12.1 passive OPEN has 4-byte ASN CAP for: 65000
*Oct  6 19:31:18.594: BGP: nbr global 172.16.12.1 neighbor does not have IPv4 MDT topology activated
*Oct  6 19:31:18.594: BGP: 172.16.12.1 passive rcvd OPEN w/ remote AS 65000, 4-byte remote AS 65000
*Oct  6 19:31:18.598: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Adding topology IPv4 Unicast:base
*Oct  6 19:31:18.598: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Send OPEN
*Oct  6 19:31:18.602: BGP: ses global 172.16.12.1 (0x686746EC:0) pas Building Enhanced Refresh capability
*Oct  6 19:31:18.606: BGP: 172.16.12.1 passive went from Connect to OpenSent
*Oct  6 19:31:18.606: BGP: 172.16.12.1 passive sending OPEN, version 4, my as: 65001, holdtime 180 seconds, ID 14141414
*Oct  6 19:31:18.606: BGP: 172.16.12.1 passive went from OpenSent to OpenConfirm
*Oct  6 19:31:18.730: BGP: 172.16.12.1 passive went from OpenConfirm to Established
*Oct  6 19:31:18.734: BGP: ses global 172.16.12.1 (0x686746
R2(config-router)#EC:1) pas Assigned ID
*Oct  6 19:31:18.734: BGP: nbr global 172.16.12.1 Stop Active Open timer as all topologies are allocated
*Oct  6 19:31:18.738: BGP: ses global 172.16.12.1 (0x686746EC:1) Up
*Oct  6 19:31:18.742: %BGP-5-ADJCHANGE: neighbor 172.16.12.1 Up
*Oct  6 19:31:18.938: BGP: ses global 172.16.12.1 (0x686746EC:1) read request no-op
*Oct  6 19:31:18.954: BGP_Router: unhandled major event code 128, minor 0
R2(config-router)#
*Oct  6 19:31:23.230: BGP: topo global:IPv4 Unicast:base Scanning routing tables
*Oct  6 19:31:23.234: BGP: topo global:IPv4 Multicast:base Scanning routing tables

*Oct  6 19:31:23.234: BGP: topo global:MVPNv4 Unicast:base Scanning routing tables


Analysis,
1. As we can see above, R1 is initiating the Passive Open connections to R2.

2. R2 switched from Idle to Connect. In the Idle state, no BGP resources are allocated to any of the peers.  When the BGP state switched to Connect, peers are waiting to complete the TCP three way handshake.

3. Once the TCP 3 way handshake is completed, we can also see that the OPEN Packet parameters were exchange and has to be agreed on both R1 and R2.

3. We can also see that from Connect, it switch to OpenSent. On this state, the BGP waits for an OpenMessage from its peers.

4. The OpenConfirm State waits for the Keepalive or Notifications messages.

5. If the Keepalive is received , the state will be changed to Established.


  Below is the debug output on R1:

*Oct  6 20:43:03.362: BGP: ses global 172.16.12.2 (0x67C81B04:1) Removed topology IPv4 Unicast:base
*Oct  6 20:43:03.362: BGP: ses global 172.16.12.2 (0x67C81B04:1) Removed last topology
*Oct  6 20:43:03.366: BGP: nbr global 172.16.12.2 Open active delayed 11264ms (35000ms max, 60% jitter)
*Oct  6 20:43:03.366: BGP: nbr global 172.16.12.2 Active open failed – open timer running
R1#
*Oct  6 20:43:14.386: BGP: 172.16.12.2 active went from Idle to Active
*Oct  6 20:43:14.390: BGP: 172.16.12.2 open active, local address 172.16.12.1
*Oct  6 20:43:14.446: BGP: 172.16.12.2 open failed: Connection refused by remote host
*Oct  6 20:43:14.446: BGP: 172.16.12.2 Active open failed – tcb is not available, open active delayed 7168ms (35000ms max, 60% jitter                                   )
*Oct  6 20:43:14.450: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Reset (Active open failed).
*Oct  6 20:43:14.458: BGP: 172.16.12.2 active went from Active to Idle
*Oct  6 20:43:14.458: BGP: nbr global 172.16.12.2 Active open failed – open timer running
R1#
*Oct  6 20:43:14.462: BGP: nbr global 172.16.12.2 Active open failed – open timer running
R1#
*Oct  6 20:43:21.586: BGP: 172.16.12.2 active went from Idle to Active
*Oct  6 20:43:21.590: BGP: 172.16.12.2 open active, local address 172.16.12.1
*Oct  6 20:43:21.670: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Adding topology IPv4 Unicast:base
*Oct  6 20:43:21.674: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Send OPEN
*Oct  6 20:43:21.674: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Building Enhanced Refresh capability
*Oct  6 20:43:21.678: BGP: 172.16.12.2 active went from Active to OpenSent
*Oct  6 20:43:21.678: BGP: 172.16.12.2 active sending OPEN, version 4, my as: 65000, holdtime 180 seconds, ID A0A0A0A
*Oct  6 20:43:21.814: BGP: 172.16.12.2 active rcv message type 1, length (excl. header) 38
*Oct  6 20:43:21.818: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Receive OPEN
*Oct  6 20:43:21.818: BGP: 172.16.12.2 active rcv OPEN, version 4, holdtime 180 seconds
*Oct  6 20:43:21.822: BGP: 172.16.12.2 active rcv OPEN w/ OPTION parameter len: 28
*Oct  6 20:4
R1#3:21.822: BGP: 172.16.12.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Oct  6 20:43:21.822: BGP: 172.16.12.2 active OPEN has CAPABILITY code: 1, length 4
*Oct  6 20:43:21.826: BGP: 172.16.12.2 active OPEN has MP_EXT CAP for afi/safi: 1/1
*Oct  6 20:43:21.826: BGP: 172.16.12.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 20:43:21.830: BGP: 172.16.12.2 active OPEN has CAPABILITY code: 128, length 0
*Oct  6 20:43:21.830: BGP: 172.16.12.2 active OPEN has ROUTE-REFRESH capability(old) for all address-families
*Oct  6 20:43:21.830: BGP: 172.16.12.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 20:43:21.834: BGP: 172.16.12.2 active OPEN has CAPABILITY code: 2, length 0
*Oct  6 20:43:21.834: BGP: 172.16.12.2 active OPEN has ROUTE-REFRESH capability(new) for all address-families
*Oct  6 20:43:21.834: BGP: 172.16.12.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Oct  6 20:43:21.838: BGP:
R1#172.16.12.2 active OPEN has CAPABILITY code: 70, length 0
*Oct  6 20:43:21.838: BGP: ses global 172.16.12.2 (0x67C81C5C:0) act Enhanced Refresh cap received in open message
*Oct  6 20:43:21.842: BGP: 172.16.12.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Oct  6 20:43:21.842: BGP: 172.16.12.2 active OPEN has CAPABILITY code: 65, length 4
*Oct  6 20:43:21.842: BGP: 172.16.12.2 active OPEN has 4-byte ASN CAP for: 65001
*Oct  6 20:43:21.846: BGP: nbr global 172.16.12.2 neighbor does not have IPv4 MDT topology activated
*Oct  6 20:43:21.846: BGP: 172.16.12.2 active rcvd OPEN w/ remote AS 65001, 4-byte remote AS 65001
*Oct  6 20:43:21.850: BGP: 172.16.12.2 active went from OpenSent to OpenConfirm
*Oct  6 20:43:21.850: BGP: 172.16.12.2 active went from OpenConfirm to Established
*Oct  6 20:43:21.854: BGP: ses global 172.16.12.2 (0x67C81C5C:1) act Assigned ID
*Oct  6 20:43:21.854: BGP: ses global 172.16.12.2 (0x67C81C5C:1) Up
*Oct  6 20:43:21.858: %BGP-5-ADJC
R1#HANGE: neighbor 172.16.12.2 Up
*Oct  6 20:43:21.866: BGP: ses global 172.16.12.2 (0x67C81C5C:1) read request no-op
R1#
*Oct  6 20:43:51.878: BGP: topo global:IPv4 Unicast:base Scanning routing tables
*Oct  6 20:43:51.882: BGP: topo global:IPv4 Multicast:base Scanning routing tables
*Oct  6 20:43:51.882: BGP: topo global:MVPNv4 Unicast:base Scanning routing tables
R1#
Let me go through on the debug output on R1 to look at another views on the BGP States:

1.  R1 switch from Idle State to Active State.

2. From Active State, it switch to OpenSent.

3. OpenSent to OpenConfirm.

4. OpenConfirm to Established.
Let me go through the details of each of the 6 BGP States:





**************************END***************************************************




Leave a comment

Previous Post
Next Post

Quote of the week

"People ask me what I do in the winter when there's no baseball. I'll tell you what I do. I stare out the window and wait for spring."

~ Rogers Hornsby