#aggregate #ip #list #ipv4 #representation #ips #equivalent #minimum

app rs-aggregate

Aggregate a list of IP prefixes into their minimum equivalent representation

1 unstable release

0.2.2 Mar 23, 2023

#467 in Network programming

MIT license

541 lines


rs-aggregate will aggregate an unsorted list of IP prefixes

Intended to be a drop-in replacement for aggregate6 with better performance.

Takes a list of whitespace-separated IPs or IP networks and aggregates them to their minimal representation.

Known discrepancies with aggregate6

  • rs-aggregate accepts subnet and wilcard mask formats in addition to CIDR, ie all these are valid and equivalent:
  • -m/--max-prefixlen supports different maximums for each address family as ipv4,ipv6 format


Performance comparison of rs-aggregate vs aggregate6. A speedup of >100x is achieved on DFZ data.

Full DFZ (1154968 total, 202729 aggregates): dfz perf comparison

IPv4 DFZ (968520 total, 154061 aggregates): ipv4 dfz perf comparison


~118K SLoC