Команда net

Содержание:

Локальная сеть

Если дома или в офисе установлено несколько компьютеров, подключенных по локальной сети, можно использовать один как сервер точного времени. Синхронизация с временем ПК, входящего в локальную сеть, производится так же, как и с серверами в интернете. Но сначала придется запустить сервер NTP на компьютере, время которого будут использовать остальные участники сети.

Для этого откройте реестр и отредактируйте раздел HKLM\System\CurrentControlSet\services\W32Time\TimeProviders\NtpServer. В нем ключу Enabled нужно присвоить значение 1, затем перезапустить службу Windows time из командной строки, напечатав net stop w32time, а после выполнения — net start w32time.

Помните, что теперь ПК эксплуатируется другими пользователями сети в качестве ориентира, не забывайте проверять его работоспособность время от времени. Включен ли сервер, можно проверить командой w32tm /query /configuration. Значение Enabled, равное 1, показывает, что с сервером всё в порядке.

Не забывайте синхронизировать время на компьютере с интернетом, ведь теперь, если часы убегут вперед или слишком отстанут на нем, это отразится на всех пользователях.

На самом деле синхронизировать время в Виндоус 7 очень просто. Сейчас вы сами в этом убедитесь.

Первое, что вам понадобится — это доступ к интернету. Если вы вы уже в онлайне, то дальше просто выполните несколько действий.

Кликните мышкой на часы, расположенные в системной трее.

Появится окно «Дата и время»
с тремя вкладками. Вам надо перейти на вкладку «Время по Интернету».
(Кстати слово «интернет» пишется с маленькой буквы).

Варианты настройкиConfiguration options

Есть три способа настроить синхронизацию времени для виртуальных машин Windows, размещенных в Azure:There are three options for configuring time sync for your Windows VMs hosted in Azure:

  • время узла и time.windows.com;Host time and time.windows.com. это конфигурация по умолчанию для образов из Azure Marketplace;This is the default configuration used in Azure Marketplace images.
  • только от узла;Host-only.
  • использование другого внешнего сервера времени с применением или без применения времени узла.Use another, external time server with or without using host time.

Конфигурация по умолчаниюUse the default

По умолчанию образы виртуальных машин с ОС Windows настроены для синхронизации w32time из двух источников:By default Windows OS VM images are configured for w32time to sync from two sources:

  • поставщика NtpClient, который получает сведения с сервера time.windows.com;The NtpClient provider, which gets information from time.windows.com.
  • службы VMICTimeSync, которая служит для передачи времени узла виртуальным машинам и корректировки после приостановки виртуальных машин для обслуживания.The VMICTimeSync service, used to communicate the host time to the VMs and make corrections after the VM is paused for maintenance. Для поддержания точного времени узлы Azure используют принадлежащие Майкрософт устройства Stratum 1.Azure hosts use Microsoft-owned Stratum 1 devices to keep accurate time.

w32time отдает приоритет поставщикам времени в следующей очередности: уровень страты, задержка корня, дисперсия корня, смещение времени.w32time would prefer the time provider in the following order of priority: stratum level, root delay, root dispersion, time offset. В большинстве случаев служба w32time на виртуальной машине Azure будет предпочитать время размещения из-за того, что в результате оценки будут сравниваться оба источника времени.In most cases, w32time on an Azure VM would prefer host time due to evaluation it would do to compare both time sources.

Для присоединенных к домену компьютеров домен сам устанавливает иерархию синхронизации времени, однако корень леса по-прежнему должен получать время откуда-нибудь и описанные ниже особенности соблюдаются.For domain joined machines the domain itself establishes time sync hierarchy, but the forest root still needs to take time from somewhere and the following considerations would still hold true.

Только от узлаHost-only

Так как time.windows.com является общедоступным NTP-сервером, синхронизация времени с ней требует передачи трафика через Интернет, а различные задержки пакетов могут негативно повлиять на качество синхронизации времени. Удаление time.windows.com путем переключения на синхронизацию только между узлами иногда может улучшить результаты синхронизации времени.Because time.windows.com is a public NTP server, syncing time with it requires sending traffic over the internet, varying packet delays can negatively affect quality of the time sync. Removing time.windows.com by switching to host-only sync can sometimes improve your time sync results.

