Description

When an NTP client device[can be any Juniper platform] Goes out of sync with the NTP server due to network connectivity or any other issue and later when this sync/network connectivity gets restored then the client device may go out of sync and continue to stay in that state until forced sync for NTP is attempted on the client device.

Symptoms

You will notice a difference in device time and actual time. The output explains the same
 
current time >>2024-03-15 01:28:25 UTC
 
user@Device> show system uptime
localre:
--------------------------------------------------------------------------
Current time: 2024-03-14 21:34:25 UTC
Time Source: LOCAL CLOCK
System booted: 2023-06-18 04:59:35 UTC (38w4d 16:34 ago)
Protocols started: 2023-06-18 05:01:06 UTC (38w4d 16:33 ago)
Last configured: 2024-02-28 07:53:28 UTC (2w1d 13:40 ago) by user
9:34PM up 270 days, 16:35, 1 users, load averages: 0.82, 0.58, 0.46

 
As we can see that device is 5 hours behind the actual time.
 
Alternatively, you will see a High value for offset in "show ntp associations" Output:-
 
 
user@device> show ntp associations
sho ntp s remote refid st t when poll reach delay offset jitter
===============================================================================
10.66.1.78 10.5.2.67 2 - 349 1024 377 0.354 1377463 10486.0
10.66.1.66 10.5.2.67 2 - 377 1024 377 0.339 1377434 10455.3
10.66.1.74 10.5.2.67 2 - 362 1024 377 0.291 1377451 10486.0
10.66.1.70 10.5.2.67 2 - 388 1024 377 0.302 1377425 10465.7

 
 
Below is when NTP is working correctly
 
user@device> show ntp associations
remote refid st t when poll reach delay offset jitter
===============================================================================
*10.66.1.74 10.5.2.67 2 - 147 256 377 0.407 0.033 0.124  
+10.66.1.66 10.5.2.67 2 - 180 256 377 0.366 -0.080 0.117
+10.66.1.78 10.5.2.67 2 - 148 256 377 0.416 -0.049 0.065
+10.66.1.70 10.5.2.67 2 - 206 256 377 0.365 -0.088 0.080

Solution

When the NTP server goes out of Sync then the time NTP client device will continue to poll the server for syncing their Time. But this polling interval will increase if the server does not respond and if this out of Sync state goes on for a good amount of time then the result is a Large offset at the Client end which we see in the symptom section above. Now when connectivity between the NTP client and NTP server comes back up then the sync will start however the way NTP functions is slow syncing and this results in the device staying in out-of-sync state with a considerable time difference between actual time[Time provided by NTP server] and Device time.
 
NTP  won't work if the time difference between client and server is more than 1000 seconds. This is as per the design of NTP.
 
The way to fix this is to force syncing the client device time with the server.
 
On all Juniper devices below operational mode command can be executed to force sync the time.
 
 
user@device> set date ntp 
 
 
 
Below output shows the results after executing the above command:-
 
 
user@device> show system uptime
localre:
--------------------------------------------------------------------------
Current time: 2024-04-04 09:30:23 UTC
Time Source: LOCAL CLOCK

System booted: 2023-06-18 13:15:30 UTC (41w3d 20:14 ago)
Protocols started: 2023-06-18 13:17:01 UTC (41w3d 20:13 ago)
Last configured: 2024-04-04 08:54:18 UTC (00:36:05 ago) by user
9:30AM up 290 days, 20:15, 1 users, load averages: 0.93, 0.50, 0.45
 
{master:0}
user@device> set date ntp
4 Apr 10:00:34 ntpdate[26164]: step time server 10.66.1.74 offset 1801.224269 sec

 
{master:0}
user@device> show system uptime
localre:
--------------------------------------------------------------------------
Current time: 2024-04-04 10:00:46 UTC
Time Source: NTP CLOCK

System booted: 2023-06-18 13:45:31 UTC (41w3d 20:15 ago)
Protocols started: 2023-06-18 13:47:02 UTC (41w3d 20:13 ago)
Last configured: 2024-04-04 08:54:18 UTC (01:06:28 ago) by user
10:00AM up 290 days, 20:15, 2 users, load averages: 1.20, 0.58, 0.48
 

Modification History

2024-04-06 : Article Created
2024-04-30 :- Version 1