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.
| Goal | What it means |
|---|---|
| Keep tables small | Four routes become one |
| Hide churn from the outside | As 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.
| Attribute | RFC 4271 section 4.3 | Meaning |
|---|---|---|
ATOMIC_AGGREGATE | Type 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) |
AGGREGATOR | Type code 7, optional transitive | The 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 effect | What happens |
|---|---|
| An AS in the AS_SET cannot accept the route | Loop detection discards a route whose AS_PATH contains the local AS, and the AS_SET members count |
| It is rewritten whenever the components change | Each change to the AS_SET sends an UPDATE, eroding the “hide churn” benefit |
| It describes a path that does not exist | The 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
router bgp 65001
address-family ipv4 unicast
aggregate-address 172.16.0.0/22 as-set summary-only route-policy <name>| Option | Meaning |
|---|---|
| none | Generate the aggregate. The components keep being advertised as well |
summary-only | Suppress the components and advertise only the aggregate |
as-set | Put an AS_SET in the AS_PATH (normally not used) |
route-policy | Set attributes on the aggregate |
| Behaviour | Detail |
|---|---|
| When it exists | Only 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 |
| RIB | On the aggregating router it points to Null0, so non-existent destinations inside the range are not forwarded via a default route |
ORIGIN | Section 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.
- 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/24and.1.0/24, R6 advertises.2.0/24and.3.0/24, vianetworkstatements - R1 aggregates with
aggregate-address 172.16.0.0/22. Outbound eBGP policies are named per neighbour and contain onlypass
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
| STEP | Action on R1 | What is checked | Result | Main evidence |
|---|---|---|---|---|
| 0 | No aggregation | How the four /24s arrive | .0 and .1 best via R4, .2 and .3 best via R6 | R1 show bgp |
| 1 | aggregate-address | Attributes of the aggregate; are the components still advertised | Empty AS_PATH, ATOMIC_AGGREGATE, AGGREGATOR 65001 10.0.0.1, RIB to Null0. Components still advertised. Attributes reach iBGP unchanged | R1 show bgp 172.16.0.0/22, pcap No.93 and No.166 |
| 2 | Add summary-only | Suppression of the components | The four get s; a WITHDRAW goes to R6 | R1 show bgp, pcap No.111 |
| 3 | Add as-set | Side 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 away | Shrinks to 65002 65003; the transient 65002 65003 {65004} is captured. R1 does not advertise it to R4, R5 discards it, only R6 receives it | R1 show bgp 172.16.0.0/22, pcap No.160 and No.162 |
| 5 | (Lo2 and Lo3 shut on R5 too) | Zero components | The aggregate disappears with a WITHDRAW; the configuration stays | R1 show bgp, pcap No.187 |
| 6 | Restore loopbacks, remove as-set (final) | The form RFC 6472 recommends | ATOMIC_AGGREGATE is back and all three accept it. AGGREGATOR unchanged as R4 relays to R5 | R4 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.
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
router bgp 65001
address-family ipv4 unicast
aggregate-address 172.16.0.0/22RP/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.
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:45Without summary-only, R1 advertises both the aggregate and the components 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 pathsThat UPDATE is No.93 in the R1-R6 capture.
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.1The 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.
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.1STEP 2: suppress the components with summary-only
router bgp 65001
address-family ipv4 unicast
no aggregate-address 172.16.0.0/22
aggregate-address 172.16.0.0/22 summary-onlyRP/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 pathsThe 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.
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: 0STEP 3: add an AS_SET with as-set
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-onlyRP/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 21The 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.
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.1The side effect follows. AS 65002, AS 65003 and AS 65004, all listed in the AS_SET, cannot accept the aggregate.
RP/0/RP0/CPU0:R4#show bgp 172.16.0.0/22
Wed Sep 9 10:17:40.415 UTC
%% Network not in tableRP/0/RP0/CPU0:R5#show bgp 172.16.0.0/22
Wed Sep 9 10:18:27.589 UTC
%% Network not in tableRP/0/RP0/CPU0:R6#show bgp 172.16.0.0/22
Wed Sep 9 10:19:06.961 UTC
%% Network not in tableNo.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.
interface Loopback2
shutdown
!
interface Loopback3
shutdownRP/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 30The 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.
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.1ATOMIC_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.
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 pathsR6, no longer in the AS_PATH, can accept it now.
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.
interface Loopback2
shutdown
!
interface Loopback3
shutdownRP/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 paths172.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).
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: 0The configuration stays in show bgp aggregate-address, and the aggregate returns once a component does.
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 secondsSTEP 6: remove as-set (final state)
Restore the loopbacks and remove as-set on R1, the form RFC 6472 recommends.
interface Loopback2
no shutdown
!
interface Loopback3
no shutdownrouter 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-onlyRP/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 45The AS_SET is gone and atomic-aggregate is back (No.208).
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.1With no local AS in the AS_PATH, R4, R5 and R6 all accept 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.
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.1Summary of the verification
- Without
summary-onlythe 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
Null0with anetworkstatement 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).
| File | Content |
|---|---|
..._show.txt | show 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.txt | show logging limited to that STEP (the logmsg marker time passed to show logging start) |
..._run.txt | show running-config at that STEP |
STEP 0: no aggregation
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 1: aggregate-address 172.16.0.0/22
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 2: summary-only added
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 3: as-set added
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 4: Loopback2 and Loopback3 shut down on R6
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 5: Loopback2 and Loopback3 shut down on R5 as well
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
STEP 6: loopbacks restored and as-set removed (final state)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R5 | show | log | run |
| R6 | show | log | run |
Download the full R1-R6 (eBGP) capture
Download the full R1-R3 (iBGP) capture
Download the full R4-R5 (eBGP) capture
References
| Document | Title | Summary |
|---|---|---|
| RFC 4271 | A 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 6472 | Recommendation for Not Using AS_SET and AS_CONFED_SET in BGP | BCP 172. Recommends not generating new announcements containing AS_SET |
| RFC 6793 | BGP Support for Four-Octet Autonomous System (AS) Number Space | Four-octet AS numbers; the eight-octet AGGREGATOR and AS4_AGGREGATOR |
| RFC 1930 | Guidelines for creation, selection, and registration of an Autonomous System (AS) | BCP 6. Address assignment with aggregation in mind |
Related articles
- BGP (Border Gateway Protocol)
- BGP Messages
- BGP Neighbor States
- iBGP and eBGP
- BGP next-hop-self
- BGP Route Reflector
- BGP Path Attributes and Best Path Selection
- BGP ORIGIN Attribute
- BGP AS_PATH Attribute
- BGP NEXT_HOP Attribute
- BGP LOCAL_PREF Attribute
- BGP MED Attribute
- BGP WEIGHT Attribute
- BGP COMMUNITY Attribute
- BGP Route Aggregation (aggregate-address)
- MP-BGP (Multiprotocol Extensions)
- BGP Extended Community