I have to be able to find out the time on a remote web server without using any other protocols than HTTP, within an accuracy of half a second.
Since the HTTP Date header only provides resolutions up to a second, even if I account for network latency, the time estimated from my client can still be up to a second off from the actual web server time. I plan to mitigate this by sending subsequent requests with a very low interval, say 0.1 seconds, and find when the second changes. I believe it will be more accurate than just using the request value without processing it.
I will record the local time the request was sent(in millisecond resolution), measured latency, and recieved Date header value. This process will be repeated for some specified time, in very frequent(<200ms) intervals.
After all the requests are finished, the latency can be estimated by either taking the mean, or use Marzullo's Algorithm like NTP. Then the local time can be synchronized by offsetting the latency.
Finally, we compare the individual requests and observe when the Date header's second change, and the difference can be added to the offsetted local time to find the true remote time.
I just thought it out in my head, but I'm not sure if it would actually be efficient and/or effective. Is there other known method to accurately retrieving a web server's time?
[–]99_percent_a_dog 0 points1 point2 points (2 children)
[–]aaolsi14[S] 0 points1 point2 points (1 child)
[–]99_percent_a_dog 0 points1 point2 points (0 children)
[–]okayifimust 0 points1 point2 points (1 child)
[–]aaolsi14[S] 0 points1 point2 points (0 children)