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
  • 閱讀 ( 26 )
  • 分類:網際網路

你可能感興趣的文章

如何在家裡安裝led燈帶

... 我們將向您展示如何輕鬆地安裝LED條形燈來突出您家中最喜歡的區域。 ...

  • 發佈於 2021-03-10 21:37
  • 閲讀 ( 50 )

為什麼你什麼都不用樹莓皮

...以優雅地完成這項工作。如果您真的需要,它包括一個web伺服器庫,或者您可以使用精簡的基於MQTT的協議。 ...

  • 發佈於 2021-03-14 14:25
  • 閲讀 ( 70 )

如何擺脫android版chrome中的文章建議

Facebook已經四年沒有在你朋友分享的文章旁邊新增推薦連結了。大多數其他社交網路並沒有以同樣的方式效仿,但最新版本的Chrome for Android使用新標籤來推薦推薦文章。如果你是眾多對改變不滿的人中的一員,你會很高興知道有...

  • 發佈於 2021-03-17 02:53
  • 閲讀 ( 41 )

你的新安卓智慧手機上是否預裝了惡意軟體?

...該應用程式似乎利用這一許可權從命令與控制(C&C)伺服器下載惡意軟體,但在**剛通電時稍有延遲。這個被稱為RottenSys的惡意軟體能夠透過使用一個名為MarsDaemon的開源框架來保持其程序的活動性,從而對作業系統進行隱藏...

  • 發佈於 2021-03-22 20:57
  • 閲讀 ( 51 )

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

...pestics。) 在“新建”選項卡頁上的“顯示伺服器端建議”下,選擇“禁用”。 點選“立即重新啟動”重新啟動Chrome,使該功能生效。 ...

  • 發佈於 2021-03-24 14:54
  • 閲讀 ( 32 )

裝置如何使用wi-fi確定您的物理位置

...它們在您當前位置的相對訊號強度。然後,它會聯絡線上伺服器,這些伺服器基本上包含了全球Wi-Fi接入點及其地理位置的列表。 這個資料庫不僅僅包括一個Wi-FI接入點名稱(SSID)列表。該資料庫包括這些接入點的唯一MAC地址(...

  • 發佈於 2021-03-31 18:40
  • 閲讀 ( 42 )

如何快速建立自己的chrome瀏覽器主題

...歡的顏色,並在新標籤頁上設定一個時髦的背景影象。 如何啟用新的自定義工具 這些特性在chrome77中預設不啟用,但它們仍然存在:您只需啟用一些隱藏的標誌。 和往常一樣,Chrome的標誌可以隨時更改或刪除。我們預計,當Go...

  • 發佈於 2021-04-03 03:40
  • 閲讀 ( 44 )

alexa是怎麼聽醒語的

亞歷克莎總是在聽,但不是一直在錄音。它不會向雲伺服器傳送任何東西,直到它聽到你說喚醒詞(Alexa、Echo或Computer)。但聽叫醒詞比你想象的要難。 Echo硬體並不是那麼智慧。如果沒有網際網路,你提出的任何要求或問題都...

  • 發佈於 2021-04-03 08:56
  • 閲讀 ( 58 )

如何提高你在電腦遊戲中的目標

...它的功能肯定會有助於與標準的office滑鼠相比。 相關:如何選擇正確的遊戲滑鼠 其中最重要的是人機工程學。遊戲老鼠並不僅僅是為了讓過去十五年裡**的每一隻老鼠都感到舒適,而且可以做出這樣的說法。他們的設計是舒適...

  • 發佈於 2021-04-06 11:33
  • 閲讀 ( 51 )

如何在iphone上覆制照片和影片

...本和一個正常速度版本的影片。不管是什麼原因,下面是如何做到的。 開啟照片應用程式,點選右上角的“選擇”,然後點選要複製的照片或影片。 選擇影象或影片後,單擊左下角的“共享”圖示,然後單擊“複製”選項。 ...

  • 發佈於 2021-04-06 15:44
  • 閲讀 ( 18 )
zhi42977
zhi42977

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