GEOIP.NETWORK
Accurate, open source IP-based localisation
Tim Armstrong reveals GeoIP.Network, an open source IP address localisation solution using Python that’s better than what went before!
Part One!
Don’t miss next issue, subscribe on page 16!
OUR EXPERT
Tim Armstrong is a former lead engineer turned developer advocate specialising in networking, software development and security.
QUICK TIP
Internet governance organisations like the RIPE NCC, ISOC and the IETF provide and support a wide range of open source, research, and open-data projects. If you need a project for CS class start here.
Being able to reliably identify the physical location of an IP address is an important element for a lot of online activities. From ecommerce stores needing to calculate the correct sales taxes (or import regulations) to detecting fake social media accounts, knowing where visitors to your website are coming from is all vital information.
Whatever your reasons, you’re left with two questions: how do you find out this information from an IP address; and can you trust the accuracy of the source? Most GeoIP (the industry jargon) services are slow at updating their databases, and are incredibly secretive about how they get their information.
While some providers (like Maxmind) enable you to download a version of its database periodically, this tends to be its least accurate data and is rarely updated. Its goal is to push users to its API products that it claims to be significantly more accurate than its free offering. While the competition in this space is improving, and the prices of such services are coming down, an ongoing independent study out of the Technical University of Munich (TUM) has shown that these commercial databases are up to 63 per cent incorrect. GeoIP.Network takes a different approach to IP localisation. It’s 100 per cent open source, and is so transparent about how it collects its data that this tutorial will even guide you through of the fundamentals. This means that if there’s an error in the data or the code then it can be corrected far more easily.
In this tutorial, you’ll learn the basics of how GeoIP. Network works and how to use the free public access API to generate a map of visitors for your website.
Mapping to locations
In broad strokes, GeoIP.Network follows a similar approach to the research being done at TUM, and uses a “hints-based” algorithm to bootstrap the database. From there it uses measurements from thousands of probes spread all over the globe to refine the results. The “hints” are made up of publicly available primary data sources such as the IRR (International Routing Registry) which is a large database maintained by ISPs all around the world.