diff --git a/README.md b/README.md index c6da3ce..7542daa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ +[[_TOC_]] # plag -Tools to optimize a list of IP (v4 or v6) prefixes. +Plag is a couple of tools to optimize a list of IP (v4 or v6) prefixes. The tools read prefix list on stdin and output the result to stdout. - plagmax - returns a minimal superset of prefixes (loose mode) @@ -57,7 +58,7 @@ Output: 10.0.2.1/32 ``` -## Building +# Building You will need only a C compiler and a standard library to build the tools. A simple `make` run should do the job. @@ -69,7 +70,7 @@ gcc -O3 -o plagmax plagmax.c lib.o gcc -O3 -o plageq plageq.c lib.o ``` -## Running +# Running The tools read stdin where they expect IP prefixes one per line. Prefixes are of the standard form: `[/]`. @@ -86,8 +87,8 @@ This matches all prefixes, having masks in range ``-`` In case ` = = ` the submasks part is omitted. This notation of submasks is used in `bird` routing daemon. -You can use `bgpq4` tool for example to fetch the list of prefixes -and pipe its output to the tools: +You can use [bgpq4](https://github.com/bgp/bgpq4) tool for example +to fetch the list of prefixes and pipe its output to the tools: ```bash bgpq4 -4 -F '%n/%l\n' as-set-name | ./plageq > as-set-name.ipv4.strict.txt @@ -95,3 +96,54 @@ bgpq4 -6 -F '%n/%l\n' as-set-name | ./plagmax > as-set-name.ipv6.loose.txt ``` Tools also output to stderr some statistics of using preallocated memory. + +# Benchmarks + +Here are some performance tests. You can see how effective and fast +the tools are. The times are not throughly measured, so take it as indicative +only. The tools have also been compared with the analogous functions of +[bgpq4](https://github.com/bgp/bgpq4) tool. +It also aggregates and does it amost as fast, and almost as good. +But still its aggregation is not perfect. + +Test sets: + + - ripe{4,6}: route attributes from route objects in the RIPE DB (unsorted) + - radb{4,6}: route attributes from route objects in the RADB (unsorted) + - ntt{4,6}: AS2914:AS-GLOBAL snapshot taken with bgpq4 (sorted) + +Test cases (for bgpq4 a local cache of the real response is used): + + - uniq: `sort -u