Reputation: 18148
I have two computer say A and B. I need to make sure that they are sync to each other vey accurately (in the range of ms). One computer is windows base and the other is Linux. They are connected to each other by Ethernet directly (a cable from one computer is connected to other). I can write C/C++ code for each of them.
How can I make them synch to each other y noting that neither windows nor Linux are real time system and hence you don't know how long would it takes that a packet that you sent over Ethernet is received by other side so you can not compensate for it. Since you need accuracy of ms, this delay is important.
Is there any algorithm that can do this?
is there any function in windows/Linux that can be send to make sure that when you send data via Ethernet, it is passed to other side instantly?
Upvotes: 3
Views: 2916
Reputation: 1
There are 3 basic ways to do this some more complicated than others but the all use a basic rule which is based on local clock offset timing. these 3 are RBS, TPSN, and FTSP the common rule looks after any latency across each layer the synchronization schemes have four basic packet delay components: send time, access time, propagation time, and receive time see http://www.cs.wustl.edu/~jain/cse574-06/ftp/time_sync/index.html
Upvotes: 0
Reputation: 178411
Syncrhonizing a clock between two machines is not an easy and trivial task.
One known way to do it with a descent accuracy is Marzullo's Algorithm
Upvotes: 4