Page 1 of 1

New IP addresses geolocation tools and database

Posted: Wed Feb 11, 2009 8:00 pm
by marchost
-MySQL database of world IP addresses with geolocation that can be used with PHP
-HTTP IP address geolocation API
-Full list of IP from specific countries


http://blogama.org/node/58

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 7:35 am
by josh
What makes this different then the 100s of other services that do the same thing? If your entire database is calculated from a formula why not make it a function instead of requiring people to download a 1million+ record database?

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 8:47 am
by VladSun
josh wrote:If your entire database is calculated from a formula why not make it a function instead of requiring people to download a 1million+ record database?
Did you read it?
They are just searching by network subnet, not by IP:
whois 68.142.196.63

OrgName: Inktomi Corporation
OrgID: INKT
Address: 701 First Ave
City: Sunnyvale
StateProv: CA
PostalCode: 94089
Country: US

NetRange: 68.142.192.0 - 68.142.255.255
CIDR: 68.142.192.0/18

...

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 9:00 am
by marchost
Of course there is +100 site offering ip geolocation BUT whats different here :

1)IP CIDR by country like 4.0.0.0/8 -> US (only 60 thousand possibility instead of 12 millions if you go by IP)

2)Not all IP are listed in the database. Only 10% of actual IP address, they are groupe in subnet like the previous guy said but you get a result for ANY ip.

3)API to generate BY COUNTRY blocklist or whatever you might think of

4)The full database source is available either for city or country precision.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 9:07 am
by josh
VladSun wrote: Did you read it?
They are just searching by network subnet, not by IP:
The subnet is a subset of the IP. He said he's using a formula to calculate the database.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 9:08 am
by marchost
I get data for ALL IP.

If I see that 123.123.123.X to 123.123.199.X is located at the same place, I only store it once for obvious reasons.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 9:17 am
by marchost
There is 2 different table in the database :

ip_group_city -> city precision, around 1.2million IP

ip_group_country -> country precision, around 60 thousand subnet

For country based example with Afganistan and Argentina, goto (view source if they all appear on the same line) :

http://blogama.org/country_query.php?country=AF,AR

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 9:21 am
by josh
Sorry I misread, the formula is for hashing the IPs.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 12:55 pm
by VladSun
josh wrote:
VladSun wrote: Did you read it?
They are just searching by network subnet, not by IP:
The subnet is a subset of the IP. He said he's using a formula to calculate the database.
Most people use "IP" for "IP address" not for "IP protocol". Also, the topic suggests it ...
So, IP is an element of a IP set called "subnet".

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 12:59 pm
by VladSun
josh wrote:Sorry I misread, the formula is for hashing the IPs.
This is the normal, machine presentation of the IP. (PHP functions: ip2long(), long2ip() )
The format XXX.XXX.XXX.XXX is for humans.

No hashing involved here - hashing suggests there will be possible collisions, but you can't find even a single possibility here ;)

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 1:02 pm
by VladSun
josh wrote:What makes this different then the 100s of other services that do the same thing?
I really can't understand your criticism in this thread - the more providers of this service we have, the better choice we will have.

@marchost

Congratulations! Keep the service running and free :)
Best regards, Vladimir.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 1:18 pm
by josh
I said I misread it, what more you want me to say? And I was debating pointing it out but:

"Hash functions are related to (and often confused with) checksums, check digits, fingerprints, randomizing functions, error correcting codes, and cryptographic hash functions. Although these concepts overlap to some extent, each has its own uses and requirements. "

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 1:27 pm
by VladSun
Did I debate your "Sorry I misread it" part of you post - I really don't think so!
I don't want our discussions to become personal battles. If you reread my posts in this thread you will see that I was trying to be objective...

For hashing:
a set of all possible values for a hash (it doesn't depend on what it is used for) is always smaller (and usually limited) than the set of all posible values to be hashed. That's why collisions are to be possible and expected.

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 1:37 pm
by josh
Thatd be a checksum I believe, does it matter though?

Re: New IP addresses geolocation tools and database

Posted: Thu Feb 12, 2009 1:45 pm
by VladSun
http://en.wikipedia.org/wiki/Hash_function
A hash function is any well-defined procedure or mathematical function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index into an array. The values returned by a hash function are called hash values, hash codes, hash sums, or simply hashes.
http://en.wikipedia.org/wiki/Checksum
A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data
http://en.wikipedia.org/wiki/Fingerprint_(computing)
In computer science, a fingerprinting algorithm is a procedure that maps an arbitrarily large data item (such as a computer file) to a much shorter bit string, its fingerprint, that uniquely identifies the original data for all practical purposes
...

I just pointed out that ip2long() is not a hash function. For every X argument it produces a Y value and there are no two or more values of X that will produce the same value of Y - so, no collisions.

I even don't know where this "hash" word came from in this topic.