SNTP and NTP use the same protocol on the wire “Ethernet Time Server” messages to compute accurate times. The difference is in the application that is running  on each PC. The difference is in how the time diff is calulated. NTP is much more complex and thus accurate then SNTP. SNTP only keeps track of 1 server and NTP can triangulate between many servers.

NTP servers and NTP clients use the same socket for communication. So when you update the localtime, you need to turn off the NTP server for a moment.

NTP servers, hold time and can give their time to NTP clients. NTP clients check their time with NTP servers, and change their own time to try and match the servers time.

NTPDATE is used to adjust time with NTP servers.

SNTP is used to adjust time with SNTP servers.

You can use SNTP and NTP servers interchangeably. So  you can use SNTP to update off an NTP servers time.

Here is a good explanation of the way they work with each other:

SNTP RFC 2030:

There are 2 types of time adjustments. Try to jump the time to the new time (settimeofday), or skew the time with minor adjustments to final time (adjtime).

Running NTP server and NTPDATE client for updates

I list several methods, based on if you want to log using bash3 or bash4 methods.

Command options:

COMMANDS WHILE SYSTEM IS UP

# if system is booting

# if system still running

To log:

# if system is booting

# if system still running

To log Or on bash4:

# if system is booting

# if system still running

NTP RCLOCAL SCRIPT FOR BOOT

If you want to put this in an rc.local script:

To do on system startup in rc.local:

On boot actually better to use -b as it setstimeofday

Lets logs using bash3 methods as well

Or log with bash4

 SNTP – simple network time protocol

Note below I use an NTP timeserver locally on the machine, but SNTP to get time from time server

Command line options:

commands For sntp:

By timeofday change – while system is booting

By adjtime change – good is system is running

commands for sntp on rc.local (for boot):

We will use the method that is good while booting -r, which just sets time of day with settimeofday instead of adjtime (which skews)

To log with bash3 methods:

To log with bash4 methods:

 

Leave a Reply

Your email address will not be published. Required fields are marked *