Переход на синхронизацию времени только с узлом имеет смысл, если возникают проблемы при использовании конфигурации синхронизации по умолчанию.Switching to host-only time sync makes sense if you experience time sync issues using the default configuration. Попробуйте использовать синхронизацию только с узлом и посмотрите, улучшится ли синхронизация времени в виртуальной машине.Try out the host-only sync to see if that would improve the time sync on VM.

Внешний сервер времениExternal time server

Если предъявляются особые требования к синхронизации времени, можно также воспользоваться внешними серверами времени.If you have specific time sync requirements, there is also an option of using external time servers. Внешние серверы времени могут предоставлять определенное время, что может быть полезно для тестирования, обеспечения одинаковости времени в машинах, размещенных в центрах обработки данных, не принадлежащих Майкрософт, или обработки корректировочных секунд особым образом.External time servers can provide specific time, which can be useful for test scenarios, ensuring time uniformity with machines hosted in non-Microsoft datacenters, or handling leap seconds in a special way.

Внешние серверы можно использовать в сочетании со службой VMICTimeSync и поставщиком VMICTimeProvider, что позволяет получить результаты, сходные с конфигурацией по умолчанию.You can combine external servers with the VMICTimeSync service and VMICTimeProvider to provide results similar to the default configuration.

Средства командной строки

Не всегда удобно использовать графические средства настройки системы. Например, если окно перегружено текстом: глаза пытаются найти нужную кнопку, но все сливается в одно монотонное изображение. Да и ввод пары команд производится быстрее, чем частые перемещения курсора мыши из одного угла окна в другой.

Чтобы синхронизировать время на компьютере с интернетом при помощи командной строки, откройте меню «Пуск» и выберите «Выполнить» либо просто нажмите Win+R на клавиатуре. В строке окна, которое запустится, напишите cmd, а после нажмите Enter. Так вы войдете в командную строку, следующая команда выполнит обновление времени на локальном компьютере с сервером, установленным по умолчанию:

Для настройки сервера, который будет использовать система, чтобы синхронизировать время на локальном компьютере с интернетом, выполните команды:

  • w32tm /config /manualpeerlist: /syncfromflags:manual /reliable:yes (эта команда устанавливает сервер, время которого будет использоваться для обновлений);
  • w32tm /config /update (сообщение службе времени о том, что настройки изменились);
  • net stop w32time && net start w32time (перезапуск службы).

Client

Construction

An instance of timesync is created as:

var ts = timesync(options);

Options

The following options are available:

Name Type Default Description
Delay in milliseconds between every request sent.
or Interval in milliseconds for running a synchronization. Defaults to 1 hour. Set to to disable automatically running synchronizations (synchronize by calling ).
Function returning the local system time.
or Array or comma separated string with uri’s or id’s of the peers to synchronize with. Cannot be used in conjunction with option .
Number of times to do a request to every peer.
none Url of a single server in case of a master/slave configuration. Cannot be used in conjunction with option .
Timeout in milliseconds for requests to fail.

Methods

Name Return type Description
none Destroy the timesync instance. Stops automatic synchronization. If timesync is currently executing a synchronization, this synchronization will be finished first.
Get the synchronized time. Returns a timestamp. To create a , call .
Register a callback handler for an event. Returns the timesync instance. See section for more information.
Unregister a callback handler for an event. If no callback is provided, all callbacks of this event will be removed. Returns the timesync instance. See section for more information.
none Do a synchronization with all peers now.

To be able to send and receive messages from peers, needs a transport. To hook up a transport like a websocket or http requests, one has to override the method of the instance, and has to call on incoming messages.

Name Return type Description
none Send a message to a peer. is the id of the peer, and a JSON object containing the message. Must return a Promise which resolves when the message has been sent, or rejects when sending failed or a timeout occurred.
none Receive a message from a peer. is the id of the sender, and a JSON object containing the message.

