Detailed explanation of BGP route reflector, introduction and experiment of RR reflection cluster and RR anti-loop mechanism

1. What is RR

RR (Route Reflector): route reflector

Due to the split horizon, in order to ensure that all BGP routers in the AS can learn complete BGP routes, it is necessary to implement IBGP full interconnection in the AS.

However, there are many shortcomings in the realization of IBGP full interconnection:

 Routers need to maintain a large number of TCP and BGP connections, especially when the number of routers is large.

 The scalability of the BGP network in the AS is poor because the commands are configured manually.

In order to solve this problem, it can be applied to the RR route reflector technology.

2. Working principle of RR/reflection rules

insert image description here

As shown in the figure above, R1 has established BGP neighbors with R2 and R3, but R2 and R3 have not. Set R1 as the RR device in the network and designate R2 as the RR reflector client.

When R2 learns the EBGP route from R4, it will pass it to R1, and R1 will reflect the route learned by the client to the non-client R3, so R3 can learn the route of R2.

Note : R3 learns the reflected route, its next hop is still R2, and the next hop address will not be modified after reflection.

At this point, you may wonder, R2 and R3 have not established a BGP neighbor relationship. If the next hop is R2, can R3 still access the learned R4 network?

Answer: Yes, because R2 and R3 belong to the same IGP (OSPF), so R3 knows the location of R2. When R3 accesses R4, it will pass the data to R2 for forwarding through IGP.

RR client and non-client

As mentioned earlier, a certain device is set as a client, and other devices are non-clients, so what role do these identities play in the RR reflector environment?

1. Client: RR client, manually specified on the RR device.

Specified command: peer neighbor reflect-client

2. Except for the specified device as the client, other devices are non-client.

When the RR receives BGP routes :

 If a BGP route is received from a non-client , it will be reflected to all clients .

 If the BGP route from the client is received, it will be reflected to all devices (referring to the device that establishes a neighbor relationship with the RR)

 If the RR learns the EBGP route from the EBGP neighbor, it sends the route to all clients and non-client IBGP peers (similar to all devices that establish a neighbor relationship with the RR).

There is a mantra for RR's reflection rules: don't pass nonsense, pass everything else .

Regarding non-non-non-pass, it means that non-clients do not pass non-clients.

3. Pay attention to the location of RR equipment

What kind of equipment is suitable for RR reflector?

 1. The number of routing entries that can be carried by the network device is large, but the requirements are not fixed based on the location of the RR.

(1) If the RR acts as the core device of the backbone network control plane, the RR not only needs to complete the route reflection work, but also needs to carry large-scale routing entries.

(2) If the RR is in the bypass mode and is only used for route reflection, there is no need to make too many requirements on its bearer entries.

 2. Support the establishment of a large number of BGP peering relationships.

Because the prerequisite for RR to perform reflective routing is to establish peer relationships with other BGP neighbors, the number of supported peer relationships is also the key point of RR device selection.

 3. Devices with better CPU and memory (so that RR can be interconnected with more BGP devices, and can carry more routing entries and reverse routing speed).

 4. The relatively idle devices at the forwarding level are used as reflectors.

How to select the RR deployment location on the BGP network?

 Based on some basic requirements for RR equipment, and then combined with the current network environment to select the most suitable node for route reflection.

 1. As shown in the figure below, the common RR is usually set at the intermediate node position of IBGP:

insert image description here

 2. And the scenario where there are few links between IBGP neighbors can be solved by specifying multiple RRs .

insert image description here

 3. When there are many interconnected links in the network, the device with the most links to other devices in the entire network can be set as the RR device to facilitate route reflection.

insert image description here

4. RR reflection cluster

 The relationship formed between RR and customers is called a reflection cluster (Cluster), which is generally understood as a reflection collection or a reflection environment.

 Each cluster has a unique cluster ID (Cluster_ID, which is the BGP Router ID of RR by default)

 Multiple route reflection clusters are allowed in an AS, as shown in the following figure:

[R2 acts as the RR device of R1, and also acts as the client device of R2]

insert image description here

 In the scene shown in the figure below, for example, Client2 belongs to both reflection cluster RR1 and reflection cluster RR2.

insert image description here

5. The loop problem caused by RR

1. Here comes the problem. RR has set up the client and non-client, which solves the problem that IBGP cannot be passed to IBGP. Why is it necessary to design a reflection cluster?

Assuming the environment shown in the figure below, when R1 passes the learned route to RR1, RR1 will reflect the route to RR2, and RR2 will also reflect the route to R1 again, and this cycle will lead to a routing loop.

insert image description here

insert image description here

But if there is a refraction cluster concept, R1 and RR1 belong to reflection cluster 1, and R1 and RR2 belong to reflection cluster 2.

 When RR1 reflects the R1 route, it will record its own RID in the cluster-list path attribute of the reflected route.

 When RR2 rereflects the route back to RR1, RR1 finds that the cluster-list record in the reflected route has its own RID, so it will not perform the reflective operation again.

