On Fri, 03 Feb 2017 03:15:09 GMT, [email protected] (Robert Scott) wrote:
>I am writing some parsing code for reading Time Server packets. The >first 32 bits of the returned packet are: > >+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >|LI | VN |Mode | Stratum | Poll | Precision | >+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >When the two LI bits come back as 11 (clocks not synchronized) I have >been treating that as a fatal error for that server. I ignore that >packet and do not attempt to retry my query for that server. However >I have found that LI=11 is not all that uncommon for servers from the >pool. Is my response to LI=11 the correct one? Should I discard the >response and should I write off that server for retries? So far, the >only reason I might retry a server is if my recvfrom() socket call >times out. > >-Robert Scott > Hopkins, MN > I think I found a bug in my software that was causing this. I was fetching four IP addresses from pool.ntp.org just fine, but I was mistakenly always accessing just the first one of those IP addresses when I thought I was looping through all four. The result is I was trying to hit the same server four times in quick succession. With some servers this worked fine. But with other servers, the first response came back good, the second response came back LI=3, the third and fourth responses never came back at all. (recvfrom() has to be aborted). Is this possibly a defense mechanism against a DOS attack? In any case I only did it a few times before I found my error. A big clue was that the responses from all four hosts had the same stratum. Sometimes 2, sometimes 3. Now I get a mixture of strata in the four hosts so I know I am quering each host only once. -Robert Scott Hopkins, MN _______________________________________________ questions mailing list [email protected] http://lists.ntp.org/listinfo/questions
