I'm working on conceiving a project that will track IP addresses, their usage (assignment) and also be able to show/view free/open space inside of blocks
I'll be working with both IPv4 and v6 addressing
For arguments sake lets say I'm working with:
v4: /24 /23 /22 /21 /20 /19 /18
v6: /32
one of each
so thats 32512 ipv4 addresses and 79228162514264337593543950336 ipv6 addresses
yea, alot
i'm going to be back-filling the db with all existing assignments... now this is where I was hoping for some suggestions b/c depending on which database I use determines if I save the data in a cidr/inet field or (as suggested by a friend) a 32 bit unsigned int and an integer field for the cidr mask
at the moment i havent decided on which db to use but i'm thinking either postgres or mysql
postgres has a some nice data types (inet, cidr) that natively handle these and some basic functions to do calculation... but based on my limited tests I dont see it really out-winning mysql (speed, etc)
the quick jist of this (lets use two tables for simplicity sake)
one table "netBlock" will hold the ranges assigned by ARIN...
one table "netBlocks" will hold the sliced ranges that are assigned to customers (using a identifying key that relates to another table(s))
the main goal I need to accomplish here is to aggregate all the used (active) assigned ranges subtract them from the ARIN assignments and then be able to report back whats available/free...
again for simplicity sake lets say whatever is free can be sliced into /29's or /30's in the event of a "remainder"...or even just an integer... just so long as the free number can be correlated to within its encompassing /24 thats fine
now, i was hoping to task the database to do much of this work and hence my original look towards postgres, but, if postgres cant do more than basic math then I might as well just use mysql and then move on to my next quest, figuring out how to code this up logically
so, thats the idea and my thought process... any input, ideas or suggestions would be greatly appreciated