NTP time synchronization with PTP clock

Network Time Protocol (NTP) time synchronization with a Precision Time Protocol (PTP) clock provides:

  • Precise time distribution across network devices.

  • High accuracy using PTP as a stratum 0 reference clock.

PTP as NTP reference clock

Starting from Cisco IOS-XE Release 17.9.1, Cisco Catalyst IR8340 Rugged Series Routers support NTP time synchronization with PTP clock. A Network Advantage license is required for this support.

PTP time serves as a stratum 0 source, while the Cisco IOS NTP server functions as a stratum 1 device. The server provides clock information to its NTP clients at stratum 2 and 3.

Configure PTP reference clock

The PTP as a reference clock to NTP is disabled by default. Cisco Catalyst IR8340 Rugged Series Routers support this feature with PTP Default, Power, and 802.AS profiles. Telecom profiles (8265.1 or 8275.1) as sources are not supported. NTP can use only one reference at a time either GNSS or PTP.

Before you begin

Configure the PTP and verify that it is in client mode.

Procedure


Step 1

Use the configure terminal command to enter into the configuration mode.

Example:

Router# configure terminal

Step 2

Use the ntp master command to configure the master clock as NTP.

Example:

Router(config)# ntp master

Step 3

Use the ntp refclock ptp command to configure PTP as a reference clock.

Example:

Router(config)# ntp refclock ptp

You can use the no form of the command to disable this feature.

Router(config)# no ntp refclock ptp

Step 4

(Optional) Use the show run command to monitor the PTP reference clock configuration.

Example:

Router# show run | sec ptp|ntp
ntp refclock ptp
ptp clock boundary domain 0  profile power
 clock-port 1
  transport ethernet multicast interface Gi0/1/4

Step 5

(Optional) Use the show ptp clock running command to monitor the PTP mode status.

Example:

Router# show ptp clock running
                      PTP Boundary Clock [Domain 0]  [Profile: power]
         State          Ports          Pkts sent      Pkts rcvd      Redundancy Mode
         PHASE_ALIGNED  1              629978         633            Hot standby
                               PORT SUMMARY
                                                                        PTP Master
Name  Tx Mode      Role         Transport    State         Sessions     Port Addr
1     mcast        negotiated   Ethernet     Slave         1            UNKNOWN

Step 6

(Optional) Use the show ntp status command to monitor the NTP status.

Example:

Router# show ntp status
Clock is synchronized, stratum 1, reference is .PTP.
nominal freq is 250.0000 Hz, actual freq is 249.9998 Hz, precision is 2**10
ntp uptime is 28233900 (1/100 of seconds), resolution is 4016
reference time is E6161FA8.FFBE7988 (08:26:16.999 UTC Fri Apr 29 2022)
clock offset is 0.9998 msec, root delay is 0.00 msec
root dispersion is 3940.49 msec, peer dispersion is 3938.47 msec
loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000000856 s/s
system poll interval is 64, last update was 4 sec ago.

Step 7

(Optional) Use the show ptp lan clock command to monitor PTP and NTP synchronization status.

Example:

Router# show ptp lan clock | inc time
Local clock time: 2022-4-29 8:48:39 UTC

Step 8

(Optional) Use the show clock detail command to monitor the clock information.

Example:

Router# show clock detail
08:48:39.278 UTC Fri Apr 29 2022
Time source is NTP

Step 9

(Optional) Use the command to check the amount of time the platform takes to switch to the next available timing source after the initial timing source goes down.

Example:

Router# show ntp association detail
127.127.6.1 configured, ipv4, our_master, sane, valid, stratum 0
ref ID .PTP., time E61622E9.00000000 (08:40:09.000 UTC Fri Apr 29 2022)
our mode active, peer mode passive, our poll intvl 256, peer poll intvl 1024
root delay 0.00 msec, root disp 0.00, reach 377, sync dist 4.62
delay 0.00 msec, offset 0.9998 msec, dispersion 2.81, jitter 0.97 msec
precision 2**10, version 4
assoc id 63756, assoc name 127.127.6.1
assoc in packets 11, assoc out packets 17652, assoc error packets 0
org time E61622E8.FFBE7988 (08:40:08.999 UTC Fri Apr 29 2022)
rec time 00000000.00000000 (00:00:00.000 UTC Mon Jan 1 1900)
xmt time E61622E8.FFBE7988 (08:40:08.999 UTC Fri Apr 29 2022)
filtdelay = 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
filtoffset = 0.99 1.99 0.99 0.99 0.99 0.99 1.99 0.99
filterror = 0.97 2.89 4.81 6.73 8.65 10.57 11.53 12.49
minpoll = 4, maxpoll = 10

In this example, the NTP waits 8x256 seconds to switch over to the next source.


PTP as NTP reference clock commands

These are the PTP commands to use when PTP acts as an NTP reference clock.

Table 1. PTP debug commands
Command Description

ntp logging

Enables syslogs from NTP.

debug ntp all

Provides the complete debugging logs for NTP processes.

debug platform software pd-ptp all

Provides debugging logs on the switch relating to PTP as a reference clock.

show ntp status

Shows detailed NTP status, including whether NTP is using PTP as its reference clock.

show ntp association detail

Shows detailed information about NTP peering.

show ptp clock running

Verify PTP's secondary mode by checking its phase-aligned state and its lock to a primary clock.

Timing Card as NTP reference clock

Timing Card as NTP reference clock provides:

  • enhanced precision compared to the system oscillator, and

  • a seamless fallback to the Timing Card's time when Global Navigation Satellite System (GNSS) is unlocked or disabled.

NTP polls the Timing Card for time at predefined intervals. If GNSS becomes unavailable or is disabled, the router automatically switches to the Timing Card for time synchronization.

Configure Timing Card reference clock

You can configure the Timing Card as a reference clock for NTP.

Procedure


Step 1

Use the configure terminal command to enter configuration mode.

Example:

Router# configure terminal

Step 2

Use the ntp master command to configure the master clock for NTP.

Example:

Router(config)# ntp master

Step 3

Use the ntp refclock timing-card command to configure the Timing Card as a reference clock.

Example:

Router(config)# ntp refclock timing-card

Step 4

(Optional) Use the show ntp status command to monitor the NTP status.

Example:

Router# show ntp status
 Clock is synchronized, stratum 4, reference is 127.127.7.1
 nominal freq is 250.0000 Hz, actual freq is 249.9997 Hz, precision is 2**10
 ntp uptime is 6200 (1/100 of seconds), resolution is 4016
 reference time is E8DB7E3A.DC6A8158 (15:36:50.861 IST Thu Oct 19 2023)
 clock offset is 1.0000 msec, root delay is 0.00 msec
 root dispersion is 3940.44 msec, peer dispersion is 3938.29 msec
 loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000001064 s/s
 system poll interval is 16, last update was 11 sec ago.

Step 5

(Optional) Use the show ntp associations command to monitor the NTP associations.

Example:

Router# show ntp associations
address ref clock st when poll reach delay offset disp
~192.2.1.1 .LOCL. 7 14 16 7 0.000 0.000 1938.4
*~127.127.7.1 .TCLO. 3 15 16 3 0.000 1.000 3938.2
* sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured

GPS as NTP reference clock

GPS as NTP reference clock ensures that it:

  • Receives time from GNSS, where GNSS acts as a Stratum 0 reference clock and provides the time as a Stratum 1 server through NTP.

  • Provides continuous synchronization from GNSS when it is locked and stable, even if other Stratum 1 servers are available through NTP peers.

  • Automatically falls back to a reachable NTP server using NTP peers when GNSS is not available.

Configure NTP using GPS time

You can configure the GPS time as the reference clock for NTP.

The GPS time serves as a Stratum 0 source, while the Cisco IOS NTP server functions as a Stratum 1 device, distributing clock information to its NTP clients at Stratum 2 and Stratum 3.

Procedure


Step 1

Use the configure terminal command to enter global configuration mode.

Example:

Router# configure terminal

Step 2

Use the ntp refclock gps command to configure the NTP reference clock as GPS.

Example:

Router(config)#ntp refclock gps

Step 3

(Optional) Use the show ntp status command to monitor the NTP status.

Example:

Router# show ntp status
Clock is synchronized, stratum 1, reference is .GPS.
nominal freq is 250.0000 Hz, actual freq is 249.9970 Hz, precision is 2**10
ntp uptime is 94000 (1/100 of seconds), resolution is 4016
reference time is E31778F3.0B851ED8 (19:58:43.045 GMT Thu Sep 24 2020)
clock offset is 11.0000 msec, root delay is 0.00 msec
root dispersion is 3950.55 msec, peer dispersion is 3938.47 msec
loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000011995 s/s
system poll interval is 64, last update was 7 sec ago.

Step 4

(Optional) Use the show ntp associations command to monitor the NTP status.

Example:

Router# show ntp associations
address ref clock st when poll reach delay offset disp
*~127.127.5.1 .GPS. 0 38 64 7 0.000 11.000 1938.8
* sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured

Step 5

(Optional) Use the show clock command to view the clock information.

Example:

Router# show clock
20:00:43.660 GMT Thu Sep 24 2020

Step 6

(Optional) Use the debug ntp refclock command to check the NTP reference clock configuration messages in the log.

Example:

Router# debug ntp refclock
*Sep 24 19:58:43.045 GMT: GPS: Poll Requested
*Sep 24 19:58:43.045 GMT: GPS (19:58:43.056 GMT Thu Sep 24 2020)
*Sep 24 19:58:43.045 GMT: Valid time rcvd from GPS: 2020/09/24 19:58:43.056 (frac = 0x0E560440)
*Sep 24 19:58:43.045 GMT: RTS poll timestamp (local clock) was 0xE31778F3.0B851ED8
*Sep 24 19:58:43.045 GMT: GPS timestamp is 0xE31778F3.0E560440
*Sep 24 19:58:43.045 GMT: NTP Core(NOTICE): ntpd PPM
*Sep 24 19:58:43.046 GMT: NTP Core(NOTICE): trans state : 5
*Sep 24 19:58:43.046 GMT: NTP Core(NOTICE): Clock is synchronized.

The syntax of the command: debug ntp {adjust | all | core | events | packet | refclock}

Table 2. Syntax description

Keyword of the command

Description

adjust

NTP clock adjustments information

all

All levels of debugging for NTP

core

Core messages of NTP

events

Events of NTP

packet

NTP packets

refclock

Reference Clock messages