I have a large number (millions) of IP ranges which might overlap. An IP range should contain the start IP, stop IP and an range id. How can I efficiently find which ranges contain a given IP?
I could iterate over all the ranges and check for every range if it contains the IP, but I'm looking for a complexity better than O(n).