IP Address mapping

Status
Not open for further replies.
I wrote the following php script to help myself comply with US law regarding export of encryption software:

http://24.5.29.77:10080/encryption/index.phps

It uses a perl script that querries whois to attempt to get the country that an IP address is coming from.

That's not terribly accurate (it thinks my IP address is in the Netherlands- because that's where @home apparently registered that block) and its incredibly slow, because after the file is requested by the user, my server has to make a whois request and get a response before it can continue.

I have been looking for a database I can install on my server that I can querry, instead of having to use whois. Only ones I find are big $$$ commercial subscriptions.

Anyhow, this got me thinking- this would be a good application for distributed computing-

different computers run traceroute on various IP addresses to try to get the actual country location of the IP address, and send the results to a central system which inserts them into a database.

Obviously, not every IP in the world would need to be in the database- it would be pretty easy to figure out what subnets have been subdivided and what have not.

This database could then be made freely available either to those who run the client to help continuously map the internet (and it is a continual process as subnets sometimes move) or (preferably) free for anyone.

The applications such a database could have are huge-
detection of fraud, providing prices to customers in proper currency, compliance with law regarding who can download what, etc.

Is a distributed mapping of the internet project already in place?
If not, any takers?
 
Originally posted by IronBits:
I might be interested

DP - can you do this on dBestern in SQL or MySQL ?

Hat - what do you think ? Worth the efforts ?

It could be done, but I'm not quite sure as to why... Is this just so that there is a database of hostnames attached to IPs? If so, a script would have to run at least daily, since the hostnames would/could/do change frequently... Can you give a little more specifics resedit???

Glen
 
The reason is for a database of IP addresses associated with countries.

Hostname associated with country isn't good enough- look at all the .tv domains that are actually hosted in the US.

All a hostname means is that you have said hostname pointing to your IP address on some dns server somewhere in the world, and means diddle as to where you are actually coming from.

With respect to the privacy issue, if you don't want someone knowing what country you are coming from, and you are surfing the web, use an anonymous proxy. Every server logs your IP and is capable of doing a traceroute on it anyway, so this database doesn't provide any info that can't be gotten by anyone anyway.

What it will do, is make it so that the info can be obtained quickly by the server, which may help dynamic content be better suited for the viewer (such as default currency on commercial sites).

I don't think the database should contain any more information other than the country the IP address is in.

As far as database format- probably the best idea is a text file along with perl scripts that can convert the text file into a dump from most databases (mSQL, mySQL, postgresql, berkeleydb, etc.)

That way anyone can load the database into whatever database program they happen to have license to use.

My guess is that the central computer that gathers the work units and creates the database should be oracle for performance reasons, but the data people can get should be text for portability reasons.
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
So basically, we need a random number generator to create the IP block (work unit) then a client which will perform a traceroute on every one of those IP addresses before uploading it's output.

How, exactly, are the traceroute data going to be locked to a specific country? Most backbones or routers along the route are .COM or .NET

Short of human intervention, we're going to need a very good algorithm for that.

H@
 

axell

Ars Scholae Palatinae
994
This will always be wildly inaccurate. Anyone can use an IP-masking firewall to change their external IP-address, and there are several likely reasons to do that.

A company Intranet may span several countries, and only have a single access-point to the Internet.

If someone wishes to download your encryptionprogram they will probably have no trouble finding a Unix-box in the US which they can Telnet to and download your software.

In the end, if you still want a guess as to what country a given IP-address lies in, a reverse DNS-query is a MUCH smaller effort, and only slightly less useless.
 

Hat Monster

Ars Legatus Legionis
47,680
Subscriptor
I think that the US export laws place any distributer of software fitting the description under a "reasonable" responsibilty. The method being described is far more than just reasonable.
Furthermore, where embargoes are in place, there are unlikely to be big global mega corporations, and even less likely to want to download his software.

Even if the telnet method is used, then it is not the responsibility of the original poster. He supplies the software to a US system. That system exports it, not him.

H@
 

axell

Ars Scholae Palatinae
994
That depends on how you do it. Whenever an unknown IP-address makes a page request, first send the requested page, then send a message to all mirrors to ping this adress. Once all mirrors have responded, relay this data so that all mirrors know which server is the closest. The next time a request comes in to one of the servers, it will have the IP-address in it's cache, and if the server is not the closest one, it does a redirect. To keep the cache fresh, pings should probably be redone every month or so.

OK, I'll freely admit it is stupid, but I'd venture to say it is better than to secondguess what country an IP-adress originates from, and on that (dibious) data try to guess which mirror is the closest. For instance, the connection between many european countries as a lot slower than their connection to the US, even though they're geographically closer. Computers only a few hops from Mae West might have a better connection to many Japanese servers than to servers on the east coast.

I'm not proposing a ping-based mirror-selection, I know it's not a good idea. I'm just saying that it's better than the above proposition.
 
Status
Not open for further replies.