BGP routing reflector

Note: this note is used for BGP routing reflector theory and Command Reference explanation

Reference video: Three cups of black tea

Front

Let's review the first day of BGP:

By directly observing the above figure, we find that there is a transit as, which can be determined directly. If D and C cannot afford BGP routing protocol, it will cause the problem of routing black hole

However, if BGP is used, we need to pay attention to the horizontal segmentation principle of IBGP: the routes I learned from an IBGP will not be forwarded to any of my IBGP neighbors. Therefore, in order to avoid the timeout caused by the principle of horizontal segmentation, we must establish a fully interconnected BGP neighbor relationship in as transit. We call this transit relationship Full mesh neighbors

This situation is actually very common, but BGP configuration is annoying enough. It is related to various routing strategies. I also care about routing black holes and horizontal segmentation. Don't go crazy?

At this time, the BGP routing reflector was born

IBGP problems in transit AS:

  • IBGP is required to be fully interconnected in AS (iBGP horizontal segmentation)

  • BGP Routers

    • A large number of TCP and BGP connections need to be maintained
    • The network is full of BGP routing information
  • Solution

    • Route Reflector
    • BGP Federation

0x01 technical background of routing reflector

Keyword: Route Reflector = = Route Reflector RR

Observe the above figure:

Because of the IBGP horizontal segmentation principle, a large number of BGP connections need to be maintained within the AS (IBGP full mesh is required), which affects the network performance. The routing reflector can "relax" the horizontal segmentation principle to alleviate this problem.

In fact, to put it bluntly, we just don't want to give R3 and R5 BGP neighbors, which will waste network performance

0x02 routing reflector Foundation

As for the RR route reflector, we can understand its image as a mirror

Observe the following figure:

We can find that there is a relationship between client - > RR (route reflector),

If we set up a routing reflector on R4 and use R3 as a Client, * * R4 will reflect the routing information sent from R3 to R4 to * * R5, so that R5 can cross the barrier of horizontal segmentation and learn the routing of R4.

0x03 route reflection rule 🔺

1: If the route is learned from a non Client IBGP Peer, it is reflected to all clients

2: If the route is learned from the Client, it is reflected to all non Client IBGP neighbors and all clients except the Client

3: If the route is learned from EBGP Peer, it is sent to all Client and non Client IBGP neighbors

Consolidation example 1:

Consolidation example 2:

0x04 Route Reflector anti loop path attribute 🔺

Because we use the routing reflector to relax the horizontal segmentation principle, it will bring some hidden dangers to the loop

Generally, the Route Reflector is deployed inside the Transit AS. Since it is inside the AS, the AS path anti ring is invalid. In order to avoid horizontal segmentation and routing black holes, the Route Reflector is used, but we also need to pay attention to the anti ring of the Route Reflector

Route Reflector anti loop property:

  • Originator_ID
  • Cluster_list

Refer to figure:

By observing the above figure, we can find that: 🔺

1: Originator_ID marks the origin of a route, that is, the Router ID of R3

2: Cluster_list is a reflection cluster on the RR tag

Both are similar to the anti ring characteristics of as path attribute

3: Originator_ID, which will always be carried after reflection without changing the value

4: Cluster_list, after each reflection, the Route Reflector router will mark its Route ID and store it in the list

Refer to example 1:

Refer to example 2: 🔺

Here, each circle represents a reflection cluster

R1 is the Client of R2

R1 is the Client of R3

R3 is the Client of R4

We can see that the preferred path attribute of the reflector is Cluster list, the less is the priority, and the mark is Best

0x05 Route Reflector deployment redundancy

BGP route reflection is an advanced feature in BGP. It has the basic anti ring property. At the same time, it can reduce BGP TCP connections and optimize the network

Therefore, if we deploy Route Reflector in Transit AS, we must consider the redundancy of Route Reflector.

If we do not consider the redundancy of the reflector, once the only RR hangs, the BGP AS will be divided horizontally.

