Skip to content

Safari77/raggre46

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raggre

raggre Aggregate IPv4 network addresses.

Since v0.5.0 raggre4 and raggre6 are combined into raggre.

This is a rust program. Dependencies: clap. Random IP generators ruran4 and ruran6 require rand. libc is used to handle SIGPIPE.

By default IP addresses are accepted if /nn network specified is invalid; for example 1.4.5.6/16 is accepted and processed as 1.4.0.0/16; if you wish to ignore them, use parameter --ignore-invalid, then such addresses are silently ignored.

This program may or may not be suitable for your use case, feel free to read the code and make a pull request. https://github.com/Safari77/raggre46

benchmark of this program raggre4
    vs
CIDR network aggregation and filtering - Horms, at verge.net.au, v1.0.2 (C code)
    vs
ISC aggregate 1.6, coded by a committee? (C code)
    vs
aggregate6 1.0.14 by Job Snijders (Python)
$ wc -l shuf4.txt
200000 shuf4.txt

$ time ./raggre4 < shuf4.txt | sha256sum
af202604d655dd1af52d97c63fe9eddb748775526b9269ec6ebcfc9824f5c49c  -

real    0m0,058s
user    0m0,027s
sys     0m0,065s

$ time verge-aggregate < shuf4.txt | sha256sum
af202604d655dd1af52d97c63fe9eddb748775526b9269ec6ebcfc9824f5c49c  -

real    0m3,956s
user    0m3,935s
sys     0m0,006s

$ time aggregate -m32 < shuf4.txt > out4_isc.txt
aggregate: maximum prefix length permitted will be 32

real    5m53,334s
user    5m52,841s
sys     0m0,028s
$ sha256sum out4_isc.txt
af202604d655dd1af52d97c63fe9eddb748775526b9269ec6ebcfc9824f5c49c  out4_isc.txt

$ time aggregate6 < shuf4.txt | sha256sum
af202604d655dd1af52d97c63fe9eddb748775526b9269ec6ebcfc9824f5c49c  -

real	0m2,519s
user	0m2,442s
sys	0m0,076s

$ calc 352.841/0.027
    ~13068.18518518518518518518518518518518518518518518518519
$

About

high performance rust applications to aggregate ipv4 and ipv6 netblocks

Resources

License

Stars

Watchers

Forks

Contributors