How-to SNTP Server

This document describes the SNTP time server which is part of the QINSy software distribution.

Contents:

                                                             

Abstract

This tool can be used to let 3rd party applications synchronize to the MSWindows time or even to let multiple QINSy systems synchronize to one-another.
The SNTP server will act as a stratum 1 server when QINSy uses a PPS driver (with PPS TTL adaptor) with accuracy better than 0.5 milliseconds on local networks.
The QINSy SNTP server only works correctly when QINSy is also running.
You will need to define a Time Synchronisation system in your Database Setup. For a basic setup you could use the NMEA GGA driver, a PPS is not necessary.

Usage

Start the server:

  1. Manually
    1. You can also add a shortcut to SNTPServer.exe in the Console using the right-mouse menu option Add/Remove QPS Programs:
       
  2. Or you can add a shortcut to SNTPServer.exe to the start-up folder of MSWindows to start it when MSWindows starts.

    Info
    It is not possible to start this application automatically when QINSy starts.

When the Server starts it will show this window:

QINSy SNTP Server
RequestsThe Server will listen on any network adapter for NTP requests on the selected port number. If a request is handled then the request counter is incremented.
Port

Shows the used port number. The NTP default is port 123 but you can optionally use a different port.

Status bar shows
  • Whether the application is listening for activity
    • Running
    • Not Running
      This can happen for instance when port 123 is in use by other applications.

  • When QINSy is running with a working PPS driver then it shows "PPS" or else "Windows Clock"

  • The current UTC time.
OptionsThis button allows you to set some program settings, see paragraph below.

Options

A screen capture of the options dialog:

IP Settings
PortThe port number can be set to any number. Make sure that clients are also using this port number.
Clock Offset
Offset the clockThe time in the NTP reply can be offset with whole seconds for debug testing. Watch out, this is a dangerous option, leave at zero.
NTP clock status reply
Only valid status when PPS driver is running (advised)
  • When QINSy is running with valid PPS driver then the server will reply stratum-1 and no warning to the client.
  • When QINSy is not running (and hence the MSWindows clock is used) the server will report stratum-0 and warning "clock not synchronized" set in the NTP reply.

QINSy - NTP PPS Driver

When using the NTP PPS driver in your Template, it will only accept valid stratum and no warning.

Always report valid status

Regardless if QINSy is running or not the server will reply with stratum-1 and no warning.

Note that the client will synchronize to the SNTP server computer clock but this may not necessarily be UTC.

Display Options
Highlight client when offset >

Enter the maximum allowed offset between client and QINSy computer.

When an offset larger than the entered value is detected this will be highlighted in the SNTP Server dialog.

Hide in system tray when minimizedWhen enabled and the server is minimized the icon will disappear from the task bar and show up in the system tray (next to the clock). When double-clicked upon in the system tray the icon will show in the task bar again.
Hide in system tray on startupWhen enabled on start-up the icon will only show in the system tray.

Using the SNTP Server in combination with

  1. PPS NTP driver
    An NTP client is available for QINSy. Open Database Setup and add PPS driver "NTP Client (Network) (No TTL)". Select the IP number of the pc that runs the SNTP server. The port number is by default 123 but can be anything as long as you set the same port number in the server options. Note that the QINSy NTP client does not accept stratum-0 so when the SNTP server is not running alongside QINSy make sure to set SNTPServer option "Always report valid status".

  2. NTPD
    Some third party (usually Linux based) programs may use the official NTP Daemon "ntpd". This will work fine in combination with the SNTP Server.
  3. If you want to gain some experience with this you can download the MSWindows version from www.meinberg.de and run it on your machine.


Various

  1. Startup problems
    The server will complain if an MSWindows time service is running on your pc, as is often the case. Stop this time service altogether.
    This can be done like this:
    1. Run program: "services.msc". This will give you a list of the running MSWindows services.
    2. Find service "Windows Time " and stop it.
    3. Under the Action menu Properties set Startup type to Disabled, see screen-shot below.


  2. Timer resolution
    When the server is started the MSWindows timer resolution is decreased from 15 msec to 1 msec.
    This is done to improve accuracy of the clock, no worries, this is done very often these days by many programs like MSWindows Media player, Firefox, Skype etc.

  3. Accuracy
    When the SNTP server is running alongside QINSy with PPS TTL adapter the accuracy is better than 1 millisecond, this is what benchmark tests have shown.
    When running stand alone the accuracy will be worse because of the MSWindows clock. You can still use the time server to synchronize two computer clocks but both will be susceptible to clock drift.

  4. Clock drift
    During tests it was noticed that an MSWindows clock drifts between 20-50 milliseconds per hour.

  5. Xml file with settings
    Settings are stored in an xml file in the Appdata folder.

  6. NTP details
    Refer to www.ntp.org for more info on NTP protocol.