sends messages using the JSON-RPC protocol, as described in the section .

Events

emits events when starting and finishing a synchronization, and when the time offset changes. To listen for events:

ts.on('change', function (offset) {
  console.log('offset changed:', offset);
});

Available events:

Name Description
Emitted when the offset is changed. This can only happen during a synchronization. Callbacks are called with the new offset (a number) as argument.
Emitted when an error occurred. Callbacks are called with the error as argument.
Emitted when a synchronization is started or finished. Callback are called with a value or as argument.
Name Type Description
The offset from system time in milliseconds.
An object holding all options of the timesync instance. One can safely adjust options like at any time. Not all options can be changed after construction, for example a changed value will not be applied.

DS Clock

DS Clock is another good software for network time synchronization. This time synchronization software uses SNTP protocol to connect to the time server.

The software is made up of two tabs: Clock and Synchronization. The Clock tab contains some options to manage data and time format related settings. While, Synchronization tab lets you choose a time server, auto time adjustment frequency, etc. After choosing a time server, you can click on Adjust Now button to calibrate PC time to server.

Like some other software, it also lets you add your own time server but to do so, you need to edit the timesvrs.dat file.

Coopoint Atomic Clock Sync

Coopoint Atomic Clock Sync is another free server time synchronization software for Windows. The software interface is kept very simple and displays information about server time, local time, their difference, and also time zone. You can change time zone as per your requirement.

In order to synchronize time of your PC to the server, you need to click on synchronize button icon given in the lower part of the interface. Also, by clicking on Change time zone option, you can manually set date and time, time zone, specify additional clocks to see time for other time zones, and synchronize your PC to internet time using time.windows.com server. You can see time for other time zones (specified using additional clocks), by hovering over or clicking on the taskbar clock.

Server

comes with a build in server to serve as a master for time synchronization. Clients can adjust their time to that of the server. The server basically just implements a POST request responding with its current time, and serves the static files and from the folder. It’s quite easy to implement this request handler yourself, as is demonstrated in the advanced examples.

The protocol used by the server is described in the section .

The server can be loaded in node.js as:

var timesyncServer = require('timesync/server');

Methods

Name Return type Description
Create a new, dedicated http Server. This is just a shortcut for doing .
Attach a request handler for time synchronization requests to an existing http Server. Argument must be an instance of . Argument is optional, and is by default.

Properties

Name Type Description
A default request handler, handling requests for the timesync server. Signature is . This handler can be used to attach to an expressjs server, or to create a plain http server by doing .

Protocol

sends messages using the JSON-RPC protocol. A peer sends a message:

{"jsonrpc": "2.0", "id": "12345", "method": "timesync"}

The receiving peer replies with the same id and its current time:

{"jsonrpc": "2.0", "id": "12345", "result": 1423151204595}

The sending peer matches the returned message by id and uses the result to adjust it’s offset.

Algorithm

This algorithm assumes multiple clients synchronizing with a single server. In case of multiple peers, will take the average offset of all peers (excluding itself) as offset.

To build the library:

This will generate the files and in the folder .

To automatically build on changes, run:

Как исправить настройки синхронизации времени

Настройка синхронизации времени на компьютерах и контроллерах домена
(кроме КД с ролью PDC)

  1. Найдите все групповые политики, изменяющие настройки синхронизации времени, и отключите такие политики. Через групповые политики служба времени настраивается здесь: gpedit.msc => «Computer Configuration» => «Administrative Templates» => «System» => «Windows Time Service» => «Time Providers». Проверьте, что политики синхронизации времени не применяются, для этого можно выполнить команду:
  2. Проверьте, что на всех виртуальных машинах — контроллерах домена отключена синхронизация времени с хостами виртуализации. Для этого (в Hyper-V) можно зайти в свойства виртуальной машины, раздел средств интеграции и отключить синхронизацию времени. После чего конфигурацию службы времени (на виртуальном контроллере домена) нужно обновить.
  3. Обновите конфигурацию на всех проблемных компьютерах / контроллерах домена (кроме КД с ролью PDC):
  4. Выполните принудительную синхронизацию времени, дав команду заново найти источники синхронизации времени:
  5. Если вышеуказанные действия не помогают, перезагрузите службу времени (на проблемных компьютерах)
    и заново выполните пункты 3 и 4.
  6. Если вышеуказанные действия не помогли решить проблему с синхронизацией времени, необходима перерегистрация службы времени на проблемных компьютерах (и повторная настройка параметров).

