LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [NTP] Time synchronization between two nodes (https://www.linuxquestions.org/questions/linux-software-2/%5Bntp%5D-time-synchronization-between-two-nodes-4175653885/)

jsam000 05-14-2019 09:08 AM

[NTP] Time synchronization between two nodes
 
Hello,

I work on an embedded product that is composed by two Linux nodes connected by Ethernet. Let’s call them Node A and Node B.

Node A has an RTC while Node B has not. So at the boot, Node B time is completely wrong.
Node B can get an GPS time.

The need is to have the two nodes synchronized during all the product lifecycle:
• At the boot, Node B needs to be sync to the Node A’s RTC until it gets the GPS time
o At this time, I try to use ntpdate on Node B to get Node A’s time but it takes a lot of time (several minutes) until Node A stratum is set to another value than 16.
• When the GPS time is getted, both nodes need to be synced on the GPS time as soon as possible.
o When the GPS time is gotten on Node B, is it possible to force the Node A’s system time to the Node B time without killing ntpd?

Thanks for your help
Jérémie

michaelk 05-14-2019 09:58 AM

Welcome to LinuxQuestions.

Its been awhile since I've played with ntp/gps in this fashion but if you configure a fudge server using stratum 4 on node A and its ntpd.conf configured to only use node B then configure node B to use ntpdate to sync to node A with its ntpd.conf to use itself as a server. If the jitter is to large between the two nodes ntpdate might fail.

The fudge server allows node A to use itself as a time source and configuring it with a stratum of 4 would allow node B to sync to it using ntpdate. Configuring ntpd.conf on node B as stratum 1 to serve time would then use itself as a source when GPS is synced. Don't use the -g option when starting ntpd but it may not matter. When node B is synced to GPS node A should switch from itself to node B as a time source.

The other caveat might be how well the RTC keeps time.


All times are GMT -5. The time now is 05:25 AM.