This solves the problem of repeated route reflection.

insert image description here

2. Although the problem of route reflection loop in the RR environment is solved, it can be noticed that the route sent by R1 is actually learned again from R3 or R4.

Because of route reflection, R1 will receive the route sent by itself.

This may cause the route reflected from R3 or R4 to be used when the route advertised by R1 is disconnected, resulting in a new loop.

Therefore, for this situation, the RR will mark the issuer of the route, that is, R1, in the Originator ID attribute of the reflected route before the route is reflected.

When the subsequent RR reflects the route again, the Originator ID will not change.

insert image description here

6. RR case configuration

(1) Common RR reflection case

insert image description here

R1

1、配置接口地址
interface G0/0/0
 ip address 10.1.12.1 24
#

2、配置OSPF
ospf 1
 area 0
 network 10.1.12.1 0.0.0.0
#

3、配置BGP
bgp 100
 peer 10.1.12.2 as-number 100
 network 192.168.10.0
#

R2

1、配置接口地址
interface G0/0/0
 ip address 10.1.12.2 24
#
interface G0/0/1
 ip address 10.1.23.2 24
#

2、配置OSPF
ospf 1
 a 0
 network 10.1.12.2 0.0.0.0
 network 10.1.23.2 0.0.0.0
 
3、配置BGP与RR,基于非非不传规则,在这个场景中设置一个客户端即可
bgp 100
 peer 10.1.12.1 as-number 100
 peer 10.1.23.3 as-number 100
 peer 10.1.12.1 reflect-client

R3

1、配置接口地址
interface G0/0/0
 ip address 10.1.23.3 24
 
2、配置OSPF
ospf 1
 a 0
 network 10.1.23.3 0.0.0.0
 
3、配置BGP
bgp 100
 peer 10.1.23.2 as-number 100

Test results

1、R3上查看BGP路由表,检查是否学习到BGP路由

<R3>dis bgp routing-table 

 Total Number of Routes: 1
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>i  192.168.10.0       10.1.12.1       0          100        0      i
 
2、如果没有学习到路由,可回头检查一下各自的BGP邻居是否建立

<R2>display bgp peer 

 BGP local router ID : 10.1.12.2
 Local AS number : 100
 Total number of peers : 2		  Peers in established state : 2

  Peer        V     AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
  10.1.12.1    4    100    119    116    0 01:54:55 Established    1
  10.1.23.3    4    100    116     119   0 01:54:50 Established    0

(2) Case of multiple RR reflection clusters

Doubts: Why does RR2 set RR1 as the client?

Because RR1 will reflect the route to RR2, if RR1 is a non-client, then the non-client of RR2 needs to learn the route of RR1.

The main thing is the rule of non-transmission. The best way is to set RR1 (that is, R2) as the client.
insert image description here

R1

1、配置接口地址
interface G0/0/0
 ip address 10.1.12.1 24
#

2、配置OSPF
ospf 1
 area 0
 network 10.1.12.1 0.0.0.0
#

3、配置BGP
bgp 100
 peer 10.1.12.2 as-number 100
 network 192.168.10.0
#

R2

1、配置接口地址
interface G0/0/0
 ip address 10.1.12.2 24
#
interface G0/0/1
 ip address 10.1.23.2 24
#

2、配置OSPF
ospf 1
 a 0
 network 10.1.12.2 0.0.0.0
 network 10.1.23.2 0.0.0.0
 
3、配置BGP与RR,基于非非不传规则,在这个场景中设置一个客户端即可
bgp 100
 peer 10.1.12.1 as-number 100
 peer 10.1.23.3 as-number 100
 peer 10.1.12.1 reflect-client

R3

1、配置接口地址
interface G0/0/0
 ip address 10.1.23.3 24
interface g0/0/1
 ip address 10.1.34.3 24
 
2、配置OSPF
ospf 1
 a 0
 network 10.1.23.3 0.0.0.0
 
 network 10.1.34.3 0.0.0.0
 
3、配置BGP与RR,基于非非不传规则,在这个场景中需要设置R2为客户端。
bgp 100
 peer 10.1.23.2 as-number 100
 peer 10.1.23.2 reflect-client
 peer 10.1.34.4 as-number 100

R4

1、配置接口地址
interface G0/0/0
 ip address 10.1.34.4 24
#

2、配置OSPF
ospf 1
 area 0
 network 10.1.34.4 0.0.0.0
#

3、配置BGP
bgp 100
 peer 10.1.34.3 as-number 100
#

test result

1. Check the BGP routing table on R4 to check whether the BGP route is learned

<R4>dis bgp routing-table 

 Total Number of Routes: 1
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>i  192.168.10.0       10.1.12.1       0          100        0      i

2. Check the route details learned again
insert image description here

Guess you like

Origin blog.csdn.net/qq_45443704/article/details/129923500
Recommended