Настройка синхронизации времени на контроллере домена с ролью PDC

Настройки времени на КД с ролью PDC принципиально отличаются от настроек на всех остальных компьютерах в домене (включая остальные контроллеры домена). PDC является источником времени во всём домене, именно его время будет использовано (прямо или косвенно — через другие контроллеры домена) всеми остальными компьютерами.

  1. Если контроллер домена с ролью PDC — виртуальная машина, убедитесь, в настройках этой виртуальной машины отключена синхронизациия времени с хостом, на котором она находится!
  2. Убедитесь, что групповые политики синхронизации времени во всем домене (если они у Вас есть) не применяются к КД с ролью PDC! У этого компьютера источник времени — в интернете, и тип синхронизации времени (в отличие от всего остального домена) не NT5DS, а NTP!
  3. Если есть сомнения в том, что синхронизация времени на КД с ролью PDC выполняется правильно, проще всего выполнить перерегистрацию и повторную настройку службы времени.

Настройка синхронизации времени на контроллере домена с ролью PDC

Наш КД с ролью PDC необходимо настроить на синхронизацию с внешним источником (в интернете). Для этой цели не подходит тип синхронизации NT5DS и синхронизации в соответствии с иерархией домена (DOMHIER). Поэтому на нашем КД с ролью PDC мы используем тип синхронизации NTP и синхронизация будет настроена вручную (MANUAL). Источники синхронизации (peers) указываются в кавычках, а если таких источников несколько, то они перечисляются через запятую. Кроме того, мы даем указание считать данный источник синхронизации (КД с ролью PDC) надежным источником времени (reliable):

Теперь можно ускорить применение параметров и синхронизацию времени, перезагрузив службу времени и форсировав синхронизацию:

или

После выполнения этих команд (сделав паузу в несколько минут на применение параметров и выполнение синхронизации) сравните время на контроллере домена с временем в интернете:

Не забудьте проверить, что на всех контроллерах домена время синхронизировалось с PDC. Для этого наберите команду:

Всё должно заработать!

P.S.: Обратите внимание, что применение параметров команды w32tm требует времени. Поэтому после каждого обновления конфигурации рекомендуем делать паузу в 1-5 минут, а потом уже проверять, обновилась ли конфигурация службы времени, и как всё работает

Источники информации для данной статьи:

  1. w32tm Настройка синхронизации времени через cmd
  2. Windows Standart 2012 R2 синхронизация времени с интернетом не работает
  3. Особенности настройки времени для виртуальных контроллеров домена
  4. OsZone.net: Домен — Синхронизация времени
  5. Настройка синхронизации времени в домене Active Directory
  6. Синхронизация времени с внешним NTP сервером в Windows Server 2008 R2
  7. Настройка синхронизации времени по NTP с помощью групповых политик

Статья опубликована: 20.08.2017, обновлена 31.01.2020

Neutron

Neutron is another good software to synchronize PC time to server. You need to run it with administrator privilege in order to make corrections to system date and time.

As you launch this software, you can see the current system time. Now, you can click on Get atomic time button to get atomic time. In order to adjust system clock, you need to click on Synchronize button and wait for just a few seconds to allow the software to establish connection to the server and make appropriate corrections.

Additionally, it comes with a set of time servers and you can manually select a server for network time synchronization. Also, you can enable automatic connection to next server in case of connection failure.

FG Time Sync

