BGP Synchronization Rule and IGP Route Validation Explained

« 2024 Oct 28 »

What is BGP Synchronization?

BGP synchronization is configured on provider edge routers to mitigate a type of failure scenario where an iBGP route is advertised to an eBGP peer, even though the iBGP route is not reachable. As a result, incoming traffic is dropped (traffic blackhole). This scenario can affect transit providers as shown in the following image.

BGP Synchronization Rule summary and overview of transit provider IGP validation
If the Host tries to reach the Server, there are two outcomes which are described in this table
Scenario Description
BGP synchronization is turned off Traffic from the Host reaches the transit provider PE2. In fact, PE2 forwards the traffic to router B. And router B drops the traffic because it has no knowledge of the Server prefix 192.168.1.0/24.
BGP synchronization is turned on The Server prefix is never advertised by PE2 to ISP2. So even if traffic from the Host reaches the ISP2 router, it will get dropped by ISP2 without being sent to PE2. The transit provider is not affected, and the Server prefix will show not synchronized on PE2.

BGP Synchronization details

BGP synchronization is no longer used in most modern implementations. The following topology details the type of scenario it was meant to protect against. The Transit Provider (AS 65100) uses only IP forwarding in a BGP-free core network with the IGP OSPF. In other words, MPLS or other tunneling mechanism is not configured. And BGP is not configured on R3 and R4. However, OSPF is configured on R2, R3, R4 and R5.

BGP synchronization with transit provider

Configuration:

R1
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Server **
     ip address 192.168.1.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
     
    R1#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to PE R2 **
     ip address 172.16.1.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run | sec ^router
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     network 192.168.1.0
     neighbor 172.16.1.1 remote-as 65100
    
R2 (PE)
    R2#show run int Gi0/0 | sec int 
    interface GigabitEthernet0/0
     description ** to R1 ISP1 **
     ip address 172.16.1.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R3 **
     ip address 10.1.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run | sec ^router
    router ospf 10
     router-id 2.2.2.2
     network 10.1.0.0 0.0.0.3 area 0
    router bgp 65100
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 10.3.0.1 remote-as 65100
     neighbor 10.3.0.1 next-hop-self
     neighbor 172.16.1.2 remote-as 65001
    
R3
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to PE R2 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.2.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run | sec ^router     
    router ospf 10
     router-id 3.3.3.3
     network 10.1.0.0 0.0.0.3 area 0
     network 10.2.0.0 0.0.0.3 area 0
    
R4
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to PE R5 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R3 **
     ip address 10.2.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run | sec ^router
    router ospf 10
     router-id 4.4.4.4
     network 10.2.0.0 0.0.0.3 area 0
     network 10.3.0.0 0.0.0.3 area 0
    
R5 (PE)
    R5#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R6 ISP2 **
     ip address 172.16.2.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R5#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R5#show run | sec ^router
    router ospf 10
     router-id 5.5.5.5
     network 10.3.0.0 0.0.0.3 area 0
    router bgp 65100
     bgp router-id 5.5.5.5
     bgp log-neighbor-changes
     neighbor 10.1.0.1 remote-as 65100
     neighbor 10.1.0.1 next-hop-self
     neighbor 172.16.2.2 remote-as 65002
    
R6
    R6#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host **
     ip address 192.168.2.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R6#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to PE R5 **
     ip address 172.16.2.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R6#show run | sec ^router
    router bgp 65002
     bgp router-id 6.6.6.6
     bgp log-neighbor-changes
     network 192.168.2.0
     neighbor 172.16.2.1 remote-as 65100
    
