Ping time depends on which factors

Does the ping time only depend on the total distance traveled by the signal or it depends on other factors?

Ping time is essentially a measure of the time it takes to send a request to remote host and get a response.

Factors Ping time depends on

  1. Number of Hops between you and the remote host
  2. Network Congestion between these hops
  3. Delay incurred due to routing performance at these hops
  4. Distance

You can run a traceroute command to check the hops between you and a remote host. Say when i run

traceroute facebook.com
  1   192.168.0.1  0.983ms  0.850ms  0.777ms    // My Home Router
  2   103.82.xx.xx  2.305ms  1.926ms  1.856ms    // My ISP's Router/Concentrator
  3   103.82.xx.xx  4.634ms  3.199ms  2.769ms    // My ISP's Border Router
  4   182.75.170.5  3.696ms  3.629ms  5.164ms    // Airtel's Border Router to My ISP
  5   182.79.152.162  78.173ms  80.210ms  86.224ms // Airtel's Border Router to Next ISP(In this case Facebook)
  6   157.240.65.230  81.448ms  75.143ms  72.892ms // Internal ISP Routing
  7   157.240.40.236  75.697ms  75.271ms  75.367ms
  8   129.134.42.213  76.000ms  76.867ms  75.712ms
  9   157.240.39.165  74.681ms  75.286ms  74.435ms
 10   157.240.25.35  76.788ms  76.527ms  76.452ms

We end at 157.240.25.35. Let’s where/who it is

curl http://ip-api.com/157.240.25.35 
{
  "country"     : "Singapore",
  "countryCode" : "SG",
  "region"      : "01",
  "regionName"  : "Central Singapore",
  "city"        : "Singapore",
  "district"    : "",
  "zip"         : "",
  "lat"         : 1.28009,
  "lon"         : 103.851,
  "timezone"    : "Asia/Singapore",
  "isp"         : "Facebook, Inc.",
  "org"         : "Facebook, Inc.",
  "as"          : "AS32934 Facebook, Inc.",
  "mobile"      : false,
  "proxy"       : false,
  "query"       : "157.240.25.35"
}

So it is in Singapore, owned by Facebook Inc. Total ping time : ~77ms.

Theoretically speaking, we can calculate the minimum possible ping time for such a request
Displacement from New Delhi to Singpore (Bird’s path) : 4,163.24 km
Assuming light speed for communication and elementary Physics : 4,163.24/ 3,00,000 = ~ 13.8ms

Reasons for the difference ?

  1. We don’t have a single, point to point optical fiber from my home to Facebook Datacenter in Singapore, so my request needs to travel a lot more than the displacement.
  2. The request has to be processed and routed by many routers along the way, which takes time, computers are slow (slower than light)
  3. Congestion. If there is network congestion between any two hops, the Internet is designed to use protocols to handle such congestion either by delaying your request or dropping the packet entirely.

Lastly, Different ISPs use different routes to reach different places around the world, so it is expected to have different ping times to remote locations using different internet connection, even if you are in the exact same place.

Here is graph of how Bharti Airtel is connected to other ISPs across the world. https://bgp.he.net/AS9498#_graph4

Sources: Trust me, I run an ISP