How NTP works

Figure 5 shows the basic workflow of NTP. Device A and Device B are connected over a network. They have their own independent system clocks, which need to be automatically synchronized through NTP. Assume that:

Figure 5: Basic work flow of NTP

The synchronization process is as follows:

Up to now, Device A can calculate the following parameters based on the timestamps:

Based on these parameters, Device A can synchronize its own clock to the clock of Device B.

This is a rough description of how NTP works. For more information, see RFC 1305.