FG Time Sync is an easy to use network time synchronization tool for Windows. It utilizes the time protocol specified in internet time standard RFC-868. Moreover, it comes with a list of time servers to synchronize time of your PC with. Some of these servers are time.ien.it, cuckoo.nevada.edu, DESKTOP-NQL1BFC, etc.

To use this net time sync tool, you just need to launch the software, specify the time server, and click on Sync Now button. You may require to use it with time.ien.it, cuckoo.nevada.edu servers to synchronize time. Thus, it is one of the simplest to use software for time synchronization.

Why Netdata

Netdata has a quite different approach to monitoring.

Netdata is a monitoring agent you install on all your systems. It is:

  • A metrics collector for system and application metrics (including web servers, databases, containers, and much
    more),
  • A long-term metrics database that stores recent metrics in memory and «spills» historical metrics to disk for
    efficient long-term storage,
  • A super fast, interactive, and modern metrics visualizer optimized for anomaly detection,
  • And an alarms notification engine for detecting performance and availability issues.

All the above, are packaged together in a very flexible, extremely modular, distributed application.

This is how Netdata compares to other monitoring solutions:

Netdata others (open-source and commercial)
High resolution metrics (1s granularity) Low resolution metrics (10s granularity at best)
Monitors everything, thousands of metrics per node Monitor just a few metrics
UI is super fast, optimized for anomaly detection UI is good for just an abstract view
Long-term, autonomous storage at one-second granularity Centralized metrics in an expensive data lake at 10s granularity
Meaningful presentation, to help you understand the metrics You have to know the metrics before you start
Install and get results immediately Long preparation is required to get any useful results
Use it for troubleshooting performance problems Use them to get statistics of past performance
Kills the console for tracing performance issues The console is always required for troubleshooting
Requires zero dedicated resources Require large dedicated resources

Netdata is open-source, free, super fast, very easy, completely open, extremely efficient,
flexible and integrate-able.

It has been designed by system administrators, DevOps engineers, and developers for to not just visualize
metrics, but also troubleshoot complex performance problems.

Dimension 4

Dimension 4 is another free software to synchronize time of your PC to a server. It comes with a number of built-in servers based on SNTP protocol. You can use any of these servers to synchronize PC time. Also, it lets you add servers that are based on SNTP, Time/TCP, Time/UDP, or HTTP protocol.

After adding/selecting a server for PC time synchronization, you can specify time synchronization rate under How Often section. Also, it lets you perform time zone correction and specify maximum time correction (in seconds, minutes, or hours) to perform using this time synchronization tool. Now, it will automatically establish a connection to the server and perform time correction as per specified synchronization interval.

Using the Advanced button provided on its interface, you can set timeout and specify interval to retry time synchronization on errors. Also, enable automatic or manual server selection for each time synchronization process. You can also enable error and successful synchronization message boxes to appear on the screen.

Note: You need to run this software in administrator mode to perform network time synchronization.

What Netdata monitors

Netdata can collect metrics from 200+ popular services and applications, on top of dozens of system-related metrics
jocs, such as CPU, memory, disks, filesystems, networking, and more. We call these collectors, and they’re managed
by plugins, which support a variety of programming languages, including Go and
Python.

Popular collectors include Nginx, Apache, MySQL, statsd, cgroups (containers, Docker, Kubernetes,
LXC, and more), Traefik, web server files, and much more.

See the full list of supported collectors.

Netdata’s data collection is extensible, which means you can monitor anything you can get a metric for. You can even
write a collector for your custom application using our plugin API.

Chrony

  • chrony может быстрее синхронизировать системные часы с большей точностью;
  • chrony меньше, потребляет меньше памяти и обращается к процессору только тогда, когда это необходимо. Для экономии ресурсов и энергии это большой плюc;
  • chrony поддерживает метки времени на аппаратном уровне в Linux, что обеспечивает чрезвычайно точную синхронизацию в локальных сетях.
  • chronyd — сервис, работающий в фоновом режиме. Он получает информацию о разнице системных часов с внешним сервером времени и корректирует локальное время. Он также реализует протокол NTP и может выступать в качестве клиента или сервера.
  • chronyc — утилита командной строки для мониторинга и контроля программы. Используется для тонкой настройки различных параметров сервиса, например позволяет добавлять или удалять серверы NTP в то время, как chronyd продолжает работать.

