How to calculate Clock Skew of nodes in a distributed system

The difference between the smallest and largest count is 3 counts. This is the maximum clock skew between N2 and N3, or between any two of the nodes.
  • #1
22990atinesh
143
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
  • #2
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 [itex]\frac{800-810}{810}\cdot 30s = -0.37s [/itex] and [itex] \frac{800-795}{795}\cdot 30s = 0.19s[/itex].
 
  • #3
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 [itex]\frac{800-810}{810}\cdot 30s = -0.37s [/itex] and [itex] \frac{800-795}{795}\cdot 30s = 0.19s[/itex].

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:
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 

Related to How to calculate Clock Skew of nodes in a distributed system

1. What is clock skew in a distributed system?

Clock skew refers to the difference in time between the clock values of different nodes in a distributed system. It occurs when the clocks of different nodes do not match due to factors such as network delays or variations in clock speeds.

2. Why is it important to calculate clock skew in a distributed system?

Calculating clock skew is important because it helps ensure that the nodes in a distributed system are synchronized, meaning they have an accurate understanding of time. This is crucial for tasks such as data replication and coordination between nodes.

3. How do you calculate clock skew in a distributed system?

The most common way to calculate clock skew is by using the Network Time Protocol (NTP). This involves comparing the clock values of different nodes and adjusting for any differences. Other methods include using timestamps in network messages or implementing a global logical clock.

4. What are the potential causes of clock skew in a distributed system?

Clock skew can be caused by various factors, such as network delays, hardware or software issues, and differences in clock drift rates. It can also be caused by human error, such as manually setting the clock on a node to the wrong time.

5. How can clock skew be minimized in a distributed system?

Clock skew can be minimized by regularly synchronizing the clocks of nodes using a reliable time synchronization protocol, such as NTP. It is also important to regularly monitor and adjust for any clock drift or network delays that may affect clock accuracy.

Similar threads

Replies
6
Views
4K
  • Programming and Computer Science
Replies
1
Views
2K
  • Mechanical Engineering
Replies
26
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
2K
Replies
2
Views
7K
  • Beyond the Standard Models
Replies
2
Views
2K
  • Biology and Medical
Replies
2
Views
11K
Back
Top