Problem with Linux Machine's Request for Time from an XP Machine

Discussion in 'Linux Networking' started by W. Watson, Jan 9, 2005.

  1. W. Watson

    W. Watson Guest

    Quite frankly when I brought this topic up on a GPS group it was the group that sent
    me off to investigate NTP. However, no one mentioned jitter, but had both positive
    and negative things to say about the GPS unit as a time source.

    prg mentions the "sales name" and not the model #/name is important. As far as I can
    tell its GPS 12XL Pesonal Navigator". I'm still interested in where this leads. I'll
    call Garmin later today, and ask them about it. They actually have a tech support
    line with real people at the other end.

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
    1. Advertisements

  2. W. Watson

    W. Watson Guest

    The previous thread was getting a bit too convoluted. I was spending too much time
    repeating myself. I'm sure things got lost in translation. Thus the new thread with a

    Fortunately, some of my effort had some good news. I think I managed to hit every
    snag one could hit getting to the NTP part of it, and then it has had its snags. I
    think I've only spent about 7-10 days pondering the NTP approach. Fortunately, I've
    had some fun on the side on other matters.

    If you want a very good read on disasters, google the net for the story "A Comet's Tale".

    See my note just above yours to McIntosh about Garmin.
    Even my current registry (see authoritative time source in the list of URLs you
    gathered, and I have mentioned seveal times) effort has stalled. One of the
    instructions makes no sense, #3. They ask me to change a binary with a text string.
    I'm trying to clear it up.
    See ya...

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
    1. Advertisements

  3. The Garmin 12XL is not suitable for use as a time standard.

    How accurate do you want?
    Floyd L. Davidson, Jan 10, 2005
  4. W. Watson

    W. Watson Guest

    For simplicity, 1 second a day. If there is a cheap GPS unit that is suitable, I'd be

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
  5. W. Watson

    W. Watson Guest

    Well, let me add a little more to Floyd's question on accuracy.

    Ideally, this problem comes down to accurately time stamping the realtime data video
    observations of meteors at two locations about 30 miles apart. Ultimately it will be
    a meteor trajectory analyst who has the answer. I think the last time I asked him
    about this he offered, "very accurate". I've seen him work with less accurate data
    than we have, and I'd say the results were OK, passable.

    However, what guides this is money. This effort is really on a shoestring. If my
    partner and I could afford it, we'd go buy an atomic clock board and be done with it.
    NTP seems like a cheap but good way to go. At this point, what I'm doing about time
    synchs is exploratory. However, I'm beginning to think that maybe adjtimex is the way
    to go. (This is with a nod to the fact that my effort to use the authoritative time
    change registry change I've mentioned throughout this thread has temporarily
    aground.) It (adjtimex) sure sounds a lot easier to implement. This (NTP, synching
    time off the net, and related attempts) is taking too much time in the face of other

    Money wise we may have to just settle for it (adjtimex or NTP, but not a board or
    GPS), and just live with the consequences of having our observations really only
    agree within say 1/4 of a second of one another, and perhaps being off by the same
    amount with true time. There is a bit of what I would call politicking here. That is,
    the better my partner and I do with solving this problem, the more acceptable to the
    meteor community our data becomes. It's already proven valuable, but there's room for
    improvement. Interesting, problem, eh? I find the whole effort great fun.

    So, I guess is the answer is better than we have now, and within an almost
    infintesimally small budget. However, a big part of this is to have good timestamping
    between two distant observers. My partner has access to a local college network where
    he works. I'm out the middle of nowhere in the mountains of California. I don't think
    I really answered the question, but that's the state of things at the moment.

    If anyone is interested in donating their time to science, I know about a neutrino
    project that needs help ... :)

    [End of philosphical waxing] Cheers ...

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
  6. "1 second a day" doesn't mean much. That would be drift rate,
    not accuracy.

    From your discussion it sounds to me like you need something in
    the 10s of milliseconds (less than 0.1 second error).

    The simple GPS method (syncing to the NMEA messages), is not
    good enough. But if you think 0.5 second error is okay, then
    syncing to the NMEA messages from most inexpensive GPS units
    would be fine. Go buy one of the typical USB "mouse" style GPS
    units *if* you can mount it in a location that has sufficient
    "sky view" (for example right on a roof window in your
    observatory) *and* if that is within a USB extension cable
    distance of your computer. Otherwise get something (not made by
    Garmin) with a remote antenna and a regular RS-232 port. These
    things cost anywhere from $60 to $150.

    Do a google search on "GPS NMEA LINUX TIME" or something
    similar. There are several programs available to set the clock
    to sync with the NMEA messages, such as the GPGGA response. But
    they range from bad (200 to 500 ms error) to worse (your Garmin
    12XL, which might have 2 second errors).

    If you want a stand alone time standard, which will be accurate
    to at least a few milliseconds, or with a good one to within a
    few microseconds, do a google search on "GPS FREQUENCY STANDARD
    NTP", and you'll find that several companies make them. For a
    few hundred bucks you can get something that will probably do
    fine. For 2-5 thousand bucks you can get a stand alone NTP
    server that will do everything but polish your shoes.

    But... given what you have described (which is extremely
    difficult to decipher), you would still be *far* better off to
    run ntpd on your Linux box and allow it to have access to the
    Internet. (Which apparently is *exactly* what the folks in the
    GPS group already told you.)

    If what you described was what it sounded like, you have two
    computers, one running Linux and one running XP, that are
    connected via a LAN, and the XP box has a dial up modem and can
    connect to the Internet.

    I do *not* recommend using the XP box as an ntp server or as a
    gateway for the Linux box to access the Internet. Instead I
    would suggest you go find the cheapest old box you can find (I
    use an old PII-400mHz box) and put a stripped down Linux on it,
    with IP forwarding enabled and set it up as a firewall with the
    modem attached to it rather than the XP box. Then both the XP
    box and the Linux box can safely access the Internet through a
    real firewall, and both can also run ntp client software to
    access a remote server (and skip all these various
    servers... use, which will give you a different
    server every time you query it).

    That will give you accuracy to 10's of milliseconds, and will
    cost only whatever you pay for an old computer (which you can
    probably get for free if you try hard).
    Floyd L. Davidson, Jan 10, 2005
  7. W. Watson

    prg Guest

    "very accurate" would indicate the need for ntp, but for now maybe
    something less will do ;-)

    Actually, I was going to suggest this as a "good enough for now
    solution" till you work out other issues -- didn't want to inject yet
    another detour toward ultimate victory lest you shriek, "Gods, my head
    is aching and my patience is exhausted."
    30 miles ain't that far apart at meteor velocities, is it? That's why
    the more accurate the better.


    The adjtimex manpage looks pretty clear -- is it clear to you what you
    need to do to use it? As suggested in the manpage, it would be nice if
    you could run ntp on the Linux box for at least several (12 hrs good,
    24 hrs better). Can you afford to use your modem on the Linux box like
    that to acquire some good error/correction data? Maybe overnight?
    Quiet net traffic is best for making this work.

    This combined with a cron job running clockdiff -- $ man clockdiff --
    to fetch the timestamp time from XP (d**d firewall gonna allow it?)
    would allow you to keep Linux awfully close (-10 ms) to XP's time, so
    that if you can verify that XP's time synching is adequate to your
    needs this may automate the whole process once adjtimex corrections are
    applied to Linux. From a Linux X terminal you could run clockdiff and
    see if it works without messing with XP's fw (not likely is my guess).

    If this sounds like someting worth exploring, let me know and I'll whip
    up something -- or someone else around here may have something already
    scripted. If this will work "good enough" it would allow you to get on
    to better things and come back to synching to XP's clock when life

    I'll post some reference links re: XP's firewall separately -- may be
    usefull to have on hand.

    email above disabled

    PS Could you maybe set the width on your posts to something like 64 --
    I'm getting 10-15 char softwraps with most lines and it makes "quoted"
    lines break up and hard to read.
    prg, Jan 10, 2005
  8. Based on all of this, I think what you need is to have a Linux box be
    your Authoritative Time Source, and have it sync not against a cheapo
    GPS unit (which will have enough jitter that it won't play well) or
    against an XP box (which will be running whatever Microsoft has hacked
    up as their variation on NTP that is NOT REALLY NTP), but against a
    couple or three members of the NTP 'pool.'

    After that box has been synced for a while, its times should be pretty

    You then should sync each of the boxes at those two locations against
    your internal "time authority" host.
    If you have a decent fast connection between the two boxes, there's no
    need for them to agree by a "mere" 1/4 second. They can do way better
    than that.
    output = ("cbbrowne" "@" "")
    Rules of the Evil Overlord #141. "As an alternative to not having
    children, I will have _lots_ of children. My sons will be too busy
    jockeying for position to ever be a real threat, and the daughters
    will all sabotage each other's attempts to win the hero."
    Christopher Browne, Jan 10, 2005
  9. W. Watson

    W. Watson Guest

    What! No interest in the summer job watching for neutrinos light up a detector at
    Fermi Lab in Chicago? :)
    When I approach that stage, I got get my Complete Book of New Yorker contains and
    begin reading. It and the 2 CDs contain 68,000+ cartoons. I'm through the first 1600
    in the book.
    Unfortunately, neither one of us wanted to move another 100 miles from the other. :)
    Basically, we took what we could get. Yes, ideally we should be much further apart,
    but our dual sights are often good enough to put together a decent trajectory.
    I definitely know how to use it. I just need to review the methodolgy. My other
    partner, my wife, is particularly adept with it. Are you thinking of a script that
    dials out at 2 am and gets the time, and updates accordingly? Ah, I see more below.
    I'll keep it in mind. See end note.
    Yes, I've found the formatting a little odd. I'll see what I can do. I get some
    strange things at times. When some I reply some people, their lines are unwrapped
    completely, and I have to rewrap them. Never quite understood that. Moz 1.6 is what
    I'm using.

    We'll at this point, I'm just taking it easy waiting for someone on a windows group
    to tell me why I cannot get by the 3rd step in the authoritative time document that I
    tried using to make registry changes for NTP. I'll do what I can through Thursday to
    deal with what I can, then I'm going on a four day birding trip. When I get back,
    I'll evaluate what I then know, and follow a path that seems reasonable for at least
    an improvement in my present arrangement. I'm sure my partner will have some input on
    it. He's been away for 2 weeks. Whatever it is it'll be something I can do with less
    effort than I've put into this so far. Then it's back to working on meteor detection
    methodolgy and algorithms.

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
  10. W. Watson

    W. Watson Guest

    What is that? I guess I can go there and find out. Sounds like perhaps averaging time
    from three different ntp servers.
    I take it that would be XP--after I figure out why I cannot complete a registry
    change required to make it authoritative.
    Good. Let's hope we can achieve that. I think I'm getting the attention of my partner
    on this, so maybe we'll achieve it.

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 10, 2005
  11. W. Watson

    Snowbat Guest

    Some further digging shows XP's 'Windows Time Service' can be configured to
    use one of the following modes:
    # NT5DS -- use the Win2K method of locating a server, and use the NetRemoteTOD
    protocol for time
    # NTP -- use the servers you specify, and use the SNTP protocol
    # NoSync -- run, but don't check or set the time

    As a test I configured an XP machine on my network for NTP mode and I can
    successfully query it from the Linux box using the ntpdate command. The
    following changes were required on the XP box:

    Registry: HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type
    Change this REG_SZ value from NT5DS to NTP

    Registry: HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags
    Change this REG_DWORD value from 10 to 5 here. (select decimal not hex)

    Registry: HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer
    List NTP server(s) to sync to - see

    Firewall: Add an entry to allow incoming UDP traffic on port 123

    Stop and restart the time service from XP command prompt
    net stop w32time
    net start w32time

    Snowbat, Jan 11, 2005
  12. Just so. I used to get sub-second precision most of the time when
    using a 9600 baud dialup. If you're on DSL or better, you can surely
    do better. You ought to be able to get within a few milliseconds on
    both systems.
    No, XP comes with a hacked-up variation on NTP that you shouldn't
    trust. It's not really NTP; it only resembles it.

    You surely know better than to imagine Microsoft would actually
    conform to someone else's standard; NTP is no exception to this.

    It is possible to get a real implementation of NTP for Windows that
    might be satisfactory; that requires that you get that, and that you
    deactivate any time services that are installed by default by
    Christopher Browne, Jan 11, 2005
  13. W. Watson

    W. Watson Guest

    Sounds like a considerable challenge to install NTP. See below about the latest on
    accuracy, but I think after I break through on the authoritative (which seems like it
    makes the real NTP server appear on XP) time source approach, I should be OK.
    However, as I mention in the last paragraph, that's looking a bit gloomy. If so, I'm
    just going to punt on my machine and see what adjtimex brings. I discuss a little of
    this on a recent post today to prg.

    Well, my partner in meteor work reappeared after a two week vacation, and I put it to
    him about the accuracy. We diddled with some velocity, altitude, and pixel
    calculations and came up with an estimate of 8ms as a goal.

    Someone piped up elsewhere that NTP can be established on XP easily by using the XP
    net time command. All one needs to do is execute net time /,
    where :.... is an ntp server in California. Supposedly I can then use
    redhat-config-date to then access time from XP at (my IP address for XP).
    I tried this but it didn't work. I need to look at the net time command to see what
    I'm missing.

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 11, 2005
  14. W. Watson

    Bill Unruh Guest

    Sorry, I have no idea why you would think that even a poor GPS would be
    worse than getting the time off the net. there is no way you are going to
    get better than ms accuracy from the net. While for a GPS you HAVE to get
    sub microsec accuracy so that you can determine your position. Even to 100
    m you need .3 microsec accuracy. And there is no way you will get that
    over the net-- timing instabilities-- differing routes for each packet,
    will make sure of that.
    Bill Unruh, Jan 11, 2005
  15. W. Watson

    Bill Unruh Guest

    ??????? You want to do scientific work, and you seem totally unwilling to
    listen to others. You insist on using a completely useless time technique. Sheesh. Why
    did you ever come onto netnews to get advice?
    As it stands, Windows is NOT going to give you 10ms accuracy. Phone line
    ntp will NOT give you 10ms accuracy. DSL might give it to you. If you
    were to use a decent ntp server.

    sntp is NOT going to give you the accuracy you need. SNTP is Simple NTP. Ie
    it does not have all of the bells and whistles-- whose main prupose is to
    try to squeeze out the best accuracy possible from a net connection.


    The Network Time Protocol (NTP)

    When the highest accuracy time information available on the Internet is
    required, the NTP protocol is used. NTP is robust and can select the best
    from a number of time sources, will reject false sources, operates to a
    very high precision in the Internet realm, with its variable delays and
    path lenghts. The NTP data packet contains information about the mode of
    operation, Stratum number of the server, polling interval, precision, delay
    and dispersion of the server as well as an identifier. It also contains
    four time stamps, and an optional authenticator. The time stamp is the
    number of seconds since 0h on 1 January 1900, in a 32 bit field, with the
    fractions of a second in a second 32 bit field. This gives the NTP protocol
    a precision of about 200 picoseconds, which should be sufficient for even
    the most demanding applications. The typical accuracy of a synchronised NTP
    client is between 1-50 milliseconds. For more information see the link
    below, or read the relevant document (RFC-1305).

    The Simple Network Time Protocol (SNTP)

    When the ultimate accuracy of NTP is not required, SNTP can be used. The
    SNTP client/server exchange is the same as the NTP client/server exchange,
    except that when using SNTP, some of the fields in the data packet are
    "canned", which means they are filled with pre-determined values. The
    advantage of the SNTP implementation is that it is much simpler and fewer
    exchanges are made between the client and the server. The typical accuracy
    of a SNTP client/server exchange is fractions of a second. For more
    information see the link below, or read the relevant document (RFC-1769).


    Ie, IF you want ms accuracy, your only choice is full NTP together with
    some fast connection with the net ( not a phone line and modem-- too slow)
    or with some GPS receiver time source.
    Bill Unruh, Jan 11, 2005
  16. A "poor GPS" doesn't provide the PPS signal necessary for
    accuracy (it is accurate to better than 340 nsec). If the GPS
    only provides NMEA messages at "regular" intervals, the
    regularity of the intervals can be anything from .25 sec to 2

    Hence NTP is a *far* better solution than a "poor GPS".

    The problem with using a GPS is that a "good" GPS is either
    complex or expensive (or both). Clearly the OP can't deal with
    either. But in fact a decent GPS system will provide accuracy
    to less than 20 microsec, at worst and maybe as low as 2-3
    microsec with some effort.

    Christopher and I agree that NTP, hosted by Linux, and synced to, is just about the only way the OP is going to
    manage to accomplish his goals on a shoe string budget and keep
    this within the realm of what he is capable of implementing.
    Floyd L. Davidson, Jan 11, 2005
  17. W. Watson

    W. Watson Guest

    Yes, many suggestions in that direction.
    You've got it. Yep, 30K baud on a good day.
    This sounds good, but there is no modem where the meteor (Linux) box is.
    The modem is in the house sitting next to my desk and is 100 feet away from
    Linux. Installing ntp on my XP machine seems a better way to go in my
    situation. The only way I can see doing this via Linux is putting a modem
    on it and having it automatically dial out at 2am to get a time synch. Is
    that possible?
    I have a number of old computers.My meteor partner came back from a 2 week+ vacation, and I was able to get
    his attention on accuracy. We did some back of the envelope calculations
    using a meteor's altitude, velocity, and image size. 8ms or about 1/10th of
    a second should do. BTW, in one sec, a meteor will move 17 miles.

    While I'm at it, people have asked if port 123 is open. I've answered that
    I thought I noted during bootup a message saying 123 is open. It is open.
    The message specifically says it opens 123 for the firewall.
    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 11, 2005
  18. W. Watson

    W. Watson Guest

    Ah, ha. Do I detect a breakthrough? The article I cited on this has been a
    flop. This is encouraging. I'll review this when I actually awake in about
    6 hours. It's 2:30 am here right now.

    I just posted a response that states 123 is open. I see messages announcing
    this during boot up. It opens 123 for the FW.

    Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <>
    W. Watson, Jan 11, 2005
  19. The above is all nonsense; it does NOT involve 'establishing NTP;' it
    should be something of a clue when the command involves "setsntp",
    rather than "setntp."

    SNTP is the dumbed-down version of NTP that may be appropriate if you
    don't care about having accurate time.

    But the nature of your application clearly requires better.

    You have been told, over and over again, that Windows sucks for this.

    What do we have to do, get David Mills (who wrote most of the NTP
    specs) to explain it to you?

    From what I can see, you're not really listening, and won't be helped,
    because you're refusing to recognize that it is unrealistic to use
    Microsoft's SNTP implementation.

    If you won't listen, and won't be helped, then it's futile for people
    to bother to try to do so.
    Christopher Browne, Jan 11, 2005
  20. In an attempt to throw the authorities off his trail, (Bill Unruh) transmitted:
    Um, because it can take as long as a second for consumer grade GPS
    units to report NMEA messages.
    There may be vastly more accurate time readings available inside the
    GPS unit, but you can't get at them; all you get is NMEA.

    Furthermore, a little bit of peeking around is highly likely to
    provide a Really Local time source.

    Traceroute is your friend...

    [email protected]:/tmp> traceroute Tuesday 07:52:46
    traceroute to (, 30 hops max, 38 byte packets
    1 godel ( 1.148 ms 0.857 ms 0.791 ms
    2 ( 50.939 ms 51.379 ms 50.567 ms
    3 ( 49.099 ms 49.702 ms 55.182 ms
    4 ( 48.462 ms 76.198 ms 48.131 ms
    5 ( 59.955 ms 57.873 ms 58.578 ms
    6 ( 65.593 ms 66.257 ms 66.227 ms
    7 ( 80.931 ms 65.470 ms 65.846 ms
    8 ( 66.294 ms 111.332 ms 65.658 ms
    9 ( 146.735 ms 158.251 ms 144.925 ms
    10 ( 145.181 ms 145.301 ms 144.815 ms
    11 ( 147.344 ms 171.478 ms

    Of those hosts, about half of them (all the ones at and provide NTP, are demonstrably nearby, since I went
    thru them in order to get to where I was going, and are demonstrably
    appropriate for use since I'm their customer. They're probably all
    Cisco routers.

    They're good for me. You run traceroute at YOUR location and you'll
    see an analagous list of hosts that will probably include something
    that will respond to NTP that is probably nearer than anything in
    Christopher Browne, Jan 11, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.