использует

News

— Netdata v1.24.0 released!

The v1.24.0 release of the Netdata Agent brings enhancements to the breadth of metrics we collect with a new Prometheus/OpenMetrics collector and enhanced storage and querying with a new multi-host database mode.

— Netdata v1.23.2 released!

Release v1.23.2 of the Netdata Agent is a patch for one significant issue.

PR #9491 fixed a buffer overrun vulnerability in Netdata’s JSON parsing
code. This vulnerability could be used to crash Agents remotely, and in some circumstances, could be used in an
arbitrary code execution (ACE) exploit.

We strongly encourage all Netdata users to update their nodes to v1.23.2 as soon as possible.

This release also contains additional bug fixes and improvements.

— Netdata v1.23.1 released!

Release v1.23.1 of the Netdata Agent is a patch for two significant issues.

PR #9436 fixed an issue where dimensions were marked obsolete and
archived simultaneously, which caused segmentation faults. We’re grateful to marioem, who
first reported the issue, and other members of the Netdata community who contributed their insights and valuable log
information, which we used to diagnose and fix the bug.

PR #9428 fixed a significant issue with duplicate alarm IDs, which
caused issues in how alarms were sent and displayed in Netdata Cloud.

This release also contains a few additional bug fixes that were not fully reviewed before the release of v1.23.0.

— Netdata v1.23.0 released!

The v1.23.0 release of the Netdata Agent is all about unlocking new depths of visibility for your applications,
services, and systems. We have Kubernetes service discovery, new eBPF metrics like virtual filesystem switch and
bandwidth per process out of the Linux kernel at event frequency, more interoperability with your monitoring stack
thanks to a new exporting engine, and much more.

This release contains 2 new collectors, 1 new exporting connector, 1 new alarm notification method, 55 improvements, 45
documentation updates, and 40 bug fixes.

Our service discovery collector detects Kubernetes (k8s) pods
and immediately collects metrics from 22 different services as the associated pods are created, destroyed, and
scaled. Service discovery is installed when you use our Helm chart, which means
you can now collect and visualize service-, pod-, Kubelet-, kube-proxy-, and node-level k8s metrics with one command and zero configuration. All our Kubernetes monitoring components are open source and free for clusters
of any size.

We’re also releasing an improvement for the availability of your monitoring and metrics: persistent metadata. The
Agent now writes metadata to disk alongside metrics to allow access to non-active charts from Netdata Cloud and enable
future features.

Недокументированные настройки

По умолчанию период, с которым Windows после настройки будет синхронизировать время на компьютере с интернетом, равен неделе. Иногда этот интервал требуется уменьшить, но встроенные средства не позволяют выполнить необходимую конфигурацию. Поможет реестр.

Для запуска реестра в строке окна «Выполнить» введите regedit и нажмите Enter. Перейдите в ветку HKEYLM, в ней необходимо развернуть каталог SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient. Найдите параметр SpecialPollInterval. В нем уже будет записано значение 604800. Именно за такое количество секунд проходит одна неделя. Если изменить эту цифру на 3600, время синхронизации будет равно одному часу.

Не рекомендуется вводить в эту графу значения меньше часа и больше суток. Малые значения заметно увеличат интернет-трафик. К тому же если пытаться синхронизировать время каждые несколько секунд, сервер заблокирует ваш IP. При больших значениях не удастся добиться максимальной точности системных часов. После внесения изменений введите символы net stop w32time && net start w32time в командную строку.

