Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 11 min read Case study hardMaster

NTS: Authenticated Time at Meta

Meta's public time service now supports NTS (RFC 8915) at nts.meta.com, authenticating NTP responses so clients can detect forged time, a growing concern as TLS certificate lifetimes shrink toward 47 days and renewals become unattended. Key exchange runs over TLS 1.3 and hands clients off to separate NTP responders. Those servers hold no per-client state: the cookie-sealing key is derived with HKDF-SHA256 from a shared master secret and the Unix epoch day number, so no key ring is replicated and any responder can open any cookie. NTS still cannot stop delay attacks, bootstrapping circularity, wrong-but-authenticated servers, or non-monotonic wall clocks, and Meta urges Android and iOS to add NTS to their stock time clients.

Assumes: NTP basicsTLS 1.3AEAD ciphersX.509 certificate validation

Related posts

  • How Precision Time Protocol is being deployed at Meta

    Meta Engineering hardMaster

    Meta replaced NTP with Precision Time Protocol across its data centers to get nanosecond-level clock sync. Its main motivating use is commit-wait reads that bound clock uncertainty and avoid quorum reads, which ran roughly 100x better on PTP than on NTP in Meta's experiments. The design has three parts. The PTP rack has GNSS-over-fiber antennas and OCP Time Cards disciplined by oscillatord, with NIC clocks aligned via ts2phc and PPS to within ±50ns. The network uses unicast PTP with transparent clocks instead of boundary clocks. Clients are served by ptp4u, an open-source Go PTP server handling over 1 million clients per appliance, with c4u generating dynamic clock class and accuracy and Calnex Sentinel independently monitoring the setup.

  • How Precision Time Protocol handles leap seconds

    Meta Engineering mediumAdept

    Meta handles leap seconds for its nanosecond-precision PTP service by self-smearing inside the fbclock library, which shifts its returned Window of Uncertainty {earliest_ns, latest_ns} by 1 ns every 62.5 µs. The approach is stateless and reproducible, since the start time comes from tzdata, so a rebooted server can recompute its position. The service keeps TAI internally and returns UTC through the API. The costs are that linear PTP smearing and quadratic NTP smearing can disagree by over 100 µs, hosts still drift apart during the smear, and precisely scheduled jobs end up nearly 1 ms off after 60 seconds. Meta therefore recommends that clients use TAI where possible and supports freezing new leap seconds after 2035.

  • PTP: Timing accuracy and precision for the future of computing

    Meta Engineering easyNovice

    Meta is rolling out Precision Time Protocol (PTP) across its data centers to replace NTP, moving clock synchronization precision from milliseconds to nanoseconds. Accurate offset measurement depends on network latency being consistent and symmetric, so PTP uses hardware timestamping to improve consistency and transparent clocks to improve symmetry. Meta removed boundary clocks so every machine syncs directly with the Server Clock. Because off-the-shelf gear could not handle PTP at its scale, Meta built its own Time Appliance (a GNSS receiver plus a miniaturized atomic clock) and a PCIe Time Card, and has open-sourced the hardware, client software and transparent clock through the Open Compute Project.

  • Post-quantum readiness for TLS at Meta

    Meta Engineering hardMaster

    Meta has deployed hybrid X25519+Kyber key exchange in its Fizz TLS library for most internal service traffic, prioritizing store-now-decrypt-later protection where it controls both endpoints. Kyber768 is the default, but Kyber512 is used where the larger 1184-byte keyshare pushed resumption ClientHellos (with PSKs) past the TCP MSS and broke TCP Fast Open, adding an extra RTT. Rollout surfaced a race condition in liboqs's Keccak dispatch causing segfaults, fixed upstream with pthread_once, and HelloRetryRequest thrashing during cross-host resumption, solved by splitting TLS session scopes into classical and hybrid. The hybrid group cost about 40% more CPU than X25519 alone.

  • Simple Precision Time Protocol at Meta

    Meta Engineering hardMaster

    Simple Precision Time Protocol (SPTP) replaces the subscription-based unicast PTPv2 exchange with a stateless, client-driven three-packet exchange: a delay request (flagged with PTP profile Specific 1), a sync carrying T4, and a followup/announce carrying T1 and CF1. Standard two-step PTP formulas then give path delay and offset. Because the client drives the exchange, it can poll several servers at once and combine them into a clock ensemble. That ensemble rejects outliers using Chauvenet's criterion over 400 samples and weights the remaining clocks by inverse variance. At Meta scale SPTP matches ptp4l precision while cutting CPU by over 40%, memory by 70% and network traffic by 50%, at the cost of losing subscription signaling and authentication.

The quest for software engineering knowledge.

Look:
Layout: