aggregate6 - a fast versatile prefix list compressor

Job Snijders job at ntt.net
Thu Nov 30 20:07:49 CST 2017


Dear NANOG,

I re-implemented the venerable 'aggregate' tool (by Joe Abley & co) in
python under the name of 'aggregate6'. The 'aggregate6' tool is faster
and also has IPv6 support.

    https://github.com/job/aggregate6

Installation is can be done through 'pip', or your operating system's
package manager (if they carry the 'aggregate6' tool). 

    $ pip install aggregate6

Example use:

	$ echo 10.0.0.0/16 10.0.0.0/24 2000::/4 3000::/4 | aggregate6
	10.0.0.0/16
	2000::/3

Note that 'aggregate6' can also be imported as module in your own python
project:

	>>> import from aggregate6 import aggregate
	>>> aggregate(["10.0.0.0/8", "10.0.0.0/24"])
	['10.0.0.0/8']
	>>>

Related to the above example, NTT uses 'aggregate6' as library in their
network automation toolchain to help compress firewall rules.

When using a dump from the IPv4 Default-Free Zone, it appears that
'aggregate6' can deaggregate that list ~ 50 times faster than
'aggregate'. However the tradeoff is that 'aggregate6' uses a bit more
memory.

Aggregate6 has been tested with pypy, python2 and python3; and can be
used both from the command line or as python module. Aggregate6 is
published under the 2-Clause BSD license.

Kind regards,

Job


More information about the NANOG mailing list