microsoft / W32Time

This repo provides resources for high accuracy time on Windows
MIT License
71 stars 23 forks source link

PTP Client not synching #11

Open JaredM93 opened 3 years ago

JaredM93 commented 3 years ago

I've setup a PTPd grandmaster on another system using the instructions, and conf file, from the "Windows Subsystem for Linux for testing Windows 10 PTP Client" techcommunity blog. My PtpClient registry entries are as follows:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\PtpClient] "PtpMasters"="10.0.50.43" "Enabled"=dword:00000001 "InputProvider"=dword:00000001 "DllName"="C:\Windows\System32\ptpprov.dll" "DelayPollInterval"=dword:00003e80 "AnnounceInterval"=dword:00000fa0 "EnableMulticastRx"=dword:00000000

Querying the w32tm configuration shows the PtpClient as the only enabled TimeProvider, and Wireshark shows that I'm receiving Announce, Follow_Up, and Sync messages from the grandmaster. Here's a sample of the Announce Message contents:

Frame 597: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface 0 Ethernet II, Src: IntelCor_53:2b:ca (a4:bf:01:53:2b:ca), Dst: SuperMic_ab:82:76 (ac:1f:6b:ab:82:76) Internet Protocol Version 4, Src: 10.0.50.43, Dst: 10.0.50.33 User Datagram Protocol, Src Port: 60332, Dst Port: 320 Precision Time Protocol (IEEE1588) 0000 .... = transportSpecific: 0x0 .... 1011 = messageId: Announce Message (0xb) .... 0010 = versionPTP: 2 messageLength: 64 subdomainNumber: 0 flags: 0x040c 0... .... .... .... = PTP_SECURITY: False .0.. .... .... .... = PTP profile Specific 2: False ..0. .... .... .... = PTP profile Specific 1: False .... .1.. .... .... = PTP_UNICAST: True .... ..0. .... .... = PTP_TWO_STEP: False .... ...0 .... .... = PTP_ALTERNATE_MASTER: False .... .... ..0. .... = FREQUENCY_TRACEABLE: False .... .... ...0 .... = TIME_TRACEABLE: False .... .... .... 1... = PTP_TIMESCALE: True .... .... .... .1.. = PTP_UTC_REASONABLE: True .... .... .... ..0. = PTP_LI_59: False .... .... .... ...0 = PTP_LI_61: False correction: 0.000000 nanoseconds ClockIdentity: 0x00155dfffea95405 SourcePortID: 1 sequenceId: 59107 control: Other Message (5) logMessagePeriod: 127 originTimestamp (seconds): 0 originTimestamp (nanoseconds): 0 originCurrentUTCOffset: 37 priority1: 120 grandmasterClockClass: 10 grandmasterClockAccuracy: The time is accurate to within 1 us (0x23) grandmasterClockVariance: 28768 priority2: 125 grandmasterClockIdentity: 0x00155dfffea95405 localStepsRemoved: 0 TimeSource: INTERNAL_OSCILLATOR (0xa0)

The domain is 0, and PTP_TIMESCALE and PTP_UTC_REASONABLE are both non-zero. But, the PtpClient doesn't appear to be receiving any of this information. When I look in the event viewer, I'm just getting event 515:

Ptp Provider Configuration:

Allowed Masters:10.0.50.43 Announce Interval:4000(msec) Delay Poll Interval:16000(msec) IfTstmp:1

PTP provider status:

PTP Best Master Details: Name: IP Address: Clock Identity:0x0000000000000000 Port Number:0 Tick Count At Last Time Sample:0

ActiveMasterCount:0 MulticastRxEnabled:0 Current Tick Count:74884656

Why is the PtpClient either not receiving, or using, the Announce Message?

Fredister commented 2 years ago

Hi, I have the exact same problem as this... Did you find a solution?

JaredM93 commented 2 years ago

Yes, you'll want to verify the IP address used by your PTP client on the virtual machine. I'd mistakenly used the IP of the machine that was hosting the virtual machine.