Skip to content
Adam Spera

Network Time Protocol (NTP)

Synchronizing time across network devices is a critical service. While it might not seem important at first glance, many key network functions rely on accurate clocks, including:

  • Time-based ACLs
  • Expiring passwords and certificates
  • Key exchange validation for VPNs and secure tunnels
  • Accurate log timestamps for troubleshooting and correlation

NTP uses UDP port 123

NTP works on a hierarchical model called the Stratum model, which defines the “distance” a device is from the reference clock (usually an atomic or GPS clock).

  • Stratum 0: Reference clock (atomic, GPS, etc.)
  • Stratum 1: Directly connected to Stratum 0
  • Stratum 2+: Syncs to a device at a lower stratum

Each hop away from the atomic clock increases the stratum level.

Devices can participate in NTP in one of several roles:

  • Syncs time from a specified server
  • Provides time to other clients or peers
  • Use ntp master if you’re making a router or switch act as an authoritative clock source
  • Two devices at the same stratum can peer
  • Helps provide redundancy and resilience
  • If both peers lose connection to their stratum-lower server, they can stay in sync with each other

NTP Peering is great for maintaining consistent time across a zone when the upstream clock source is temporarily unreachable.

! Configure as a time source (typically on the "server" side)
ntp master [stratum]
! Configure as an NTP client
ntp server [ipaddress]
! Peer with another device (must be same stratum)
ntp peer [ipaddress]
! Enable NTP authentication & Define authentication key
ntp authenticate
ntp authentication-key [number] md5 [key-string]
ntp trusted-key [number]
ntp server [address] key [number]
show ntp status ! View current sync status and stratum
show ntp associations ! View peers/servers and their reachability

While NTP provides reasonable time synchronization (typically accurate within milliseconds), the Precision Time Protocol (PTP) is designed for applications that require much higher precision, often in the sub-microsecond range.

PTP is defined in IEEE 1588 and is commonly used in environments such as:

  • Industrial automation
  • Telecommunications (e.g., mobile backhaul, 5G)
  • Financial trading systems
  • Power distribution networks
FeatureNTPPTP
AccuracyMillisecondsSub-microseconds
Transport ProtocolUDP (port 123)UDP (port 319/320) or Ethernet
Hardware SupportOptionalTypically hardware-assisted
Use CaseGeneral network devicesPrecision-critical systems