Time Zone HQ
12h
24h
-- -- ------:--:--
Deep Dives

NTP: How Computers Stay in Sync

NTP (Network Time Protocol) is the standard protocol that keeps the world's computers synchronized. Without it, every device's clock would drift — a few seconds per day — until timestamps were useless for coordination, logging, or security. NTP keeps clocks accurate to within tens of milliseconds over the public internet and sub-millisecond over local networks.

The Hierarchy of Time Servers

NTP operates in a hierarchical structure called strata. Stratum 0 devices are the authoritative time sources: atomic clocks, GPS receivers, and radio receivers tuned to national standards broadcasts. Stratum 1 servers are directly connected to Stratum 0 hardware and serve time across the internet. Stratum 2 servers synchronize from Stratum 1 servers and serve time to clients on your local network. Your laptop or phone is typically a Stratum 3 or 4 client.

The public NTP pool (pool.ntp.org) is a volunteer project that routes NTP queries to thousands of globally distributed Stratum 1 and 2 servers. Most consumer devices and cloud instances use the pool or a cloud provider's own NTP infrastructure.

Why Accurate Time Matters for Software

Timestamp accuracy isn't just a cosmetic concern. TLS/SSL certificates have validity periods checked against the system clock — a clock that's more than a few minutes wrong can cause valid certificates to appear expired. Distributed databases like Cassandra and Google Spanner rely on tight clock synchronization to determine the order of writes across nodes. Log correlation across microservices requires clocks within milliseconds of each other to reconstruct event sequences. Security systems use timestamps for replay attack prevention and token expiry.

← Back to all articles
Help us make this better!