Второй этап — NTP под защитой NTS

  • Unique Identifier Extension содержит случайный nonce для предотвращения атак путем повтора.
  • NTS Cookie Extension содержит один из имеющихся в наличие у клиента NTP куки. Поскольку только клиент располагает симметричными AAED ключами C2S и S2C, сервер NTP должен извлечь их из материала куки.
  • NTS Cookie Placeholder Extension способ для клиента запросить дополнительные куки с сервера. Это расширение необходимо, чтобы ответ сервера NTP не был намного длиннее, чем запрос. Это позволяет предотвратить атаки усиления.
  • NTS Authenticator and Encrypted Extension Fields Extension содержит шифр алгоритма AAED с C2S ключем, заголовком NTP, временными отметками, и упомянутыми выше EF в качестве сопутствующих данных. Без этого расширения возможно подделать временные отметки.
  • Unique Identifier Extension зеркальная копия клиентского запроса, мера против атак путем повтора.
  • NTS Cookie Extension больше куки для продолжения сеанса.
  • NTS Authenticator and Encrypted Extension Fields Extension содержит шифр AEAD с S2C ключем.

Network Time (NetTime)

Network Time (NetTime) is another free network time synchronization software for Windows. It uses SNTP, RFC868 (TCP), and RFC 868 (UDP) protocols to perform network time synchronization.

Using this software, you can perform auto time synchronization at the defined synchronization interval, or perform it manually any time you want with the help of Update Now button. The software runs in background and synchronizes time with server at an interval defined by the user. You can easily launch this software from the system tray any time.

Like many other software, it also comes with some predefined servers (based on aforementioned protocols) to synchronize time. It also lets you add desired server by adding information about host name, protocol, port number, etc. You can also set time update interval, retry interval, etc.

Получение времени от GPS с сигналами PPS

4.3 Настройка FreeBSD и ntpd

Using a Garmin GPS 18 LVC as NTP stratum-0 on Linux 2.6 пересобрать ядро

options PPS_SYNC
cd /usr/ports/net/ntp
make install clean
ntpd_enable="YES"
ntpd_program="/usr/local/bin/ntpd"
link    cuau0   gps0
link    cuau0   pps0

серверов stratum 1

server ntp.mobatime.ru prefer iburst maxpoll 9
server ntp1.vniiftri.ru iburst maxpoll 9
server ntp2.vniiftri.ru iburst maxpoll 9
server  127.127.22.0    minpoll 4
fudge   127.127.22.0    flag3 1

kernel disciplineнаписано

server  127.127.20.0	    prefer	 minpoll 4
fudge   127.127.20.0	 flag1 1	flag3 1
/etc/rc.d/ntpd restart
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
xnut.rsuitb.ru   5.89.176.137     3 u   21   64  377    2.074   41.522   5.869
+mx.kr-pro.ru    62.117.76.138    2 u   34   64  377    4.167    0.336   0.423
+wooster.rojer.p 195.54.192.55    3 u   25   64  377   70.609    9.523   0.262
x193.124.4.177   7.123.225.33     3 u   21   64  377    2.133   56.525   9.041
 ntp1.vniiftri.r .INIT.          16 u    -  512    0    0.000    0.000   0.000
xntp2.vniiftri.r .PPS.            1 u   39   64  377   73.585  -14.117   0.189
*mail.mobatime.r .DTS.            1 u   17   64  377   15.223    0.147   0.843
oPPS(0)          .PPS.            0 l    5   16  377    0.000   -0.001   0.002
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*GPS_NMEA(0)     .GPS.            0 l   11   16   17    0.000   -9.795  14.537

*

ntptime
ntp_gettime() returns code 0 (OK)
  time d24065e8.9067dfac  Wed, Oct 12 2011 23:15:52.564, (.564085545),
  maximum error 4739 us, estimated error 1 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 2.004 us, frequency -28.979 ppm, interval 256 s,
  maximum error 4739 us, estimated error 1 us,
  status 0x2107 (PLL,PPSFREQ,PPSTIME,PPSSIGNAL,NANO),
  time constant 4, precision 0.001 us, tolerance 496 ppm,
  pps frequency -28.979 ppm, stability 0.019 ppm, jitter 1.434 us,
  intervals 313, jitter exceeded 195, stability exceeded 0, errors 1.

