[MUD-Dev] Synchronizing Client and Server...

Daniel.Harman at barclayscapital.com Daniel.Harman at barclayscapital.com
Tue Mar 12 09:09:02 CET 2002


From: Dan MacDonald [mailto:danmac at windows.microsoft.com]

> My current implementation uses UDP, and I'm looking for a way to
> determine the difference between the server time and the clients
> time.  So that the client can have a variable that says, "Add x to
> the current client time when comparing with times from the server"
> I want to be able to determine what x is. SNTP does this pretty
> well, but i dont want to be dependant on other tecnologies, i'd
> like to build this functionality into my networking layer. I was
> wondering if anyone had any hacked down versions that could be
> used to synch time up to about 3-5ms accuracy? Or any suggestions
> as to how this might be achieved?  (besides sending X amount of
> upd packets and averaging the round trip times to predict the
> offset)

Oops, I was about to answer this then saw your last caveat. As far
as I know, and I've done a fair amount of research, the method you
rule out is exactly the one everyone uses. In the end, I don't know
of any other way to do it without piggybacking a ping on your
packets and assuming the round trip time is symmetric.

As I mention above, you can be clever about this and piggyback the
timestamp onto packets with 'real' payloads etc. so that it's a
fairly transparent process. Try it, you'll be pleasantly surprised
at the results assuming your connection isn't lag spiking.

Dan
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list