How is ping so low, lower than theoretical limit?
According to this article, we would expect a ping of at least 60 milliseconds for 10,000km of distance:
Ireland is roughly 10,000km away from California, so this is the ping we would expect.
I am pinging api.kraken.com
from Ireland, which is located somewhere in California.
How is my ping so low - 4 milliseconds?
I am using the ping
command in Command Prompt to test this:
And it's definitely not just me getting this low ping. Here is a report from check-host.net:
Here is the location of the server, using iplocation.net:
Here is a traceroute if useful:
For me, traceroute api.kraken.com
ends with
8 ae-2-3602.edge3.Berlin1.Level3.net (4.69.159.5) 15.422 ms 16.278 ms 17.423 ms
9 unknown.Level3.net (212.162.40.34) 12.069 ms 12.045 ms 9.120 ms
10 104.16.214.191 (104.16.214.191) 9.071 ms 10.039 ms 4.867 ms
From a colo server I rent, it ends with
7 as13335.dusseldorf.megaport.com (194.146.118.139) 3.027 ms 3.000 ms 2.965 ms
8 104.16.213.191 (104.16.213.191) 2.419 ms 2.451 ms 2.386 ms
The round-trip times there have a lot of noise on them as we only have three probes per host, but we can be fairly confident that there is no transatlantic link involved.
What is happening here is that Cloudflare are announcing the same IP address block from multiple datacenters that all have copies of the services offered, so each client is connected to the closest one.
Such a setup can fail if routes change around while a connection is active, but generally only few clients are affected and the majority of clients will just rebuild the connection, possibly to a different instance this time.
Keeping the different instances synchronized to simulate a single service is part of Cloudflare's business model.
IP geolocation is guesswork at best, and certainly breaks with such setups since the same IP is used in different places. The ipinfo.io
service is likely in San Francisco, so the next instance of api.kraken.com
they found is their neighbor.
The api.kraken.com is behind CloudFlare Edges. The IP address is known as anycast IP address. All users will be connected to the nearest local edge server instead of one physical server. In this case, users will enjoy the lowest latency.
I can confirm this by performing traceroute from 3 different continents. Please see the traceroute below and confirm that netrouting to the nearest local CloudFlare edge server.
Traceroute from USA
%> ip2trace -p api.kraken.com -d /usr/share/ip2location/DB4.BIN
IP2Location Geolocation Traceroute (ip2trace) Version 8.0.0
Copyright (c) 2021 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application
1. 50.97.82.1 0.544 ms ["US", "United States of America", "Texas", "Dallas", "SoftLayer Technologies Inc.]
2. 173.192.118.144 0.398 ms ["US", "United States of America", "Texas", "Dallas", "SoftLayer Technologies Inc.]
3. 50.97.18.192 1.135 ms ["US", "United States of America", "Texas", "Dallas", "SoftLayer Technologies Inc.]
4. 206.223.118.145 1.914 ms ["US", "United States of America", "Texas", "Dallas", "Equinix Inc.]
5. 104.16.212.191 1.533 ms ["US", "United States of America", "California", "San Francisco", "CloudFlare Inc.]
Traceroute from France
%> ip2trace -p api.kraken.com -d /usr/share/ip2location/DB4.BIN
IP2Location Geolocation Traceroute (ip2trace) Version 8.0.0
Copyright (c) 2021 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application
1. 176.67.168.129 0.511 ms ["FR", "France", "Ile-de-France", "Paris", "UK-2 Limited]
2. 149.6.166.145 0.588 ms ["FR", "France", "Ile-de-France", "Paris", "PSINet Inc.]
3. 154.25.5.125 1.130 ms ["FR", "France", "Ile-de-France", "Paris", "Cogent Communications Inc]
4. 130.117.1.45 1.659 ms ["FR", "France", "Ile-de-France", "Paris", "Cogent Communications Inc]
5. 154.54.60.126 1.382 ms ["FR", "France", "Ile-de-France", "Paris", "Cogent Communications Inc]
6. 149.11.0.126 1.708 ms ["FR", "France", "Ile-de-France", "Paris", "CloudFlare Inc.]
7. 104.16.214.191 1.661 ms ["US", "United States of America", "California", "San Francisco", "CloudFlare Inc.]
Traceroute from Singapore
%> ip2trace -p api.kraken.com -d /usr/share/ip2location/DB4.BIN
IP2Location Geolocation Traceroute (ip2trace) Version 8.0.0
Copyright (c) 2021 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application
1. 174.133.118.150 0.295 ms ["SG", "Singapore", "Singapore", "Singapore", "SoftLayer Technologies Inc.]
2. 50.97.18.202 0.943 ms ["SG", "Singapore", "Singapore", "Singapore", "SoftLayer Technologies Inc.]
3. 104.16.214.191 0.871 ms ["US", "United States of America", "California", "San Francisco", "CloudFlare Inc.]