8-timing-synchronisation Flashcards

(43 cards)

1
Q

List the 8 Fallacies of Distributed Computing.

A
  1. Network reliable, 2. Latency zero, 3. Bandwidth infinite, 4. Network secure, 5. Topology constant, 6. One admin, 7. Transport free, 8. Network homogeneous.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the 9th fallacy sometimes added?

A

All clocks are synchronised.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why do distributed systems need time?

A

Schedulers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Physical clocks?

A

Count number of seconds elapsed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Logical clocks?

A

Count events (e.g. messages sent).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why is time difficult in DS?

A

No global agreement on time. Each machine has own clock running at slightly different rate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Clock Skew?

A

Different clocks running at slightly different rates in a distributed system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do Quartz clocks work?

A

Crystal resonates at specific frequency via piezoelectric effect. Count cycles to measure time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is clock drift measured in?

A

Parts per million (ppm). 1 ppm = 1 μs/sec = 86 ms/day = 32 s/year. Most computers within 50 ppm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens if two clocks drift opposite directions?

A

After time δt they may be 2ρδt apart (where ρ is max drift rate).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What was TAI before 1958?

A

Time based on mean solar second: 1/86

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is TAI (International Atomic Time)?

A

1 second = time for caesium-133 to make 9,192,631,770 electronic transitions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why are leap seconds needed?

A

Mean solar day growing longer. Without them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is UTC?

A

Universal Coordinated Time - TAI corrected with leap seconds to match solar time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Unix time?

A

Seconds since 1 January 1970 00:00:00 UTC (the epoch)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is ISO 8601?

A

Date format: year

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does most software deal with leap seconds?

A

Ignores them! Smearing spreads leap second over a day.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

When to use Cristian’s Algorithm?

A

One machine has UTC receiver - synchronise others with it.

19
Q

When to use Berkeley Algorithm?

A

No machines have UTC receivers - just minimise clock skew between them.

20
Q

What is the drift rate constraint for proper clock?

A

1 - ρ ≤ dC/dt ≤ 1 + ρ where ρ is max drift rate.

21
Q

How does Cristian’s Algorithm work?

A

Client asks UTC server for time, server responds. Client adjusts gradually to avoid time running backward.

22
Q

What is the formula for round-trip delay in Cristian’s?

A

δ = (t₄ - t₁) - (t₃ - t₂)

23
Q

What is estimated server time when client receives response?

24
Q

What is estimated clock skew in Cristian’s?

A

θ = t₃ + δ/2 - t₄ = (t₂ - t₁ + t₃ - t₄)/2

25
How does Berkeley Algorithm work?
Time daemon asks all machines for clock values, calculates average, tells everyone how to adjust.
26
What is the key difference between Cristian's and Berkeley?
Cristian's uses external UTC source. Berkeley uses average of all clocks (no external source).
27
Why do we need election algorithms?
Many distributed algorithms need one coordinator. Need to pick one if coordinator fails.
28
What are the assumptions of Bully Algorithm?
Each process has unique ID, processes know all IDs/addresses, communication reliable.
29
What is the key idea of Bully Algorithm?
Select process with highest ID as coordinator.
30
What are the 3 message types in Bully Algorithm?
Election, OK, I won.
31
How does Bully Algorithm work?
P sends Election to higher IDs. If no OK received, P is coordinator and sends I won. If OK received, waits for I won.
32
What happens when process receives Election?
Returns OK and starts its own election.
33
What is the message complexity of Bully Algorithm?
O(n²) messages with n processes.
34
What is NTP?
Network Time Protocol - enables Internet clients to synchronise to UTC reliably.
35
What are the goals of NTP?
Synchronise to UTC, survive connectivity loss, authenticate timing data, resync frequently to offset drift.
36
What is an NTP synchronisation subnet?
Hierarchical structure of time servers organised in strata.
37
What is Stratum 1 in NTP?
Primary servers connected directly to UTC source (radio clock).
38
What is Stratum 2 in NTP?
Secondary servers that synchronise with Stratum 1.
39
What happens to accuracy in NTP strata?
Decreases as you go down through strata.
40
How does NTP correct small clock skew (|θ| < 125ms)?
Slew - slightly speed up or slow down by up to 500 ppm.
41
How does NTP correct medium clock skew (125ms ≤ |θ| < 1000ms)?
Step - reset client clock to estimated server timestamp.
42
How does NTP handle large clock skew (|θ| > 1000ms)?
Panic - do nothing
43
What is the Ring Election Algorithm?
Nodes in logical ring communicate with upstream neighbours. Election message circulates collecting IDs. Highest ID wins.