Time Sync between Linux (LS1028) and Windows using PTP

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Sync between Linux (LS1028) and Windows using PTP

287 Views
sameer_chouksey
Contributor II

Hello,

I am trying to interface Windows system to NXP LS1028ARDB switch. I need to be establish time synchronization between the devices. The windows system is physically connected to the NXP LS1028 switch via Intel I210 NIC card.

For time synchronization on the switch I am using ptp4l library and for windows system I am configuring PTPProv.dll in Registry. Where switch acting as a PTP grandmaster and widows machine acting as slave.

Below are the configuration on master side (NXP switch):

 gPTP.cfg

[global]

gmCapable               1

priority1               248

priority2               248

logAnnounceInterval     0

logSyncInterval         -3

syncReceiptTimeout      3

neighborPropDelayThresh 5000

min_neighbor_prop_delay -20000000

assume_two_step         1

path_trace_enabled      1

follow_up_info          1

transportSpecific       0x1

ptp_dst_mac             01:80:C2:00:00:0E

tx_timestamp_timeout    1000

network_transport       L2

delay_mechanism         P2P

 

As per windows Validation Guide -Precision Time protocol to enable ptp time sync between windows and linux system, currentUtcOffsetValid & ptpTimescale flags need to be high. I set the flags using following command.

pmc -u -b 0 "set GRANDMASTER_SETTINGS_NP clockClass 248 clockAccuracy 0xfe offsetScaledLogVariance 0xffff currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 ptpTimescale 1 timeTraceable 0 frequencyTraceable 0 timeSource 0xa0"

 

On the windows side, as per windows Validation Guide -Precision Time protocol, I configure Registry editor for PTP Client.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\PtpClient]

"PtpMasters"="10.1.4.10"

"Enabled"=dword:00000001

"InputProvider"=dword:00000001

"DllName"="c:\\windows\\system32\\ptpprov.dll"

"DelayPollInterval"=dword:00001770

"AnnounceInterval"=dword:000007d0

"EnableMulticastRx"=dword:00000001

 

w32tm service configuration

C:\Windows\system32>w32tm /query /configuration

[Configuration]

EventLogFlags: 2 (Local)

AnnounceFlags: 10 (Local)

TimeJumpAuditOffset: 28800 (Local)

MinPollInterval: 10 (Local)

MaxPollInterval: 15 (Local)

MaxNegPhaseCorrection: 54000 (Local)

MaxPosPhaseCorrection: 54000 (Local)

MaxAllowedPhaseOffset: 1 (Local)

FrequencyCorrectRate: 4 (Local)

PollAdjustFactor: 5 (Local)

LargePhaseOffset: 50000000 (Local)

SpikeWatchPeriod: 900 (Local)

LocalClockDispersion: 10 (Local)

HoldPeriod: 5 (Local)

PhaseCorrectRate: 1 (Local)

UpdateInterval: 360000 (Local)

 

FileLogName: C:\Windows\Temp\w32time.log (Local)

FileLogEntries: 0-300 (Local)

FileLogSize: 10000000 (Local)

 

[TimeProviders]

PtpClient (Local)

DllName: c:\windows\system32\ptpprov.dll (Local)

Enabled: 1 (Local)

InputProvider: 1 (Local)

NtpClient (Local)

DllName: C:\Windows\system32\w32time.dll (Local)

Enabled: 0 (Local)

InputProvider: 1 (Local)

NtpServer (Local)

DllName: C:\Windows\system32\w32time.dll (Local)

Enabled: 0 (Local)

InputProvider: 0 (Local)

 

After restart windows time service in Event viewer under Application and Services log ->Microsoft ->Windows-> Time Service PTP Provider we receive two event

 

[PTP EVENT 512]

PTP provider started receiving announcements from the PTP Master 10.1.4.10 with IP Address 10.1.4.10:320 and the following PTP parameters:

Clock Identity:0x300052feff11b36c

Port Number:1

Domain Number:0

Utc Offset Valid:1

Current UTC Offset:37

Flags:0x0000000000003c00

Grandmaster Clock Id:0x300052feff11b36c

Steps Removed From GM:0

Time Source Code:0x00000000000000a0

Announce Interval (Log2):1

Number of active Masters:1

Current Tick Count:93359687

For more information, see https://go.microsoft.com/fwlink/?linkid=873491.

 

 

[PTP EVENT 513]

PTP provider has chosen the PTP Master 10.1.4.10 with IP Address 10.1.4.10:320 as the best master and the source of time. This master is announcing the following PTP parameters:

Clock Identity:0x300052feff11b36c

Port Number:1

Domain Number:0

Utc Offset Valid:1

Current UTC Offset:37

Flags:0x0000000000003c00

Grandmaster Clock Id:0x300052feff11b36c

Steps Removed From GM:0

Time Source Code:0x00000000000000a0

Announce Interval (Log2):1

Current Tick Count:93366156

 

C:\Windows\system32>w32tm /query /status /verbose

Leap Indicator: 3(not synchronized)

Stratum: 0 (unspecified)

Precision: -23 (119.209ns per tick)

Root Delay: 0.0000000s

Root Dispersion: 0.0000000s

ReferenceId: 0x00000000 (unspecified)      #We were expecting this to change to ptp grandmaster

Last Successful Sync Time: unspecified

Source: Local CMOS Clock

Poll Interval: 10 (1024s)

Phase Offset: 0.0000000s

ClockRate: 0.0156250s

State Machine: 0 (Unset)

Time Source Flags: 0 (None)

Server Role: 0 (None)

Last Sync Error: 1 (The computer did not resync because no time data was available.)

Time since Last Good Sync Time: 3585.2198286s

 

 

After running service on both system we also try to verify the packet exchange using wireshark. We see Follow up, Sync and Announce messages but don't see delay request and delay response messages. 

On windows system we do not see reference id and source ip of  PTP Grandmaster

 

Please let us know we need to make any further configuration ?

If it is technically feasible to do time Synchronization between windows and Linux system

 

Thanks & Regards,

Sameer 

0 Kudos
0 Replies