NTP Server
Network Time Protocol互联网时间协议
NTP is intended to synchronize all participating computers to within a few milliseconds of Coordinated Universal Time (UTC).[1]:3 It uses a modified version of Marzullo's algorithm to select accurate time servers and is designed to mitigate the effects of variable network latency. NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networksunder ideal conditions. Asymmetric routes and network congestion can cause errors of 100 ms or more.[2][3]
NTP旨在几毫秒协调世界时(UTP)的时间内同步所有参与的计算机。NTP使用一个修改的版本来选择精确的时间服务器,并能缓解可变的网络延迟的影响。NTP通常能够在几十毫秒的时间内在公网上维护时间,并且能够比一个在理想状态下的局域网的一个毫秒的精度表现更好。不对称线路和网络拥塞能导致100毫秒或更多的错误。
The protocol is usually described in terms of a client-server model, but can as easily be used in peer-to-peer relationships where both peers consider the other to be a potential time source.[1]:20 Implementations send and receive timestamps using the User Datagram Protocol (UDP) on port number 123.[4][5] They can also usebroadcasting or multicasting, where clients passively listen to time updates after an initial round-trip calibrating exchange.[3] NTP supplies a warning of any impending leap second adjustment, but no information about local time zones or daylight saving time is transmitted.[2][3]
As of June 2010, the current protocol is version 4 (NTPv4), which is a proposed standard as documented in RFC 5905. It is backwards compatible with version 3, specified in RFC 1305.
这个协议通常用 客户端-服务器模型来描述,但是能被容易地用于对等的关系,在这种情况下,两方都放为另一方是一个潜在的时间源。在 123端口使用UDP协议发送和接收时间戳。他们也能使用广播或多播,在这种情况下,客户端在接收到往返时间校准后被地监听时间更新。NTP提供了一个对任何迫近的闰秒的调整警告,但是关于本地时区或夏时令没有给出信息。
Clock strata (时钟层)
NTP uses a hierarchical, semi-layered system of time sources. Each level of this hierarchy is termed a "stratum" and is assigned a number starting with zero at the top. The number represents the distance from the reference clock and is used to prevent cyclical dependencies in the hierarchy. Stratum is not always an indication of quality or reliability; it is common to find stratum 3 time sources that are higher quality than other stratum 2 time sources. Telecommunication systems use a different definition for clock strata.
关于 时间源,NTP 使用了一个分层的,半独立的分层系统。每个层叫作一个“stratum”,并且在最上面被分配了一个从0开始的数字。这个数字代表了与参考时钟的距离,并且被用来防止形成回路。
Stratum 0
These are high-precision timekeeping devices such as atomic (cesium, rubidium) clocks, GPS clocks or other radio clocks. They generate a very accurate pulse per second signal that triggers an interrupt and timestamp on a connected computer. Stratum 0 devices are also known as reference clocks.
第0层是高精度的计时设备,如原子的(铯,铷)时钟,GPS时钟或其它电波时钟。它们生成一个很准确的每秒脉冲信号并在连接的计算机上触发一个中断和时间戳。
Stratum 1
These are computers whose system clocks are synchronized to within a few microseconds of their attached stratum 0 devices. Stratum 1 servers may peer with other stratum 1 servers for sanity checking and backup.[6] They are also referred to as primary time servers.[2][3]
第一层是计算机,这些计算机的系统时钟在几微妙一次的与与之连接的第0层的设备进行同步。第一层上的服务器为了完整性检查与备份,可能与其它位于同层的服务器进行连接。他们也被称为主时间服务器。
Stratum 2
These are computers that are synchronized over a network to stratum 1 servers. Often a stratum 2 computer will query several stratum 1 servers. Stratum 2 computers may also peer with other stratum 2 computers to provide more stable and robust time for all devices in the peer group.
第二层是通过网络与第一层进行时钟同步的计算机。通常一个位于第二层的计算机机将查询好几个位于第一层的服务器。位于第二层的计算机可能与其他层2电脑同行为所有其它位于同一层的设备提供更稳定和健壮的时间。
Stratum 3
These are computers that are synchronized to stratum 2 servers. They employ exactly the same algorithms for peering and data sampling as stratum 2, and can themselves act as servers for stratum 4 computers, and so on.
位于第三层的是与第二层服务器进行同步的计算机。它们使用与第二层同样的同步和数据采集算法,并且它们自己可以作为第四层的服务器,以此类推。
Only strata 0 to 15 are valid; stratum 16 is used to indicate that a device is unsynchronized. The NTP algorithms on each computer interact to construct a Bellman-Ford shortest-path spanning tree, to minimize the accumulated round-trip delay to the stratum 1 servers for all the clients.[1]:20
只有层0到层 15是有效的。层 16 被用来指示一个设备是异步的。在每个计算机上的NTP算法互相作为形成一个 Bellman-Ford最短路径生成树,来最小化所有客户端与层一服务器之间积累的回路延迟。
Timestamps
The 64-bit timestamps used by NTP consist of a 32-bit part for seconds and a 32-bit part for fractional second, giving a time scale that rolls over every 232 seconds (136 years) and a theoretical resolution of 2−32 seconds (233 picoseconds). NTP uses an epoch of January 1, 1900. The first rollover occurs in 2036,[note 1] prior to the UNIX year 2038 problem.
被NTP使用的64位的时间戳由一个 32位的秒和一个32位的小数部分的秒组成,提供一个每232 (136年) 滚动一次时间范围和一个理论上的0, 2−32 秒(233皮秒)。NTP使用一个新纪元, 1900年1月1 日。第一次的翻转发生在 2036年,在 unix 年的 2038 年之前。
Future versions of NTP may extend the time representation to 128 bits: 64 bits for the second and 64 bits for the fractional-second. The current NTPv4 format has support for Era Number and Era Offset, that when used properly should aid fixing date rollover issues. According to Mills, "the 64 bit value for the fraction is enough to resolve the amount of time it takes a photon to pass an electron at the speed of light. The 64 bit second value is enough to provide unambiguous time representation until the universe goes dim."[7][note 2]
NTP Server的更多相关文章
- 创建一个Windows的NTP Server
搭建一个VMware vRealize Suite的时候遇见了不少时间同步的问题, 实验室里网络与外界隔绝, 不能使用公网的NTP服务器, 所以使用文中的方法自己搭建了一个. 蛮好用的. Creati ...
- linux 下使rdate命令支持ipv6 ntp server 同步时间
如果使用linux 下,busybox自带的rdate命令 去ipv6 的ntp server 同步时间的话,会提示invalid argument :无效参数. 那么现在下载rdate的源码并对其进 ...
- 设置新时间校正服务器NTP SERVER
时间校正服务器IP : 10.*.*.* 适用系统:windows server 2008/windows 7 net stop w32time net start w32time w32tm /qu ...
- Linux 上配置 NTP SERVER
在CENTOS 6.2上面安装配置NTP SERVER 安装NTP:yum install ntp 配置时间源vi /etc/ntp.confserver 210.72.145.44server nt ...
- VMware ESXi 5.5无法与Windows 2012 NTP Server同步时间
这次笔者需要面对的环境对时间的同步有比较高的要求, 而虚拟化的环境中时间是比较容易出问题的, 您可以参考上一篇博文为什么Domain controller上的time synchronization非 ...
- Ubuntu 配置NTP Server
Ubuntu安装NTP Server很简单,分位3步走: 第一步:安装NTP root@cephadmin:~/ceph-cluster# apt-get install ntp Reading pa ...
- shell脚本安装ntp server 服务
##############################Deploy ntp server ######################## echo "start deploy ntp ...
- win2003系统同步Linux ntp server批处理
最后更新时间: 2018/12/15 一般windows配置时间服务器,只需要在windows系统右下角,点时间,里面配置好对应NTP服务器地址就行, 至多再修改一下注册表 HKEY_LOCAL_MA ...
- centos7 ntp server & samba
最近公司内部一个需求:必须 Linux建个 ntp server ,并且 Windows可以net time \\ip 访问. 想要解决问题,还得解决前置问题. 服务器不能上网,无法直接访问外部 yu ...
- ubuntu NTP server 搭建
ubuntu server ntp时间同步服务器安装及使用一.服务端1 apt-get install ntp 2 安装后默认启动服务,如果没有启动,启动之. /etc/init.d/ntp star ...
随机推荐
- 1007 Maximum Subsequence Sum (25)(25 point(s))
problem Given a sequence of K integers { N~1~, N~2~, ..., N~K~ }. A continuous subsequence is define ...
- mysql常见知识点
最近整理了一些数据库常见的面试题,对自己也是个复习,希望对大家也有所帮助. 1.触发器的作用? 触发器是一类特殊的存储过程,主要是通过事件来触发而被执行的.它可以强化约束,来维护数据的完整性和一致性, ...
- django信号调度的用法
Django中提供了"信号调度",用于在框架执行操作时解耦. 一些动作发生的时候,系统会根据信号定义的函数执行相应的操作 Django中内置的signal Model_signal ...
- SKLearn数据集API(二)
注:本文是人工智能研究网的学习笔记 计算机生成的数据集 用于分类任务和聚类任务,这些函数产生样本特征向量矩阵以及对应的类别标签集合. 数据集 简介 make_blobs 多类单标签数据集,为每个类分配 ...
- 数据准备<5>:变量筛选-实战篇
在上一篇文章<数据准备<4>:变量筛选-理论篇>中,我们介绍了变量筛选的三种方法:基于经验的方法.基于统计的方法和基于机器学习的方法,本文将介绍后两种方法在Python(skl ...
- luoguP4571 [JSOI2009]瓶子和燃料 裴蜀定理
裴蜀定理的扩展 最后返回的一定是\(k\)个数的\(gcd\) 因此对于每个数暴力分解因子统计即可 #include <map> #include <cstdio> #incl ...
- Educational Codeforces Round 13 E. Another Sith Tournament 状压dp
E. Another Sith Tournament 题目连接: http://www.codeforces.com/contest/678/problem/E Description The rul ...
- RTSP交互过程
步骤一: 发送:OPTIONS rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream RTSP/1 ...
- java_线程的几种状态
java thread的运行周期中, 有几种状态, 在 java.lang.Thread.State 中有详细定义和说明: NEW 状态是指线程刚创建, 尚未启动 RUNNABLE 状态是线程正在正常 ...
- 【XPath Helper:chrome爬虫网页解析工具 Chrome插件】XPath Helper:chrome爬虫网页解析工具 Chrome插件下载_教程_安装 - 开发者插件 - Chrome插件网
[XPath Helper:chrome爬虫网页解析工具 Chrome插件]XPath Helper:chrome爬虫网页解析工具 Chrome插件下载_教程_安装 - 开发者插件 - Chrome插 ...