Time and global states Flashcards
Why is time problematic in distributed systems?
♦ Each computer has its own physical clock
♦ Clocks typically deviate; cannot synchronise them perfectly, only approximately
Why is time an important practical issue distributed systems?
♦ computers worldwide need to timestamp e-commerce transactions consistently
♦ Ordering of events Global state in absence of global time
♦ Need to know what state process A is when process B is in a certain state
What is a computer’s physical clock?
♦ Clock is an electronic device that counts oscillations occurring in a crystal at a definite frequency
♦ Typically divide this count and store the result in a counter register
♦ Clock can be programmed to generate interrupts at regular intervals
What is Skew?
The instantaneous difference between the readings of any two clocks is their skew
What is clock drift?
♦ Crystal-based clocks are subject to clock drift – i.e. they oscillate at slightly different frequencies i.e. count time at different rates and hence diverge
♦ Even the same clock will vary with temperature
Why doesn’t it matter how accurately clocks may have been initialised?
Difference in oscillation period between two clocks may be extremely small, but when accumulated over many oscillations leads to an observable difference in the counters registered by two clocks
What is a clocks drift rate?
A clock’s drift rate is the difference in reading between the clock and a nominal perfect reference clock per unit of time measured by the reference clock
What is Cristian’s method for synchronising clocks
Cristian’s algorithm works between a process P, and a time server S — connected to a source of UTC (Coordinated Universal Time).
- P requests the time from S
- After receiving the request from P, S prepares a response and appends the time T from its own clock.
- P then sets its time to be T + RTT/2
What does Cristian’s method for synchronising clocks assume?
The method assumes that the RTT is split equally between request and response
Suggest how Cristian’s method could be more accurate.
Further accuracy can be gained by making multiple requests to S and using the response with the shortest RTT.