Thomas Tempelmann
Thomas Tempelmann

Reputation: 12095

synchronize clocks over internet

I am sending real-time-critical data over the internet between two dedicated computers, using my own protocol.

There is, of course, latency involved.

For debugging and optimization, I like to have both computers use the same timebase. I.e, I need to know the time difference of their clocks so that I can judge the latencies better.

Of course, relativism and such doesn't really allow me to sync them perfectly, but I like to get as close as possible.

Relying on NTP alone does not appear good enough - clocks can be off by half a second in my experience (clarification: I relied so far on the default one provided by Apple).

I need precision in the 1/10s range, at least. The two computers won't be too far apart, ICMP ping times are less than 100ms, usually.

Any suggestions how to do this?

(currently, the machines involved run OS X, so if you know a solution just for them, that'll be a start)

Upvotes: 5

Views: 1117

Answers (4)

vartec
vartec

Reputation: 134691

Relying on NTP alone does not appear good enough - clocks can be off by half a second in my experience.

That's strange. NTPd over Internet is supposed to give you much greater precision.

Upvotes: 2

David Segonds
David Segonds

Reputation: 84762

Did you try to have one of the machine as NTP server for the other? May be they won't be in sync with the 'real' time but this may bring you within the precision you require.

Upvotes: 2

pauljwilliams
pauljwilliams

Reputation: 19225

I would suggest that your best bet is to install an ntp server on one of the machines and get the other to sync to it.

Upvotes: 7

andynormancx
andynormancx

Reputation: 13762

Get the time from a GPS receiver connected to the machines. If they are in a data centre it can be difficult getting an antenna into a location that it can get a lock though unfortunately.

Upvotes: 10

Related Questions