microsoft/SDN

PTP time sync on windows with Linux grandmaster

Aniket-Naik opened this issue · 0 comments

Hello we are trying to interface one windows system to Linux system and our application needs to be time synchronized .both the machines are connected through Intel I210 NIC cards.which are PTP compatible
For time synchronization on linux machine we are using PTP4l library and for windows system we are configured PTPProv.dll in Registry. Where linux acting as a PTP grandmaster and widows machine acting as slave.

Below are the configuration on master side.

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 E2E

then we ran grandmaster using PTP4l Library

as per ‘windows Validation Guide -Precision Time protocol’ to enable currentUtcOffsetValid & ptpTimescale flag we have run following command in linux machine

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"

now as per per windows Validation Guide -Precision Time protocol we 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 IP
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 and below are the Wireshark traces on windows machine

no Time Source Destination protocol lenght info
1 0.000000 10.1.4.10 224.0.1.129 PTPv2 86 Sync Message
2 0.000212 10.1.4.10 224.0.1.129 PTPv2 86 Follow_Up Message
7 1.000065 10.1.4.10 224.0.1.129 PTPv2 86 Sync Message
8 1.000066 10.1.4.10 224.0.1.129 PTPv2 86 Follow_Up Message
9 1.202257 10.1.4.10 224.0.1.129 PTPv2 106 Announce Message
14 1.696429 10.1.4.51 10.1.4.10 PTPv2 86 Delay_Req Message
15 2.000084 10.1.4.10 224.0.1.129 PTPv2 86 Sync Message
16 2.000085 10.1.4.10 224.0.1.129 PTPv2 86 Follow_Up Message

We don’t see delay response message in Wireshark, and 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?