NTP (Network Time Protocol) – Time Synchronisation, Stratum Levels, and Cisco IOS Configuration
1. What Is NTP and Why Does It Matter?
NTP (Network Time Protocol) is a networking protocol defined in RFC 5905 that synchronises the clocks of computers and network devices to within milliseconds of a reference time source. Without NTP, each device maintains its own independent clock that drifts at a different rate — in just a few days, clocks across a network can diverge by minutes or hours.
Clock accuracy is not merely a convenience — it is a functional requirement for several critical network systems. Syslog timestamps become meaningless for cross-device event correlation when clocks disagree. Security protocols including Kerberos and TLS certificate validation embed timestamps in authentication tokens and will actively reject connections if the time difference between client and server exceeds a threshold (Kerberos default: 5 minutes). Compliance frameworks including PCI-DSS, HIPAA, and SOX mandate accurate log timestamps for audit evidence.
Related pages: show logging | Syslog Configuration Lab | show ip protocols | show running-config | ACLs | Named ACLs | Common Port Numbers | SSH Configuration | Troubleshooting Methodology | NTP Configuration Lab
2. How NTP Works
NTP uses a client-server model over UDP port 123. A client sends a request to an NTP server containing the client's current time. The server responds with its own timestamp. The client then calculates the round-trip delay (how long the packet took in each direction) and the offset (how far the client's clock differs from the server's) — and applies a correction to gradually adjust its clock without causing an abrupt jump that could disrupt time-sensitive applications.
NTP Polling Intervals
3. NTP Stratum Hierarchy
NTP uses a hierarchical stratum model to measure distance from the authoritative time reference. Lower stratum numbers indicate higher accuracy and closer proximity to an atomic reference clock. Stratum is incremented by 1 for each hop away from a Stratum 0 source.
| Stratum | Description | Example | Accuracy |
|---|---|---|---|
| 0 | Physical reference clock — not on the network; connected directly to a Stratum 1 server | GPS receiver, atomic clock, WWVB radio | Nanoseconds |
| 1 | Primary time server; directly connected to a Stratum 0 source via hardware interface | time.google.com, pool.ntp.org, corporate GPS-synced NTP appliance | Microseconds to low milliseconds |
| 2 | Secondary server; synchronised to one or more Stratum 1 servers | Internal corporate NTP server, core switch acting as NTP server | Low milliseconds |
| 3–15 | Further downstream clients/servers; each level adds slight jitter from the hop above | Branch routers, switches, servers, workstations | Milliseconds to tens of milliseconds |
| 16 | Unsynchronised — the device has no valid NTP source; clock is not trusted | Cisco device before ntp server is
configured or before sync is achieved |
Unreliable — do not use |
Important CCNA exam point: A Cisco router configured
with ntp master 5 advertises itself as a Stratum
5 NTP server to other devices on the network. It uses its own
internal clock (which may not be externally synchronised) as
the source. This is used when no external NTP reference is
available — for example, in a lab or isolated network. The
ntp master command should always include a
stratum number higher than the true stratum of the best
available reference.
4. Cisco IOS NTP Configuration — Client
! ── Configure NTP server sources ──────────────────────────────────────
Router(config)# ntp server pool.ntp.org prefer
! └─ "prefer" = use this server
! as the preferred source when
! multiple servers are configured.
! The router still polls all
! servers but weights this one higher.
Router(config)# ntp server 192.168.1.100
! Add a second NTP source (internal corporate server).
! Using multiple servers provides redundancy and improves accuracy —
! NTP uses all configured servers and cross-checks them.
! ── Sync hardware clock (NVRAM-backed) ───────────────────────────────
Router(config)# ntp update-calendar
! Synchronises the hardware clock (the battery-backed clock in NVRAM)
! with the NTP-corrected software clock.
! Why this matters: if the router reloads and has no NTP connectivity on
! boot, the hardware clock provides the initial time. Without this command,
! the hardware clock may drift and cause a brief period of wrong timestamps
! on reboot until NTP re-syncs.
! ── Verify the configuration ─────────────────────────────────────────
Router# show ntp status
Router# show ntp associations
5. Cisco IOS NTP Configuration — Server (ntp master)
! Configure this router as an NTP server for the local network:
Router(config)# ntp master 5
! └─ Stratum number this router advertises.
! Set higher than the best external source.
! Common values: 3 (if synced to public Stratum 1/2)
! or 5 (if using internal clock only).
!
! IMPORTANT: "ntp master" makes the router use its OWN INTERNAL CLOCK
! as the time source if it cannot reach any external NTP server.
! It does NOT mean the router is connected to an atomic clock.
! If the internal clock drifts, all clients will receive wrong time.
!
! Best practice: always also configure ntp server [external] alongside
! ntp master so the router prefers the external source when available.
! ── Full recommended configuration for an internal NTP server ────────
Router(config)# ntp server pool.ntp.org prefer ! sync to public NTP
Router(config)# ntp server time.google.com ! secondary public NTP
Router(config)# ntp master 3 ! act as server to LAN
Router(config)# ntp update-calendar ! keep hardware clock synced
! Client devices on the LAN then point to this router:
BranchRouter(config)# ntp server 192.168.1.1 ! this router's LAN IP
6. NTP Authentication — MD5 Key-Based
Without authentication, any device can claim to be an NTP server and send false time updates to your routers. NTP authentication uses a shared key (MD5) to verify that time updates come from a trusted source. This prevents NTP spoofing attacks where an attacker sends crafted NTP responses to shift the clock on a target device.
! ── On the NTP SERVER router ──────────────────────────────────────────
Server(config)# ntp authenticate
! Enable NTP authentication globally (required on both client and server)
Server(config)# ntp authentication-key 1 md5 MySecureKey
! │ └─ Shared secret (must match client)
! └─ Key ID number (1–65535)
Server(config)# ntp trusted-key 1
! Mark key 1 as trusted — the server will only accept time from peers
! that present this key ID with the correct password
! ── On the NTP CLIENT router ──────────────────────────────────────────
Client(config)# ntp authenticate
Client(config)# ntp authentication-key 1 md5 MySecureKey
Client(config)# ntp trusted-key 1
Client(config)# ntp server 192.168.1.100 key 1
! └─ Associate key 1 with this server
! Client only accepts time from
! 192.168.1.100 if it presents key 1
! ── Verify authentication is working ─────────────────────────────────
Router# show ntp associations detail
! Look for "authenticated" in the output to confirm auth is active
! If authentication fails:
! "configured, no authentication" appears in show ntp associations detail
! Check that both sides have: same key ID, same password, ntp trusted-key set
7. NTP Configuration on Linux (chrony)
chrony is the recommended NTP implementation on modern
Linux distributions (Ubuntu 18.04+, RHEL 8+, Debian 11+),
replacing the older ntpd daemon. Chrony
synchronises faster after boot or after network disruptions
and handles intermittent connectivity better than ntpd.
Windows NTP Configuration
8. Verification — show ntp status and show ntp associations
These two Cisco IOS commands together give a complete picture of NTP synchronisation state. Knowing how to read both outputs is a CCNA exam requirement.
show ntp status — Annotated
show ntp associations — Annotated
Router# show ntp associations
address ref clock st when poll reach delay offset disp
*~192.168.1.100 .GPS. 2 45 64 377 5.123 +1.456 2.345
~pool.ntp.org .INIT. 16 - 64 0 0.000 0.000 16000.
Column meanings:
Column 1 (symbols):
* = currently selected (synced) peer ← this is the active time source
+ = acceptable peer (could take over if * fails)
- = peer considered but rejected by the clock selection algorithm
x = peer declared a false ticker (outlier) — not used
~ = configured as server (static peer, not discovered via broadcast)
# = too many peers selected (rare)
blank = not yet evaluated
address = IP or hostname of the NTP server
ref clock = the server's own time reference (what it syncs to)
.GPS. = GPS; .INIT. = initialising; .LOCL. = local clock
st = server's stratum level (2 = Stratum 2 server)
when = seconds since last packet received from this server
poll = current polling interval in seconds (64 = polling every 64s)
reach = octal reachability register (377 = all 8 recent polls successful)
0 = no polls succeeded → NTP server not reachable
377 = all recent polls succeeded → healthy connection
delay = round-trip delay to this server in milliseconds (5.123ms)
offset = clock offset in milliseconds (+1.456ms = router 1.456ms ahead)
disp = dispersion (clock error estimate) — lower is better
16000 in second row = server not yet reachable
Linux — chronyc tracking and ntpq -p Annotated
9. Public vs Internal NTP Servers
| Type | Examples | Pros | Cons | Best For |
|---|---|---|---|---|
| Public NTP pool | pool.ntp.org, time.google.com, time.cloudflare.com, time.apple.com | No setup required; highly available distributed pools; Stratum 1 accuracy; free to use | Requires internet access from the device; adds network latency vs a local server; not suitable for air-gapped networks | Internet-connected devices; small networks without internal NTP infrastructure |
| Internal NTP server | Corporate NTP appliance with GPS
disciplining; Cisco router with
ntp master; Linux server
with chrony |
Lower latency (LAN-local); works in air-gapped environments; full control over stratum and accuracy; one internet connection serves all internal devices | Requires initial setup and maintenance; internal server must itself sync from an external reference for maximum accuracy | Large enterprise networks; security-sensitive environments; networks without direct internet access from all devices |
Recommended Enterprise NTP Hierarchy
Stratum 1: GPS-disciplined NTP appliance or public pool servers
(time.google.com, pool.ntp.org, time.cloudflare.com)
│ sync to
Stratum 2: Internal NTP server (Linux chrony or core Cisco router)
configured: ntp server pool.ntp.org + ntp master 3
│ sync to
Stratum 3: All network devices (routers, switches, firewalls)
configured: ntp server 192.168.1.100
(all clients point to the internal server, not the internet)
│ sync to
Stratum 4: Servers, workstations, IoT devices
This design: only ONE device (the internal NTP server) needs outbound
access to the internet on UDP/123. All other devices sync internally.
Centrally managed, audit-friendly, and secure.
10. NTP Security
NTP faces two main security threats: NTP spoofing (an attacker sends forged NTP responses to shift a device's clock) and NTP amplification DDoS (an attacker uses open NTP servers to amplify a flood). Authentication addresses the first; firewall controls address both.
── Restrict UDP 123 to trusted sources (most important control) ──────
! Only allow NTP queries from the internal NTP server:
Router(config)# access-list 10 permit 192.168.1.100
Router(config)# ntp access-group peer 10
! "peer" = only IPs in ACL 10 can peer (sync) with this device
! On Linux — restrict which clients can query this server:
# In /etc/chrony/chrony.conf:
allow 192.168.1.0/24 # only allow this subnet to query
deny all # deny all other sources
! UFW firewall — allow NTP only from internal network:
sudo ufw allow from 192.168.1.0/24 to any port 123 proto udp
sudo ufw deny from any to any port 123
── Disable NTP broadcast/multicast mode ─────────────────────────────
Router(config)# no ntp broadcast
Router(config)# no ntp multicast
! NTP broadcast mode sends time updates to all devices on a subnet
! without requiring them to authenticate. An attacker on the LAN can
! inject false broadcast time updates. Disable unless specifically needed.
── Enable MD5 authentication (reviewed in Section 6) ────────────────
Router(config)# ntp authenticate
Router(config)# ntp authentication-key 1 md5 MySecureKey
Router(config)# ntp trusted-key 1
Router(config)# ntp server 192.168.1.100 key 1
── Additional security controls ──────────────────────────────────────
• Monitor: alert if system time suddenly changes by more than a threshold
• Use NTPsec (NTP with cryptographic authentication) where supported
• Do not run public-facing NTP servers unless necessary (DDoS risk)
• Consider PTP (Precision Time Protocol, IEEE 1588) for sub-microsecond
accuracy in financial trading or industrial control environments
See: ACLs | Named ACLs | ACL Overview
11. Troubleshooting NTP Issues
| Symptom | Likely Cause | Diagnostic and Fix |
|---|---|---|
show ntp status shows
"Clock is unsynchronised" |
No NTP server reachable; UDP/123 blocked by firewall; NTP server IP misconfigured; NTP authentication mismatch | ping [ntp-server-ip] — verify IP
reachability; show ntp associations
— check reach value (0 = no response);
verify firewall allows UDP/123 outbound; verify
ntp server command is present in
running config |
| Stratum shown as 16 | Device has no valid NTP source — same causes as "unsynchronised"; also seen immediately after boot before first sync completes | Check NTP source configuration; verify
reachability; allow 5–10 minutes after boot
(or use iburst to accelerate);
check show ntp associations for
reach column |
| Large clock offset (hundreds of ms or more) | NTP is functioning but the clock drifted significantly before sync; old hardware clock value loaded on boot | Add iburst option for faster
correction; run ntp update-calendar
to sync hardware clock; on Linux:
chronyc makestep forces an immediate
step correction |
| Syslog messages still show wrong timestamps despite NTP synced | service timestamps log datetime msec
not configured; device showing uptime instead
of real date/time in logs |
Router(config)# service timestamps log
datetime msec; verify with
show logging — asterisk (*) before
timestamp means NTP not yet synced |
NTP authentication fails — peers show
"unauth" in show ntp associations
detail |
Key ID mismatch; password mismatch; forgot
ntp trusted-key; forgot ntp
authenticate on one end |
Verify: both ends have ntp
authenticate; same key ID and password;
ntp trusted-key [n]; server is
referenced with key [n] appended |
| reach column shows values like 377, 177, 077 (not all 377) | Some NTP polls are failing — intermittent connectivity to NTP server; packet loss | The reach column is an octal representation of the last 8 polls (1=success, 0=fail); 377 (binary 11111111) = all 8 successful; 377 dropping to 177 (11111111 → 01111111) means the most recent poll failed; investigate link quality or firewall |
12. NTP vs SNTP vs PTP
| Feature | NTP (v4) | SNTP | PTP (IEEE 1588) |
|---|---|---|---|
| Precision | ±1ms over LAN; ±50ms over WAN | ±100ms or worse | Sub-microsecond (nanoseconds with hardware timestamping) |
| Complexity | Moderate — uses multiple servers, Marzullo's algorithm, clock filtering | Simple — single server, basic request/response | High — requires PTP-aware hardware and network switches |
| Algorithm | Complex filtering, clock discipline, clock selection algorithm | Basic: takes the server's time directly without filtering | Hardware timestamping at the physical layer; best master clock algorithm |
| Transport | UDP port 123 | UDP port 123 | UDP port 319 (event), 320 (general); also Ethernet multicast |
| Use case | Standard for all network devices — routers, switches, servers, workstations | IoT devices, embedded systems, simple clients where complexity is undesirable | Financial trading, industrial automation, telecom (5G), power grid synchronisation |
| Cisco IOS support | Full support — ntp server,
ntp master,
ntp authenticate |
Clients only (simplified mode) | Supported on specific Cisco platforms with hardware timestamping |
13. Complete Enterprise NTP Deployment Example
Network: Corporate with HQ and branch offices.
Design:
HQ core router (192.168.1.1) = internal NTP server (Stratum 3)
Branch routers = NTP clients pointing to HQ router
All servers and devices = NTP clients
── HQ Core Router (NTP Server) ───────────────────────────────────────
HQRouter(config)# ntp server pool.ntp.org prefer
HQRouter(config)# ntp server time.google.com
HQRouter(config)# ntp master 3
HQRouter(config)# ntp update-calendar
HQRouter(config)# ntp authenticate
HQRouter(config)# ntp authentication-key 1 md5 Corp@NTP2025
HQRouter(config)# ntp trusted-key 1
HQRouter(config)# service timestamps log datetime msec
── Branch Routers (NTP Clients) ──────────────────────────────────────
BranchRouter(config)# ntp server 192.168.1.1 key 1 prefer
BranchRouter(config)# ntp server 192.168.1.2 key 1 ! secondary
BranchRouter(config)# ntp authenticate
BranchRouter(config)# ntp authentication-key 1 md5 Corp@NTP2025
BranchRouter(config)# ntp trusted-key 1
BranchRouter(config)# ntp update-calendar
BranchRouter(config)# service timestamps log datetime msec
── Syslog server / Linux (NTP Client) ───────────────────────────────
# /etc/chrony/chrony.conf:
server 192.168.1.1 iburst prefer
server 192.168.1.2 iburst
── Verification on all devices ───────────────────────────────────────
Cisco: show ntp status → confirm "synchronised", stratum 3 or 4
show ntp associations → confirm * on the HQ router entry, reach=377
Linux: chronyc tracking → confirm "System time: X seconds fast/slow"
chronyc sources -v → confirm * on the server entry
14. Exam Tips & Key Points
- NTP uses UDP port 123 exclusively. It is connectionless for efficiency — time queries do not need the overhead of TCP connection establishment.
- Know the stratum hierarchy: Stratum 0 = atomic clock/GPS (not on network); Stratum 1 = primary NTP servers directly connected to Stratum 0 (e.g., pool.ntp.org); Stratum 2 = syncs to Stratum 1; Stratum 16 = unsynchronised (clock is unreliable).
- Cisco client command:
ntp server [IP]. Cisco server command:ntp master [stratum]. Know the difference —ntp mastermakes the device serve time to others from its own clock. ntp update-calendarsynchronises the hardware (battery-backed NVRAM) clock with the software clock — important for correct time on reload before NTP re-syncs.- The
preferkeyword onntp servermarks the preferred source when multiple servers are configured. The router still polls all servers but weights the preferred one higher. iburston client configuration sends a rapid burst of 8 packets on startup for fast initial synchronisation — reduces time to first sync from minutes to seconds.- NTP authentication uses MD5 shared keys:
ntp authenticate→ntp authentication-key [n] md5 [key]→ntp trusted-key [n]→ntp server [IP] key [n]. All four commands required. - In
show ntp associations: asterisk (*) = currently selected source; reach 377 = all recent polls successful; reach 0 = NTP server not reachable; stratum 16 = server is not synchronised. - In
show ntp status: "synchronised" = good; "unsynchronised" = no valid source; stratum 16 = same problem; offset should be small (milliseconds). - Disable broadcast mode (
no ntp broadcast) and restrict UDP/123 to trusted sources for NTP security. Enable MD5 authentication to prevent time spoofing. - NTP vs SNTP: NTP uses complex filtering and clock discipline algorithms for ±1ms accuracy; SNTP is simpler with ±100ms accuracy for IoT/embedded use. Both use UDP/123.
15. Summary Reference Table
| Topic | Key Detail |
|---|---|
| NTP transport | UDP port 123 |
| NTP accuracy | ±1ms over LAN; ±50ms over WAN |
| Stratum 0 | Physical reference (GPS, atomic) — not on network |
| Stratum 1 | Primary NTP server (directly connected to Stratum 0) |
| Stratum 16 | Unsynchronised — clock is unreliable |
| Cisco NTP client | ntp server [IP] [prefer] |
| Cisco NTP server | ntp master [stratum] |
| Sync hardware clock | ntp update-calendar |
| Fast initial sync | iburst option on ntp server line |
| NTP authentication | ntp authenticate + ntp authentication-key + ntp trusted-key + ntp server [IP] key [n] |
| Verify Cisco NTP | show ntp status + show ntp associations |
| Verify Linux NTP | chronyc tracking + chronyc sources -v |
| reach=377 | All 8 recent NTP polls successful — server reachable |
| Security: disable broadcast | no ntp broadcast |
NTP Quiz
Related Topics & Step-by-Step Tutorials
Continue your NTP studies:
- NTP – Network Time Protocol Overview — NTP fundamentals — stratum, polling, authentication
- NTP (Network Time Protocol) — NTP timestamp exchange and offset calculation
- Syslog – Logging Overview — accurate timestamps in syslog require NTP
- NTP Configuration (Step-by-Step)