rotonda icon indicating copy to clipboard operation
rotonda copied to clipboard

feature: query aggregate data over RIB

Open ties opened this issue 9 months ago • 1 comments

Hi,

I have a rotonda instance with a significant amount of data in it. I want to query simple aggregate statistics over the routing tables in there, and I think this may warrant an API endpoint that returns less data (it also does not necessarily need to be json, grpc, arrow flight, etc may be good alternatives).

$ time curl curl -s http://localhost:8080/prefixes/193.0.0.0/20?include=moreSpecifics > /dev/null
real    0m0.341s
user    0m0.004s
sys     0m0.008s
$ curl curl -s http://localhost:8080/prefixes/193.0.0.0/20?include=moreSpecifics | wc -l
388679
$ curl curl -s http://localhost:8080/prefixes/193.0.0.0/20?include=moreSpecifics | jq '.included.moreSpecifics[] | "\(.p
refix) \(.attributes[] | select(.asPath) | .asPath[-1])"' | sort | uniq -c
    386 "193.0.0.0/21 AS3333"
    386 "193.0.10.0/23 AS3333"
    386 "193.0.12.0/23 AS3333"
    430 "193.0.14.0/23 AS25152"
    485 "193.0.14.0/24 AS25152"
    453 "193.0.15.0/24 AS25152"
    419 "193.0.8.0/23 AS197000"
    431 "193.0.8.0/24 AS197000"
    441 "193.0.9.0/24 AS197000"

ties avatar Mar 12 '25 08:03 ties

With the new HTTP API in place in 0.5.0, we can start experimenting with such functionality. I'm specifically thinking the 'function' parameter family on the routes endpoint could be a place to start, e.g. ?function[aggregate]=originAsn.

Could get quite heavy depending on the size of the RIBs.

DRiKE avatar Sep 30 '25 06:09 DRiKE