I'm not looking for a service that does this. I'm just curious as to how geolocation works.
相关问题
- How to transform IP addresses into geolocation in
- Location not updating on server when app enters st
- Mapbox 'setMyLocationEnabled' doesn't
- react native ios: geoloc has poor accuracy by defa
- Google Maps API v3 Geolocation not working in Goog
相关文章
- curl: (3) Illegal characters found in URL
- Implementing Triangulation in android [closed]
- Google maps Android API getting wifi location
- Is it possible to retrive an existing iPhone image
- Getting user location on Facebook page tab
- Find all nearby customers within a given distance
- Efficient way to calculate geographic density in P
- Javascript Function - Convert Geolocation Code to
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.
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.
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.
Basically they guess based on the IP address. somewhere they have a list of ip-address ranges and locations. which they maintain based on lookups against whois, traceroute, and/or user feedback.
MaxMind for instance seems to rely mostly on user feedback to keep its lists current.
People use VPNs amt Proxies to get around IP baes geoblocking. and sometimes the table just have wrong data.
If you want somtjhing that's cheap and mostly works and aren't worried about alienating your users it;s a good solution. don't expect better than 99% of results to be within 2000 miles of the actual user location.
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.Mapping IP addresses to geolocations is done via tables, where an IP maps to a particular location. This location, however, does't need to be accurate, since IP addresses don't carry any information about their locations, these are approximated.
From http://en.wikipedia.org/wiki/Geolocation_software: