Re: [mirrorbrain] [PATCH] IPv6 support for mod_asn - Apparently a very low hanging fruit.

From: Peter Pml <>
Date: Wed, 10 Jun 2015 13:51:06 +0200

great patches! 

More inline below.

On Fri, May 08, 2015 at 08:43:13 +0200, Michael Meier wrote:
> > With the adoption of IPv6 for more and more end user connections I believe it's
> > necessary that mod_asn is also able to match IPv6 addresses to their AS and get
> > the users to the closest IPv6-enabled mirror possible.
> > [...]
> > as you can see it works just as it should, giving back the correct order, IPv4
> > and IPv6 prefixes in harmony !
> I played around with your incredibly small patches today, and it really
> does seem to work very well. It really is a very low hanging fruit.
> > The only piece to the IPv6 puzzle that is missing to me at least, is a good
> > source for the IPv6 prefixes <-> AS list in plain just like there is with
> > for IPv4. If someone has BGP full-table running on
> > maybe a looking glass router one can simply get it from there, but that is of
> > course not something for everyone. So this needs some thought and then the
> > appropriate addition to the provided script to gather the data and put it into
> > the database.
> While there are no textual dumps available for IPv6, there is really no
> lack of binary dumps. For example, ripe offers quite a few on
> But since mirrorbrain already uses
> data for IPv4, I used their IPv6 data for my tests.
> Unfortunately, there is no "current" symlink as with the IPv4 text data,
> so you need to construct the right filename depending on the current
> date (and maybe time) yourself. For example, the data i used was
> So generally,
> They offer dumps every two hours, but for mirrorbrain use just taking a
> random one from the last week should be perfectly fine.
> The command-sequence I used then was:
> > bzcat rib.20150508.0000.bz2 | ./ | ./ > /tmp/v6routedump.dat
> > asn_get_routeviews > /tmp/v4routedump.dat
> > cat /tmp/v6routedump.dat /tmp/v4routedump.dat |
> The helper tools used in this and the slightly modified version of
> that I used can be found in
> While this works, it could need some more streamlining, e.g.:
> - providing a download-tool like for the IPv4 data
> - providing a mirror of the data used on
> - install the new helper tool(s) in packaging
> - perhaps merging it all together into
> It would really be nice if this could be integrated into mirrorbrain.

That's all great. I'm only struggling to package it in "digestible"
form, so the existing users don't run into problems. Unfortunately, the
old mod_asn SQL query doesn't work with the new database schema.
I think I might add the new column alongside the old one first and
duplicate the data, so that mod_asn can continue running until it's updated
as well. 

This database upgrade could be integrated into the mb tool, where there
already is some logic for things like that.. 

Regarding the import machinery, there's quite a zoo of scripts now... it
would be nice to have something more integrated, but it's not trivial to
rewrite everything, and why not use what's there (and what works)... however, at least
some kind of wrapper would be nice to hide the mess below it, and to
ease admministration. Maybe also wrapped into the mb tool. 

So, I have not managed to integrate your patches so easily yet, but I'm
slowly getting there.

> While I'm at it, I also have a small documentation fix at
> This should be trivial to merge, it simply adapts the documentation to
> non-ancient postgresql-versions.

Excellent! Merged. Thanks.


mirrorbrain mailing list

Note: To remove yourself from this mailing list, send a mail with the content
to the address
Received on Wed Jun 10 2015 - 11:51:19 GMT

This archive was generated by hypermail 2.3.0 : Tue Jun 16 2015 - 01:32:05 GMT