Pages

Friday, June 3, 2011

BGP Cluster ID Loop Prevention

A router reflector cluster normally has a single route reflector. To avoid a single point of failure, you can configure a cluster with more than one route reflector. In case we have more than one RR in the group, we will establish the cluster of RRs. All RRs in the cluster are in the same cluster -ID.

Route-Reflector (RR) has an algorithm to prevent the update from the other RRs. It will not accept the update that has the same Cluster-ID as itself in order to prevent the loop in BGP. Below is the example of how the loop prevention works.

Example 



We have 2 scenarios as followings

  • R1 and R2 are in the same cluster and have the same Cluster ID which is 111.111.111.111
  • R1 and R2 are in the different cluster. R1 has cluster ID of 111.111.111.111 and R2 has a cluster ID of 222.222.222.222
Here is the example of the 1st scenario. ( same cluster ID)


R1
router bgp 100
 no synchronization
 bgp cluster-id 111.111.111.111
 bgp log-neighbor-changes
 neighbor 192.168.1.2 remote-as 100
 neighbor 192.168.1.2 next-hop-self
 neighbor 192.168.2.2 remote-as 100
 neighbor 192.168.2.2 route-reflector-client
 neighbor 192.168.2.2 next-hop-self
 neighbor 192.168.4.2 remote-as 100
 neighbor 192.168.4.2 route-reflector-client
 neighbor 192.168.4.2 next-hop-self
 no auto-summary
R1#


R2
R2#sh run | sec bgp
router bgp 100
 no synchronization
 bgp cluster-id 111.111.111.111
 bgp log-neighbor-changes
 network 20.20.20.20 mask 255.255.255.255
 neighbor 192.168.1.1 remote-as 100
 neighbor 192.168.1.1 next-hop-self
 neighbor 192.168.3.2 remote-as 100
 neighbor 192.168.3.2 route-reflector-client
 neighbor 192.168.3.2 next-hop-self
 no auto-summary


R2(config-router)#do sh ip bgp
BGP table version is 11, local router ID is 20.20.20.20
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i3.3.3.3/32       192.168.3.2              0    100      0 i
*> 20.20.20.20/32   0.0.0.0                  0         32768 i
R2(config-router)#

From the bgp table shown, R2 do not have the 50.50.50.50/32 and 40.40.40.40/32 in its BGP table, the reason is these networks have the same cluster-id with the R2. Due to the loop prevention mechanism, R2 will not accept these networks.


********************

R2
router bgp 100
 no synchronization
 bgp cluster-id 222.222.222.222
 bgp log-neighbor-changes
 network 20.20.20.20 mask 255.255.255.255
 neighbor 192.168.1.1 remote-as 100
 neighbor 192.168.1.1 next-hop-self
 neighbor 192.168.3.2 remote-as 100
 neighbor 192.168.3.2 route-reflector-client
 neighbor 192.168.3.2 next-hop-self
 no auto-summary


R2(config-router)#do sh ip bgp
BGP table version is 13, local router ID is 20.20.20.20
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i3.3.3.3/32       192.168.2.2              0    100      0 i
*>i                 192.168.3.2              0    100      0 i
*> 20.20.20.20/32   0.0.0.0                  0         32768 i
*>i40.40.40.40/32   192.168.4.2              0    100      0 i
*>i50.50.50.50/32   192.168.4.2              0    100      0 i
R2(config-router)#

Now, we have changed the cluster ID of R2 to 222.222.222.222. At this time R1 and R2 have a different Cluster-ID. Therefore, R2 will accept the bgp update from R1 and it has the 40.40.40.40/32 and 50.50.50.50/32 networks in its bgp table.

Verification

R3#sh ip bgp 40.40.40.40
BGP routing table entry for 40.40.40.40/32, version 11
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Not advertised to any peer
  Local
    192.168.4.2 (metric 74) from 192.168.3.1 (20.20.20.20)
      Origin IGP, metric 0, localpref 100, valid, internal
      Originator: 4.4.4.4, Cluster list: 222.222.222.222, 111.111.111.111
  Local
    192.168.4.2 (metric 74) from 192.168.2.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 4.4.4.4, Cluster list: 111.111.111.111
R3#


R2#
R2#sh ip bgp 40.40.40.40
BGP routing table entry for 40.40.40.40/32, version 13
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        2
  Local
    192.168.4.2 (metric 74) from 192.168.1.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 4.4.4.4, Cluster list: 111.111.111.111
R2#

3 comments: