What is iBGP Scalability? BGP Confederation Configured

« 2022 Aug 4 »

What is BGP Confederation?

A BGP Confederation creates domains of sub-Autonomous Systems (also called Member AS) which belong to the same confederation. This improves the scalability of very large BGP networks. Notably, an iBGP full-mesh is only needed between routers configured under the same sub-AS. The required number of iBGP neighborships within a local Confederation is thus reduced.

In a BGP Update the AS_CONFED_SEQUENCE is added to the AS_PATH Path Attribute as long as it is within the same BGP Confederation. When a BGP Update message is advertised across an eBGP neighborship, the AS_CONFED_SEQUENCE segment is removed. As a result, for eBGP neighbors the Confederation sub-AS numbers are invisible.

BGP Update AS CONFED SEQUENCE confederation

In the following example configuration R2 and R3 belong to the BGP sub-AS 65002. The larger BGP Confederation AS is 65001. R2 peers with R4 which is not assigned to sub-AS 65002. Nonetheless, the peering between R2 and R4 is an iBGP neighborship (route attributes such as BGP Next-Hop, do not change).

BGP Confederation introduction

Configuration:

R1
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R2 **
     ip address 10.1.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Lo10 | sec int
    interface Loopback10
     ip address 192.168.1.1 255.255.255.0
    
    R1#show run | sec ^router
    router bgp 65100
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     network 192.168.1.0
     neighbor 10.1.0.2 remote-as 65001
    
R2
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#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
    
    R2#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run | sec ^router
    router bgp 65002
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     bgp confederation identifier 65001
     bgp confederation peers 65001 
     neighbor 10.1.0.1 remote-as 65100
     neighbor 10.2.0.2 remote-as 65001
     neighbor 10.2.0.2 next-hop-self
     neighbor 10.3.0.2 remote-as 65002
     neighbor 10.3.0.2 next-hop-self
    
R3
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R2 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run | sec ^router     
    router bgp 65002
     bgp router-id 3.3.3.3
     bgp log-neighbor-changes
     bgp confederation identifier 65001
     neighbor 10.3.0.1 remote-as 65002
    
R4
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R2 **
     ip address 10.2.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 R5 **
     ip address 10.4.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run | sec ^router
    router bgp 65001
     bgp router-id 4.4.4.4
     bgp log-neighbor-changes
     bgp confederation identifier 65001
     bgp confederation peers 65002 
     neighbor 10.2.0.1 remote-as 65002
     neighbor 10.2.0.1 next-hop-self
     neighbor 10.4.0.2 remote-as 65200
    
R5
    R5#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R4 **
     ip address 10.4.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R5#show run int Lo10 | sec int
    interface Loopback10
     ip address 192.168.2.1 255.255.255.0
    
    R5#show run | sec ^router
    router bgp 65200
     bgp router-id 5.5.5.5
     bgp log-neighbor-changes
     network 192.168.2.0
     neighbor 10.4.0.1 remote-as 65001
    
R1#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.1.0      0.0.0.0                  0         32768 i
 *>   192.168.2.0      10.1.0.2                               0 65001 65200 i    « Sub-AS 65002 is not shown over eBGP neighborship



R5#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.1.0      10.4.0.1                               0 65001 65100 i
 *>   192.168.2.0      0.0.0.0                  0         32768 i



R3#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>i  192.168.1.0      10.3.0.1                 0    100      0 65100 i
 *>i  192.168.2.0      10.3.0.1                 0    100      0 (65001) 65200 i



R4#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.1.0      10.2.0.1                 0    100      0 (65002) 65100 i   « Sub-AS 65002 is shown within Confederation
 *>   192.168.2.0      10.4.0.2                 0             0 65200 i



R4#show ip bgp 192.168.1.0
BGP routing table entry for 192.168.1.0/24, version 19
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     3         
  Refresh Epoch 1
  (65002) 65100
    10.2.0.1 from 10.2.0.1 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, confed-external, best           « This route is external to the local BGP Confederation
      rx pathid: 0, tx pathid: 0x0

It is visible in the above outputs that the sub-AS number is identified in paranthesis and only appears within the BGP Confederation. To external BGP (eBGP) neighbors, the sub-AS is hidden.

What is the difference between BGP Route Reflector and Confederation?

BGP Confederations and BGP Route Reflectors both provide methods to improve scalability of large BGP networks. Both methods deal with the scalability issue of the iBGP full-mesh requirement. A central difference between the two methods is complexity and ease of migration. Generally, BGP Confederations are more difficult to implement and require more configuration tasks.

How to configure BGP Confederation?

In this example topology, the BGP AS 65020 confederation is divided into three sub-AS domains: 65021, 65022, and 65023. As visible from the configurations, the BGP process is configured under the sub-AS number.

Within the BGP router configuration, the command bgp confederation identifier tells the router which is the larger BGP Confederation AS number it belongs to. If a sub-AS is peering with another sub-AS, it is configured with the command bgp confederation peers. With these commands a router can generate its BGP Update Messages with correct AS-Path attributes and handle BGP session accordingly.

BGP Confederation configuration with three sub-AS networks

Configuration:

R2
    R2#show run | sec router bgp
    router bgp 65021
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     bgp confederation identifier 65020
     bgp confederation peers 65022 65023 
     neighbor 10.20.1.1 remote-as 65022
     neighbor 10.20.1.1 next-hop-self
     neighbor 10.20.2.2 remote-as 65023
     neighbor 10.20.2.2 next-hop-self
     neighbor 10.21.1.2 remote-as 65021
     neighbor 10.21.1.2 next-hop-self
    
R5
    R5#show run | sec router bgp 
    router bgp 65023
     bgp router-id 5.5.5.5
     bgp log-neighbor-changes
     bgp confederation identifier 65020
     bgp confederation peers 65020 
     neighbor 10.20.3.2 remote-as 65020
     neighbor 10.20.3.2 next-hop-self
     neighbor 10.23.1.1 remote-as 65023
     neighbor 10.23.1.1 next-hop-self
     neighbor 10.23.3.2 remote-as 65023
     neighbor 10.23.3.2 next-hop-self
    
R6
    R6#show run | sec router bgp 
    router bgp 65022
     bgp router-id 6.6.6.6
     bgp log-neighbor-changes
     bgp confederation identifier 65020
     bgp confederation peers 65021 
     neighbor 10.20.1.2 remote-as 65021
     neighbor 10.20.1.2 next-hop-self
     neighbor 10.22.1.2 remote-as 65022
     neighbor 10.22.1.2 next-hop-self
     neighbor 10.22.3.2 remote-as 65022
     neighbor 10.22.3.2 next-hop-self
     neighbor 172.16.20.2 remote-as 65010
    
R9
    R9#show run | sec router bgp
    router bgp 65020
     bgp router-id 9.9.9.9
     bgp log-neighbor-changes
     bgp confederation identifier 65020
     bgp confederation peers 65023 
     neighbor 10.20.3.1 remote-as 65023
     neighbor 10.20.3.1 next-hop-self
     neighbor 172.16.50.2 remote-as 65040
    

From an external perspective, from outside of AS 65020, the sub-ASs are not included in the AS path.

R13#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   10.21.2.0/30     172.16.10.1                            0 65010 65020 ?
 *>   10.21.2.8/29     172.16.10.1                            0 65010 65020 ?
 *>   192.168.1.0/29   0.0.0.0                  0         32768 i
 *>   192.168.2.0/30   172.16.10.1                            0 65010 65020 65030 i
 *>   192.168.2.8/29   172.16.10.1                            0 65010 65020 65030 i
 *>   192.168.3.0/29   172.16.10.1                            0 65010 65020 65040 65002 i

However, within AS 65020 the sub-ASs are marked in parantheses.

R6#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   10.21.2.0/30     10.20.1.2                0    100      0 (65021) ?
 *>   10.21.2.8/29     10.20.1.2                0    100      0 (65021) ?
 *>   192.168.1.0/29   172.16.20.2                            0 65010 65001 i
 *>i  192.168.2.0/30   10.22.1.2              145    100      0 65030 i
 *>i  192.168.2.8/29   10.22.1.2                0    100      0 65030 i
 *>   192.168.3.0/29   10.20.1.2                0    100      0 (65021 65023 65020) 65040 65002 i

Peering between two sub-ASs

Peerings between sub-ASs resemble eBGP but with the characteristics of an iBGP neighborship. Next-hop address, local preference, and MED are not changed between sub-AS peerings. Route attributes are preserved throughout the confederation, between all sub-ASs.

R6#show ip bgp 192.168.2.0
BGP routing table entry for 192.168.2.0/30, version 16
Paths: (1 available, best #1, table default)
Multipath: eBGP
  Advertised to update-groups:
     1          2         
  Refresh Epoch 9
  (65020) 65030
    10.22.3.2 from 10.22.3.2 (7.7.7.7)
      Origin IGP, metric 180, localpref 95, valid, confed-internal, best
      rx pathid: 0, tx pathid: 0x0




R2#show ip bgp 192.168.2.0
BGP routing table entry for 192.168.2.0/30, version 16
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     1          2         
  Refresh Epoch 7
  (65022 65020) 65030
    10.20.1.1 from 10.20.1.1 (6.6.6.6)
      Origin IGP, metric 180, localpref 95, valid, confed-external, best     « Attributes remain unchanged between sub-ASs
      rx pathid: 0, tx pathid: 0x0




R5#show ip bgp 192.168.2.0
BGP routing table entry for 192.168.2.0/30, version 16
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2         
  Refresh Epoch 1
  (65021 65022 65020) 65030
    10.23.1.1 from 10.23.1.1 (3.3.3.3)
      Origin IGP, metric 180, localpref 95, valid, confed-internal, best     « Attributes remain unchanged between sub-ASs
      rx pathid: 0, tx pathid: 0x0