Questions: Clock Synchronization and Network Time Protocol
5 questions to test your understanding
Score: 0 / 5
Question 1 Multiple Choice
System A records event X at timestamp 10:00:00.010 and system B records event Y at timestamp 10:00:00.012. The machines use NTP and are synchronized to within ±5ms. Can you conclude that X happened before Y?
AYes, because A's timestamp is strictly lower than B's timestamp
BNo, because the 2ms difference is within the ±5ms synchronization error; the true ordering is indeterminate
CYes, if both machines synchronized to a stratum-1 server within the last minute
DNo, because NTP timestamps cannot be used for any ordering of events across machines
The 2ms difference between the two timestamps is smaller than the synchronization bound of ±5ms. Machine B's clock could be running 5ms fast relative to A's, making Y actually occur before X in real time despite having a higher timestamp. You can only reliably order events when their timestamp difference exceeds the synchronization error bound. Option D is too strong — timestamps are useful for approximate ordering, just not for events within the error window.
Question 2 Multiple Choice
NTP organizes time servers into strata. What is the primary purpose of this hierarchy?
ATo ensure each server synchronizes to exactly one reference source, preventing loops
BTo aggregate time estimates from multiple accurate sources and discard outliers, reducing synchronization error
CTo limit the total number of clients that can connect to any single time server
DTo assign different synchronization polling intervals to different network segments
The stratum hierarchy allows NTP clients to query multiple servers and apply statistical algorithms to combine estimates and reject outliers. By drawing on several stratum-1 or stratum-2 sources rather than trusting a single server, NTP can detect and compensate for a misbehaving server. Loop prevention (option A) is a side benefit of the hierarchy, not its primary purpose.
Question 3 True / False
NTP can achieve perfect clock synchronization on a local area network if most machines synchronize to the same stratum-1 server.
TTrue
FFalse
Answer: False
Perfect synchronization is theoretically impossible because NTP estimates one-way network delay as RTT/2, but network delays are asymmetric and variable. Even on a LAN, there is always residual uncertainty in the estimated offset. Physical clocks also drift continuously between synchronization corrections. The best achievable result is bounded skew — typically sub-millisecond on a LAN — not zero skew.
Question 4 True / False
Distributed systems use logical clocks (Lamport timestamps, vector clocks) because physical clock synchronization cannot guarantee accurate ordering of closely-timed events on different machines.
TTrue
FFalse
Answer: True
This is precisely the motivation. When two events occur within the synchronization error window, their physical timestamps cannot reliably indicate which came first. Logical clocks track causal relationships directly, without depending on accurate physical time: if A sends a message that B receives, B knows its event happened after A's event, regardless of what the clocks say. Logical clocks capture 'happened-before' ordering exactly where physical clocks are uncertain.
Question 5 Short Answer
Explain why even a well-configured NTP deployment cannot reliably determine which of two events on different machines happened first, if those events occurred within a few milliseconds of each other.
Think about your answer, then reveal below.
Model answer: NTP estimates clock offset by measuring round-trip time and assuming symmetric one-way delay. But network delays are variable and asymmetric: a packet might take 1ms one way and 5ms the other, while NTP assumes 3ms each way. This estimation error, combined with continuous clock drift between corrections, means each machine's clock can be off from true time by several milliseconds. If two events are separated by less than the combined error of both clocks, their timestamps could be in the wrong order — event B might have a lower timestamp than event A even though B actually occurred later.
This limitation is not a failure of NTP implementation — it is fundamental to clock synchronization over any network with variable latency. The only way to circumvent it is to use specialized hardware (GPS receivers, PTP/IEEE 1588 with hardware timestamping) that can achieve microsecond accuracy, or to abandon physical time ordering entirely and use logical causality tracking instead.