[e2e] Mapping IP Addresses to Geographic Location

George Michaelson ggm at apnic.net
Tue Feb 26 22:42:08 PST 2002


I have just finished writing some slides for an APNIC member meeting where
I am using the RIR statistics files to generate the sorted set of masks
which are the nearest-match allocation boundary, and refer to the known
recorded CCTLD of allocation of the address.

Obviously, for a Level3 or Verio or IBM this is meaningless, but as an 80:20
mechanism, can I recommend that people look closely at the files in the RIR
statistics pages, which use 'count of hosts' instead of prefix/length but
which can be used to derive the prefix very simply?

I applied a 1978 Djikstra algorithm to sorted lists of IP's to do this, which
(at the cost of a UNIX sort) is very fast. Smarter people can do a RADIX tree
version and apply it runtime to the IP stream.

This data is updated monthly. So, its reasonably in-step with reality.

The biggest problem? the 50% or more of legacy allocations before the RIRs
which cannot be mapped. There is some hope that in the next few years this
will sort itself out as the legacy allocations move to management by the
regional body.

I'm not posting my code because it would insult your intelligence to see
a 3 line compare sorted lists program third hand.

cheers
	-George
--
George Michaelson       |  APNIC
Email: ggm at apnic.net    |  PO Box 2131 Milton QLD 4064
Phone: +61 7 3858 3100  |  Australia
  Fax: +61 7 3858 3199  |  http://www.apnic.net





More information about the end2end-interest mailing list