BGP route reflector experiment example

1. Understanding route reflectors:

To ensure connectivity between IBGP peers, a full connection relationship needs to be established between IBGP peers. Assuming that there are n devices within an AS, the number of IBGP connections established is n(n-1)/2. When there are a large number of devices, the device configuration will be very complicated, and the consumption of network resources and CPU resources will be very large after configuration. Using route reflectors between IBGP peers can solve the above problems.

2. Related roles of route reflector:

  • Route Reflector RR (Route Reflector): A BGP device that allows the routes learned from IBGP peers to be reflected to other IBGP peers, similar to the DR in the OSPF network.

  • Client: An IBGP device that forms a reflective neighbor relationship with the RR. Clients within the AS only need to be directly connected to the RR.

  • Non-Client: An IBGP device that is neither an RR nor a client. Full connection relationships must still be established between non-clients and RRs within the AS, and between all non-clients.

  • Originator: The device that originates routing within the AS. The Originator_ID attribute is used to prevent routing loops within the cluster.

  • Cluster: A collection of route reflectors and their clients. The Cluster_List attribute is used to prevent routing loops between clusters.

3. Principle of route reflector:

Clients in the same cluster only need to directly exchange routing information with the RR of the cluster. Therefore, the client only needs to establish IBGP connections with the RR and does not need to establish IBGP connections with other clients, thus reducing the number of IBGP connections.

RR breaks through the limitation of “BGP routes obtained from IBGP peers, BGP devices only publish them to its EBGP peers.” and uses unique Cluster_List attributes and Originator_ID attributes to prevent routing loops. RR advertises routing rules to IBGP neighbors as follows:

  • Routes learned from non-clients are published to all clients.

  • Routes learned from clients are published to all non-clients and clients (except the client that originated the route).

  • Routes learned from EBGP peers are published to all non-clients and clients.

4. Understanding attributes:

Cluster_List attribute

The route reflector and its client form a cluster, which is identified by the unique Cluster ID within the AS. In order to prevent routing loops between clusters, the route reflector uses the Cluster_List attribute to record the Cluster IDs of all clusters that the route passes through.

  • When a route is reflected by RR for the first time, RR will add the local Cluster ID to the front of the Cluster List. If there is no Cluster_List attribute, RR creates one.

  • When RR receives an updated route, RR checks the Cluster List. If there is already a local Cluster ID in the Cluster List, discard the route; if there is no local Cluster ID, add it to the Cluster List, and then reflect the updated route.

Originator_ID attribute

The Originator ID is generated by RR. The value of the Router ID used identifies the originator of the route and is used to prevent routing loops in the cluster.

  • When a route is reflected by RR for the first time, RR adds the Originator_ID attribute to the route to identify the originating device of this route. If the Originator_ID attribute already exists in a route, RR will not create a new Originator_ID attribute.

  • When the device receives this route, it will compare the received Originator ID with the local Router ID. If the two IDs are the same, the device will not receive this route.

5. Experiment:

5.1: Experimental topology diagram:

5.2 Configure bgp:

#############R1BGP configuration#############################
bgp 200
 router-id 10.0.1.1
 peer 10.0.4.4 as-number 200
 peer 10.0.4.4 connect-interface LoopBack0
 peer 10.0.18.8 as-number 100
 group in_1 internal
 peer 10.0.2.2 as-number 200
 peer 10.0.2.2 group in_1
 peer 10.0.3.3 as-number 200
 peer 10.0.3.3 group in_1
 #
 ipv4-familyunicast
  undo synchronization
  reflector cluster-id 1
  peer 10.0.4.4 enable
  peer 10.0.4.4 next-hop-local
  peer 10.0.18.8 enable
  peer in_1 enable
  peer 10.0.2.2 enable
  peer 10.0.2.2 group in_1
  peer 10.0.3.3 enable
  peer 10.0.3.3 group in_1
#############R2BGP Configuration#############################
bgp 200
 router-id 10.0.2.2
 peer 10.0.1.1 as-number 200
 peer 10.0.1.1 connect-interface LoopBack0
 #
 ipv4-familyunicast
  undo synchronization
  network 10.0.2.2 255.255.255.255
  network 10.0.22.22 255.255.255.255
  peer 10.0.1.1 enable
#
#############R3BGP configuration#############################
bgp 200
 router-id 10.0.3.3
 peer 10.0.1.1 as-number 200
 peer 10.0.1.1 connect-interface LoopBack0
 #
 ipv4-familyunicast
  undo synchronization
  network 10.0.3.3 255.255.255.255
  peer 10.0.1.1 enable
#############R4BGP Configuration#############################
bgp 200
 router-id 10.0.4.4
 peer 10.0.1.1 as-number 200
 peer 10.0.1.1 connect-interface LoopBack0
 peer 10.0.7.7 as-number 200
 peer 10.0.7.7 connect-interface LoopBack0
 group in_2 internal
 peer 10.0.5.5 as-number 200
 peer 10.0.5.5 group in_2
 peer 10.0.6.6 as-number 200
 peer 10.0.6.6 group in_2
 #
 ipv4-familyunicast
  undo synchronization
  reflector cluster-id 2
  peer 10.0.1.1 enable
  peer 10.0.7.7 enable
  peer in_2 enable
  peer in_2 reflect-client
  peer 10.0.5.5 enable
  peer 10.0.5.5 group in_2
  peer 10.0.6.6 enable
  peer 10.0.6.6 group in_2
#############R5BGP configuration#############################
bgp 200
 router-id 10.0.5.5
 peer 10.0.4.4 as-number 200
 peer 10.0.4.4 connect-interface LoopBack0
 #
 ipv4-familyunicast
  undo synchronization
  network 10.0.5.5 255.255.255.255
  peer 10.0.4.4 enable
#############R6BGP configuration#############################
bgp 200
 router-id 10.0.6.6
 peer 10.0.4.4 as-number 200
 peer 10.0.4.4 connect-interface LoopBack0
 #
 ipv4-familyunicast
  undo synchronization
  network 10.0.6.6 255.255.255.255
  peer 10.0.4.4 enable
#
#############R7BGP Configuration#############################
bgp 200
 router-id 10.0.7.7
 peer 10.0.1.1 as-number 200
 peer 10.0.1.1 connect-interface LoopBack0
 peer 10.0.4.4 as-number 200
 peer 10.0.4.4 connect-interface LoopBack0
 #
 ipv4-familyunicast
  undo synchronization
  peer 10.0.1.1 enable
  peer 10.0.4.4 enable
#
#############R8BGP configuration#############################
bgp 100
 router-id 10.0.8.8
 peer 10.0.18.1 as-number 200
 #
 ipv4-familyunicast
  undo synchronization
  network 10.0.8.8 255.255.255.255
  peer 10.0.18.1 enable

5.3bgp configuration effect:

We can see that R6 has also obtained the routes of R2 and R8, and we have not configured too many IBGP adjacencies, reducing the number of IBGP connections and successfully reducing the consumption of network resources and CPU resources.