Refer to figure:

  • Redundant RR increases the robustness of the network
  • Using the Originator_ID,Cluster_ The list attribute avoids routing loops in a redundant RR environment (this attribute is carried and passed by RR by default)
  • Cluster two RR S_ If the ID configuration is the same, it can further prevent the ring
  • IBGP full mesh is used between all RR s

0x06 Route Reflector Command Reference 🔺

Command example:

router bgp 123
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 route-reflector-client

!!! `The basic configuration of the routing reflector is a command that specifies Client,because Client I don't know I belong to the reflection cluster, only RR know`

`neighbor Client-ip-address route-reflector-client`

RR can modify its own cluster ID

route-bgp 123
 bgp cluster-id 222.222.222.222

Experimental reference diagram:

Experimental topology diagram reference

The key configuration is route reflector

Route-Refelctor(config-router)#neighbor 2.2.2.2 route-reflector-client

Finally, it is verified in R4 that there are routes reflected by route reflector

R4#show ip bgp 
BGP table version is 3, local router ID is 4.4.4.4
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
*>i100.1.1.0/24     2.2.2.2                  0    100      0 100 i
*>i200.1.1.0        2.2.2.2                  0    100      0 100 i
         
R4#show ip bgp 100.1.1.0
BGP routing table entry for 100.1.1.0/24, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     2         
  100
    2.2.2.2 (metric 129) from 3.3.3.3 (3.3.3.3)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      'Originator: 2.2.2.2, Cluster list: 3.3.3.3'

The complete configuration is as follows

!! R1

interface Loopback0
 ip address 100.1.1.1 255.255.255.0
!
interface Loopback1
 ip address 200.1.1.1 255.255.255.0
!
interface Serial0/0
 ip address 10.1.1.1 255.255.255.0
!
router bgp 100
 network 100.1.1.0 mask 255.255.255.0
 network 200.1.1.0
 neighbor 10.1.1.2 remote-as 234
!
end
!! Client

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial0/0
 ip address 10.1.1.2 255.255.255.0
!         
interface Serial0/1
 ip address 20.1.1.1 255.255.255.0
!
router ospf 1
 network 2.2.2.2 0.0.0.0 area 0
 network 20.1.1.1 0.0.0.0 area 0
!
router bgp 234
 neighbor 3.3.3.3 remote-as 234
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self
 neighbor 10.1.1.1 remote-as 100
!
end
!! Route-Reflector

interface Loopback0
 ip address 3.3.3.3 255.255.255.0
!
interface Serial0/1
 ip address 20.1.1.2 255.255.255.0
!
interface Serial0/2
 ip address 30.1.1.1 255.255.255.0
!
router ospf 1
 network 3.3.3.3 0.0.0.0 area 0
 network 20.1.1.2 0.0.0.0 area 0
 network 30.1.1.1 0.0.0.0 area 0
!
router bgp 234
 neighbor 2.2.2.2 remote-as 234
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 route-reflector-client
 neighbor 4.4.4.4 remote-as 234
 neighbor 4.4.4.4 update-source Loopback0
!
end
!! R4

interface Loopback0
 ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
 ip address 40.1.1.1 255.255.255.0
!
interface Serial0/2
 ip address 30.1.1.2 255.255.255.0
!
router ospf 1
 network 4.4.4.4 0.0.0.0 area 0
 network 30.1.1.2 0.0.0.0 area 0
!
router bgp 234
 neighbor 3.3.3.3 remote-as 234
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 40.1.1.2 remote-as 500
!
end
!! R5

interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface Serial0/0
 ip address 40.1.1.2 255.255.255.0
!
router bgp 500
 neighbor 40.1.1.1 remote-as 234
!
end

This note is made with reference to Zhu sir (three cups of black tea) video

Keywords: network Router cisco BGP

Added by Arnerd on Wed, 05 Jan 2022 12:49:25 +0200