OpenBSD Journal

Report from the Hackathon: Timedelta Sensors for OpenNTPD

Contributed by mbalmer on from the we-are-at-it-again dept.

c2k6, the 2006 OpenBSD Hackathon is already in full fling. Around 50 OpenBSD developers from all over the world arrived friday and saturday in Calgary, CA to spend one week together and work intensively on various parts of OpenBSD. After only two days (and nights) the first hot stuff has gone into the tree. OpenNTPD, our NTP time service daemon has been around for quite some time now and is popular due to it's ease of configuration, stability and security. Earlier this year we began to work on support for hardware clock devices like GPS units or time signal station receivers to provide external reference time sources for OpenNTPD.

Theo added the concept of timedelta sensors, sensors that provide an offset (the error) of the local clock to the reference clock and I threw in udcf(4), a device driver to decode the Swiss HBG and the German DCF77 time signal stations. But until yesterday, we had no way to feed these timedelta sensors to OpenNTPD.

Henning changed the OpenNTPD code to use timedelta sensors, but he had to rescan the list of available sensors peridically, a not-so-elegant design, we concluded. So my idea was to link timedelta sensors to the hotplug event queues: As timedelta sensors can appear or disappear at runtime, aren't they pretty much hotplug devices? Hotplug devices create events in the system that applications can receive. The idea is simple: When a timedelta sensor is added to the system, e.g. after a driver received the first complete time information from a receiver, it generates a hutplug event which OpenNTPD receives. OpenNTPD then rescans the available timedelta sensors and begin using them. Michael Knudsen implemented it and we now have support for timedelta sensors in OpenNTPD.

Of course we still lack GPS support at the moment, but be assured, it will not be long anymore till you will see a commit message and a report here that outlines how addded GPS support to OpenBSD...

(Comments are closed)


Comments
  1. By Danno (70.64.129.49) on

    I was not aware that there is a Calgary in California.

    Comments
    1. By Anonymous Coward (65.94.59.238) on

      > I was not aware that there is a Calgary in California.

      Canada?

      Comments
      1. By Anonymous Coward (84.48.209.190) on

        > > I was not aware that there is a Calgary in California.
        >
        > Canada?

        Automatic spell check?

        Comments
        1. By Anonymous Coward (62.4.77.94) on

          > > > I was not aware that there is a Calgary in California.
          > >
          > > Canada?
          >
          > Automatic spell check?
          >

          I thought it was spelled "Canuckistan"

      2. By Danno (70.64.129.49) on

        > > I was not aware that there is a Calgary in California.
        >
        > Canada?

        Yes, I do know where Calgary is, it's just that things like that annoy me. It's like seeing Chicago, USA annoys me, as does Chicago, IL. However, Chicago, IL, USA is fine, as is Calgary, (Alberta|AB|Alta), Canada is fine.

      3. By Anonymous Coward (66.11.66.41) on

        > > I was not aware that there is a Calgary in California.
        >
        > Canada?

        CA is California. AB is Alberta. "Canada" is Canada.

        Comments
        1. By Lars Hansson (203.65.246.6) lars@unet.net.ph on

          > > > I was not aware that there is a Calgary in California.
          > >
          > > Canada?
          >
          > CA is California. AB is Alberta. "Canada" is Canada.

          CA is Canada for everyone outside the USA, ie for the majority of the earths population.

          Comments
          1. By Michael (65.204.119.134) on

            > > > > I was not aware that there is a Calgary in California.
            > > >
            > > > Canada?
            > >
            > > CA is California. AB is Alberta. "Canada" is Canada.
            >
            > CA is Canada for everyone outside the USA, ie for the majority of the earths population.
            >
            >

            Nah, CA is Canada for people inside the USA as well.

            --Michael

          2. By tedu (71.139.182.193) on

            > > > > I was not aware that there is a Calgary in California.
            > > >
            > > > Canada?
            > >
            > > CA is California. AB is Alberta. "Canada" is Canada.
            >
            > CA is Canada for everyone outside the USA, ie for the majority of the earths population.

            write "calgary, ca" on an envelope, drop it in a canadian mailbox, and see where it goes. :)

  2. By Tim (145.99.137.25) on

    Did anybody read about the stuff Matthew Dillon of the DragonflyBSD project had to say about OpenNTPd:
    http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00378.html

    and in more detail:
    http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00402.html

    Just wondering.

    Comments
    1. By Anonymous Coward (66.11.66.41) on

      > Did anybody read about the stuff Matthew Dillon of the DragonflyBSD project had to say about OpenNTPd:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00378.html
      >
      > and in more detail:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00402.html
      >
      > Just wondering.

      Yeah. Did anyone care? Not likely. OpenNTPd gets within a few ms just fine. If you want more precision than that, then you need to use something other than another server over the network anyways.

      Comments
      1. By Alan Watson (132.248.81.29) alan@alan-watson.org on http://www.alan-watson.org/

        > OpenNTPd gets within a few ms just fine. If you want more precision than that, then you need to use something other than another server over the network anyways.

        I have a Soekris box that has a systematic error of half a second with OpenNTPd. We can argue about whether this is good enough, but the statement that OpenNTPd is accurate to a few ms is not universally correct.

        The fix is relatively simple: measure clock frequency errors and compensate for them. I hope to get this into the kernel and OpenNTPd this summer, but at the moment real life is hogging my CPU.


        Comments
        1. By Anonymous Coward (202.6.138.34) on

          > > OpenNTPd gets within a few ms just fine. If you want more precision than that, then you need to use something other than another server over the network anyways.
          >
          > I have a Soekris box that has a systematic error of half a second with OpenNTPd. We can argue about whether this is good enough, but the statement that OpenNTPd is accurate to a few ms is not universally correct.
          >

          Add to that, the -portable version is broken on every Linux system I've used it with. (or does that make every Linux system broken?)

    2. By Anonymous Coward (128.171.90.200) on

      Hopefully any corrections they make will get pushed upstream

    3. By roy (24.34.19.74) on

      > Did anybody read about the stuff Matthew Dillon of the DragonflyBSD project had to say about OpenNTPd:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00378.html
      >
      > and in more detail:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00402.html
      >
      > Just wondering.

      Thank you for those links, I was not aware of them. I've been testing the OpenNTPD daemon on one 3.9 system for nearly a month now. I definitely agree with Matt -- the OpenNTPD daemon is a very poor time keeper. I don't see any evidence that it even attempts frequency correction. The typical error I measure is about 80 ms. with about a dozen daily adjustments of more than 128 ms. Compared with the real NTP, it also puts between three and four times the packet load on the servers it is using.

    4. By Tim (145.99.137.25) on

      > Did anybody read about the stuff Matthew Dillon of the DragonflyBSD project had to say about OpenNTPd:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00378.html
      >
      > and in more detail:
      > http://leaf.dragonflybsd.org/mailarchive/commits/2005-04/msg00402.html
      >
      > Just wondering.

      I have seen a better discussion before but I can't find it anymore, but these links will give some additional information:

      http://leaf.dragonflybsd.org/mailarchive/users/2005-04/msg00171.html
      http://leaf.dragonflybsd.org/mailarchive/users/2005-04/msg00206.html

      I'm really wondering if Henning has been talking with Matt or Joerg and aware of their work?

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]