Skip to content

Conversation

@troglobit
Copy link
Contributor

@troglobit troglobit commented Dec 3, 2025

Description

This PR adds NTP server support using the ietf-ntp (RFC 9249) YANG model. The implementation supports three operational modes aligned with the documentation:

  • Standalone mode: Uses only a local reference clock to serve time
  • Server mode: Syncs from upstream NTP servers while serving clients
  • Peer mode: Bidirectional synchronization between two NTP servers

Features Implemented

  • Unicast server and peer configurations with composite key (address, type)
  • Configurable poll intervals (minpoll/maxpoll), NTP version, per-source port
  • Preference settings (prefer, iburst, burst with peer mode restrictions)
  • makestep: Fast initial synchronization (1.0s threshold, 3 update limit by default)
  • rtcsync: Hardware RTC synchronization enabled by default for time persistence across reboots
  • Comprehensive operational state:
    • Server statistics (packets received/sent/dropped)
    • Associations (address, mode, stratum)
    • Clock state (stratum, offsets, delays, frequencies, sync state)
  • Mutual exclusion with ietf-system NTP client enforced via YANG

Deviations & Limitations

Several advanced features from ietf-ntp have been deviated as not-supported:

  • Authentication (keys and per-source auth)
  • Access rules (currently allows all clients)
  • Interface-specific configurations (broadcast/multicast modes)
  • Source interface binding (chronyd limitation)

Testing

  • server_mode_standalone: Standalone operation with local reference clock
  • server_mode_server: Upstream sync while serving clients
  • server_mode_peer: Bidirectional peer synchronization
  • server_makestep: Configuration and operational state verification
  • server_client: Verifies ietf-ntp (server) and ietf-system (client)

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

Fixes #904

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit marked this pull request as ready for review December 4, 2025 15:48
@troglobit troglobit requested a review from mattiaswal December 4, 2025 15:48
@troglobit troglobit linked an issue Dec 5, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Add support for NTP server

2 participants