NTP Timing Based on PTP Clock

PTP as a reference clock for NTP

You can configure Precision Timing Protocol (PTP) time as the reference clock for Network Time Protocol (NTP) by enabling the feature on a Cisco Catalyst IE9300 Rugged Series Switch.

PTP time acts as a stratum 0 source, and the Cisco IOS NTP server acts as a stratum 1 device. The server then provides clock information to its NTP clients (strata 2 and 3).

The feature is supported on Cisco Catalyst IE9300 Rugged Series Switches beginning with the Cisco IOS XE Cupertino 17.9.1 release. A Network Essentials or Network Advantage license is required.

Enable PTP as a reference clock for NTP

The PTP reference clock feature is disabled by default. You enable it by entering a CLI command.

Before you begin

Configure PTP and ensure that it is in slave mode. for details on configuration, see Precision Time Protocol .

Procedure


Step 1

Use the ntp refclock ptp command to enable PTP as a reference clock for NTP.

Use the no ntp refclock ptp command to disable the PTP reference clock.

Step 2

(Optional) Use the show run | sec ptp|ntp command to check the PTP reference clock configuration.

Example:

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

Step 3

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

Example:

Switch# 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 4

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

Example:

Switch# 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.
                    

What to do next

Validate the PTP reference clock feature on the switch. See Validate the PTP reference clock .

Validate the PTP reference clock

After you enable PTP as the reference clock for NTP, you can enter CLI commands to validate the configuration.

Procedure


Step 1

Use the show run | sec ptp|ntp command to monitor the PTP reference clock.

Example:

Switch# 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 2

Use the sh ptp clock running command to monitor PTP phase aligned state (locked to a master clock).

Example:

Switch# sh 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 3

Use the show ntp status command to check that NTP reference clock.

Example:

Switch# 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.

Troubleshoot PTP as an NTP reference clock

You can check the time on the PTP and NTP clocks to ensure that they are synchronized.

PTP-NTP synchronization

Use the show ptp lan clock | inc time command to check the time on the PTP and NTP clocks to ensure that they are synchronized.

Switch# show ptp lan clock | inc time
Local clock time: 2022-4-29 8:48:39 UTC 
Switch# show clock detail
08:48:39.278 UTC Fri Apr 29 2022 
Time source is NTP

Troubleshooting commands

Table 1. Troubleshooting 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

Check that PTP is in slave mode; that is PTP is in phase aligned state, which means it is locked to a master clock.

View NTP peer details

Use the show ntp assoc deta command to view the detailed information about NTP peer. You can check the amount of time the platform takes to switch to the next available timing source after the initial timing source goes down. In this example, NTP waits 8x256 seconds to switch over to the next source .

Switch# show ntp assoc deta
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

Feature history

This table lists features which are included in all releases after the initial introduction, unless noted otherwise.

Release

Feature

Feature Information

Cisco IOS XE Cupertino 17.9.x

NTP timing based on the PTP clock

You can configure Precision Time Protocol (PTP) time as the reference clock for Network Time Protocol (NTP) by enabling the feature on the switch.