How does IP geolocating work?

29,262

Solution 1

Mapping IP addresses to geolocations is done via tables, where an IP maps to a particular location. This location, however, doesn't need to be accurate, since IP addresses don't carry any information about their locations, these are approximated.

From Wikipedia's article on Internet geolocation:

The primary source for IP address data is the regional Internet registries which allocate and distribute IP addresses amongst organizations located in their respective service regions:

  • African Network Information Centre (AfriNIC)
  • American Registry for Internet Numbers (ARIN)
  • Asia-Pacific Network Information Centre (APNIC)
  • Latin American and Caribbean Internet Address Registry (LACNIC)
  • RIPE Network Coordination Centre (RIPE NCC)

Secondary sources include:

  • Data mining or user-submitted geographic location data:
    • Website-submitted, e.g. a weather website asking visitors for a city name to find their local forecast or pairing a user's IP address with the address information in their account profile.
    • Wi-Fi positioning system through the examination of neighborhood Wi-Fi BSSID. E.g. Mozilla Location Service.
    • Examination of neighborhood Bluetooth devices.
    • Pairing a user's IP address with the GPS location of a device that's using such an IP address.
  • Data contributed by Internet service providers.
  • Guesstimates from adjacent Class C range and/or gleaned from network hops.
  • Network routing information collected to the end point of IP address.
  • Analysis of linguistic data from the device, using pretrained models that show that some term is frequently mentioned in a certain location (e.g. "the T" vs "the El" vs. "the subway").

Accuracy is improved by:

  • Data scrubbing to filter out or identify anomalies.
  • Statistical analysis of user submitted data.
  • Utilizing third-party tests conducted by reputable organizations.

Solution 2

As I understand it, IP subnets are assigned to the providers upstream of your service providers - each IP range is therefore flagged as being within the country of origin of that provider, so each IP within that range is assumed to be within that country.

This is not foolproof - we previously had satellite broadband provided to us (in the UK) by a Belgian provider. Each time we googled anything, we'd be offered to see only pages within Belgium.

Solution 3

There are a number of organizations that manage the allocation of IP addresses, such as the American Registry of Internet Numbers (ARIN). These organizations maintain master lists of allocated IP address blocks and where they are allocated to, and publish updated lists frequently.

Geolocation software takes full advantage of these lists and provides quick methods of mapping IP addresses to countries. Generally commercial products will strive for more accuracy and utilize other data sources as well.

Check out the Geolocation Software article on wikipedia for some interesting links on the topic.

Solution 4

There's in the internet infrastructure something called an Autonomous System, defintion here

Each provider has been assigned at least one of these. An AS has a unique ASN (Autonomous System Number), within that AS one can have networks (WAN & LAN).

These are assigned to providers, which off course have a location, so the routing protocols know by the ASN what zone they're in.

Using WHOIS services one can determine who an IP address belongs to, as most of us are assigned an IP address by our provider when going online, on WHOIS, you'll mostly find the town of the provider you're in. But WHOIS a website, you'll find it's owner, so Geolocation uses that service a lot.

Solution 5

For a quick start into geolocation, open a command line and enter tracert stackoverflow.com and pay close attention to the results. Mostly, the first few lines already give away important hints about your location.

Share:
29,262

Related videos on Youtube

weicool
Author by

weicool

Updated on August 12, 2020

Comments

  • weicool
    weicool over 3 years

    I'm not looking for a service that does this. I'm just curious as to how geolocation works.