DS L3. Explain the concept of time in DS and how clocks are synchronized. Flashcards

1
Q

Why is time complex in DS?

A

Nodes and components do not share one global synchronized clock. Achieving synchronization among distributed clocks is challenging due to factors like network delays and clock drift. However, a common understanding of time is required for coordinating actions across multiple nodes.

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

How are clocks synchronized in DS?

A

Various clock synchronization algorithms are employed.

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

What are the two conceptualizations of time used in DS?

A

Logical Time and Physical Time

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

What is logical time?

A

Logical time provides a partial ordering of events based on their causal relationships, allowing systems to reason about the sequence of operations even when physical time cannot be accurately synchronized.

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

What is physical time?

A

Physical time ensures that timestamps accurately reflect real-world time, facilitating tasks like logging, scheduling, and coordination across multiple nodes. While logical time is useful for event ordering, many applications still require synchronization of physical time across distributed nodes.

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

What is the purpose of using logical time?

A

It allows systems to reason about the sequence of operations without using phyiscal time.

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

What is the purpose of using physical time?

A

It allows applications to use real-world time for tasks like logging and scheduling as well as coordination across nodes.

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

What techniques are used for clock synchronization?

A
  1. NTP (Network Time Protocol)
  2. PTP (Precision Time Protocol)
  3. Clock Drift Compensation
  4. Consensus-Based Algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is NTP?

A

Network Time Protocol (NTP) is a widely-used protocol for synchronizing clocks over a network.

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

How does NTP work?

A

NTP operates by exchanging timestamped messages between servers and clients, adjusting clock rates to minimize time discrepancies.

NTP uses a hierarchical structure of servers, with higher-stratum servers obtaining time from lower-stratum servers, eventually synchronizing with an authoritative time source like an atomic clock.

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

What is PTP?

A

Precision Time Protocol (PTP) is a more precise (compared to NTP) clock synchronization protocol designed for applications requiring sub-microsecond accuracy.

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

How does PTP work?

A

PTP employs a master-slave architecture, with a grandmaster clock providing a reference time to slave clocks.

PTP uses hardware-assisted timestamping and synchronization mechanisms to achieve high precision and low jitter, making it suitable for applications like industrial automation and financial trading.

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

What are the differences between NTP and PTP?

A

PTP is more precise, designed for applications requiring sub-microsecond accuracy.

NTP uses a hierarchical structure of servers, where servers obtain time from lower-stratum servers, eventually synchronizing with an authoritative time source. PTP employs a master-slave architecture, with a grandmaster clock providing a reference time to slave clocks.

In NTP, servers and clients exchange timestamped messages and adjust clock rates to minimize time discrepancies. PTP uses hardware-assisted timestamping and synchronization mechanisms.

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

What is clock drift compensation?

A

Clock drift, caused by variations in clock rates, can lead to time discrepancies between nodes over time. Clock synchronization algorithms compensate for drift by periodically adjusting clock rates or applying correction factors based on observed time differences.

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

What are consensus-based algorithms?

A

Consensus algorithms like the Berkeley algorithm and the Cristian’s algorithm achieve clock synchronization by reaching an agreement on the current time among a set of distributed nodes. These algorithms rely on message exchange and statistical methods to estimate clock offsets and adjust local clocks accordingly.

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

What are three challenges for time synchronization?

A
  1. Network Delays
  2. Clock Drift
  3. Security
17
Q

How do network delays affect time synchronization?

A

Variability in network delays can impact the accuracy of clock synchronization algorithms, especially in environments with high-latency or unreliable network connections.

18
Q

What is clock drift and how is it mitigated?

A

Clock drift is when clocks in distributed systems drift apart over time due to differences in clock precision and stability. Clock synchronization algorithms must account for drift to maintain accurate time across nodes.

19
Q

What security risks does time synchronization involve and how are they addressed?

A

Clock synchronization protocols may be vulnerable to attacks like man-in-the-middle and replay attacks. Security measures such as authentication and encryption are essential to protect against unauthorized manipulation of time synchronization.

20
Q
A