3.7.e Implement and troubleshoot scalability

3.7.e (iii) Aggregation, AS set

this simple network illustrates aggregation in bgp, and the use of as_set…

first the difference between as_set and as_sequence…

  • AS_SEQUENCE.  This is the ordered list of AS’s that were used in the path to reach the destination.
  • AS_SET.  This is an unordered list of AS’s that were used in the path to reach the destination.as_set

r1 and r3 each have two loopbacks and are advertising the networks:

R1(config-router)#do sh run | b router
router bgp 100
bgp log-neighbor-changes
network 172.16.1.0 mask 255.255.255.0
network 172.16.2.0 mask 255.255.255.0
neighbor 192.168.12.2 remote-as 200

R3(config-router)#do sh run | b router
router bgp 300
bgp log-neighbor-changes
network 172.16.3.0 mask 255.255.255.0
network 172.16.4.0 mask 255.255.255.0
neighbor 192.168.23.2 remote-as 200

r2 will perform the aggregation, but first we’ll look at r4’s bgp table

R4(config-router)#do sh ip bgp | b Network
Network          Next Hop            Metric LocPrf Weight Path
*>  172.16.1.0/24    192.168.24.2                           0 200 100 i
*>  172.16.2.0/24    192.168.24.2                           0 200 100 i
*>  172.16.3.0/24    192.168.24.2                           0 200 300 i
*>  172.16.4.0/24    192.168.24.2                           0 200 300 i

R2(config-router)#do sh run | b router
router bgp 200
bgp log-neighbor-changes
neighbor 192.168.12.1 remote-as 100
neighbor 192.168.23.3 remote-as 300
neighbor 192.168.24.4 remote-as 400

r2 performs aggregation with:

R2(config-router)#aggregate-address 172.16.1.0 255.255.248.0

R4(config-router)#do sh ip bgp | b Net
Network          Next Hop            Metric LocPrf Weight Path
*>  172.16.0.0/21    192.168.24.2             0             0 200 i
*>  172.16.1.0/24    192.168.24.2                           0 200 100 i
*>  172.16.2.0/24    192.168.24.2                           0 200 100 i
*>  172.16.3.0/24    192.168.24.2                           0 200 300 i
*>  172.16.4.0/24    192.168.24.2                           0 200 300 i

without further filtering by r2, r4 gets the aggregate, and the other networks…

R2(config-router)#aggregate-address 172.16.1.0 255.255.248.0 summary-only

R4(config-router)#do sh ip bgp | b Net
Network          Next Hop            Metric LocPrf Weight Path
*>  172.16.0.0/21    192.168.24.2             0             0 200 i

R2(config-router)#do sh ip bgp | b Net
Network          Next Hop            Metric LocPrf Weight Path
*>  172.16.0.0/21    0.0.0.0                            32768 i
 s>  172.16.1.0/24    192.168.12.1             0             0 100 i
 s>  172.16.2.0/24    192.168.12.1             0             0 100 i
s>  172.16.3.0/24    192.168.23.3             0             0 300 i
s>  172.16.4.0/24    192.168.23.3             0             0 300 i

if we add the as-set statement, then path information will be preserved…

router bgp 200
aggregate-address 172.16.0.0 255.255.248.0 as-set summary-only

R4(config-router)#do sh ip bgp | b Net
Network          Next Hop            Metric LocPrf Weight Path
*>  172.16.0.0/21    192.168.24.2             0             0 200 {100,300}i