How your clock gets the right time
From atomic clocks to your device: how layers of time servers pass the time along, and how NTP measures the trip and corrects your clock.
Step through it
Tip: swipe, or use the left and right arrow keys, to turn the slides.
Step 1 of 7: Atomic clocks keep the reference
See the whole path at once
- Atomic clocksAnd GPS satellites
- Stratum 1 serversWired to a clock
- Public time serverspool.ntp.org and others
- Your devicePhone or computer
- YouAnd the apps you use
Read every step as text
1.Atomic clocks keep the reference
Atomic clocks in laboratories around the world are combined into Coordinated Universal Time, UTC. GPS satellites carry atomic clocks too. This reference is called stratum 0, and it is never reached over the internet directly.
Path: Atomic clocks
2.Stratum 1 servers copy a clock
A stratum 1 server is wired straight to a reference clock, such as a GPS receiver, so it knows the time to within a tiny fraction of a second. These servers are the first layer you can reach over a network.
Path: Atomic clocks to Stratum 1 servers
3.Public servers pass it on
Public time servers copy the time from stratum 1 servers, so they are stratum 2, and the next layer copies from them. A higher number means more hops from the clock, not a worse server. pool.ntp.org spreads the load across thousands of volunteers.
Path: Stratum 1 servers to Public time servers
4.Your device asks
Your device sends a tiny message over UDP, port 123, to a few servers and notes the time it left. Each server replies with the time it received the request and the time it answered. Your device notes when the reply arrives.
Path: Your device to Public time servers
5.It measures the trip
From those four times, your device works out how long the round trip took and how far its clock is from the server's, assuming the way out took as long as the way back. A short, steady trip gives the best answer, and servers that disagree are ignored.
Path: Public time servers to Your device
Read: NTP: how the internet keeps timeTry: Try the same calculation on your clock
6.It nudges its clock
A small error is fixed by running the clock slightly faster or slower until it catches up, so time never jumps backwards. Only a large error is fixed by setting the clock outright. Your device repeats the whole check every so often.
Path: Your device
7.Everything else relies on it
Certificates are valid between two dates, two-factor codes are computed from the time, and logs and backups are stamped with it. A clock that is far off can make secure websites fail to load and codes get rejected.
Path: Your device to You
Go deeper
- NTP: how the internet keeps timeHow your device gets the right time: atomic clocks, layers of time servers called strata, and the round-trip calculation NTP uses to correct a clock.
- What is an IP address?What an IP address is, how IPv4 and IPv6 differ, and why the address a website sees may not be your own device's.