Skip to main content
  1. Network Articles/
  2. BGP Articles/

BGP Route Aggregation (aggregate-address)

Table of Contents

What route aggregation is

Route aggregation advertises several prefixes as a single shorter prefix. The four routes 172.16.0.0/24 through 172.16.3.0/24 can be advertised as one 172.16.0.0/22.

Four /24s aggregated into one /22, and why the result is a /22
GoalWhat it means
Keep tables smallFour routes become one
Hide churn from the outsideAs long as one component remains, the aggregate keeps being advertised and the flap stops inside your own AS

RFC 4271 covers aggregation in sections 9.1.4 and 9.2.2.2: the aggregating router originates a brand-new route of its own.

What aggregation loses, and the two attributes that say so

The aggregate is a route separate from the four it replaces. With the IOS XR default (no as-set), the components’ AS_PATH is not carried into it, and the AS_PATH starts at the aggregating AS (the same holds for COMMUNITY; the components here carry none, so that was not observed).

RFC 4271 section 9.2.2.2 does define how to merge several AS_PATHs into one (keep the common leading sequence as an AS_SEQUENCE, put the rest in an AS_SET), but because an AS_SET has the side effects described below, implementations do not use it by default. They attach two attributes that record the drop instead.

AttributeRFC 4271 section 4.3Meaning
ATOMIC_AGGREGATEType code 6, well-known discretionary, length 0“This aggregates more specific routes and the original AS_PATH information is lost.” A receiver must not de-aggregate the route into more specific prefixes (MUST NOT) and should not strip the attribute when re-advertising (SHOULD NOT)
AGGREGATORType code 7, optional transitiveThe AS number and BGP identifier of the aggregating router: who did the aggregation

AGGREGATOR is eight octets (AS 4 + IP 4) between peers that support four-octet AS numbers (RFC 6793) and six octets towards a peer that does not. Only when the aggregating AS is 65536 or above does the old peer get AS_TRANS (23456) plus AS4_AGGREGATOR (type code 18).

as-set: keeping the AS_SET, and why not to

Adding as-set to aggregate-address keeps the components’ ASes as an AS_SET (an unordered set, shown as {65002, 65003, 65004}) following the section 9.2.2.2 procedure. In AS_PATH length comparison an AS_SET counts as 1 no matter how many ASes it holds. ATOMIC_AGGREGATE is then not set: section 9.1.4 says an aggregate should either include all ASes in an AS_SET or carry ATOMIC_AGGREGATE.

Side effectWhat happens
An AS in the AS_SET cannot accept the routeLoop detection discards a route whose AS_PATH contains the local AS, and the AS_SET members count
It is rewritten whenever the components changeEach change to the AS_SET sends an UPDATE, eroding the “hide churn” benefit
It describes a path that does not existThe AS_PATH blends several routes and need not be the sequence packets traverse (section 5.1.6)

RFC 6472 (BCP 172) recommends not generating new announcements containing AS_SET or AS_CONFED_SET, mainly because they make route origin hard to validate. In production, do not add as-set.

Configuring it on IOS XR

Aggregation
router bgp 65001
 address-family ipv4 unicast
  aggregate-address 172.16.0.0/22 as-set summary-only route-policy <name>
OptionMeaning
noneGenerate the aggregate. The components keep being advertised as well
summary-onlySuppress the components and advertise only the aggregate
as-setPut an AS_SET in the AS_PATH (normally not used)
route-policySet attributes on the aggregate
BehaviourDetail
When it existsOnly while at least one route inside the range is in the BGP table. It vanishes at zero and returns when a component comes back; the configuration stays in show bgp aggregate-address
RIBOn the aggregating router it points to Null0, so non-existent destinations inside the range are not forwarded via a default route
ORIGINSection 9.2.2.2: INCOMPLETE if any component is INCOMPLETE, else EGP if any is EGP, else IGP. Every component here comes from a network statement, so it is IGP

Verifying on real hardware

Six XRd 26.1.1 routers.

Topology for the BGP route aggregation verification
  • AS 65001: R1 and R2 at the border, R3 internal (iBGP full mesh, next-hop-self, OSPF). AS 65002 is R4, AS 65003 is R5, AS 65004 is R6
  • R5 advertises 172.16.0.0/24 and .1.0/24, R6 advertises .2.0/24 and .3.0/24, via network statements
  • R1 aggregates with aggregate-address 172.16.0.0/22. Outbound eBGP policies are named per neighbour and contain only pass

The components reach R1 with two AS_PATHs: the two from R5 via R4 as 65002 65003, the two from R6 as 65004. That is why the AS_SET becomes {65002, 65003, 65004} once as-set is added.

The STEPs at a glance

STEPAction on R1What is checkedResultMain evidence
0No aggregationHow the four /24s arrive.0 and .1 best via R4, .2 and .3 best via R6R1 show bgp
1aggregate-addressAttributes of the aggregate; are the components still advertisedEmpty AS_PATH, ATOMIC_AGGREGATE, AGGREGATOR 65001 10.0.0.1, RIB to Null0. Components still advertised. Attributes reach iBGP unchangedR1 show bgp 172.16.0.0/22, pcap No.93 and No.166
2Add summary-onlySuppression of the componentsThe four get s; a WITHDRAW goes to R6R1 show bgp, pcap No.111
3Add as-setSide effects of the AS_SET{65002,65003,65004} appears, ATOMIC_AGGREGATE disappears. R4, R5 and R6 all discard it (reachability kept by the original /24s)R4, R5, R6 show bgp 172.16.0.0/22, pcap No.133
4(Lo2 and Lo3 shut on R6)The AS_SET when components go awayShrinks to 65002 65003; the transient 65002 65003 {65004} is captured. R1 does not advertise it to R4, R5 discards it, only R6 receives itR1 show bgp 172.16.0.0/22, pcap No.160 and No.162
5(Lo2 and Lo3 shut on R5 too)Zero componentsThe aggregate disappears with a WITHDRAW; the configuration staysR1 show bgp, pcap No.187
6Restore loopbacks, remove as-set (final)The form RFC 6472 recommendsATOMIC_AGGREGATE is back and all three accept it. AGGREGATOR unchanged as R4 relays to R5R4 show bgp 172.16.0.0/22, pcap No.208 and R4-R5 No.93

STEP 0: no aggregation

R1’s BGP table holds the four /24s individually.

STEP 0: the BGP table on R1
RP/0/RP0/CPU0:R1#show bgp

Wed Sep  9 09:42:35.140 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000   RD version: 12
BGP main routing table version 12
BGP NSR Initial initsync version 11 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
* i172.16.0.0/24      10.0.0.2                      100      0 65002 65003 i
*>                    10.1.4.4                               0 65002 65003 i
*                     10.1.6.6                               0 65004 65003 i
* i172.16.1.0/24      10.0.0.2                      100      0 65002 65003 i
*>                    10.1.4.4                               0 65002 65003 i
*                     10.1.6.6                               0 65004 65003 i
*> 172.16.2.0/24      10.1.6.6                 0             0 65004 i
*> 172.16.3.0/24      10.1.6.6                 0             0 65004 i
*> 192.168.1.0/24     0.0.0.0                  0         32768 i
*>i192.168.2.0/24     10.0.0.2                 0    100      0 i
*>i192.168.3.0/24     10.0.0.3                 0    100      0 i
* i192.168.4.0/24     10.0.0.2                 0    100      0 65002 i
*>                    10.1.4.4                 0             0 65002 i
*                     10.1.6.6                               0 65004 65003 65002 i
* i192.168.5.0/24     10.0.0.2                      100      0 65002 65003 i
*>                    10.1.4.4                               0 65002 65003 i
*                     10.1.6.6                               0 65004 65003 i
*> 192.168.6.0/24     10.1.6.6                 0             0 65004 i

Processed 10 prefixes, 18 paths

.0 and .1 are best via R4 (65002 65003), .2 and .3 via R6 (65004). For the first pair the path via R6 (65004 65003) ties all the way down to IGP metric. Between eBGP paths that tie this far, IOS XR keeps the best path it already had, so the path via R4, whose session came up first, stays (it does not compare Router IDs unless bgp bestpath compare-routerid is configured). This choice determines the contents of the AS_SET.

STEP 1: create the aggregate with aggregate-address

R1 (AS 65001)
router bgp 65001
 address-family ipv4 unicast
  aggregate-address 172.16.0.0/22
STEP 1: the aggregate R1 generated
RP/0/RP0/CPU0:R1#show bgp 172.16.0.0/22

Wed Sep  9 10:06:29.711 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 14           14
Last Modified: Sep  9 10:04:41.774 for 00:01:48
Paths: (1 available, best #1)
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  Local, (aggregated by 65001 10.0.0.1)
    0.0.0.0 from 0.0.0.0 (10.0.0.1)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, atomic-aggregate, best, group-best
      Received Path ID 0, Local Path ID 1, version 14

(aggregated by 65001 10.0.0.1) is AGGREGATOR and atomic-aggregate is ATOMIC_AGGREGATE. Next Hop 0.0.0.0 and Weight 32768 mark it as a route R1 originated itself, and the RIB points it to Null0.

STEP 1: the RIB on R1
RP/0/RP0/CPU0:R1#show route bgp

Wed Sep  9 10:06:28.343 UTC

B    172.16.0.0/22 [200/0] via 0.0.0.0, 00:01:46, Null0
B    172.16.0.0/24 [20/0] via 10.1.4.4, 00:26:45
B    172.16.1.0/24 [20/0] via 10.1.4.4, 00:26:45
B    172.16.2.0/24 [20/0] via 10.1.6.6, 00:26:45
B    172.16.3.0/24 [20/0] via 10.1.6.6, 00:26:45
B    192.168.2.0/24 [200/0] via 10.0.0.2, 00:26:45
B    192.168.3.0/24 [200/0] via 10.0.0.3, 00:26:45
B    192.168.4.0/24 [20/0] via 10.1.4.4, 00:26:45
B    192.168.5.0/24 [20/0] via 10.1.4.4, 00:26:45
B    192.168.6.0/24 [20/0] via 10.1.6.6, 00:26:45

Without summary-only, R1 advertises both the aggregate and the components to R6.

STEP 1: what R1 advertises to R6
RP/0/RP0/CPU0:R1#show bgp neighbors 10.1.6.6 advertised-routes

Wed Sep  9 10:06:34.085 UTC
Network            Next Hop        From            AS Path
172.16.0.0/22      10.1.6.1        Local Aggregate 65001i
172.16.0.0/24      10.1.6.1        10.1.4.4        65001 65002 65003i
172.16.1.0/24      10.1.6.1        10.1.4.4        65001 65002 65003i
192.168.1.0/24     10.1.6.1        Local           65001i
192.168.2.0/24     10.1.6.1        10.0.0.2        65001i
192.168.3.0/24     10.1.6.1        10.0.0.3        65001i
192.168.4.0/24     10.1.6.1        10.1.4.4        65001 65002i
192.168.5.0/24     10.1.6.1        10.1.4.4        65001 65002 65003i

Processed 8 prefixes, 8 paths

That UPDATE is No.93 in the R1-R6 capture.

No.93 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 67
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 44
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.1.6.1
                IPv4 Address: 10.1.6.1
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: 65001
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 6
            AS Path segment: 65001
                Segment type: AS_SEQUENCE (2)
                Segment length (number of ASN): 1
                AS4: 65001
        Path Attribute - ATOMIC_AGGREGATE
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ATOMIC_AGGREGATE (6)
            Length: 0
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.93 UPDATE)

The AS_PATH is just 65001; neither the components’ 65002 65003 nor 65004 survives. AGGREGATOR has Length: 8 because both ends exchanged the four-octet AS capability.

As seen over iBGP

The iBGP UPDATE to R3 (No.166 in the R1-R3 capture) carries ATOMIC_AGGREGATE and AGGREGATOR unchanged. iBGP adds no AS, so the AS_PATH is empty.

No.166 UPDATE (R1 to R3, iBGP), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 68
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 45
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.0.0.1
                IPv4 Address: 10.0.0.1
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: empty
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 0
        Path Attribute - LOCAL_PREF: 100
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: LOCAL_PREF (5)
            Length: 4
            Local preference: 100
        Path Attribute - ATOMIC_AGGREGATE
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ATOMIC_AGGREGATE (6)
            Length: 0
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.166 UPDATE)

STEP 2: suppress the components with summary-only

R1 (AS 65001)
router bgp 65001
 address-family ipv4 unicast
  no aggregate-address 172.16.0.0/22
  aggregate-address 172.16.0.0/22 summary-only
STEP 2: the BGP table on R1
RP/0/RP0/CPU0:R1#show bgp

Wed Sep  9 10:10:44.459 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000   RD version: 19
BGP main routing table version 19
BGP NSR Initial initsync version 11 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
*> 172.16.0.0/22      0.0.0.0                            32768 i
s i172.16.0.0/24      10.0.0.2                      100      0 65002 65003 i
s>                    10.1.4.4                               0 65002 65003 i
s                     10.1.6.6                               0 65004 65003 i
s i172.16.1.0/24      10.0.0.2                      100      0 65002 65003 i
s>                    10.1.4.4                               0 65002 65003 i
s                     10.1.6.6                               0 65004 65003 i
s i172.16.2.0/24      10.0.0.2                      100      0 65002 65003 65004 i
s                     10.1.4.4                               0 65002 65003 65004 i
s>                    10.1.6.6                 0             0 65004 i
s i172.16.3.0/24      10.0.0.2                      100      0 65002 65003 65004 i
s                     10.1.4.4                               0 65002 65003 65004 i
s>                    10.1.6.6                 0             0 65004 i
*> 192.168.1.0/24     0.0.0.0                  0         32768 i
*>i192.168.2.0/24     10.0.0.2                 0    100      0 i
*>i192.168.3.0/24     10.0.0.3                 0    100      0 i
* i192.168.4.0/24     10.0.0.2                 0    100      0 65002 i
*>                    10.1.4.4                 0             0 65002 i
*                     10.1.6.6                               0 65004 65003 65002 i
* i192.168.5.0/24     10.0.0.2                      100      0 65002 65003 i
*>                    10.1.4.4                               0 65002 65003 i
*                     10.1.6.6                               0 65004 65003 i
*> 192.168.6.0/24     10.1.6.6                 0             0 65004 i

Processed 11 prefixes, 23 paths

The four /24s are now marked s (suppressed). They stay in the table; only their advertisement stops. No.111 is the WITHDRAW R1 sent for the components at the moment of the switch.

No.111 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 31
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 8
    Withdrawn Routes
        172.16.1.0/24
            Withdrawn route prefix length: 24
            Withdrawn prefix: 172.16.1.0
        172.16.0.0/24
            Withdrawn route prefix length: 24
            Withdrawn prefix: 172.16.0.0
    Total Path Attribute Length: 0
Download the pcap of the packet in the tshark output above (No.111 WITHDRAW)

STEP 3: add an AS_SET with as-set

R1 (AS 65001)
router bgp 65001
 address-family ipv4 unicast
  no aggregate-address 172.16.0.0/22 summary-only
  aggregate-address 172.16.0.0/22 as-set summary-only
STEP 3: the aggregate with an AS_SET
RP/0/RP0/CPU0:R1#show bgp 172.16.0.0/22

Wed Sep  9 10:15:54.193 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 21           21
Last Modified: Sep  9 10:14:05.774 for 00:01:48
Paths: (1 available, best #1)
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  {65002,65003,65004}, (aggregated by 65001 10.0.0.1)
    0.0.0.0 from 0.0.0.0 (10.0.0.1)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, best, group-best
      Received Path ID 0, Local Path ID 1, version 21

The AS_PATH is now {65002,65003,65004} and atomic-aggregate is gone. The capture (No.133) shows two segments, an AS_SEQUENCE and an AS_SET.

No.133 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 78
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 55
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.1.6.1
                IPv4 Address: 10.1.6.1
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: 65001 {65002, 65003, 65004}
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 20
            AS Path segment: 65001
                Segment type: AS_SEQUENCE (2)
                Segment length (number of ASN): 1
                AS4: 65001
            AS Path segment: {65002, 65003, 65004}
                Segment type: AS_SET (1)
                Segment length (number of ASN): 3
                AS4: 65002
                AS4: 65003
                AS4: 65004
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.133 UPDATE)

The side effect follows. AS 65002, AS 65003 and AS 65004, all listed in the AS_SET, cannot accept the aggregate.

STEP 3: R4 (AS 65002)
RP/0/RP0/CPU0:R4#show bgp 172.16.0.0/22

Wed Sep  9 10:17:40.415 UTC
%% Network not in table
STEP 3: R5 (AS 65003)
RP/0/RP0/CPU0:R5#show bgp 172.16.0.0/22

Wed Sep  9 10:18:27.589 UTC
%% Network not in table
STEP 3: R6 (AS 65004)
RP/0/RP0/CPU0:R6#show bgp 172.16.0.0/22

Wed Sep  9 10:19:06.961 UTC
%% Network not in table

No.133 proves R1 sent it, so the drop is on the receiving side. A route discarded by loop detection does not appear in received routes either. Reachability is not lost, though: the three ASes exchange the original /24s directly, so all that disappeared is the aggregate AS 65001 created.

STEP 4: fewer components, a different AS_SET

Shut down Loopback2 and Loopback3 on R6, removing 172.16.2.0/24 and 172.16.3.0/24.

R6 (AS 65004)
interface Loopback2
 shutdown
!
interface Loopback3
 shutdown
STEP 4: the aggregate on R1
RP/0/RP0/CPU0:R1#show bgp 172.16.0.0/22

Wed Sep  9 10:21:55.225 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 30           30
Last Modified: Sep  9 10:20:02.774 for 00:01:52
Paths: (1 available, best #1)
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.6.6        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.6.6        
  65002 65003, (aggregated by 65001 10.0.0.1)
    0.0.0.0 from 0.0.0.0 (10.0.0.1)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, best, group-best
      Received Path ID 0, Local Path ID 1, version 30

The AS_SET disappears, leaving a plain AS_SEQUENCE

The AS_PATH changed from {65002,65003,65004} to 65002 65003. Both remaining components carry 65002 65003, and section 9.2.2.2 says that identical AS_PATHs give the aggregate the same AS_PATH.

The capture also holds the transient state on the way there. From STEP 2 onwards R1 holds .2 and .3 via R4 as well (65002 65003 65004), so when the direct routes from R6 vanish first the components are briefly 65002 65003 twice and 65002 65003 65004 twice. The common leading 65002 65003 plus the leftover {65004} produces an UPDATE with 65001 65002 65003 {65004} (No.160). Thirty seconds later the paths via R4 are gone too, giving No.162 without an AS_SET.

No.162 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 72
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 49
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.1.6.1
                IPv4 Address: 10.1.6.1
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: 65001 65002 65003
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 14
            AS Path segment: 65001 65002 65003
                Segment type: AS_SEQUENCE (2)
                Segment length (number of ASN): 3
                AS4: 65001
                AS4: 65002
                AS4: 65003
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.162 UPDATE)

ATOMIC_AGGREGATE is not set. Section 5.1.6 calls for it when dropping the AS_SET excludes ASes, and 65002 65003 contains every AS of the components.

With AS 65002 in the AS_PATH, the advertisement to R4 stops: R4 appears neither in advertised-routes nor among the peers listed in show bgp 172.16.0.0/22. IOS XR does advertise a received route to a peer whose AS is in its AS_PATH (see the R4 → R1 advertisement in BGP (Border Gateway Protocol)), so this is specific to a locally generated aggregate.

STEP 4: what R1 advertises to R4 (no /22)
RP/0/RP0/CPU0:R1#show bgp neighbors 10.1.4.4 advertised-routes

Wed Sep  9 10:22:26.926 UTC
Network            Next Hop        From            AS Path
192.168.1.0/24     10.1.4.1        Local           65001i
192.168.2.0/24     10.1.4.1        10.0.0.2        65001i
192.168.3.0/24     10.1.4.1        10.0.0.3        65001i
192.168.6.0/24     10.1.4.1        10.1.6.6        65001 65004i

Processed 4 prefixes, 4 paths

R6, no longer in the AS_PATH, can accept it now.

STEP 4: the aggregate as R6 receives it
RP/0/RP0/CPU0:R6#show bgp 172.16.0.0/22

Wed Sep  9 10:25:15.552 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 19           19
Last Modified: Sep  9 10:20:32.774 for 00:04:42
Paths: (1 available, best #1)
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.5.6.5        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.5.6.5        
  65001 65002 65003, (aggregated by 65001 10.0.0.1), (received & used)
    10.1.6.1 from 10.1.6.1 (10.0.0.1)
      Origin IGP, localpref 100, valid, external, best, group-best
      Received Path ID 0, Local Path ID 1, version 19
      Origin-AS validity: (disabled)

R6 passes it to R5 as 65004 65001 65002 65003, and R5 (AS 65003) discards it because its own AS is in the path. R6 is the only one of the three that sees the aggregate in this STEP. Losing some of the components changed which ASes the aggregate reaches.

STEP 5: with no components left, the aggregate goes too

Shut down Loopback2 and Loopback3 on R5 as well.

R5 (AS 65003)
interface Loopback2
 shutdown
!
interface Loopback3
 shutdown
STEP 5: the BGP table on R1
RP/0/RP0/CPU0:R1#show bgp

Wed Sep  9 10:28:02.381 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000   RD version: 38
BGP main routing table version 38
BGP NSR Initial initsync version 11 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
*> 192.168.1.0/24     0.0.0.0                  0         32768 i
*>i192.168.2.0/24     10.0.0.2                 0    100      0 i
*>i192.168.3.0/24     10.0.0.3                 0    100      0 i
* i192.168.4.0/24     10.0.0.2                 0    100      0 65002 i
*>                    10.1.4.4                 0             0 65002 i
*                     10.1.6.6                               0 65004 65003 65002 i
* i192.168.5.0/24     10.0.0.2                      100      0 65002 65003 i
*>                    10.1.4.4                               0 65002 65003 i
*                     10.1.6.6                               0 65004 65003 i
*> 192.168.6.0/24     10.1.6.6                 0             0 65004 i

Processed 6 prefixes, 10 paths

172.16.0.0/22 and the four /24s are all gone from the table, and R1 sends R6 a WITHDRAW for the /22 (No.187).

No.187 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 27
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 4
    Withdrawn Routes
        172.16.0.0/22
            Withdrawn route prefix length: 22
            Withdrawn prefix: 172.16.0.0
    Total Path Attribute Length: 0
Download the pcap of the packet in the tshark output above (No.187 WITHDRAW)

The configuration stays in show bgp aggregate-address, and the aggregate returns once a component does.

STEP 5: the aggregate is gone but the configuration remains
RP/0/RP0/CPU0:R1#show bgp aggregate-address

Wed Sep  9 10:28:02.928 UTC

Address-Family: IPv4 Unicast
  Total time spent processing aggregates: 0.0 seconds
  Maximum time taken to process aggregates: 0.0 seconds run on ---
  Total number times we have process aggregates: 8
  172.16.0.0/22
    Last time aggregate was run: Sep  9 10:26:08.485
    Longest time aggregate taken: 0.0 seconds was run on ---
    Total number of runs: 8
    Total time of all runs: 0.0 seconds

STEP 6: remove as-set (final state)

Restore the loopbacks and remove as-set on R1, the form RFC 6472 recommends.

R5 and R6
interface Loopback2
 no shutdown
!
interface Loopback3
 no shutdown
R1 (AS 65001)
router bgp 65001
 address-family ipv4 unicast
  no aggregate-address 172.16.0.0/22 as-set summary-only
  aggregate-address 172.16.0.0/22 summary-only
STEP 6: the aggregate on R1 (final state)
RP/0/RP0/CPU0:R1#show bgp 172.16.0.0/22

Wed Sep  9 10:34:32.736 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 45           45
Last Modified: Sep  9 10:32:30.774 for 00:02:02
Paths: (1 available, best #1)
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to update-groups (with more than one peer):
    0.2 
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.1.4.4        10.1.6.6        
  Local, (aggregated by 65001 10.0.0.1)
    0.0.0.0 from 0.0.0.0 (10.0.0.1)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, atomic-aggregate, best, group-best
      Received Path ID 0, Local Path ID 1, version 45

The AS_SET is gone and atomic-aggregate is back (No.208).

No.208 UPDATE (R1 to R6), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 67
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 44
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.1.6.1
                IPv4 Address: 10.1.6.1
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: 65001
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 6
            AS Path segment: 65001
                Segment type: AS_SEQUENCE (2)
                Segment length (number of ASN): 1
                AS4: 65001
        Path Attribute - ATOMIC_AGGREGATE
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ATOMIC_AGGREGATE (6)
            Length: 0
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.208 UPDATE)

With no local AS in the AS_PATH, R4, R5 and R6 all accept it.

STEP 6: the aggregate as R4 (AS 65002) receives it
RP/0/RP0/CPU0:R4#show bgp 172.16.0.0/22

Wed Sep  9 10:36:20.921 UTC
BGP routing table entry for 172.16.0.0/22
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 30           30
Last Modified: Sep  9 10:32:34.774 for 00:03:46
Paths: (2 available, best #1)
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.4.5.5        
  Path #1: Received by speaker 0
  Advertised IPv4 Unicast paths to peers (in unique update groups):
    10.4.5.5        
  65001, (aggregated by 65001 10.0.0.1), (received & used)
    10.1.4.1 from 10.1.4.1 (10.0.0.1)
      Origin IGP, localpref 100, valid, external, atomic-aggregate, best, group-best
      Received Path ID 0, Local Path ID 1, version 30
      Origin-AS validity: (disabled)
  Path #2: Received by speaker 0
  Not advertised to any peer
  65001, (aggregated by 65001 10.0.0.1), (received & used)
    10.2.4.2 from 10.2.4.2 (10.0.0.2)
      Origin IGP, localpref 100, valid, external, atomic-aggregate
      Received Path ID 0, Local Path ID 0, version 0
      Origin-AS validity: (disabled)

In the UPDATE R4 relays to R5 (No.93 in the R4-R5 capture) 65002 is prepended to the AS_PATH, while ATOMIC_AGGREGATE and AGGREGATOR remain those set by R1.

No.93 UPDATE (R4 to R5), tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 71
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 48
    Path attributes
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
<snip>
            Type Code: MP_REACH_NLRI (14)
            Length: 13
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Unicast (1)
            Next hop: 10.4.5.4
                IPv4 Address: 10.4.5.4
            Number of Subnetwork points of attachment (SNPA): 0
            Network Layer Reachability Information (NLRI)
                172.16.0.0/22
                    MP Reach NLRI prefix length: 22
                    MP Reach NLRI IPv4 prefix: 172.16.0.0
        Path Attribute - ORIGIN: IGP
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ORIGIN (1)
            Length: 1
            Origin: IGP (0)
        Path Attribute - AS_PATH: 65002 65001
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: AS_PATH (2)
            Length: 10
            AS Path segment: 65002 65001
                Segment type: AS_SEQUENCE (2)
                Segment length (number of ASN): 2
                AS4: 65002
                AS4: 65001
        Path Attribute - ATOMIC_AGGREGATE
            Flags: 0x40, Transitive, Well-known, Complete
<snip>
            Type Code: ATOMIC_AGGREGATE (6)
            Length: 0
        Path Attribute - AGGREGATOR: AS: 65001 origin: 10.0.0.1
            Flags: 0xc0, Optional, Transitive, Complete
<snip>
            Type Code: AGGREGATOR (7)
            Length: 8
            Aggregator AS: 65001
            Aggregator origin: 10.0.0.1
Download the pcap of the packet in the tshark output above (No.93 UPDATE)

Summary of the verification

  • Without summary-only the components keep being advertised and the peer’s table does not shrink
  • Do not add as-set. RFC 6472 recommends against it, and on real hardware the ASes that originated the components cannot accept the aggregate
  • The aggregate depends on its components. To advertise it unconditionally, originate a static route to Null0 with a network statement instead

Verification config and show output

Each STEP captures three kinds of file from all six routers. The verification config is the ..._run.txt (final state: STEP 6).

FileContent
..._show.txtshow version / show interface description / show route / show bgp / show bgp aggregate-address / show bgp 172.16.0.0/22 and the four components / show bgp neighbors <peer> advertised-routes, routes, received routes / show bgp update-group / show rpl route-policy
..._log.txtshow logging limited to that STEP (the logmsg marker time passed to show logging start)
..._run.txtshow running-config at that STEP

STEP 0: no aggregation

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 1: aggregate-address 172.16.0.0/22

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 2: summary-only added

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 3: as-set added

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 4: Loopback2 and Loopback3 shut down on R6

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 5: Loopback2 and Loopback3 shut down on R5 as well

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

STEP 6: loopbacks restored and as-set removed (final state)

Routershow outputsyslogrunning-config
R1showlogrun
R2showlogrun
R3showlogrun
R4showlogrun
R5showlogrun
R6showlogrun

Download the full R1-R6 (eBGP) capture

Download the full R1-R3 (iBGP) capture

Download the full R4-R5 (eBGP) capture

References

DocumentTitleSummary
RFC 4271A Border Gateway Protocol 4 (BGP-4)Defines ATOMIC_AGGREGATE and AGGREGATOR (4.3, 5.1.6, 5.1.7) and aggregation (9.1.4, 9.2.2.2)
RFC 6472Recommendation for Not Using AS_SET and AS_CONFED_SET in BGPBCP 172. Recommends not generating new announcements containing AS_SET
RFC 6793BGP Support for Four-Octet Autonomous System (AS) Number SpaceFour-octet AS numbers; the eight-octet AGGREGATOR and AS4_AGGREGATOR
RFC 1930Guidelines for creation, selection, and registration of an Autonomous System (AS)BCP 6. Address assignment with aggregation in mind

Related articles