Grouping IP Addresses based on ranges [on hold]
- by mustard
Say I have 5 different categories based on IP Address ranges for monitoring user base. What is the best way to categorize a list of input IP addresses into one of the 5 categories depending on which range it falls into? Would sorting using a segment tree structure be efficient?
Specifically - I'm looking to see if there are more efficient ways to sort IP addresses into groups or ranges than using a segment sort.
Example:
I have a list of IP address ranges per country from http://dev.maxmind.com/geoip/legacy/geolite/
I am trying to group incoming user requests on a website per country for demographic analysis. My current approach is to use a segment tree structure for the IP address ranges and use lookups based on the structure to identify which range a given ip address belongs to. I would like to know if there is a better way of accomplishing this.