Centralized Clock Synchronization - GeeksforGeeks

31 Jul, 2020
Centralized Clock Synchronization is an internal clock synchronization approach where clocks of system are synchronized with one of clock of system.
Clock synchronization is carried out to make all clocks in network agree on the same value. In centralized clock synchronization, one of clocks is appointed as master clock. Other clock of the system are called slaves and these clocks are kept is synchronization with master clock.
Master Clock :It is one of clocks of system which is designated as master clock. All remaining clocks are synchronized with this clock. Master clock is also known as time server. It is single in number.Slave Clocks :Remaining clocks of systems after designated master clock are known as slave clocks. These clocks are synchronized with master clock of system. These are various in number in system.
Master Clock :It is one of clocks of system which is designated as master clock. All remaining clocks are synchronized with this clock. Master clock is also known as time server. It is single in number.
Slave Clocks :Remaining clocks of systems after designated master clock are known as slave clocks. These clocks are synchronized with master clock of system. These are various in number in system.
Working :Master clock sends its time to all other clocks (slave clocks) for synchronization. Server broadcasts its time after each ‘t’ time interval. Slave clocks receive time from master clock and set their time accordingly. Time interval ‘t’ is chosen quite carefully.
Case-I:If ‘t’ is very small then, master clock frequently sends its time to slave clocks and slave clocks are in propersynchronization with master clock but high communication overhead occurs.
Case-II:If ‘t’ is very large then, clocks drift too much from each other.
Relation between ‘t’ and ‘p’ :‘t’ represents time interval and ‘p’ represents drift rate between two clocks.
When slave clocks are synchronized after every ‘t’ time then drift of slave clock from master clock is p x t.Hence, maximum drift between any two clocks is 2 x p x t.
Example –Suppose drift rate between any two clocks is 5 micro second. A synchronized set of six distributed clocks are implemented using Centralized Clock Synchronization. Maximum drift between any two clocks is limited to 1 milli second. Find re-synchronization time interval ‘t’.
Explanation :
Drift rate (p) = 0.000005 sec.

Maximum drift b/w two clocks (e) = 0.001 sec.

As we know maximum drift e = 2 x p x t

Hence, 
t = e / (2 x p)
  = 0.001 / (2 x 0.000005)
  = 100 sec.

Therefore, it can be concluded that re-synchronization time interval should be less than 100 second.
Operating Systems
Operating Systems
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Memory Management in Operating System
Logical and Physical Address in Operating System
Program for Least Recently Used (LRU) Page Replacement algorithm
Difference between Internal and External fragmentation
File Allocation Methods
Mutex lock for Linux Thread Synchronization
States of a Process in Operating Systems
Process Table and Process Control Block (PCB)
Dining Philosopher Problem Using Semaphores
Process Schedulers in Operating System