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: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.
|









Leave a comment