Electrical-Forenics Home ray@RayFranco.com                       601.529.7473
   © Dr. Ray Franco, PhD, PE  -  208 Fairways Dr., Vicksburg, MS 39183

Network Time Protocol (NTP)

The Network Time Protocol (NTP) synchronizes clocks of client computers with a time server. It runs on top of the User Datagram Protocol (udp) and uses port 123.

Linux Implementations of the NTP Protocol

With Linux, you have a choice. There are 3 different daemon that will implement the NTP Protocol, but ony one of them can be installed and running at a time [2].

  1. Ntpd is the reference daemon that fully implements the ntp protocol (clients and time servers).
  2. Chrony a daemon that fully implements the ntp protocol - Originally used by RedHat.
  3. Timesyncd is a lightweight daemon that implements the parts of ntp protocol neccessary for clients - Used by Debian.

There is also a Simplified Network Time Protocol (SNTP). Microsoft Windows OS uses SNTP [7].

You can determine which NTP daemon your system is currently using by checking its status:

sudo systemctl status systemd-timesyncd

or

sudo systemctl status ntp

Default Time Servers

You can change timesyncd's default time servers in its configuration file at: /etc/systemd/timesyncd.conf.

Microsoft Windows time.windows.com
Apple time.apple.com

US Government Public NTP Servers:

Google Public NTP Servers:

Amazon Public NTP Servers:

Cloudflare Public NTP Severs:

Other Public NTP Severs:

For a more comprehensive list of public NTP Servers, see reference [12].

datetimectl command

You can check the time, time-zone, and time server with the command:

datetimectl

or even better, the command:

datetimectl show-timesync

or

datetimectl status

You enable synchronization with a time server via the command:

datetimectl set-ntp true

To disable time syncrhronization:

datetimectl set-ntp false

To set the timezone, first get a list of time-zones with the command:

datetimectl list-timezones

The set the time-zone with the command:

datetimectl set-timezone your_Continent/City

NTP Appliances

You can purchase cheap NTP appliances between $200 - $400.

However, you will probably need 3 of them!

I believe that "Tall Paul Tech" has the right idea. You don't really need, your own GPS based NTP Server. You just need to allow it through your network, and block everything elsei [13]. My problem is that I do not yet know how to make a router out of a Raspberry Pi, and Paul confuses me with his VLANS.

However to see how this would or would not work, I need to set up a Raspberry Pi as a time server. There may also be antennas and receiver for the RPi.

Yes, there are GPS receivers for the Raspberry Pi, and you can do this much cheaper [5].

Make sure that the GPS reciever has an accurate 1 Pulse Per Second (PPS) output. The PPS connects to one of the GPIO pins on the Raspberry Pi or some microcomputer. The best that I can determine from articles on the Internet is that Chroney will that care of processing the PPS, while to get ntpd to process the PPS, you have to complile ntpd from the source.

In "Tall Paul Tech's" Youtube Video, "NAT is Not a Firewall", he uses a Yizget USB 3.0 to Eithernet Adapter.

References:

  1. How to Sync Time with a Server on Raspberry Pi
  2. How to Set Up Time Synchronization on Debian
  3. PiMyLifeUp - Syncing Time from the Network on the Raspberry Pi
  4. Wikpedia - Chrony
  5. Microsecond accurate NTP with a Raspberry Pi and PPS GPS
  6. how-to-tell-ubuntu-that-hardware-clock-is-local-time?
  7. A Guide To GPS NTP Servers For Network Time Synchronization
  8. Building a GPS based time server
  9. Building A NTP Server With Raspberry Pi and GPS
  10. FOSS-Linux: The ultimate guide: Syncing your Linux time with NTP server
  11. Cloudflare NTP servers
  12. GitHub - List of Top Public Time Servers
  13. YouTube - Tall Paul Tech - Raspberry Pi NTP Server
  14. VLANs - Raspberry Pi as a Router Using a Single Network Interface
  15. Setting up a Linux Server as a Router