TTR Networks

Intermediate · IRR, RPSL and AS-SETs · section 5 of 8

AS-SETs and expansion

✓ Lab-tested 17 October 2026 on IRRd 4.5.3, bgpq4 1.9, PostgreSQL 16, Redis 7

An as-set groups ASNs. Its usual job is to describe a customer cone: a network plus everything it provides transit for. When AS64500 tells its upstream "build my filter from AS64500:AS-CUSTOMERS", the upstream expands that set to ASNs, then collects every route object those ASNs originate.

Members

  • members: lists ASNs and other as-sets, so sets nest. A transit's set includes each customer's set, which includes their customers' sets, and so on.
  • mbrs-by-ref: lets members join from their own side: any aut-num with member-of: <this set> is included, if it is maintained by a maintainer listed in mbrs-by-ref (or the list is ANY).

Naming

  • Flat names like AS-EXAMPLE are a single global namespace across every IRR source. Two unrelated networks can create AS-EXAMPLE in RADb and in RIPE, and tools may merge or confuse them.
  • Hierarchical names like AS64500:AS-CUSTOMERS start with the owner's ASN. In an authoritative IRR, only the holder of AS64500 can create sets under that prefix. Prefer hierarchical names.

Expansion is where things go wrong

Expansion is recursive, so a single bad member pulls in everything below it:

  • Set bloat: a customer adds their upstream's set (or a large IXP's) to their own. Expanding it now yields thousands of ASNs, and your "customer filter" accepts much of the internet.
  • Loops: set A includes B, and B includes A. Good tools detect this and stop.
  • Stale members: a customer that left years ago is still in the set, along with its route objects.

Try it below.

A hierarchical as-set
as-set:         AS64500:AS-CUSTOMERS
descr:          AS64500 and its customer cone
members:        AS64500
members:        AS64501:AS-CUSTOMERS
mbrs-by-ref:    EXAMPLE-MNT
admin-c:        EX123-RIPE
tech-c:         EX123-RIPE
mnt-by:         EXAMPLE-MNT
source:         RIPE
  • Line 1: Hierarchical name: only the holder of AS64500 can create sets under AS64500: in an authoritative IRR.
  • Lines 3–4: Ourselves, plus our customer's own set. Nesting their set means their new customers are picked up automatically.
  • Line 5: Also include any aut-num with member-of: AS64500:AS-CUSTOMERS that is maintained by EXAMPLE-MNT.

Interactive: AS-SET expander Edit the objects and watch the expansion and the generated filter update. Try: (1) add AS64496:AS-ALL to the members of AS64501:AS-CUSTOMERS (set bloat); (2) add AS64500:AS-CUSTOMERS to AS64501:AS-CUSTOMERS (a loop); (3) change AS64504's mnt-by and see it drop out. (needs JavaScript)

Check your understanding

After a customer edits their as-set, your generated filter for them grows from 12 prefixes to 85,000. What most likely happened?

  • They gained thousands of new customers overnight
  • They added an upstream's or IXP's as-set to their own (set bloat)
  • An as-set loop
  • Their maintainer was deleted