---
title: "NTP; Berkeley vs Cristian"
subject: "Distributed System"
chapter: 5
key: "semester_7/distributed_system:ntp-berkeley-cristian"
source: https://www.bctengineer.com/q/semester_7/distributed_system/ntp-berkeley-cristian
site: BCT Engineering
---

# NTP; Berkeley vs Cristian

Distributed System · Chapter 5: Time and State in Distributed Systems

- Asked in: 2075 Asoj, 2+4 marks
- Video: [2.2 Clock Synchronization - Cristian, Berkeley | Distributed Computing | CS3551 Anna University R...](https://www.youtube.com/watch?v=UEaPTr4ZHwY) — PK Educational Institute
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/ntp-berkeley-cristian
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-5

## Question

What is Network Time Protocol (NTP)? How does Berkeley minimize the problems of single time server failures of Cristian's algorithm?

## Short answer

NTP synchronizes clocks to UTC using hierarchical strata, multiple servers, and four timestamps to compute offset and delay. Berkeley avoids Cristian's single-server failure by electing a master that polls slaves, computes the average, sends adjustments, and elects a new master if it fails.

## Answer

#### Network Time Protocol (NTP)
NTP is an Internet protocol (UDP port 123) that synchronises computer clocks to UTC over variable-delay networks.
- Servers are arranged in a hierarchy of **strata**: stratum 0 = reference clocks (GPS, atomic); stratum 1 = servers directly connected to them; stratum 2 gets time from stratum 1, and so on.
- A client talks to several servers and uses statistical filtering to select the best.
- Modes: *multicast* (LAN, low accuracy), *procedure call* (like Cristian's) and *symmetric* (peers, highest accuracy).
- In a message exchange with timestamps Ti−3 (request sent), Ti−2 (request received), Ti−1 (reply sent), Ti (reply received): delay d = (Ti − Ti−3) − (Ti−1 − Ti−2), offset o = ((Ti−2 − Ti−3) + (Ti−1 − Ti)) / 2. The best of the last eight pairs (smallest delay) is used.
- Reliable (many servers, tree reconfigures on failure), scalable and authenticated. Accuracy: milliseconds on the Internet, below 1 ms on LANs.

#### How Berkeley reduces the single-server problem of Cristian
Cristian's algorithm depends on one passive time server, which if it fails or has a wrong clock, stops synchronisation for all. The **Berkeley algorithm** (internal synchronisation) has no external time source:
1. A master (time daemon) is elected; it polls all slaves for their clock values.
2. Slaves reply; the master estimates each one's time using round-trip delay.
3. The master computes the **average** of all clocks (ignoring faulty ones that differ too much, and including its own).
4. The master sends each machine the **adjustment** (not an absolute time) needed, positive or negative, which avoids the transmission delay error. Clocks are slowed, not set back.
5. If the master fails, **another machine is elected** as master, so the service continues.

Thus failure of one node does not stop the system, and the averaging reduces the effect of a single bad clock.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. In NTP, what is a stratum 1 server?
   A. A client of a stratum 2 server
   B. The reference clock itself
   C. A server that has no time source
   D. A server directly connected to a reference clock such as GPS or atomic (stratum 0)
   Answer: D. Stratum 0 are reference clocks; stratum 1 connects directly to them. (Key point: NTP strata)

2. Which NTP quantity is computed as ((Ti-2 - Ti-3) + (Ti-1 - Ti))/2?
   A. Offset
   B. Delay
   C. Stratum
   D. Drift
   Answer: A. The offset is the average of the two one-way differences; delay is (Ti - Ti-3) - (Ti-1 - Ti-2). (Key point: NTP offset)

3. How does Berkeley reduce reliance on one correct time source?
   A. It uses a UTC receiver in every machine
   B. The master averages all clocks (ignoring outliers) and everyone adjusts to it
   C. It sets all clocks to the master's time
   D. It uses atomic clocks only
   Answer: B. Averaging reduces the effect of one bad clock; no external source is needed. (Key point: Berkeley averaging)

4. What does the Berkeley master send to each machine?
   A. Its own absolute time
   B. The UTC time
   C. The amount to adjust (plus or minus), not an absolute time
   D. A new clock rate only
   Answer: C. Sending adjustments avoids transmission delay error. (Key point: Berkeley adjustment)

## Related in Distributed System

- [Physical/logical clocks; NTP and Berkeley](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aphysical-logical-ntp-berkeley) — Distributed System, chapter 5
- [Cristian's algorithm](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Acristian-algorithm) — Distributed System, chapter 5, asked 3×

## Related in other subjects

- [Java simulation of single server queue](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Ajava-simulation-single-server) — Simulation and Modeling, chapter 9, asked 5×
- [Client-server vs peer-to-peer](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aclient-server-vs-p2p) — Computer Networks and Security, chapter 1
- [Repair vs rehabilitation; rigid pavement failures](https://www.bctengineer.com/question.md?key=semester_7%2Ftransportation_engineering_ii%3Arepair-vs-rehabilitation-rigid-failure-types) — Transportation Engineering II, chapter 4
- [Routed vs routing protocol](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Arouted-vs-routing-protocol) — Computer Networks and Security, chapter 4
