Time going backwards - NTP

This is a discussion on Time going backwards - NTP ; Hi Folks, I have some questions about when (if ever) NTP will set time backward. I'll be using it on Embedded Linux for time stamping video frames. I've found several mentions in RFC 1305 that this should not happen, and ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Time going backwards

  1. Time going backwards

    Hi Folks,

    I have some questions about when (if ever) NTP will set time backward.
    I'll be using it on Embedded Linux for time stamping video frames.

    I've found several mentions in RFC 1305 that this should not happen, and
    also in section "Step Phase Adjustments" mention that it can jump
    backwards.

    Is there a simple description anywhere if what variables affect this,
    and how? I'd like to know when it's going to jump backwards on Linux -
    what the rules are and what control I have over it.

    Any help would be appreciated.

    -JB-
    ...

  2. Re: Time going backwards

    John Bartas wrote:
    > Hi Folks,
    >
    > I have some questions about when (if ever) NTP will set time backward.
    > I'll be using it on Embedded Linux for time stamping video frames.
    >
    > I've found several mentions in RFC 1305 that this should not happen, and
    > also in section "Step Phase Adjustments" mention that it can jump
    > backwards.
    >
    > Is there a simple description anywhere if what variables affect this,
    > and how? I'd like to know when it's going to jump backwards on Linux -
    > what the rules are and what control I have over it.
    >
    > Any help would be appreciated.
    >
    > -JB-
    > ..


    I wouldn't get terribly upset about it. Ntpd does not step the time
    unless it is grossly wrong. Ntpd has been known to step *FORWARD* on
    certain Windows and MAYBE Linux systems when heavy disk activity
    resulted in missed clock ticks. I can't think of anything likely to go
    wrong that would cause a *BACKWARD* step.

  3. Re: Time going backwards

    jbartas@speakeasy.net (John Bartas) writes:

    >Hi Folks,


    >I have some questions about when (if ever) NTP will set time backward.
    >I'll be using it on Embedded Linux for time stamping video frames.


    It won't, unless you tell it to at when it first starts up.


    >I've found several mentions in RFC 1305 that this should not happen, and
    >also in section "Step Phase Adjustments" mention that it can jump
    >backwards.


    >Is there a simple description anywhere if what variables affect this,
    >and how? I'd like to know when it's going to jump backwards on Linux -
    >what the rules are and what control I have over it.


    It will not under operation except possibly on startup. Otherwise it will
    change the time by changing the clock frequency by at most 500PPM. Since to
    go backwards it has to go at -1000000PPM or less, ntp will not go
    backwards.




  4. Re: Time going backwards


    >I wouldn't get terribly upset about it. Ntpd does not step the time
    >unless it is grossly wrong. Ntpd has been known to step *FORWARD* on
    >certain Windows and MAYBE Linux systems when heavy disk activity
    >resulted in missed clock ticks. I can't think of anything likely to go
    >wrong that would cause a *BACKWARD* step.


    It could step backwards if there was a lot of traffic on a phone line
    such that the network delay was asymmetric for long enough.

    --
    These are my opinions, not necessarily my employer's. I hate spam.


  5. Re: Time going backwards

    There's also the theoretical possibility of a negative leapsecond,
    but of course that's intentional.

    Paul

  6. Re: Time going backwards

    Paul.Croome@softwareag.com writes:

    >There's also the theoretical possibility of a negative leapsecond,
    >but of course that's intentional.


    It is not supposed to step backwards then It is supposed to take a second
    seconds to move forward at a glacial pace. -- ie, if during that time the
    clock is read, it is supposed to give a later time than the previous
    reading (by a microsecond or so), but otherwise it is stopped.

    I guess it is true that if the time is out by more than 125ms is it it does
    step.


  7. Re: Time going backwards

    On 2008-08-14, Unruh wrote:
    > Paul.Croome@softwareag.com writes:
    >
    >>There's also the theoretical possibility of a negative leapsecond,
    >>but of course that's intentional.

    >
    > It is not supposed to step backwards then It is supposed to take a second
    > seconds to move forward at a glacial pace. -- ie, if during that time the
    > clock is read, it is supposed to give a later time than the previous
    > reading (by a microsecond or so), but otherwise it is stopped.
    >
    > I guess it is true that if the time is out by more than 125ms is it it does
    > step.


    The default step threshold is 128ms.

    This threshold may be changed with the 'tinker step N' command.

    Stable release documentation:

    http://doc.ntp.org/4.2.4/miscopt.html

    Dev release documentation:

    http://www.eecis.udel.edu/~mills/ntp/html/miscopt.html

    --
    Steve Kostecke
    NTP Public Services Project - http://support.ntp.org/

  8. Re: Time going backwards

    On 2008-08-13, John Bartas wrote:
    > Hi Folks,
    >
    > I have some questions about when (if ever) NTP will set time backward.
    > I'll be using it on Embedded Linux for time stamping video frames.
    >
    > I've found several mentions in RFC 1305 that this should not happen, and
    > also in section "Step Phase Adjustments" mention that it can jump
    > backwards.


    ntpd has a default step threshold of 128ms. When the offset does not
    exceed this threshold the clock is slewed. When the offset exceeds this
    threshold the clock is stepped.

    > Is there a simple description anywhere if what variables affect this,
    > and how? I'd like to know when it's going to jump backwards on Linux -
    > what the rules are and what control I have over it.


    The ntpd manual page,
    http://www.eecis.udel.edu/~mills/ntp/html/ntpd.html (dev release)
    or http://doc.ntp.org/4.2.4/ntpd.html (stable release), provides a
    description of now NTP works. Start at the "How NTP Operates" section.

    --
    Steve Kostecke
    NTP Public Services Project - http://support.ntp.org/

  9. Re: Time going backwards

    Steve Kostecke wrote:

    >
    > This threshold may be changed with the 'tinker step N' command.



    But note that inappropriate use of this can result in the kernel time
    discipline being disabled.

+ Reply to Thread