lundi 7 mars 2022

Resolving asymmetry of latency in the NTP protocol

I am practically shure somebody has already resolved this problem.

But I haven't seen the solution in the description of the NTP protocol in Wikipedia. I should have explored the Rfc's but I am too lazy for that. I just enjoy trying to find a solution by myself.

So we want to synchronize the clocks of two computers. And we would want to take in account  differences in latency for each direction.

M1 and M2 are the two machines 

L1 is the latency from M1 to M2

L2 is the latency from M2 to M1

A,B and C are waiting times (could be adjusted for better accuracy)

Let's analyse two subsequent poolings between M1 and M2.

In the first polling we have:

L1 = T3 - T0 - A - L2 

In second one we have

L1= T7 - T4 - C - L2

their Square values are equals:

([ T3 - T0 - A] - L2 )² = ( [T7 - T4 - C] - L2)²

and we get

2 L2 [ (T7 - T4 - C) - ( T3 - T0 - A) ]= (T7 - T4 - C)²  -  (T3 - T0 - A)²

We assume that L1 and L2 will not change a lot during the two pollings and that  T3, T0, T7, T4, A and ,C are easily  recorded during the polling.

Aucun commentaire:

Enregistrer un commentaire