Comment by jimaek

20 hours ago

This is a little project exploring the feasibility of using a service such as Globalping for geo location needs.

I had fun making it but please note that the current implementation is just a demo and far from a proper production tool.

If you really want to use it then for best possible results you need at least 500 probes per phase.

It could be optimized fairly easily but not without going over the anon user limit which I tried to avoid

I wonder if you could optimize for reducing the total probe count (at the expense of possibly longer total time, though it may be faster in some cases) by using some sort of "gradient descent".

Start by doing the multi-continent probe, say 3x each. Drop the longest time probes, add probes near the shortest time, and probe once. Repeat this pattern of probe, assess, drop and add closer to the target.

You accumulate all data in your orchestrator, so in theory you don't need to deliberately issue multiple probes each round (except for the first) to get statistical power. I would expect this to "chase" the real location continuously instead of 5 discrete phases.

I just watched the Veritasium video on potentials and vector fields - the latency is a scalar potential field of sorts, and you could use it to derive a latency gradient.

  • Yes, most likely there are multiple algorithms that could be used to get better results with fewer probes, but I'm not smart enough to do the math and implement them.

    • The simplest is drop the longest latency probe, and add a new one in the proximity of the fastest.

isn't 3 theoretically enough?

  • Time of flight from three points gets you two options for position with GPS, but GPS signals propagate directly in free space. At least mostly, reflections happen.

    Internet signals generally travel by cable, and the selected route may or may not be the shortest distance.

    It's quite possible for traffic between neighboring countries to transit through another continent, sometimes two. And asymetric routing is also common.

    Since this is using traceroute anyway, if you characterize the source nodes, you could probably use a lot fewer nodes and get similar results with something like:

    a) probe from a few nodes on different continents (aiming to catch anycast nodes)

    b) assuming the end of the trace is similar from all probes, choose probe nodes that are on similar networks, and some other nodes that are geolocated nearby those nodes.

    c) declare the target is closest to the node with the lowest measured latency (after offsetting from node charachterized first hop latency)

    You'll usually get the lowest ping times if you can ping from nearby customer of the same ISP as the target. Narrowing to that faster is possible if you know about your nodes.