Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use precision field in NTP packet for analyzing ntp.network.ntp_update results #959

Open
evensonbryan opened this issue Jun 14, 2022 · 0 comments

Comments

@evensonbryan
Copy link

The NTP update test in subset/network/ntp_tests.py checks the client's time and the server's time in the NTP messages and verifies if they are within 0.128 seconds of each other. If so the test passes and otherwise the test fails. This gives me false-negative test results. Chrony implements NTP Client Data Minimization (https://datatracker.ietf.org/doc/html/draft-ietf-ntp-data-minimization-04). Chrony correctly adjusts the device's system time, but the Transmit Timestamp field in the NTP client messages is randomly offset by decades. However, the precision field is set to 0x20 in the NTP client messages. The Transmit Timestamps are within the precision indicated but are not very useful in indicating how close the client's time was set to the server's time.

I'm proposing re-working ntp_tests.py to account for the additional packet information.

  1. Read the precision field in the NTP client messages.
  2. Verify that the client's Transmit Timestamp is within the noted precision of the server's time.
  3. If the time difference is outside the specified precision then the test fails.
  4. If the time difference is within the specified precision and the precision is below a threshold (1 second? A configurable parameter?) then the test passes.
  5. If the time difference is within the specified precision and the precision is above a threshold, then the test is skipped. An additional note is added to the test stating that NTP messages were detected but could not validate the time was set. In these cases, the user may need to manually verify the time was set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant