Skip to content

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

Step 1 of 7

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

Read: NTP: how the internet keeps time

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
  1. Atomic clocksAnd GPS satellites
  2. Stratum 1 serversWired to a clock
  3. Public time serverspool.ntp.org and others
  4. Your devicePhone or computer
  5. YouAnd the apps you use
Read every step as text
  1. 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

    Read: NTP: how the internet keeps time

  2. 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

    Read: NTP: how the internet keeps time

  3. 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

    Read: NTP: how the internet keeps time

  4. 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

    Read: What is an IP address?

  5. 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. 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

    Read: NTP: how the internet keeps time

  7. 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

    Read: NTP: how the internet keeps time

Go deeper