Reputation: 25435
The wikipedia page for NTP says two calculations are necessary it to sync a clock:
Applying the offset to the client clock makes sense, but how does the round-trip delay come into play? I've made it all the way to the RFC for NTP and still can't figure it out.
From what I can tell, you only need to apply the offset to the client clock at its current time to bring it in sync.
You could use the round-trip delay by dividing it by two and adding it to the offset and applying that number the initial client clock time (I think). But, I'm not sure what that gets you over applying the offset directly.
Can you get by with just the offset, or is the round-trip delay involved in the calculation in a direct way?
Upvotes: 2
Views: 680
Reputation:
No, you cannot get by with just the offset. The math is complex, but in a nutshell, the delay is used to determine the best (offset, delay, dispersion, time) sets from the arriving packets to use to discipline the clock. The only/best place I've found that explains this well is in section 3.5, "Clock Filter Algorithm" on page 43 in the "Computer Network Time Synchronization: The Network Time Protocol" book by Dr. David L. Mills. As of this writing, a later version of this book can be found online here: http://lib.uhamka.ac.id/file?file=digital/47911-eBST-11030034.pdf. In this version, the relevant section is 3.7 on page 48. https://www.eecis.udel.edu/~mills/ntp/html/filter.html also explains it, but not as well. This SO link might help with the understanding, as well: How does NTP Clock Discipline work?
Upvotes: 0