R5#show ip route | beg Ga
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O        10.1.0.0/30 [110/3] via 10.3.0.2, 02:31:00, GigabitEthernet0/1             « PE R2 address learned through OSPF
O        10.2.0.0/30 [110/2] via 10.3.0.2, 02:31:10, GigabitEthernet0/1
C        10.3.0.0/30 is directly connected, GigabitEthernet0/1
L        10.3.0.1/32 is directly connected, GigabitEthernet0/1
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.2.0/30 is directly connected, GigabitEthernet0/0
L        172.16.2.1/32 is directly connected, GigabitEthernet0/0
B     192.168.1.0/24 [200/0] via 10.1.0.1, 00:34:17                                 « PE R5 receives Server prefix with next-hop PE R2
B     192.168.2.0/24 [20/0] via 172.16.2.2, 02:33:54




R5#show ip bgp 192.168.1.0
BGP routing table entry for 192.168.1.0/24, version 5
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     1         
  Refresh Epoch 2
  65001
    10.1.0.1 (metric 3) from 10.1.0.1 (2.2.2.2)                                     « PE R5 learns next-hop address from OSPF
      Origin IGP, metric 0, localpref 100, valid, internal, best                    « Path is considered valid
      rx pathid: 0, tx pathid: 0x0




R6#show ip bgp 192.168.1.0
BGP routing table entry for 192.168.1.0/24, version 5
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Refresh Epoch 1
  65100 65001
    172.16.2.1 from 172.16.2.1 (5.5.5.5)
      Origin IGP, localpref 100, valid, external, best                              « PE R5 advertises Server prefix to R6 (ISP2)
      rx pathid: 0, tx pathid: 0x0




R4#show ip route | beg Ga                              « But on router R4 there is no Server prefix learned
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O        10.1.0.0/30 [110/2] via 10.2.0.1, 02:36:42, GigabitEthernet0/1
C        10.2.0.0/30 is directly connected, GigabitEthernet0/1
L        10.2.0.2/32 is directly connected, GigabitEthernet0/1
C        10.3.0.0/30 is directly connected, GigabitEthernet0/0
L        10.3.0.2/32 is directly connected, GigabitEthernet0/0

As a result of this scenario, when Host sends traffic destined to 192.168.1.1, it will be forwarded to PE R5 which has a route to 192.168.1.0/24 in its routing table. On PE R5 the next-hop address is PE R2 (10.1.0.1) which is reachable through OSPF. This is called a BGP recursive lookup, when PE R5 looks up the reachability of the next-hop address.

Now that PE R5 has a valid next-hop address it forwards traffic to 192.168.1.0/24 towards router R4. However, when traffic destined to 192.168.1.1 reaches R4 it is dropped, because R4 does not have a route to this prefix. The following output from R4 shows this result.

R4#show log | beg Log Buffer
Log Buffer (8192 bytes):

%SYS-5-CONFIG_I: Configured from console by console
IP: s=192.168.2.1 (GigabitEthernet0/0), d=192.168.1.1, len 100, input feature, MCI Check(109), rtype 0, forus FALSE, sendself FALSE, mtu 0, fwdchk FALSE
IP: s=192.168.2.1 (GigabitEthernet0/0), d=192.168.1.1, len 100, unroutable
IP: s=10.3.0.2 (local), d=192.168.2.1, len 56, unroutable
[...]

If BGP synchronization is configured on PE R5 it protects the Transit Provider's network from this kind of scenario. In other words, with BGP synchronization PE R5 also checks whether the 192.168.1.0/24 is reachable through OSPF or not. This is called IGP validation. If the prefix is not reachable through OSPF, then PE R5 does not advertise it through eBGP to R6.

Limitations of BGP Synchronization

IGP validation and BGP synchronization has its specific use case, and its limitations. Redistributing a large number of BGP routes into an IGP like OSPF can cause undesired effects in protocol convergence. Instead, many ISPs or transit providers rely on some form of MPLS VPN (Layer-2 or Layer-3) for network service virtualization, data forwarding and customer segmentation.

They use a BGP-free core network with Route Reflectors and/or BGP confederations for scalability. These implementations do not work well with BGP synchronization. For example, if the above topology were to use a L3VPN MPLS architecture with a VPN/VRF for ISP1 and ISP2, BGP synchronization would prevent installation of BGP VPNv4 routes into the IPv4 VRF table on the PE routers.