- Accurate Time for Windows Server 2016
- Domain Hierarchy
- Critical Factors for Accurate Time
- Why is time important?
- служба времени Windows Windows Time Service
- Поиск сведений о конфигурации службы времени Windows Where to Find Windows Time Service Configuration Information
- Принцип работы службы времени Windows What is the Windows Time Service?
- Важность протоколов времени Importance of Time Protocols
Accurate Time for Windows Server 2016
Applies to: Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows 10 or later
The Windows Time service is a component that uses a plug-in model for client and server time synchronization providers. There are two built-in client providers on Windows, and there are third-party plug-ins available. One provider uses NTP (RFC 1305) or MS-NTP to synchronize the local system time to an NTP and/or MS-NTP compliant reference server. The other provider is for Hyper-V and synchronizes virtual machines (VM) to the Hyper-V host. When multiple providers exist, Windows will pick the best provider using stratum level first, followed by root delay, root dispersion, and finally time offset.
For a quick overview of Windows Time service, take a look at this high-level overview video.
In this topic, we discuss . these topics as they relate to enabling accurate time:
- Improvements
- Measurements
- Best Practices
An addendum referenced by the Windows 2016 Accurate Time article can be downloaded here. This document provides more details about our testing and measurement methodologies.
The windows time provider plugin model is documented on TechNet.
Domain Hierarchy
Domain and Standalone configurations work differently.
Domain members use a secure NTP protocol, which uses authentication to ensure the security and authenticity of the time reference. Domain members synchronize with a master clock determined by the domain hierarchy and a scoring system. In a domain, there is a hierarchical layer of time strata, whereby each DC points to a parent DC with a more accurate time stratum. The hierarchy resolves to the PDC or a DC in the root forest, or a DC with the GTIMESERV domain flag, which denotes a Good Time Server for the domain. See the [Specify a Local Reliable Time Service Using GTIMESERV section below.
Standalone machines are configured to use time.windows.com by default. This name is resolved by your DNS Server, which should point to a Microsoft owned resource. Like all remotely located time references, network outages, may prevent synchronization. Network traffic loads and asymmetrical network paths may reduce the accuracy of the time synchronization. For 1 ms accuracy, you can’t depend on a remote time sources.
Since Hyper-V guests will have at least two Windows Time providers to choose from, the host time and NTP, you might see different behaviors with either Domain or Standalone when running as a guest.
For more information about the domain hierarchy and scoring system, see the «What is Windows Time Service?» blog post.
Stratum is a concept used in both the NTP and Hyper-V providers, and its value indicates the clocks location in the hierarchy. Stratum 1 is reserved for the highest-level clock, and stratum 0 is reserved for the hardware assumed to be accurate and has little or no delay associated with it. Stratum 2 talk to stratum 1 servers, stratum 3 to stratum 2 and so on. While a lower stratum often indicates a more accurate clock, it is possible to find discrepancies. Also, W32time only accepts time from stratum 15 or below. To see the stratum of a client, use w32tm /query /status.
Critical Factors for Accurate Time
In every case for accurate time, there are three critical factors:
- Solid Source Clock — The source clock in your domain needs to be stable and accurate. This usually means installing a GPS device or pointing to a Stratum 1 source, taking #3 into account. The analogy goes, if you have two boats on the water, and you are trying to measure the altitude of one compared to the other, your accuracy is best if the source boat is very stable and not moving. The same goes for time, and if your source clock isn’t stable, then the entire chain of synchronized clocks is affected and magnified at each stage. It also must be accessible because disruptions in the connection will interfere with time synchronization. And finally, it must be secure. If the time reference is not properly maintained, or operated by a potentially malicious party, you could expose your domain to time based attacks.
- Stable client clock — A stable client clocks assures that the natural drift of the oscillator is containable. NTP uses multiple samples from potentially multiple NTP servers to condition and discipline your local computers clock. It does not step the time changes, but rather slows or speeds up the local clock so that you approach the accurate time quickly and stay accurate between NTP requests. However, if the client computer clock’s oscillator is not stable, then more fluctuations in between adjustments can occur and the algorithms Windows uses to condition the clock don’t work accurately. In some cases, firmware updates might be needed for accurate time.
- Symmetrical NTP communication — It is critical that the connection for NTP communication is symmetrical. NTP uses calculations to adjust the time that assume the network path is symmetrical. If the path the NTP packet takes going to the server takes a different amount of time to return, the accuracy is affected. For example, the path could change due to changes in network topology, or packets being routed through devices that have different interface speeds.
For battery powered devices, both mobile and portable, you must consider different strategies. As per our recommendation, keeping accurate time requires the clock to be disciplined once a second, which correlates to the Clock Update Frequency. These settings will consume more battery power than expected and can interfere with power saving modes available in Windows for such devices. Battery powered devices also have certain power modes which stop all applications from running, which interferes with W32time’s ability to discipline the clock and maintain accurate time. Additionally, clocks in mobile devices may not be very accurate to begin with. Ambient environmental conditions affect clock accuracy and a mobile device can move from one ambient condition to the next which may interfere with its ability to keep time accurately. Therefore, Microsoft does not recommend that you set up battery powered portable devices with high accuracy settings.
Why is time important?
There are many different reasons you might need accurate time. The typical case for Windows is Kerberos, which requires 5 minutes of accuracy between the client and server. However, there are many other areas that can be affected by time accuracy including:
- Government Regulations like:
- 50 ms accuracy for FINRA in the US
- 1 ms ESMA (MiFID II) in the EU.
- Cryptography Algorithms
- Distributed systems like Cluster/SQL/Exchange and Document DBs
- Blockchain framework for bitcoin transactions
- Distributed Logs and Threat Analysis
- AD Replication
- PCI (Payment Card Industry), currently 1 second accuracy
служба времени Windows Windows Time Service
Применяется к: Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows 10 или более поздних версий Applies to: Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows 10 or later
В данном руководстве In this guide
- Поиск сведений о конфигурации службы времени Windows Where to find Windows Time Service Configuration Information
- Принцип работы службы времени Windows What is the Windows Time Service?
- Важность протоколов времени Importance of Time Protocols
- Принцип работы службы времени Windows How the Windows Time Service Works
- Средства и параметры службы времени Windows Windows Time Service Tools and Settings
В Windows Server 2003 и Microsoft Windows 2000 Server служба каталогов называется «служба каталогов Active Directory» In Windows Server 2003 and Microsoft Windows 2000 Server, the directory service is named Active Directory directory service. В Windows Server 2008 и Windows Server 2008 R2 служба каталогов называется «доменные службы Active Directory» (AD DS). In Windows Server 2008 R2 and Windows Server 2008 , the directory service is named Active Directory Domain Services (AD DS). Остальная часть этой статьи относится к AD DS, но эти сведения применимы также и к доменным службам Active Directory в Windows Server 2016. The rest of this topic refers to AD DS, but the information is also applicable to Active Directory Domain Services in Windows Server 2016.
Служба времени Windows, также известная как W32Time, синхронизирует дату и время для всех компьютеров, работающих в домене AD DS. The Windows Time service, also known as W32Time, synchronizes the date and time for all computers running in an AD DS domain. Синхронизация времени важна для правильной работы многих служб Windows и бизнес-приложений. Time synchronization is critical for the proper operation of many Windows services and line-of-business applications. Служба времени Windows использует протокол сетевого времени (NTP) для синхронизации компьютерных часов в сети, чтобы можно было назначить точное значение времени или отметку времени запросам проверки сети и доступа к ресурсам. The Windows Time service uses the Network Time Protocol (NTP) to synchronize computer clocks on the network so that an accurate clock value, or time stamp, can be assigned to network validation and resource access requests. Служба интегрирует поставщики NTP и времени, что делает ее надежной и масштабируемой службой времени для корпоративных администраторов. The service integrates NTP and time providers, making it a reliable and scalable time service for enterprise administrators.
До Windows Server 2016 служба W32Time не предназначалась для поддержки зависящих от времени потребностей приложений. Prior to Windows Server 2016, the W32Time service was not designed to meet time-sensitive application needs. Не теперь обновления Windows Server 2016 позволяют реализовать в домене решение с точностью 1 мс. However, updates to Windows Server 2016 now allow you to implement a solution for 1ms accuracy in your domain. Дополнительные сведения см. в статьях Windows 2016 Accurate Time (Точное время для Windows Server 2016) и Support boundary for high-accuracy time (Граница области поддержки для сверхточного времени). See Windows 2016 Accurate Time and Support boundary to configure the Windows Time service for high-accuracy environments for more information.
Поиск сведений о конфигурации службы времени Windows Where to Find Windows Time Service Configuration Information
В этом руководстве не затрагивается настройка службы времени Windows. This guide does not discuss configuring the Windows Time service. В Microsoft TechNet и в базе знаний Майкрософт есть несколько разделов, которые описывают процедуры настройки службы времени Windows. There are several different topics on Microsoft TechNet and in the Microsoft Knowledge Base that do explain procedures for configuring the Windows Time service. Если вам требуется информация о конфигурации, вы сможете найти ее в следующих статьях. If you require configuration information, the following topics should help you locate the appropriate information.
Сведения о том, как настроить службу времени Windows для эмулятора основного контроллера домена в корне леса, см. в этих статьях: To configure the Windows Time service for the forest root primary domain controller (PDC) emulator, see:
Статья 816042 базы знаний Майкрософт Как настроить полномочный сервер времени в операционной системе Windows Server, в которой описаны параметры конфигурации для компьютеров под управлением Windows Server 2008 R2, Windows Server 2008, Windows Server 2003 и Windows Server 2003 R2. Microsoft Knowledge Base article 816042, How to configure an authoritative time server in Windows Server, which describes configuration settings for computers running Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, and Windows Server 2003 R2.
Сведения о настройке службы времени Windows на любом клиенте- или сервере-члене домена или даже на контроллерах домена, которые не настроены в качестве эмулятора основного контроллера в корне леса, см. в этой статье. To configure the Windows Time service on any domain member client or server, or even domain controllers that are not configured as the forest root PDC emulator, see Configure a client computer for automatic domain time synchronization.
Некоторые приложения могут требовать наличия высокоточных служб времени на компьютерах, где они работают. Some applications may require their computers to have high-accuracy time services. В этом случае вы можете настроить источник времени, задаваемый вручную, но имейте в виду, что служба времени Windows не предназначена для работы в качестве источника с высокой точностью времени. If that is the case, you may choose to configure a manual time source, but be aware that the Windows Time service was not designed to function as a highly accurate time source. Убедитесь, что вы знаете об ограничениях поддержки для сред высокой точности, описанных в статье 939322 базы знаний Майкрософт: Support boundary for high-accuracy time (Граница области поддержки для высокоточного времени). Ensure that you are aware of the support limitations for high-accuracy time environments as described in Microsoft Knowledge Base article 939322, Support boundary to configure the Windows Time service for high-accuracy environments.
Чтобы настроить службу времени Windows на всех клиентских и серверных компьютерах под управлением Windows, которые настроены как члены рабочей группы, а не члены домена, см. статью Configure a Manual Time Source for a Selected Client Computer (Настройка источника времени вручную для выбранного клиентского компьютера). To configure the Windows Time service on any Windows-based client or server computers that are configured as workgroup members instead of domain members see Configure a manual time source for a selected client computer.
Сведения о настройке службы времени Windows на главном компьютере, на котором выполняется виртуальная среда, см. в статье 816042 базы знаний Майкрософт Как настроить полномочный сервер времени в операционной системе Windows Server. To configure the Windows Time service on a host computer that runs a virtual environment, see Microsoft Knowledge Base article 816042, How to configure an authoritative time server in Windows Server. Если вы работаете с продуктом виртуализации не от Майкрософт, обязательно ознакомьтесь с документацией поставщика для этого продукта. If you are working with a non-Microsoft virtualization product, be sure to consult the documentation of the vendor for that product.
Чтобы настроить службу времени Windows на контроллере домена, работающем в виртуальной машине, мы рекомендуем частично отключить синхронизацию времени между хост-системой и гостевой операционной системой, выполняющей роль контроллера домена. To configure the Windows Time service on a domain controller that is running in a virtual machine, it is recommended that you partially disable time synchronization between the host system and guest operating system acting as a domain controller. Это позволяет гостевому контроллеру домена синхронизировать время для иерархии домена, но предохраняет его от отклонения во времени при восстановлении из сохраненного состояния. This enables your guest domain controller to synchronize time for the domain hierarchy, but protects it from having a time skew if it is restored from a Saved state. Дополнительные сведения см. в статье 976924 базы знаний Майкрософт You receive Windows Time Service event IDs 24, 29, and 38 on a virtualized domain controller that is running on a Windows Server 2008-based host server with Hyper-V (Вы получаете события с кодами 24, 29 или 38 от службы времени Windows на виртуализированном контроллере домена, который выполняется на сервере узла под управлением Windows Server 2008 с Hyper-V) и статье Deployment Considerations for Virtualized Domain Controllers (Рекомендации по развертыванию виртуализованных контроллеров домена). For more information, see Microsoft Knowledge Base article 976924, You receive Windows Time Service event IDs 24, 29, and 38 on a virtualized domain controller that is running on a Windows Server 2008-based host server with Hyper-V and Deployment Considerations for Virtualized Domain Controllers.
Чтобы настроить службу времени Windows на контроллере домена, работающем в качестве эмулятора основного котроллера в корне леса, который также работает на виртуальном компьютере, следуйте тем же инструкциям, что и для физического компьютера, как описано в статье Configure the Windows Time service on the PDC emulator in the Forest Root Domain (Настройка службы времени Windows для эмулятора основного контроллера домена в корневом домене леса). To configure the Windows Time service on a domain controller acting as the forest root PDC emulator that is also running in a virtual computer, follow the same instructions for a physical computer as described in Configure the Windows Time service on the PDC emulator in the Forest Root Domain.
Чтобы настроить службу времени Windows на рядовом сервере, работающем как виртуальный компьютер, используйте иерархию времени домена, как описано в статье Configure a Client Computer for Automatic Domain Time Synchronization (Настройка клиентского компьютера для автоматической синхронизации времени домена). To configure the Windows Time service on a member server running as a virtual computer, use the domain time hierarchy as described in (Configure a client computer for automatic domain time synchronization.
Принцип работы службы времени Windows What is the Windows Time Service?
Служба времени Windows (W32Time) обеспечивает синхронизацию сетевых часов для компьютеров без необходимости в расширенной настройке. The Windows Time service (W32Time) provides network clock synchronization for computers without the need for extensive configuration.
Служба времени Windows необходима для успешной работы проверки подлинности Kerberos версии 5 и, следовательно, для проверки подлинности на основе AD DS. The Windows Time service is essential to the successful operation of Kerberos version 5 authentication and, therefore, to AD DS-based authentication. Любое приложение, поддерживающее Kerberos, включая большинство служб безопасности, зависит от синхронизации времени между компьютерами, участвующими в запросе проверки подлинности. Any Kerberos-aware application, including most security services, relies on time synchronization between the computers that are participating in the authentication request. Контроллеры доменов AD DS также должны иметь синхронизированные часы, чтобы обеспечивать точную репликацию данных. AD DS domain controllers must also have synchronized clocks to help to ensure accurate data replication.
Служба времени Windows реализована в библиотеке динамической компоновки с именем W32Time.dll. The Windows Time service is implemented in a dynamic link library called W32Time.dll. Служба W32Time.dll устанавливается по умолчанию в папку %Systemroot%\System32 во время установки и настройки операционной системы. W32Time.dll is installed by default in the %Systemroot%\System32 folder during operating system setup and installation.
Служба W32Time.dll изначально разрабатывалась для Windows 2000 Server и поддержки спецификации протоколом проверки подлинности Kerberos версии 5, требующей синхронизации в сети. W32Time.dll was originally developed for Windows 2000 Server to support a specification by the Kerberos V5 authentication protocol that required clocks on a network to be synchronized. Начиная с Windows Server 2003, служба W32Time.dll обеспечивала повышенную точность синхронизации сетевых часов в операционной системе Windows 2000 Server и, кроме того, поддерживала различные аппаратные устройства и протоколы сетевого времени с использованием поставщиков времени. Starting with Windows Server 2003, W32Time.dll provided increased accuracy in network clock synchronization over the Windows 2000 Server operating system and, in addition, supported a variety of hardware devices and network time protocols by means of time providers. Несмотря на то, что изначально планировалось обеспечить синхронизацию часов для проверки подлинности Kerberos, теперь множество приложений используют метки времени для обеспечения согласованности транзакций, записи времени важных событий и другой критически важной для бизнеса информации, которая зависит от времени. Although originally designed to provide clock synchronization for Kerberos authentication, many current applications use timestamps to ensure transactional consistency, to record the time of important events, and other business-critical, time-sensitive information. Эти приложения получают преимущества от синхронизации времени между компьютерами, которую обеспечивает служба времени Windows. These applications benefit from time synchronization between computers that is provided by the Windows Time service.
Важность протоколов времени Importance of Time Protocols
Протоколы времени взаимодействуют между двумя компьютерами для обмена сведениями о времени, а затем используют эти сведения для синхронизации часов. Time protocols communicate between two computers to exchange time information and then use that information to synchronize their clocks. При использовании протокола времени службы времени Windows клиент запрашивает сведения о времени с сервера и синхронизирует свои часы на основе полученных данных. With the Windows Time service time protocol, a client requests time information from a server and synchronizes its clock based on the information that is received.
Служба времени Windows использует протокол NTP для синхронизации времени по сети. The Windows Time service uses NTP to help synchronize time across a network. NTP — это протокол времени в Интернете, включающий алгоритмы правил работы, необходимые для синхронизации часов. NTP is an Internet time protocol that includes the discipline algorithms necessary for synchronizing clocks. NTP является более точным протоколом времени, чем Simple Network Time Protocol (SNTP), который используется в некоторых версиях Windows; однако W32Time продолжает поддерживать SNTP для обратной совместимости с компьютерами, на которых работают службы времени на основе SNTP, такие как Windows 2000. NTP is a more accurate time protocol than the Simple Network Time Protocol (SNTP) that is used in some versions of Windows; however, W32Time continues to support SNTP to enable backward compatibility with computers running SNTP-based time services such as Windows 2000.