intervalджиттер

Средства командной строки

Не всегда удобно использовать графические средства настройки системы. Например, если окно перегружено текстом: глаза пытаются найти нужную кнопку, но все сливается в одно монотонное изображение. Да и ввод пары команд производится быстрее, чем частые перемещения курсора мыши из одного угла окна в другой.

Чтобы синхронизировать время на компьютере с интернетом при помощи командной строки, откройте меню «Пуск» и выберите «Выполнить» либо просто нажмите Win+R на клавиатуре. В строке окна, которое запустится, напишите cmd, а после нажмите Enter. Так вы войдете в командную строку, следующая команда выполнит обновление времени на локальном компьютере с сервером, установленным по умолчанию:

w32tm /resync.

Для настройки сервера, который будет использовать система, чтобы синхронизировать время на локальном компьютере с интернетом, выполните команды:

  • w32tm /config /manualpeerlist: /syncfromflags:manual /reliable:yes (эта команда устанавливает сервер, время которого будет использоваться для обновлений);
  • w32tm /config /update (сообщение службе времени о том, что настройки изменились);
  • net stop w32time && net start w32time (перезапуск службы).

Получение времени от GPS (без PPS)

3.1 Настройка GPS и ntpd

этой статье

  1. Подключите GPS-приемник к COM-порту сервера (USB переходник тоже должен сработать).
  2. Создайте символическую ссылку /dev/gpsX на устройство (например, у меня /dev/cuau0 -> /dev/gps0).
  3. В ntp.conf добавьте строку
    server  127.127.20.0    mode 0    prefer    iburst     minpoll 4       maxpoll 6

    Строка 127.127.20. означает, что мы используем локальный источник времени, драйвер 20 (NMEA Generic), устройство /dev/gps.
    Если ваше устройство работает на скорости отличной от 4800 бит/c, необходимо задать скорость с помощью команды mode: 0 — 4800 бит/c (по умолчанию, можно не указывать), 16 — 9600, 32 — 19200 и т.д.
    iburst — ускоряет инициализацию;
    minpoll n — минимальный интервал опроса в 2n секунд, минимум 4, т.е. 16 с;
    maxpoll n — максимальный интервал опроса в 2n секунд, максимум 17, около полутора суток;
    prefer — предпочитаемый сервер.
    Более подробные сведения можно найти в замечательной документации ntpd..

  4. Перезапустите сервер. Запустите ntpq -p. В списке должна быть строка GPS_NMEA(0)… Если этого не произошло, обратитесь к п. 5 «Возможные проблемы».

3.2 Проверка и коррекция

*+o — x2482

    
 remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*mail.mobatime.r .DTS.            1 u    5   377    1   14.894   -3.198   0.490
xGPS_NMEA(0)     .GPS.            0 l    2   377    7    0.000  -955.90  31.554

*

fudge   127.127.20.0    time2 0.956

*

Magitime

Magitime is one of the best free network time synchronizer for Windows. Using this software, you can easily synchronize date and time of your PC to US atomic clocks. You can access it from your system tray.

In order to use this utility for network time synchronization, you need to right click on its icon from the system tray and click on Utilities > Synchronize Time option. As a result, it automatically synchronizes time of your PC to the atomic clock.

Using its Track network option, you can analyze IP address, speed of your connection, total data transfer using Ethernet adapters, fiber distributed data interface adapters, token ring adapters, loop-back adapters, etc.

Apart from system time synchronization, it lets you detect all types of dial-up connections (especially PPP and SLIP standards), track LAN and other networks, analyze world time, schedule reminders for important dates and events, analyze moon phase (last and next, full moon, and new moon date and time), track internet expenses, set countdown timer to automatically disconnect connection after specified period of time, etc. It also provides options like Call Settings, Contact Manager, etc. for dial-up networks. Also, you can checkout timer logs, expenses statistics, data transfer statistics, etc. for specified date, week, or month using Statistics option.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *