|Do you know where your variables are?|
Re^2: Algorithom to find overlaping subnets (Internet IPv4)by chrestomanci (Priest)
|on Sep 20, 2011 at 13:47 UTC||Need Help??|
Thanks for your informative reply.
If I had know that mod::Net::IPTrie or mod::Tree::Trie existed I would have use them, unfortunately I did not know they existed and did not know the terminology to search for them on CPAN, and I thought it would take to long to implement something myself.
Instead I wrote some code using string representations of the binary bits in a database using DBIx::Class.
My DBIC table defintion looks like this:
Once I have populated the table of subnets, I then search it like this:
Using this algorithm I was able to search through the 50_000 subnets searching for overlaps in about 10 minutes. (On a 3GHz Linux box).