ntp服务器如何做到如此精确?

我们中的许多人偶尔会遇到这样的问题:我们的计算机和其他设备保留了准确的时间设置,但是与NTP服务器的快速同步会使一切恢复正常。但是,如果我们自己的设备可能会失去准确性,NTP服务器如何保持如此准确?...

ntp服务器如何做到如此精确?

我们中的许多人偶尔会遇到这样的问题:我们的计算机和其他设备保留了准确的时间设置,但是与NTP服务器的快速同步会使一切恢复正常。但是,如果我们自己的设备可能会失去准确性,NTP服务器如何保持如此准确?

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

图片由LEOL30(Flickr)提供。

问题

超级用户读者Frank Thornton想知道NTP服务器如何保持如此精确:

I have noticed that on my servers and other machines, the clocks always drift so that they have to sync up to remain accurate. How do the NTP server clocks keep from drifting and always remain so accurate?

NTP服务器如何保持如此精确?

答案

超级用户贡献者Michael Kjorling为我们提供了答案:

NTP servers rely on highly accurate clocks for precision timekeeping. A common time source for central NTP servers are atomic clocks, or GPS receivers (remember that GPS satellites have atomic clocks onboard). These clocks are defined as accurate since they provide a highly exact time reference.

There is nothing magical about GPS or atomic clocks that make them tell you exactly what time it is. Because of how atomic clocks work, they are simply very good at, having once been told what time it is, keeping accurate time (since the second is defined in terms of atomic effects). In fact, it is worth noting that GPS time is distinct from the UTC that we are more used to seeing. These atomic clocks are in turn synchronized against International Atomic Time or TAI in order to not only accurately tell the passage of time, but also the time.

Once you have an exact time on one system connected to a network like the Internet, it is a matter of protocol engineering enabling transfer of precise times between hosts over an unreliable network. In this regard a Stratum 2 (or farther from the actual time source) NTP server is no different from your desktop system syncing against a set of NTP servers.

By the time you have a few accurate times (as obtained from NTP servers or elsewhere) and know the rate of advancement of your local clock (which is easy to determine), you can calculate your local clock’s drift rate relative to the “believed accurate” passage of time. Once locked in, this value can then be used to continuously adjust the local clock to make it report values very close to the accurate passage of time, even if the local real-time clock itself is highly inaccurate. As long as your local clock is not highly erratic, this should allow keeping accurate time for some time even if your upstream time source becomes unavailable for any reason.

Some NTP client implementati*** (probably most ntpd daemon or system service implementati***) do this, and others (like ntpd’s companion ntpdate which simply sets the clock once) do not. This is commonly referred to as a drift file because it persistently stores a measure of clock drift, but strictly speaking it does not have to be stored as a specific file on disk.

In NTP, Stratum 0 is by definition an accurate time source. Stratum 1 is a system that uses a Stratum 0 time source as its time source (and is thus slightly less accurate than the Stratum 0 time source). Stratum 2 again is slightly less accurate than Stratum 1 because it is syncing its time against the Stratum 1 source and so on. In practice, this loss of accuracy is so **all that it is completely negligible in all but the most extreme of cases.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-11 09:15
  • 阅读 ( 218 )
  • 分类:互联网

你可能感兴趣的文章

如何在家里安装led灯带

... 我们将向您展示如何轻松地安装LED条形灯来突出您家中最喜欢的区域。 ...

  • 发布于 2021-03-10 21:37
  • 阅读 ( 383 )

如何摆脱android版chrome中的文章建议

Facebook已经四年没有在你朋友分享的文章旁边添加推荐链接了。大多数其他社交网络并没有以同样的方式效仿,但最新版本的Chrome for Android使用新标签来推荐推荐文章。如果你是众多对改变不满的人中的一员,你会很高兴知道有...

  • 发布于 2021-03-17 02:53
  • 阅读 ( 153 )

如何在android上删除chrome中的“articles for you”

...pestics。) 在“新建”选项卡页上的“显示服务器端建议”下,选择“禁用”。 点击“立即重新启动”重新启动Chrome,使该功能生效。 ...

  • 发布于 2021-03-24 14:54
  • 阅读 ( 178 )

如何在亚马逊fire电视棒上使用蓝牙耳机

...,你就可以用你的消防棍连接和使用它。我们将向您展示如何使用Amazon Fire电视棒设置蓝牙耳机。 ...

  • 发布于 2021-03-30 11:48
  • 阅读 ( 1488 )

如何快速创建自己的chrome浏览器主题

...欢的颜色,并在新标签页上设置一个时髦的背景图像。 如何启用新的自定义工具 这些特性在chrome77中默认不启用,但它们仍然存在:您只需启用一些隐藏的标志。 和往常一样,Chrome的标志可以随时更改或删除。我们预计,当Go...

  • 发布于 2021-04-03 03:40
  • 阅读 ( 226 )

如何提高你在电脑游戏中的目标

...它的功能肯定会有助于与标准的office鼠标相比。 相关:如何选择正确的游戏鼠标 其中最重要的是人机工程学。游戏老鼠并不仅仅是为了让过去十五年里**的每一只老鼠都感到舒适,而且可以做出这样的说法。他们的设计是舒适...

  • 发布于 2021-04-06 11:33
  • 阅读 ( 169 )

如何在iphone上复制照片和视频

...本和一个正常速度版本的视频。不管是什么原因,下面是如何做到的。 打开照片应用程序,点击右上角的“选择”,然后点击要复制的照片或视频。 选择图像或视频后,单击左下角的“共享”图标,然后单击“复制”选项。 ...

  • 发布于 2021-04-06 15:44
  • 阅读 ( 72 )

如何让windows和linux时钟显示正确且匹配的时间?[双启动]

...统时,时间和时钟的设置会让事情变得有点奇怪,那么你如何解决这个问题呢?今天的超级用户问答帖子提供了一个完美的解决方案,可以帮助一个沮丧的读者解决他的双启动时钟问题。 今天的问答环节是由SuperUser提供的,Super...

  • 发布于 2021-04-10 23:36
  • 阅读 ( 200 )

如何网络引导(pxe)citrix xen的自动安装

...经向您展示了什么是PXE,以及如何使用FOG轻松地为其安装服务器。在本指南中,我们将再次扩展优秀的FIR基金会,并添加一个菜单条目来安装一个自动化的Citrix Xen服务器。 就像在ubuntulivefromfog教程中一样,安装过程并不完全是PX...

  • 发布于 2021-04-11 20:36
  • 阅读 ( 138 )

在ubuntu10.04中与internet时间服务器同步时钟

Ubuntu有一个简单的方法来保持你的系统时钟与internet时间服务器同步,但遗憾的是它在默认情况下没有启用。下面是为您的系统启用它所需的快速步骤。 注意:我们之前已经写过如何在旧版本的Ubuntu中实现这一点,但是这个方法...

  • 发布于 2021-04-13 10:06
  • 阅读 ( 69 )
zhi42977
zhi42977

0 篇文章

相关推荐