389

I just discovered very strange thing while testing my internet connection. My ping is smaller than it should be. For example ping time to Arizona State University is about 14ms.

eryk@eryk-pc:~$ ping www.asu.edu
PING www.asu.edu.cdn.cloudflare.net (104.16.51.14) 56(84) bytes of data.
64 bytes from 104.16.51.14: icmp_seq=1 ttl=60 time=13.8 ms

I'm living in Poznań in Poland so my distance to Arizona State University in a straight line (very optimistic assumption) is about 10000 km. Considering the fact that ping time is a time for two directions (to the target and back to home). So my ping packet have to cross 20000 km distance. Speed of light is 300 000 km per second that is 300km per millisecond. So the smallest possible time to ping Arizona State University with my packet travelling at a speed of light is

20000/300=67ms

I have noticed similar results for servers located in Australia and some other States of America. Is my internet connection five times faster than light?

indiv
  • 4,385
  • 2
  • 18
  • 13
dagi12
  • 2,569
  • 3
  • 12
  • 10
  • 94
    Underwhelming answer, but the question reminds me of [the 500 mile email story](http://www.ibiblio.org/harris/500milemail.html) which is an entertaining read; well worth your time. – OJFord Jun 01 '15 at 21:59
  • 2
    How did this question gain THAT many upvotes?! 225 in only a couple of days! – cnst Jun 02 '15 at 22:14
  • 10
    @cnst because we're geeks. This is a puzzle, but when you look closer the answer is trivial. And we geeks *love* that kind of stuff. – Wayne Werner Jun 02 '15 at 22:27
  • 5
    @WayneWerner, A puzzle assumes that arriving at an answer is not entirely trivial; in this case, the answer, `cloudflare.net`, is already very noticeably present in the question itself! – cnst Jun 02 '15 at 22:56
  • 4
    If you're not familiar with cloudflare, or know that it's a cdn, it's not trivial. If you don't know what a cdn is, it would also not be trivial. – Wayne Werner Jun 03 '15 at 02:23
  • 11
    Anyone can ping faster than light. `> ping ftlgame.com` I don't get what's so hard. – Ian MacDonald Jun 03 '15 at 18:08

1 Answers1

409

As you can see from the output, you aren’t actually pinging some server in Arizona or even the United States. Apparently, they decided to protect their website with Cloudflare, which employs a content distribution network to even the load. A CDN works with many nodes, each servicing a (geographic) region. That means the node you’re pinging is very close to you.

Because Cloudflare uses Anycast (Wikipedia info) with all of their data centers, you’ll connect to the same IP address no matter where you are in the world. Every data center offers all services. Internet routers decide on the best route (to the closest/best reachable data center) and direct your connection that way.

Daniel B
  • 60,360
  • 9
  • 122
  • 163
  • http://whois.arin.net/rest/net/NET-104-16-0-0-1/pft reference https://www.cloudflare.com/ – Francisco Tapia May 29 '15 at 17:10
  • 313
    This is even part of the reason why CDNs exist. Users aren't patient enough to wait for light to make it to the other side of the Earth and back. – kasperd May 29 '15 at 18:06
  • 14
    Never thought about this before... Does this mean that it will never ever be possible to play games online from Australia to America without 3 frames of lag, at 60 fps? – Nacht Jun 01 '15 at 04:43
  • 6
    You do realize [where the chat is](http://chat.stackexchange.com/), right? ;) – Daniel B Jun 01 '15 at 16:34
  • 18
    @Nacht That is correct, which is why many large multiplayer games have regions, and switching between regions gives you bad lag usually. – David says Reinstate Monica Jun 02 '15 at 19:09
  • 4
    @Nacht You just have to wait for quantum teleportation internet. – AwokeKnowing Jun 02 '15 at 23:30
  • OP's pinging a server in Singapore (http://www.iplocation.net). Which is a minimum of 8000km from Poland, where OP is pinging from. Therefore roundtrip is 16000km and hence would take ~53ms for light to make that trip. Therefore I think this question is still unanswered – Bleeding Fingers Jun 03 '15 at 10:19
  • 3
    @BleedingFingers No, he’s not. Cloudflare uses [Anycast](https://en.wikipedia.org/wiki/Anycast). I’ll update my answer later. – Daniel B Jun 03 '15 at 10:25
  • 19
    Finally! I've been waiting decades for someone to upgrade the speed of light. – RBarryYoung Jun 03 '15 at 14:35