Skip to content

Daemon Overview

The clockbound daemon keeps the system clock synchronized and publishes a bounded timestamp over shared memory.

Overview 

The clockbound daemon keeps the system clock synchronized by reading from a local PTP Hardware Clock (PHC) device or NTP sources, and periodically writes the clock status, time and clock error bound to a shared-memory segment. It is batteries-included: it runs with zero configuration and automatically gathers the reference time sources available in its environment.

The daemon has three major architectural components:

  • IO: reads from NTP sources, the PHC, and the VMClock.
  • Clock Sync Algorithm: a feed-forward algorithm that uses hardware oscillator counters to measure local clock drift and compares them against reference timestamps.
  • Clock State: writes the time and clock error bound into the shared-memory regions and disciplines the system clock.

The feed-forward design decouples IO from modifications to the system clock, decouples the system clock from calculating time, and enables a stronger story for handling disruption events.

Time sources 

NTP 

The daemon automatically configures itself to read from the Amazon Time Sync Service (link-local 169.254.169.123:123) and time.aws.com via NTP. Additional NTP sources can be supplied in a configuration file, either as an individual server (IPv4, IPv6, or hostname) or as a pool hostname that resolves to several servers.

When polling the public time.aws.com endpoints, the daemon includes an NTP extension field (0xFEC2) carrying minimal metadata: the ClockBound version and an ephemeral random session ID that is regenerated at each daemon start.

PHC 

The daemon automatically detects PHC devices on the instance and synchronizes with them when available. PHC support is limited to the PHC exposed by the ENA driver on EC2.

VMClock 

If /dev/vmclock0 is available, the daemon uses it to be informed of clock disruptions. See Platforms for kernel requirements and permissions.

Configuration 

Without a configuration file, the daemon runs on built-in defaults and auto-detected time sources, logging to stdout/stderr only. An optional TOML file, passed with -c/--configuration, turns on log file streams and adds NTP time sources. See Configuration for every setting.

Command-line reference 

  • -c, --configuration <FILE> — load a TOML configuration file. A file that cannot be read, parsed, or validated is reported on stderr and the daemon exits with code 2.
  • --check-configuration — load and validate the file passed with -c, report whether it is usable, and exit without starting.
  • -v, --verbose — raise the stdout log level from info to debug.

cbctl 

cbctl is a command-line utility bundled with the daemon. Use cbctl status to inspect the clock status and error bound, cbctl waitsync to block until the clock is synchronized, and cbctl sources to view the state of the daemon's time sources. See the cbctl reference for details.

Logging 

The daemon always logs to stdout/stderr. It can also write three log file streams to the configured log directory:

  • synchronization.log — clock synchronization information: periodic snapshots of clock quality and summaries of system clock adjustments.
  • sources.log — a periodic snapshot summary of all sources. cbctl sources reads it.
  • ffevents.log — the Feed Forward Events Log: synchronization algorithm data for advanced diagnostics and replay.

Each stream is disabled by default and is enabled separately in the configuration file. See the Logging overview for which log to enable and how to rotate them.