# Measuring one way network latency

This is a puzzle about measuring network latency that I created. I believe the solution is that it's impossible, but friends disagree. I'm looking for convincing explanations either way. (Though it is posed as a puzzle I think it fits on this web site because of its applicability to the design and experience of communication protocols such as in online games, not to mention NTP.)

Suppose two robots are in two rooms, connected by a network with differing one-way latencies as shown in the graphic below. When robot A sends a message to robot B it takes 3 seconds for it to arrive, but when robot B sends a message to robot A it takes 1 second to arrive. The latencies never vary.

The robots are identical and do not have a shared clock, though they can measure the passage of time (e.g. they have stop watches). They do not know which of them is robot A (whose messages are delayed 3s) and which is robot B (whose messages are delayed by 1s).

A protocol to discover the round trip time is 'when receiving TICK send TOCK, start watch, send TICK, await TOCK, stop watch, record time difference (4s)'.

Is there a protocol to determine the one way trip delays? Can the robots discover which of them has the longer message sending delay?

-
See Clock synchronization in a network with asymmetric delays (which asks for something doable with typical Internet infrastructure). I think from what we saw when discussing wrong answers to that question the answer to your question is that it's impossible. –  Gilles Mar 21 '12 at 13:14
Should we merge the questions, or are they different enough in target to keep separate? –  Strilanc Mar 21 '12 at 13:48
No, they are different questions. Your question establishes that it's impossible in a two-machine setting with just message passing. I'm hoping for solutions based on, say, latency information being available for some intermediate links on the route between the client and the server and having some way to propagate this information to the client. –  Gilles Mar 21 '12 at 13:57
If there were a way to do this, Einstein's theory of relativity wouldn't work, since it depends on the fact that two observers who are space-like separated and have unknown one-way latencies cannot agree on a proper time. –  Peter Shor Mar 22 '12 at 15:07
NTP does indeed allow/implement measuring this differential delay based on machines sending each other their time & not merely tracking send/receipt time of their own msgs but also the other servers via msg contents, see answer on gilles question –  vzn Oct 1 '12 at 21:53

I think it is impossible to figure out one-way latency just by comparing stopwatches.

$A$ sends $B$ his clock $C_{A1}$, let's say its value is 5.
$B$ acknowledges the message at time $C_{B1}=1$
$A$ sends his clock again, $C_{A2}=9$ (initial + round-trip latency).
$B$ receives at time $C_{B2}=5$.
And so on. Neither $A$ or $B$ can figure out when the other robot received a message with respect to their watches.

Maybe if you make it a bounty question someone will crack it. Until then, kudos.

-