How to calculate Clock Skew of nodes in a distributed system

AI Thread Summary
In a distributed system with three nodes, each node has a different clock rate: 800, 810, and 795 ticks/ms. The maximum clock skew occurs between nodes N2 and N3, calculated as 15 ticks/ms, resulting in a skew of 200 μs every millisecond. When considering a 30-second interval, the skew can also be expressed as 0.45 seconds based on the differences in tick rates. Some participants debated the accuracy of these calculations, with suggestions that the skew could be miscalculated as 200 ms instead of 200 μs. Ultimately, the consensus indicates that if nodes are aware of their tick rates, they can synchronize effectively within a short time frame.
22990atinesh
Messages
143
Reaction score
1
A distributed system has 3 nodes ##N_1##, ##N_2## and ##N_3##, each having its own clock. The clocks of nodes ##N_1##, ##N_2## and ##N_3## tick 800, 810 and 795 times/ms. The system uses the external synchronization mechanism, in which all 3 nodes receive the real time every 30 seconds from external time source and readjust their clocks. What is the maximum Clock Skew that will occur in this system ?

Attempt: Maximum difference would come between ##N_2## and ##N_3## i.e, ##N_2## - ##N_3## = 15 times/ms = 15000 times/s
Clock Skew = 1/15000 s

Is it the right way to calculate ...
 
Physics news on Phys.org
22990atinesh said:
What is the maximum Clock Skew that will occur in this system ?
Looking at your numbers and assuming that the nodes know about their tick rates, I see a common factor of 5. This means that the maximum clock skew will be 200μs every ms.

The only way the 30s would be relevant is that all nodes believe that they have a tick rate of 800/ms. Then the clock skew in 30s will be \frac{800-810}{810}\cdot 30s = -0.37s and \frac{800-795}{795}\cdot 30s = 0.19s.
 
Svein said:
Looking at your numbers and assuming that the nodes know about their tick rates, I see a common factor of 5. This means that the maximum clock skew will be 200μs every ms.

The only way the 30s would be relevant is that all nodes believe that they have a tick rate of 800/ms. Then the clock skew in 30s will be \frac{800-810}{810}\cdot 30s = -0.37s and \frac{800-795}{795}\cdot 30s = 0.19s.

Can you please elaborate it little bit more How you have calculated clock skew.
First of all : I think Clock Skew should be 200 ms in place of 200 μs.
Secondly: By your method, I'm getting maximum clock skew as 0.56 s by considering ##N_2## and ##N_3##
Thirdly: Can I use this method
Maximum skew in 1 sec between n2 & n3 = (.810 - .795)
= .015 sec
Thus, skew in 30 sec = .015 * 30 = .45 sec
 
Last edited:
22990atinesh said:
Can you please elaborate it little bit more How you have calculated clock skew.
First of all : I think Clock Skew should be 200 ms in place of 200 μs.
  1. I do not think the clock skew should be 200ms each ms...
  2. If N2 and N3 know that they should use 810 and 795 counts/ms, they would be correct each ms.
  3. If they know their counts, in 200μs N1 will have counted to 160, N2 to 162 and N3 to 159. Therefore they are in sync after 200μs.
  4. Worst case is just before 200μs - but it is maximum 2 counts out of 160: 2.5μs.
22990atinesh said:
Maximum skew in 1 sec between n2 & n3 = (.810 - .795)
= .015 sec. Thus, skew in 30 sec = .015 * 30 = .45 sec
I would not have used that method.
 
Svein said:
  1. I do not think the clock skew should be 200ms each ms...
  2. If N2 and N3 know that they should use 810 and 795 counts/ms, they would be correct each ms.
  3. If they know their counts, in 200μs N1 will have counted to 160, N2 to 162 and N3 to 159. Therefore they are in sync after 200μs.
  4. Worst case is just before 200μs - but it is maximum 2 counts out of 160: 2.5μs.
I would not have used that method.

How do you come up with 200 μs, that's what I'm not getting. Can you please elaborate your procedure.
 
22990atinesh said:
How do you come up with 200 μs, that's what I'm not getting. Can you please elaborate your procedure.
You specified 800, 810 and 795 counts per millisecond. I see 5 as a common factor, one fifth of a millisecond is 200 μs. One fifth of the counts are 160, 162 and 159 counts.
 
Back
Top