SNTP - Simple Network Time Protocol
What is SNTP?
SNTP (Simple Network Time Protocol) is a protocol used to synchronize the clocks of computers and devices over a network. It is a simplified version of NTP (Network Time Protocol) that offers less precision, making it suitable for less demanding time synchronization needs.
Why is SNTP useful?
Provides a simple and lightweight way to synchronize system clocks.
Ensures consistent timekeeping across devices in a network.
More efficient and less complex than NTP, ideal for systems where high precision isn’t critical.
Widely supported by various devices and operating systems.
How it works?
A client sends a request to an SNTP server, typically over UDP.
The server responds with the current time.
The client adjusts its system clock based on the response.
The protocol does not perform complex time correction algorithms, making it less accurate than NTP, but sufficient for most applications.
Where is SNTP used?
SNTP is commonly used in environments where precise time synchronization is not a priority.
It is typically used in consumer devices, home routers, printers, and embedded systems.
Often found in systems with limited processing power or where NTP’s high precision isn’t necessary.
Which OSI layer does this protocol belong to?
SNTP operates at the Application Layer (Layer 7) of the OSI model.
It uses lower layers (Transport Layer and Network Layer) for communication, typically relying on UDP at the Transport Layer.
Is SNTP Windows specific?
No, SNTP is not Windows-specific.
It is supported by a wide range of operating systems including Linux, macOS, and many embedded devices.
Is SNTP Linux specific?
No, SNTP is not Linux-specific.
It is supported by various operating systems and is commonly used in a wide range of devices across different platforms.
Which Transport Protocol is used by SNTP?
SNTP typically uses UDP (User Datagram Protocol) at the Transport Layer.
UDP is used because it provides low-latency communication, which is suitable for time synchronization.
Which Port is used by SNTP?
SNTP operates on UDP port 123.
This is the same port used by NTP, as SNTP is essentially a simplified version of it.
Is SNTP using Client-server model?
Yes, SNTP follows the client-server model.
The client sends a request to the SNTP server, and the server responds with the current time.
Topics in this section,
In this section, you are going to learn
Terminology
Version Info
SNTP Version |
SNTP Number |
Year |
Core Idea / Contribution |
---|---|---|---|
SNTP v1 |
RFC 1361 |
1992 |
First formal definition of SNTP; introduced a simplified version of NTP for systems not requiring full NTP complexity. |
SNTP v2 |
RFC 1769 |
1995 |
Updated SNTP to align with NTPv3; clarified usage in simple devices and embedded systems. |
SNTP v3 |
RFC 2030 |
1996 |
Extended SNTP for IPv4 and introduced compatibility with NTPv3; emphasized simplicity and ease of implementation. |
SNTP v4 |
RFC 4330 |
2006 |
Added support for IPv6 and OSI protocols; aligned with NTPv4 while maintaining simplicity; obsoleted RFC 2030 and RFC 1769. |
SNTP C Code (Client-Server Model over UDP)
- This C program demonstrates how to build a simple SNTP (Simple Network Time Protocol) server and client using UDP sockets.
The SNTP server (mode 4) listens on a UDP port and responds with a basic NTP packet containing the transmit timestamp.
The SNTP client (mode 3) sends a request to the server and reads the transmit timestamp to print the server time.
This setup is useful for testing SNTP communication, simulating time servers, or learning basic NTP packet structure.
Replace the server IP address (127.0.0.1) in the client code with your actual SNTP server address before running.
Step-1: Download C source code for SNTP server and client.
Step-2: Convert C code to executable files.
test:~$gcc sntp_server.c -o sntp_server test:~$gcc sntp_client.c -o sntp_client
Step-3: Run SNTP server and client.
# Start SNTP server (may require sudo if using port 123) test:~$sudo ./sntp_server SNTP server listening on port 123... # Run SNTP client test:~$ ./sntp_client Server time: Wed Jul 31 13:44:28 2025
Step-4: Wireshark Capture
SNTP Client Code with Error Handling (Invalid Server IP Demonstration)
- This C program demonstrates how an SNTP client handles network errors when provided with an invalid or unreachable NTP server IP address.
The client constructs a basic NTP request packet (mode 3), sends it to the specified IP, and waits for a response.
If the IP address is invalid, or no response is received within 3 seconds, the program prints a relevant error message.
This is useful for testing SNTP client robustness, network failure scenarios, or for educational purposes.
Step-1: Download C source code for SNTP invalid server IP test.
Step-2: Convert C code to executable file.
test:~$ gcc sntp_invalid_ip_client.c -o sntp_invalid_ip_client
Step-3: Run SNTP client with an invalid or unreachable IP.
test:~$ ./sntp_invalid_ip_client 192.0.2.1 Packet sent to 192.0.2.1. Waiting for response... Receive failed: Resource temporarily unavailable
Note
192.0.2.1 is a reserved non-routable IP (TEST-NET-1) and is commonly used for documentation.
The client sets a 3-second receive timeout to avoid indefinite blocking.
Step-4: Wireshark Capture
SNTP Wrong Mode Packet Injection (Mode 7 - Reserved/Private Use)
- This C program demonstrates how to manually construct and send an SNTP/NTP packet with an invalid mode field:
Mode 7 (Reserved / Private) is not used in standard client-server communication and is typically rejected or ignored by NTP servers.
The client sets LI = 0, VN = 4, Mode = 7 and sends it to a specified NTP server over UDP.
- This test is useful for:
Evaluating how NTP servers handle non-standard or malformed mode values.
Auditing firewalls and NTP-aware intrusion detection systems.
Learning how NTP mode bits work at the packet level.
Step-1: Download the C source code for wrong mode packet generation.
Step-2: Convert the C code to an executable file.
test:~$ gcc sntp_wrong_mode.c -o sntp_wrong_mode
Step-3: Run the wrong-mode SNTP client with the target NTP server IP.
test:~$ ./sntp_wrong_mode 216.239.35.0 Wrong-mode NTP packet (mode 7) sent to 216.239.35.0
Note
Replace 216.239.35.0 with your actual test NTP server IP.
Most compliant servers will ignore or drop mode 7 packets without replying.
Step-4: Wireshark Capture
SNTP Delayed Response Simulation (Send and Receive Timestamped NTP Packets)
- This C program demonstrates how to send a fully formed SNTP (Simple Network Time Protocol) request to a server and then receive and interpret the response, including transmit timestamps.
The client sends a well-formed NTPv4 packet using Mode 3 (Client) and a valid transmit timestamp.
The program sets a 2-second socket timeout to simulate how SNTP clients handle slow or unresponsive servers.
The received NTP packet is decoded and the transmit timestamp is converted to a human-readable date/time.
- This is useful for:
Understanding client-side time parsing in SNTP.
Testing server responsiveness and round-trip behavior.
Simulating timeout or delay handling in a lightweight SNTP implementation.
Step-1: Download the C source code for SNTP delayed response client.
Step-2: Compile the C code into an executable.
test:~$ gcc sntp_delayed_response.c -o sntp_delayed_response
Step-3: Run the SNTP client and observe server response or timeout.
test:~$ ./sntp_delayed_response 129.6.15.28 NTP request sent to 129.6.15.28. Waiting for response... Response received in 365.73 ms Server time: 2025-07-31 12:34:46
Note
Replace 129.6.15.28 with the IP of a valid public or local NTP server.
If no response is received within 2 seconds, a timeout error will be shown.
Step-4: Wireshark Capture
SNTP C Client Querying Multiple NTP Servers
This C program implements a basic SNTP client that sends an NTP request (Mode 3) to a given NTP server.
It constructs a 48-byte SNTP packet, sends it via UDP, waits for the response, extracts the transmit timestamp, and converts it to human-readable local time.
This can be used to verify synchronization accuracy across multiple public NTP servers.
Step-1: Download C source code for SNTP client.
Step-2: Compile the source code into an executable.
test:~$ gcc sntp_client_1.c -o sntp_client_1
Step-3: Run the SNTP client with different public NTP server IPs.
test:~$ ./sntp_client_1 129.6.15.28 #time.google.com Server Time: Thu Jul 31 12:45:28 2025 test:~$ ./sntp_client_1 216.239.35.12 #pool.ntp.org Server Time: Thu Jul 31 12:45:30 2025 test:~$ ./sntp_client_1 40.119.6.228 #time.windows.com Server Time: Thu Jul 31 12:45:32 2025
Step-4: Analyze server time differences or round-trip delays using Wireshark.
SNTP Version Mismatch Test (Version 1 Packet to NTPv4 Server)
This C program sends an SNTP packet using NTP Version 1, which is outdated and not typically supported by modern NTP servers (which use v3 or v4).
It is useful for testing how NTP servers handle requests with unsupported or mismatched protocol versions.
This helps in evaluating server behavior and backward compatibility with legacy clients.
Step-1: Download C source code for SNTP version mismatch test.
Step-2: Compile the source code into an executable.
test:~$ gcc sntp_version_mismatch.c -o sntp_version_mismatch
Step-3: Send version 1 SNTP request to an NTPv4 server.
test:~$ ./sntp_version_mismatch 216.239.35.0 NTP packet with version 1 sent to 216.239.35.0
Step-4: Observe behavior:
No response or timeout indicates the server rejects outdated versions.
Use Wireshark or tcpdump to analyze network-level handling.
Step-5: Capture the packet exchange using Wireshark.
SNTP Malformed Packet Test
This C program sends a malformed NTP packet (only 20 bytes, whereas a valid NTP/SNTP packet must be 48 bytes) to an NTP server.
The purpose of this test is to observe how the NTP server handles improperly sized or corrupted packets.
This can be used for robustness testing, fuzzing, or input validation verification.
Step-1: Download the C source code for malformed packet generation.
Step-2: Compile the source code.
test:~$ gcc sntp_malformed.c -o sntp_malformed
Step-3: Run the executable against an NTP server.
test:~$ ./sntp_malformed 216.239.35.0 Malformed packet (20 bytes) sent to 216.239.35.0
Step-4: Observe behavior:
The server may silently drop the packet.
Use Wireshark or tcpdump to confirm packet dispatch and any server response.
Step-5: Capture and analyze using Wireshark.
SNTP Rapid-Fire Request Test
This C program sends 10 consecutive SNTP requests in rapid succession (100ms apart) to a specified NTP server.
- It is used to simulate a burst of time requests to observe:
Server rate-limiting behavior.
Whether the server drops packets under load.
How responses are handled when queried at high frequency.
This is helpful for testing firewall rules, DoS handling, or client behavior in time-critical environments.
Step-1: Download the C source code for rapid-fire SNTP requests.
Step-2: Compile the source code.
test:~$ gcc sntp_rapid_fire.c -o sntp_rapid_fire
Step-3: Run the test against a reachable NTP server.
test:~$ ./sntp_rapid_fire 216.239.35.0 Request 1 sent Request 2 sent Request 3 sent Request 4 sent Request 5 sent Request 6 sent Request 7 sent Request 8 sent Request 9 sent Request 10 sent
Step-4: Observe server behavior:
Use Wireshark or tcpdump to verify if all packets were sent and whether responses were returned.
Useful for assessing tolerance to polling frequency.
Step-5: Capture the test using Wireshark.
One-time Sync with ntpdate (SNTP Server Response Verification)
To ensure that the SNTP server responds correctly to time synchronization requests from an NTP client, and client can successfully update its system time using the received data.
Step-1: Install and Configure NTP Server (on Machine A).
test1:~$ sudo apt update test1:~$ sudo apt install ntp # Edit the NTP configuration test1:~$ sudo nano /etc/ntp.conf # Add the following lines or update accordingly restrict 192.168.56.0 mask 255.255.255.0 nomodify notrap server 127.127.1.0 fudge 127.127.1.0 stratum 10 broadcast 192.168.56.255 # Comment out online pool servers if offline # pool 0.ubuntu.pool.ntp.org iburst # pool 1.ubuntu.pool.ntp.org iburst # Restart the NTP service test1:~$ sudo systemctl restart ntp test1:~$ sudo systemctl status ntp
Step-2: Verify NTP Listening on Port 123 (UDP)
test1:~$ ss -ulpn | grep :123
Step-3: Allow NTP Traffic via UFW (if enabled)
test1:~$ sudo ufw status test1:~$ sudo ufw allow 123/udp
Step-4: Install Client Tools on Machine B
test2:~$ sudo apt update test2:~$ sudo apt install ntpdate sntp
Step-5: One-Time Time Sync Using ntpdate
test2:~$ sudo ntpdate -q 192.168.56.10 # Example Output: # server 192.168.56.10, stratum 10, offset -0.000123, delay 0.02567
Expected Result:
The client should receive a valid time response from the server.
Output should indicate stratum and offset.
No errors like “no server suitable for synchronization found” should occur.
Step-6: Wireshark Capture
One-time Sync with sntp (SNTP Server Response Verification)
To verify that the NTP server (Machine A) responds correctly to SNTP (Simple NTP) queries and that a client (Machine B) can synchronize its time using the sntp utility.
Step-1: Ensure SNTP is Installed on the Client (Machine B)
test2:~$ sudo apt update test2:~$ sudo apt install sntp
Step-2: Query the NTP Server Using SNTP
test2:~$ sntp 192.168.56.10 # Example Output: # 2025-08-04 13:15:07.123456 (+0000) +0.001234 +/- 0.005678 secs
Interpretation:
The client successfully queried the NTP server.
The output includes: - The current timestamp - Time offset (e.g., +0.001234) - Estimated error bounds (+/-)
Note: sntp by default does not set the system time; it only queries.
Step-4: Ensure Server is Listening (Run on Server - Machine A)
test1:~$ ss -ulpn | grep :123
Expected Result:
The SNTP client should successfully contact the server and display the timestamp, offset, and delay.
No error messages such as “no server suitable for synchronization found”.
Step-5: Wireshark Capture
Time Sync Validation via ntpdate
To verify the system time on the client machine before and after synchronization using ntpdate, and confirm time alignment with the NTP server.
Requirements:
Machine B (Client – test2) must have ntpdate installed.
Machine A (Server – test1) must be running and accessible on 192.168.56.10.
sudo privileges available on the client.
Step-1: Check Current Time on Client (Before Sync)
test2:~$ date # Example Output: # Mon Aug 4 13:24:10 UTC 2025
Note the time. You may observe it differs from the actual/current time if the system is out of sync.
Step-2: Synchronize Time with NTP Server
test2:~$ sudo ntpdate 192.168.56.10 # Example Output: # 4 Aug 13:25:10 ntpdate[1234]: adjust time server 192.168.56.10 offset -0.345678 sec
This indicates that the system clock was adjusted by the reported offset.
Step-3: Check Time Again on Client (After Sync)
test2:~$ date # Example Output: # Mon Aug 4 13:25:10 UTC 2025
Compare this with the time noted in Step 1. It should now reflect the correct time based on the server’s clock.
Step-4 (Optional): Check NTP Sync Status via timedatectl
test2:~$ timedatectl status
Example output might include:
NTP enabled: no (if only manual sync is used)
System clock synchronized: yes
Accurate Local time and Universal time
Step-5: Wireshark Capture
Time Sync with Deliberately Skewed System Clock
To verify that ntpdate can successfully correct the system clock on the client when the clock is significantly incorrect.
Requirements:
Machine B (Client – test2) must have ntpdate installed.
Machine A (Server – test1) must be running NTP and accessible at 192.168.56.10.
sudo access is required on the client machine.
Step-1: Manually Skew the System Clock on Client
test2:~$ sudo date -s "2020-01-01 12:00:00" test2:~$ date # Example Output: # Wed Jan 1 12:00:00 UTC 2020 * This sets the system clock far in the past.
Step-2: Synchronize Time with NTP Server
test2:~$ sudo ntpdate 192.168.56.10 # Example Output: # 4 Aug 13:32:15 ntpdate[5678]: adjust time server 192.168.56.10 offset +176490745.123456 sec
A large offset indicates a significant correction has been made.
Step-3: Confirm System Time is Corrected
test2:~$ date # Example Output: # Mon Aug 4 13:32:16 UTC 2025
The time should now match the correct date/time from the NTP server.
Expected Result:
The system clock is reset from the incorrect manual value to the correct time.
No synchronization errors should appear in the output.
Step-4: Wireshark Capture
Verbose SNTP Query for Debugging
To view detailed NTP response fields using sntp in debug mode. This is useful for troubleshooting and analyzing time synchronization behavior at the protocol level.
Requirements:
Machine B (Client – test2) must have sntp installed.
Machine A (Server – test1) must be running and accessible at 192.168.56.10.
Step-1: Run SNTP in Debug Mode from Client
test2:~$ sntp -d 192.168.56.10 # Example Output: # sntp 4.2.8p15@1.3728-o (1) # 2025-08-04 13:40:00.123456 (+0000) +0.000123 +/- 0.001234 secs # server 192.168.56.10, port 123 # stratum 10, precision -23, leap 00, trust 000 # refid [127.127.1.0], delay 0.02567, dispersion 0.00345 # transmitted 2025-08-04 13:40:00.123456 # received 2025-08-04 13:40:00.125678
Expected Output Details:
Server IP and port used
Stratum level of the server
Offset and estimated delay
Leap indicator
Reference ID
Dispersion and precision
Timestamps for transmit/receive events
This mode is especially useful for debugging synchronization issues, analyzing NTP behavior, or validating server response fields manually.
Step-2: Wireshark Capture
DNS Resolution Failure Handling
To verify how sntp behaves when provided with an invalid or non-existent hostname, and confirm that proper DNS resolution errors are shown.
Requirements:
Machine B (Client – test2) must have sntp installed.
No specific NTP server is required, since the test targets DNS failure handling.
Step-1: Attempt to Query an Invalid Hostname
test2:~$ sntp thisdoesnotexist.local # Expected Output: # sntp: Name or service not known
Expected Result:
The command should fail with a clear DNS resolution error.
No query attempt is made to any server.
Helpful for testing fallback or error handling mechanisms in time sync scripts.
This test confirms graceful failure and diagnostic output in cases of unreachable or misconfigured DNS names.
Step-2: Wireshark Capture (Optional — likely empty of NTP packets)
Sync with Multiple NTP Servers (Fallback Behavior)
To verify that sntp correctly handles multiple server inputs by skipping unreachable ones and falling back to the next available server.
Requirements:
Machine B (Client – test2) must have sntp installed.
Machine A (Server – test1) must be running NTP at 192.168.56.10.
At least one unreachable IP (e.g., 192.168.99.99) is included in the test.
Step-1: Run SNTP with Multiple Servers (First Invalid, Second Valid)
test2:~$ sudo sntp -s 192.168.99.99 192.168.56.10 # Example Output: # sntp: no response received from 192.168.99.99 # (then silently succeeds using 192.168.56.10)
Step-2: Check Time After Sync
test2:~$ date # Output should show correct current time synced from the valid server.
Expected Result:
sntp should attempt to contact 192.168.99.99 first.
Upon failure, it should continue to 192.168.56.10 and perform time sync.
No critical failure occurs; only a warning for the first server.
This test validates fallback behavior and fault tolerance when using multiple servers in SNTP.
Step-3: Wireshark Capture
Setup
Symmetric Active Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
1 |
Symmetric Active |
A peer initiates the connection and sends requests. |
48 |
LI (Leap Indicator) |
Warns of an impending leap second. |
2(bits) |
|
VN (Version Number) |
NTP version (e.g., 4 for NTPv4). |
3(bits) |
|
Mode |
Set to 1 for symmetric active. |
3(bits) |
|
Stratum |
Indicates the distance from the reference clock. |
1 |
|
Poll |
Maximum interval between messages (in log2 seconds). |
1 |
|
Precision |
Precision of the system clock (in log2 seconds). |
1 |
|
Root Delay |
Total round-trip delay to the reference clock. |
4 |
|
Root Dispersion |
Maximum error relative to the reference clock. |
4 |
|
Reference ID |
Identifier of the reference clock. |
4 |
|
Reference Timestamp |
Time when the system clock was last set or corrected. |
8 |
|
Originate Timestamp |
Time at which the request departed the client. |
8 |
|
Receive Timestamp |
Time at which the request arrived at the server. |
8 |
|
Transmit Timestamp |
Time at which the reply left the server. |
8 |
Symmetric Passive Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
2 |
Symmetric Passive |
A peer listens and responds to symmetric active requests. |
48 |
LI (Leap Indicator) |
Indicates if a leap second is to be inserted or deleted. |
2(bits) |
|
VN (Version Number) |
NTP version number (e.g., 4 for NTPv4). |
3(bits) |
|
Mode |
Set to 2 for symmetric passive. |
3(bits) |
|
Stratum |
Indicates the distance from the reference clock. |
1 |
|
Poll |
Maximum interval between messages (log2 seconds). |
1 |
|
Precision |
Precision of the system clock (log2 seconds). |
1 |
|
Root Delay |
Total round-trip delay to the reference clock. |
4 |
|
Root Dispersion |
Maximum error relative to the reference clock. |
4 |
|
Reference ID |
Identifier of the reference clock. |
4 |
|
Reference Timestamp |
Time when the system clock was last set or corrected. |
8 |
|
Originate Timestamp |
Time at which the request left the client (copied from the request). |
8 |
|
Receive Timestamp |
Time at which the request was received by the server. |
8 |
|
Transmit Timestamp |
Time at which the reply left the server. |
8 |
Client Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
3 |
Client |
used when a device (the client) sends a request to a time server to synchronize its clock. |
48 |
LI (Leap Indicator) |
Warns of an upcoming leap second. Usually set to 0 by the client. |
2(bits) |
|
VN (Version Number) |
NTP version number (e.g., 4 for NTPv4). |
3(bits) |
|
Mode |
Set to 3 for client mode. |
3(bits) |
|
Stratum |
Set to 0 by the client (server fills this in the response). |
1 |
|
Poll |
Maximum interval between messages (log2 seconds). |
1 |
|
Precision |
Precision of the client clock (log2 seconds). |
1 |
|
Root Delay |
Set to 0 by the client (server fills this in the response). |
4 |
|
Root Dispersion |
Set to 0 by the client (server fills this in the response). |
4 |
|
Reference ID |
Set to 0 by the client (server fills this in the response). |
4 |
|
Reference Timestamp |
Set to 0 by the client (server fills this in the response). |
8 |
|
Originate Timestamp |
Time when the client sent the request. |
8 |
|
Receive Timestamp |
Set to 0 by the client (server fills this in the response). |
8 |
|
Transmit Timestamp |
Time when the client sends the request . |
8 |
Server Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
4 |
Server |
used when a time server responds to a client’s request. |
48 |
LI (Leap Indicator) |
Indicates if a leap second is to be added or subtracted. |
2(bits) |
|
VN (Version Number) |
NTP version number (e.g., 4 for NTPv4). |
3(bits) |
|
Mode |
Set to 4 for server mode. |
3(bits) |
|
Stratum |
Indicates the server’s distance from the reference clock (1 = primary server). |
1 |
|
Poll |
Maximum interval between successive messages (log2 seconds). |
1 |
|
Precision |
Precision of the server clock (log2 seconds). |
1 |
|
Root Delay |
Total round-trip delay to the reference clock. |
4 |
|
Root Dispersion |
Maximum error relative to the reference clock. |
4 |
|
Reference ID |
Identifier of the reference clock (e.g., IP address or ASCII code). |
4 |
|
Reference Timestamp |
Time when the server clock was last set or corrected. |
8 |
|
Originate Timestamp |
Copied from the client’s transmit timestamp (when the request was sent). |
8 |
|
Receive Timestamp |
Time when the server received the client’s request. |
8 |
|
Transmit Timestamp |
Time when the server sent the response back to the client. |
8 |
Broadcast Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
5 |
Broadcast |
The server sends time updates to a broadcast address. |
48 |
LI (Leap Indicator) |
Indicates if a leap second is to be inserted or deleted. |
2(bits) |
|
VN (Version Number) |
NTP version number (e.g., 4 for NTPv4). |
3(bits) |
|
Mode |
Set to 5 for broadcast mode. |
3(bits) |
|
Stratum |
Indicates the servers distance from the reference clock. |
1 |
|
Poll |
Maximum interval between messages (log2 seconds). |
1 |
|
Precision |
Precision of the server clock (log2 seconds). |
1 |
|
Root Delay |
Total round-trip delay to the reference clock. |
4 |
|
Root Dispersion |
Maximum error relative to the reference clock. |
4 |
|
Reference ID |
Identifier of the reference clock. |
4 |
|
Reference Timestamp |
Time when the server clock was last set or corrected. |
8 |
|
Originate Timestamp |
Set to 0 in broadcast mode (no client request). |
8 |
|
Receive Timestamp |
Set to 0 in broadcast mode (no client request). |
8 |
|
Transmit Timestamp |
Time when the server sends the broadcast packet. |
8 |
SNTP Control Message Packet
# |
Protocol Packets |
Description |
Size(bytes) |
---|---|---|---|
6 |
NTP Control Message |
used for monitoring, configuration, and control of NTP servers and peers |
~24 |
LI (Leap Indicator) |
Same as in standard NTP packets. |
2(bits) |
|
VN (Version Number) |
NTP version number. |
3(bits) |
|
Mode |
Set to 6 for control messages. |
3(bits) |
|
Response Bit (R) |
Set to 1 if the message is a response. |
1(bit) |
|
Error Bit (E) |
Set to 1 if an error occurred. |
1(bit) |
|
More Bit (M) |
Set to 1 if more data follows in additional packets. |
1(bit) Remaining 5 bits are reserved |
|
Operation Code (OpCode) |
Specifies the type of control operation (e.g., read status, write variables). |
1 |
|
Sequence Number |
Used to match requests and responses. |
2 |
|
Status |
Server status word (e.g., stratum, leap indicator, etc.). |
2 |
|
Association ID |
Identifies the peer association (0 for system variables). |
2 |
|
Offset |
Offset into the data field (for fragmented messages). |
2 |
|
count |
Number of octets in the data field. |
2 |
S.no |
Use Case |
Description |
---|---|---|
1 |
IoT Devices |
SNTP is ideal for Internet of Things (IoT) devices like smart thermostats, sensors, and home automation systems that need basic time synchronization without the overhead of full NTP. |
2 |
Consumer Electronics |
Devices such as smart TVs, DVRs, and gaming consoles use SNTP to maintain accurate time for logs, updates, and scheduled recordings. |
3 |
Embedded Systems |
Microcontrollers and embedded systems with limited resources use SNTP for lightweight time synchronization. |
4 |
Small Office Networks |
In small networks without a dedicated time server, SNTP provides sufficient accuracy for basic coordination and logging. |
5 |
Routers and Network Devices |
Many routers and switches use SNTP to timestamp logs and events, aiding in diagnostics and monitoring. |
6 |
Digital Signage Systems |
SNTP ensures that digital displays show accurate time and synchronize scheduled content playback. |
7 |
Point of Sale (POS) Systems |
Retail systems use SNTP to timestamp transactions accurately, which is crucial for auditing and reporting. |
8 |
Industrial Automation |
SNTP is used in factory equipment and control systems where approximate time accuracy is sufficient for operations. |
S.no |
Feature |
Description |
---|---|---|
1 |
Simplicity |
SNTP is a lightweight protocol with minimal configuration, making it easy to implement in devices with limited resources. |
2 |
Time Synchronization |
Provides basic synchronization of system clocks with a reference time source, ensuring devices maintain reasonably accurate time. |
3 |
UDP-Based Communication |
Uses UDP (port 123) for communication, which is faster and requires fewer resources than TCP. |
4 |
Low Overhead |
Designed for environments where full NTP functionality is unnecessary, reducing processing and memory requirements. |
5 |
Compatibility with NTP Servers |
SNTP clients can communicate with standard NTP servers, allowing integration into existing time synchronization infrastructures. |
6 |
Support for IPv4 and IPv6 |
Modern SNTP versions support both IPv4 and IPv6, ensuring compatibility with current network standards. |
7 |
One-Way Communication |
Typically uses a simple request-response model without complex clock discipline algorithms. |
8 |
Periodic Updates |
Devices can periodically query SNTP servers to maintain time accuracy over long periods. |
Simplicity - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Start SNTP client with default config |
Minimal setup |
Time synchronized |
2 |
Start SNTP client with IP address |
Direct server IP |
Time synchronized |
3 |
Start SNTP client with hostname |
DNS resolution |
Time synchronized |
4 |
Use SNTP on embedded device |
Limited resources |
Time synchronized |
5 |
Use SNTP on microcontroller |
No OS |
Time synchronized |
6 |
Use SNTP on IoT sensor |
Low-power device |
Time synchronized |
7 |
Use SNTP on smart plug |
Minimal firmware |
Time synchronized |
8 |
Use SNTP on smart light |
Lightweight stack |
Time synchronized |
9 |
Use SNTP on Raspberry Pi |
Simple Linux setup |
Time synchronized |
10 |
Use SNTP on Arduino with Ethernet |
Basic connectivity |
Time synchronized |
11 |
Use SNTP on ESP32 |
Wi-Fi microcontroller |
Time synchronized |
12 |
Use SNTP with no authentication |
Basic SNTP |
Time synchronized |
13 |
Use SNTP with no encryption |
Lightweight protocol |
Time synchronized |
14 |
Use SNTP with UDP |
Default transport |
Time synchronized |
15 |
Use SNTP with IPv4 |
Standard IP |
Time synchronized |
16 |
Use SNTP with IPv6 |
Modern IP |
Time synchronized |
17 |
Use SNTP with single server |
One source |
Time synchronized |
18 |
Use SNTP with fallback server |
Primary fails |
Secondary used |
19 |
Use SNTP with DHCP option 42 |
Auto server config |
Time synchronized |
20 |
Use SNTP with static IP config |
Manual setup |
Time synchronized |
21 |
Use SNTP with minimal memory |
Low RAM usage |
Time synchronized |
22 |
Use SNTP with minimal CPU |
Low processing power |
Time synchronized |
23 |
Use SNTP with no logging |
Silent operation |
Time synchronized |
24 |
Use SNTP with basic logging |
Simple output |
Time synchronized |
25 |
Use SNTP with no GUI |
CLI or headless |
Time synchronized |
26 |
Use SNTP with no config file |
Hardcoded server |
Time synchronized |
27 |
Use SNTP with config file |
Simple format |
Time synchronized |
28 |
Use SNTP with retry logic |
Server unreachable |
Retry succeeds |
29 |
Use SNTP with timeout |
No response |
Retry or fail |
30 |
Use SNTP with low bandwidth |
Constrained network |
Time synchronized |
31 |
Use SNTP with high latency |
Satellite link |
Time synchronized |
32 |
Use SNTP with packet loss |
Unreliable network |
Retry succeeds |
33 |
Use SNTP with firewall open |
Port 123 open |
Time synchronized |
34 |
Use SNTP with firewall blocked |
Port 123 closed |
Sync fails |
35 |
Use SNTP with SNTP server simulator |
Test environment |
Time synchronized |
36 |
Use SNTP with public NTP server |
e.g., pool.ntp.org |
Time synchronized |
37 |
Use SNTP with local NTP server |
LAN sync |
Time synchronized |
38 |
Use SNTP with no DNS |
IP-only config |
Time synchronized |
39 |
Use SNTP with DNS |
Hostname resolution |
Time synchronized |
40 |
Use SNTP with system clock drift |
Inaccurate clock |
Time corrected |
41 |
Use SNTP after reboot |
Cold start |
Time synchronized |
42 |
Use SNTP after network reconnect |
Interface up |
Time synchronized |
43 |
Use SNTP with scheduled sync |
Periodic update |
Time synchronized |
44 |
Use SNTP with manual trigger |
On-demand sync |
Time synchronized |
45 |
Use SNTP with logging to serial |
Microcontroller debug |
Time output logged |
46 |
Use SNTP with minimal firmware |
Tiny footprint |
Time synchronized |
47 |
Use SNTP with real-time OS |
RTOS support |
Time synchronized |
48 |
Use SNTP with Linux busybox |
Lightweight distro |
Time synchronized |
49 |
Use SNTP with Windows IoT |
Embedded Windows |
Time synchronized |
50 |
Use SNTP with no user interaction |
Fully automated |
Time synchronized |
Time Synchronization - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Sync with public SNTP server |
Use pool.ntp.org |
Time synchronized |
2 |
Sync with local SNTP server |
LAN-based server |
Time synchronized |
3 |
Sync with stratum 1 server |
High-accuracy source |
Time synchronized |
4 |
Sync with stratum 2 server |
Intermediate source |
Time synchronized |
5 |
Sync with unreachable server |
Server offline |
Sync fails |
6 |
Sync with invalid server address |
Malformed hostname |
Sync fails |
7 |
Sync with fallback server |
Primary fails |
Secondary used |
8 |
Sync with GPS-based NTP server |
Hardware time source |
Time synchronized |
9 |
Sync with DHCP-provided server |
Option 42 |
Time synchronized |
10 |
Sync with static IP server |
Manual config |
Time synchronized |
11 |
Sync with IPv4 server |
Standard IP |
Time synchronized |
12 |
Sync with IPv6 server |
Modern IP |
Time synchronized |
13 |
Sync over Wi-Fi |
Wireless network |
Time synchronized |
14 |
Sync over Ethernet |
Wired network |
Time synchronized |
15 |
Sync over mobile network |
4G/5G |
Time synchronized |
16 |
Sync over satellite link |
High latency |
Time synchronized |
17 |
Sync with high latency |
Delayed response |
Time adjusted |
18 |
Sync with packet loss |
Unreliable network |
Retry succeeds |
19 |
Sync with firewall open |
Port 123 open |
Time synchronized |
20 |
Sync with firewall blocked |
Port 123 closed |
Sync fails |
21 |
Sync after reboot |
Cold start |
Time synchronized |
22 |
Sync after network reconnect |
Interface up |
Time synchronized |
23 |
Sync after long offline period |
Clock drifted |
Time corrected |
24 |
Sync with system clock drift |
Hardware inaccuracy |
Time corrected |
25 |
Sync with scheduled interval |
Periodic update |
Time synchronized |
26 |
Sync with manual trigger |
On-demand sync |
Time synchronized |
27 |
Sync with SNTP client on Linux |
Lightweight daemon |
Time synchronized |
28 |
Sync with SNTP client on Windows |
Built-in or third-party |
Time synchronized |
29 |
Sync with SNTP client on macOS |
System time service |
Time synchronized |
30 |
Sync with SNTP client on IoT device |
Embedded system |
Time synchronized |
31 |
Sync with SNTP client on microcontroller |
Minimal firmware |
Time synchronized |
32 |
Sync with SNTP client on VM |
Virtualized environment |
Time synchronized |
33 |
Sync with SNTP client on container |
Docker/LXC |
Time synchronized |
34 |
Sync with SNTP client on mobile device |
Smartphone |
Time synchronized |
35 |
Sync with SNTP client on smart TV |
Consumer device |
Time synchronized |
36 |
Sync with SNTP client on smart meter |
Utility device |
Time synchronized |
37 |
Sync with SNTP client on smart camera |
Surveillance device |
Time synchronized |
38 |
Sync with SNTP client on POS terminal |
Retail system |
Time synchronized |
39 |
Sync with SNTP client on ATM |
Banking system |
Time synchronized |
40 |
Sync with SNTP client on SCADA system |
Industrial control |
Time synchronized |
41 |
Sync with SNTP client on wearable |
Smartwatch |
Time synchronized |
42 |
Sync with SNTP client on e-reader |
Kindle or similar |
Time synchronized |
43 |
Sync with SNTP client on smart display |
Google Nest, Echo Show |
Time synchronized |
44 |
Sync with SNTP client on firewall appliance |
Security device |
Time synchronized |
45 |
Sync with SNTP client on load balancer |
Network appliance |
Time synchronized |
46 |
Sync with SNTP client on NAS |
Storage device |
Time synchronized |
47 |
Sync with SNTP client on printer |
Network printer |
Time synchronized |
48 |
Sync with SNTP client on router |
Network device |
Time synchronized |
49 |
Sync with SNTP client on switch |
Layer 2 device |
Time synchronized |
50 |
Sync with SNTP client on server |
General-purpose system |
Time synchronized |
UDP-Based Communication - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Sync with public SNTP server |
Use pool.ntp.org |
Time synchronized |
2 |
Sync with local SNTP server |
LAN-based server |
Time synchronized |
3 |
Sync with stratum 1 server |
High-accuracy source |
Time synchronized |
4 |
Sync with stratum 2 server |
Intermediate source |
Time synchronized |
5 |
Sync with unreachable server |
Server offline |
Sync fails |
6 |
Sync with invalid server address |
Malformed hostname |
Sync fails |
7 |
Sync with fallback server |
Primary fails |
Secondary used |
8 |
Sync with GPS-based NTP server |
Hardware time source |
Time synchronized |
9 |
Sync with DHCP-provided server |
Option 42 |
Time synchronized |
10 |
Sync with static IP server |
Manual config |
Time synchronized |
11 |
Sync with IPv4 server |
Standard IP |
Time synchronized |
12 |
Sync with IPv6 server |
Modern IP |
Time synchronized |
13 |
Sync over Wi-Fi |
Wireless network |
Time synchronized |
14 |
Sync over Ethernet |
Wired network |
Time synchronized |
15 |
Sync over mobile network |
4G/5G |
Time synchronized |
16 |
Sync over satellite link |
High latency |
Time synchronized |
17 |
Sync with high latency |
Delayed response |
Time adjusted |
18 |
Sync with packet loss |
Unreliable network |
Retry succeeds |
19 |
Sync with firewall open |
Port 123 open |
Time synchronized |
20 |
Sync with firewall blocked |
Port 123 closed |
Sync fails |
21 |
Sync after reboot |
Cold start |
Time synchronized |
22 |
Sync after network reconnect |
Interface up |
Time synchronized |
23 |
Sync after long offline period |
Clock drifted |
Time corrected |
24 |
Sync with system clock drift |
Hardware inaccuracy |
Time corrected |
25 |
Sync with scheduled interval |
Periodic update |
Time synchronized |
26 |
Sync with manual trigger |
On-demand sync |
Time synchronized |
27 |
Sync with SNTP client on Linux |
Lightweight daemon |
Time synchronized |
28 |
Sync with SNTP client on Windows |
Built-in or third-party |
Time synchronized |
29 |
Sync with SNTP client on macOS |
System time service |
Time synchronized |
30 |
Sync with SNTP client on IoT device |
Embedded system |
Time synchronized |
31 |
Sync with SNTP client on microcontroller |
Minimal firmware |
Time synchronized |
32 |
Sync with SNTP client on VM |
Virtualized environment |
Time synchronized |
33 |
Sync with SNTP client on container |
Docker/LXC |
Time synchronized |
34 |
Sync with SNTP client on mobile device |
Smartphone |
Time synchronized |
35 |
Sync with SNTP client on smart TV |
Consumer device |
Time synchronized |
36 |
Sync with SNTP client on smart meter |
Utility device |
Time synchronized |
37 |
Sync with SNTP client on smart camera |
Surveillance device |
Time synchronized |
38 |
Sync with SNTP client on POS terminal |
Retail system |
Time synchronized |
39 |
Sync with SNTP client on ATM |
Banking system |
Time synchronized |
40 |
Sync with SNTP client on SCADA system |
Industrial control |
Time synchronized |
41 |
Sync with SNTP client on wearable |
Smartwatch |
Time synchronized |
42 |
Sync with SNTP client on e-reader |
Kindle or similar |
Time synchronized |
43 |
Sync with SNTP client on smart display |
Google Nest, Echo Show |
Time synchronized |
44 |
Sync with SNTP client on firewall appliance |
Security device |
Time synchronized |
45 |
Sync with SNTP client on load balancer |
Network appliance |
Time synchronized |
46 |
Sync with SNTP client on NAS |
Storage device |
Time synchronized |
47 |
Sync with SNTP client on printer |
Network printer |
Time synchronized |
48 |
Sync with SNTP client on router |
Network device |
Time synchronized |
49 |
Sync with SNTP client on switch |
Layer 2 device |
Time synchronized |
50 |
Sync with SNTP client on server |
General-purpose system |
Time synchronized |
Low Overhead - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Run SNTP on low-memory device |
256KB RAM microcontroller |
Time synchronized |
2 |
Run SNTP on embedded Linux |
BusyBox environment |
Time synchronized |
3 |
Run SNTP on battery-powered device |
Energy-efficient sync |
Time synchronized |
4 |
Run SNTP on real-time OS |
RTOS like FreeRTOS |
Time synchronized |
5 |
Run SNTP on headless device |
No GUI or shell |
Time synchronized |
6 |
Run SNTP on minimal firmware |
No OS, bare-metal |
Time synchronized |
7 |
Run SNTP on constrained IoT node |
Low CPU and RAM |
Time synchronized |
8 |
Run SNTP on sensor module |
Periodic sync |
Time synchronized |
9 |
Run SNTP on BLE device |
Bluetooth-only comms |
Time synchronized |
10 |
Run SNTP on Zigbee device |
Mesh network |
Time synchronized |
11 |
Run SNTP on LoRaWAN device |
Long-range, low-power |
Time synchronized |
12 |
Run SNTP on solar-powered device |
Limited energy budget |
Time synchronized |
13 |
Run SNTP on e-ink display |
Low refresh rate |
Time synchronized |
14 |
Run SNTP on wearable |
Smartwatch or band |
Time synchronized |
15 |
Run SNTP on smart tag |
Asset tracking |
Time synchronized |
16 |
Run SNTP on smart plug |
Home automation |
Time synchronized |
17 |
Run SNTP on smart bulb |
Minimal firmware |
Time synchronized |
18 |
Run SNTP on smart thermostat |
HVAC control |
Time synchronized |
19 |
Run SNTP on smart lock |
Secure sync |
Time synchronized |
20 |
Run SNTP on smart speaker |
Voice assistant |
Time synchronized |
21 |
Run SNTP on smart camera |
Motion detection |
Time synchronized |
22 |
Run SNTP on smart meter |
Utility monitoring |
Time synchronized |
23 |
Run SNTP on smart fridge |
Appliance sync |
Time synchronized |
24 |
Run SNTP on smart oven |
Cooking timer |
Time synchronized |
25 |
Run SNTP on smart irrigation system |
Scheduled watering |
Time synchronized |
26 |
Run SNTP on smart mirror |
Display time |
Time synchronized |
27 |
Run SNTP on smart scale |
Health tracking |
Time synchronized |
28 |
Run SNTP on smart toothbrush |
Usage logging |
Time synchronized |
29 |
Run SNTP on smart toy |
Interactive play |
Time synchronized |
30 |
Run SNTP on smart glasses |
AR overlay |
Time synchronized |
31 |
Run SNTP on smart pen |
Note timestamping |
Time synchronized |
32 |
Run SNTP on smart wallet |
Anti-theft sync |
Time synchronized |
33 |
Run SNTP on smart helmet |
Safety alerts |
Time synchronized |
34 |
Run SNTP on smart bike computer |
Ride tracking |
Time synchronized |
35 |
Run SNTP on smart doorbell |
Event logging |
Time synchronized |
36 |
Run SNTP on smart vacuum |
Cleaning schedule |
Time synchronized |
37 |
Run SNTP on smart projector |
Auto power-on |
Time synchronized |
38 |
Run SNTP on smart coffee machine |
Brew timer |
Time synchronized |
39 |
Run SNTP on smart fan |
Climate control |
Time synchronized |
40 |
Run SNTP on smart bed |
Sleep tracking |
Time synchronized |
41 |
Run SNTP on smart pet feeder |
Feeding schedule |
Time synchronized |
42 |
Run SNTP on smart aquarium |
Lighting/tank control |
Time synchronized |
43 |
Run SNTP on smart air purifier |
Filter cycle |
Time synchronized |
44 |
Run SNTP on smart curtain |
Light automation |
Time synchronized |
45 |
Run SNTP on smart switch |
Power control |
Time synchronized |
46 |
Run SNTP on smart router |
Network sync |
Time synchronized |
47 |
Run SNTP on smart TV |
Display clock |
Time synchronized |
48 |
Run SNTP on smart printer |
Job timestamping |
Time synchronized |
49 |
Run SNTP on smart NAS |
File sync |
Time synchronized |
50 |
Run SNTP on smart server |
Lightweight sync |
Time synchronized |
Compatibility with NTP servers - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Connect to NTPv3 server |
Legacy server compatibility |
Time synchronized |
2 |
Connect to NTPv4 server |
Modern server compatibility |
Time synchronized |
3 |
Connect to pool.ntp.org |
Public NTP pool |
Time synchronized |
4 |
Connect to time.google.com |
Google NTP server |
Time synchronized |
5 |
Connect to time.windows.com |
Microsoft NTP server |
Time synchronized |
6 |
Connect to time.apple.com |
Apple NTP server |
Time synchronized |
7 |
Connect to time.cloudflare.com |
Cloudflare NTP server |
Time synchronized |
8 |
Connect to stratum 1 NTP server |
High-precision source |
Time synchronized |
9 |
Connect to stratum 2 NTP server |
Intermediate source |
Time synchronized |
10 |
Connect to ISP-provided NTP server |
Local provider |
Time synchronized |
11 |
Connect to university NTP server |
Academic network |
Time synchronized |
12 |
Connect to government NTP server |
National time authority |
Time synchronized |
13 |
Connect to corporate NTP server |
Enterprise environment |
Time synchronized |
14 |
Connect to NTP server via IPv4 |
Standard IP |
Time synchronized |
15 |
Connect to NTP server via IPv6 |
Modern IP |
Time synchronized |
16 |
Connect to NTP server with DNS name |
Hostname resolution |
Time synchronized |
17 |
Connect to NTP server with static IP |
Direct IP access |
Time synchronized |
18 |
Connect to NTP server with authentication |
Secure mode |
Time synchronized |
19 |
Connect to NTP server without authentication |
Open mode |
Time synchronized |
20 |
Connect to NTP server with leap second support |
Time accuracy |
Time synchronized |
21 |
Connect to NTP server with jitter |
Network instability |
Time synchronized |
22 |
Connect to NTP server with delay |
Latency tolerance |
Time synchronized |
23 |
Connect to NTP server with offset |
Time correction |
Time synchronized |
24 |
Connect to NTP server with packet loss |
Retry mechanism |
Time synchronized |
25 |
Connect to NTP server with firewall open |
Port 123 open |
Time synchronized |
26 |
Connect to NTP server with firewall blocked |
Port 123 blocked |
Sync fails |
27 |
Connect to NTP server on LAN |
Local network |
Time synchronized |
28 |
Connect to NTP server on WAN |
Internet-based |
Time synchronized |
29 |
Connect to NTP server on VPN |
Encrypted tunnel |
Time synchronized |
30 |
Connect to NTP server on proxy |
Indirect routing |
Time synchronized |
31 |
Connect to NTP server on cloud |
AWS/GCP/Azure |
Time synchronized |
32 |
Connect to NTP server on hybrid cloud |
Mixed infra |
Time synchronized |
33 |
Connect to NTP server on edge device |
Edge computing |
Time synchronized |
34 |
Connect to NTP server on container |
Dockerized service |
Time synchronized |
35 |
Connect to NTP server on VM |
Virtual machine |
Time synchronized |
36 |
Connect to NTP server on physical server |
Bare-metal |
Time synchronized |
37 |
Connect to NTP server on mobile device |
Smartphone/tablet |
Time synchronized |
38 |
Connect to NTP server on IoT device |
Embedded system |
Time synchronized |
39 |
Connect to NTP server on Windows |
OS compatibility |
Time synchronized |
40 |
Connect to NTP server on Linux |
OS compatibility |
Time synchronized |
41 |
Connect to NTP server on macOS |
OS compatibility |
Time synchronized |
42 |
Connect to NTP server on BSD |
OS compatibility |
Time synchronized |
43 |
Connect to NTP server on router |
Network device |
Time synchronized |
44 |
Connect to NTP server on switch |
Layer 2 device |
Time synchronized |
45 |
Connect to NTP server on firewall |
Security appliance |
Time synchronized |
46 |
Connect to NTP server on NAS |
Storage device |
Time synchronized |
47 |
Connect to NTP server on printer |
Peripheral device |
Time synchronized |
48 |
Connect to NTP server on SCADA system |
Industrial control |
Time synchronized |
49 |
Connect to NTP server on ATM |
Banking system |
Time synchronized |
50 |
Connect to NTP server on POS terminal |
Retail system |
Time synchronized |
Support for IPv4 and IPv6 - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Sync using IPv4 address |
Direct IPv4 server |
Time synchronized |
2 |
Sync using IPv6 address |
Direct IPv6 server |
Time synchronized |
3 |
Sync using dual-stack server |
Supports both IP versions |
Time synchronized |
4 |
Sync using IPv4 DNS resolution |
Hostname resolves to IPv4 |
Time synchronized |
5 |
Sync using IPv6 DNS resolution |
Hostname resolves to IPv6 |
Time synchronized |
6 |
Sync using IPv4-only client |
No IPv6 stack |
Time synchronized |
7 |
Sync using IPv6-only client |
No IPv4 stack |
Time synchronized |
8 |
Sync using NAT IPv4 |
Behind NAT |
Time synchronized |
9 |
Sync using NAT64 IPv6 |
IPv6 to IPv4 translation |
Time synchronized |
10 |
Sync using IPv4 over VPN |
Encrypted IPv4 tunnel |
Time synchronized |
11 |
Sync using IPv6 over VPN |
Encrypted IPv6 tunnel |
Time synchronized |
12 |
Sync using IPv4 over proxy |
Indirect routing |
Time synchronized |
13 |
Sync using IPv6 over proxy |
Indirect routing |
Time synchronized |
14 |
Sync using IPv4 on LAN |
Local IPv4 network |
Time synchronized |
15 |
Sync using IPv6 on LAN |
Local IPv6 network |
Time synchronized |
16 |
Sync using IPv4 on WAN |
Internet IPv4 |
Time synchronized |
17 |
Sync using IPv6 on WAN |
Internet IPv6 |
Time synchronized |
18 |
Sync using IPv4 on mobile network |
4G IPv4 |
Time synchronized |
19 |
Sync using IPv6 on mobile network |
5G IPv6 |
Time synchronized |
20 |
Sync using IPv4 on satellite link |
High latency |
Time synchronized |
21 |
Sync using IPv6 on satellite link |
High latency |
Time synchronized |
22 |
Sync using IPv4 with packet loss |
Retry mechanism |
Time synchronized |
23 |
Sync using IPv6 with packet loss |
Retry mechanism |
Time synchronized |
24 |
Sync using IPv4 with firewall open |
Port 123 open |
Time synchronized |
25 |
Sync using IPv6 with firewall open |
Port 123 open |
Time synchronized |
26 |
Sync using IPv4 with firewall blocked |
Port 123 blocked |
Sync fails |
27 |
Sync using IPv6 with firewall blocked |
Port 123 blocked |
Sync fails |
28 |
Sync using IPv4 on Windows |
OS compatibility |
Time synchronized |
29 |
Sync using IPv6 on Windows |
OS compatibility |
Time synchronized |
30 |
Sync using IPv4 on Linux |
OS compatibility |
Time synchronized |
31 |
Sync using IPv6 on Linux |
OS compatibility |
Time synchronized |
32 |
Sync using IPv4 on macOS |
OS compatibility |
Time synchronized |
33 |
Sync using IPv6 on macOS |
OS compatibility |
Time synchronized |
34 |
Sync using IPv4 on IoT device |
Embedded IPv4 stack |
Time synchronized |
35 |
Sync using IPv6 on IoT device |
Embedded IPv6 stack |
Time synchronized |
36 |
Sync using IPv4 on VM |
Virtualized IPv4 |
Time synchronized |
37 |
Sync using IPv6 on VM |
Virtualized IPv6 |
Time synchronized |
38 |
Sync using IPv4 on container |
Docker IPv4 |
Time synchronized |
39 |
Sync using IPv6 on container |
Docker IPv6 |
Time synchronized |
40 |
Sync using IPv4 on router |
Network device |
Time synchronized |
41 |
Sync using IPv6 on router |
Network device |
Time synchronized |
42 |
Sync using IPv4 on NAS |
Storage device |
Time synchronized |
43 |
Sync using IPv6 on NAS |
Storage device |
Time synchronized |
44 |
Sync using IPv4 on smart TV |
Consumer device |
Time synchronized |
45 |
Sync using IPv6 on smart TV |
Consumer device |
Time synchronized |
46 |
Sync using IPv4 on printer |
Peripheral device |
Time synchronized |
47 |
Sync using IPv6 on printer |
Peripheral device |
Time synchronized |
48 |
Sync using IPv4 on firewall appliance |
Security device |
Time synchronized |
49 |
Sync using IPv6 on firewall appliance |
Security device |
Time synchronized |
50 |
Sync using IPv4 and IPv6 fallback |
One fails, other used |
Time synchronized |
One-Way Communication - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Send SNTP request to NTP server |
Basic one-way query |
Time received |
2 |
Receive SNTP response |
Server reply received |
Time updated |
3 |
No response from server |
Timeout scenario |
Sync fails |
4 |
Delayed response from server |
High latency |
Time adjusted |
5 |
Response with invalid timestamp |
Corrupted data |
Sync fails |
6 |
Response with future timestamp |
Time ahead |
Time adjusted |
7 |
Response with past timestamp |
Time behind |
Time adjusted |
8 |
Response with zero timestamp |
Invalid data |
Sync fails |
9 |
Response with leap second flag |
Special case |
Time synchronized |
10 |
Response with stratum 0 |
Invalid source |
Sync rejected |
11 |
Response with stratum 1 |
High-accuracy source |
Time synchronized |
12 |
Response with stratum 15 |
Low-accuracy source |
Time synchronized |
13 |
Response with mode 4 (server) |
Valid mode |
Time synchronized |
14 |
Response with mode 5 (broadcast) |
Ignored by client |
No sync |
15 |
Response with mode 3 (client) |
Invalid response |
Sync fails |
16 |
Response with root delay > threshold |
High delay |
Sync rejected |
17 |
Response with root dispersion > threshold |
Unstable source |
Sync rejected |
18 |
Response with valid originate timestamp |
Request matched |
Time synchronized |
19 |
Response with mismatched originate timestamp |
Spoofed response |
Sync rejected |
20 |
Response with correct version number |
SNTP v4 |
Time synchronized |
21 |
Response with unsupported version |
SNTP v1 |
Sync fails |
22 |
Response with correct transmit timestamp |
Valid time |
Time synchronized |
23 |
Response with missing transmit timestamp |
Incomplete packet |
Sync fails |
24 |
Response with correct reference ID |
Valid server |
Time synchronized |
25 |
Response with invalid reference ID |
Unknown source |
Sync rejected |
26 |
Response with symmetric mode |
Not expected |
Sync ignored |
27 |
Response with broadcast mode |
Not supported |
Sync ignored |
28 |
Response with kiss-o’-death code |
Rate limited |
Sync paused |
29 |
Response with authentication not required |
Open server |
Time synchronized |
30 |
Response with authentication required |
No key |
Sync fails |
31 |
Response with MAC mismatch |
Integrity check failed |
Sync rejected |
32 |
Response with valid MAC |
Integrity verified |
Time synchronized |
33 |
Response with spoofed IP |
Source mismatch |
Sync rejected |
34 |
Response with duplicate packet |
Retransmission |
Time synchronized |
35 |
Response with reordered packets |
Out-of-order |
Time synchronized |
36 |
Response with dropped packet |
No reply |
Retry triggered |
37 |
Response with malformed packet |
Parsing error |
Sync fails |
38 |
Response with correct UDP checksum |
Valid packet |
Time synchronized |
39 |
Response with incorrect UDP checksum |
Corrupted packet |
Sync rejected |
40 |
Response with correct port (123) |
Standard port |
Time synchronized |
41 |
Response from non-standard port |
Unexpected source |
Sync rejected |
42 |
Response with valid delay calculation |
Round-trip delay |
Time adjusted |
43 |
Response with invalid delay calculation |
Negative delay |
Sync rejected |
44 |
Response with valid offset calculation |
Clock offset |
Time adjusted |
45 |
Response with invalid offset calculation |
Out-of-range |
Sync rejected |
46 |
Response with server timestamp drift |
Minor drift |
Time adjusted |
47 |
Response with server timestamp jump |
Major drift |
Sync rejected |
48 |
Response with server reboot |
New reference ID |
Time synchronized |
49 |
Response with server under load |
Delayed response |
Time adjusted |
50 |
Response with server in maintenance |
No response |
Sync fails |
Periodic Updates - Testcases
# |
Test Case |
Description |
Expected Result |
---|---|---|---|
1 |
Periodic sync every 1 minute |
High-frequency updates |
Time synchronized |
2 |
Periodic sync every 5 minutes |
Frequent updates |
Time synchronized |
3 |
Periodic sync every 15 minutes |
Moderate frequency |
Time synchronized |
4 |
Periodic sync every 1 hour |
Standard interval |
Time synchronized |
5 |
Periodic sync every 6 hours |
Low frequency |
Time synchronized |
6 |
Periodic sync every 24 hours |
Daily update |
Time synchronized |
7 |
Periodic sync with random jitter |
Avoid sync storms |
Time synchronized |
8 |
Periodic sync with exponential backoff |
On failure |
Time synchronized |
9 |
Periodic sync with retry on failure |
Resilient sync |
Time synchronized |
10 |
Periodic sync with fallback server |
Primary fails |
Secondary used |
11 |
Periodic sync with time drift correction |
Gradual adjustment |
Time corrected |
12 |
Periodic sync with leap second handling |
Special case |
Time synchronized |
13 |
Periodic sync with daylight saving change |
Time zone shift |
Time adjusted |
14 |
Periodic sync with network loss |
Offline period |
Sync resumes |
15 |
Periodic sync after reboot |
Cold start |
Time synchronized |
16 |
Periodic sync after sleep mode |
Wake-up event |
Time synchronized |
17 |
Periodic sync after firmware update |
System restart |
Time synchronized |
18 |
Periodic sync with low battery |
Power-saving mode |
Time synchronized |
19 |
Periodic sync with high CPU load |
Background task |
Time synchronized |
20 |
Periodic sync with low memory |
Lightweight operation |
Time synchronized |
21 |
Periodic sync on mobile network |
4G/5G |
Time synchronized |
22 |
Periodic sync on Wi-Fi |
Wireless LAN |
Time synchronized |
23 |
Periodic sync on Ethernet |
Wired LAN |
Time synchronized |
24 |
Periodic sync on satellite link |
High latency |
Time synchronized |
25 |
Periodic sync on VPN |
Encrypted tunnel |
Time synchronized |
26 |
Periodic sync on proxy |
Indirect routing |
Time synchronized |
27 |
Periodic sync on IPv4 |
Standard IP |
Time synchronized |
28 |
Periodic sync on IPv6 |
Modern IP |
Time synchronized |
29 |
Periodic sync on dual-stack |
IPv4/IPv6 fallback |
Time synchronized |
30 |
Periodic sync on container |
Dockerized app |
Time synchronized |
31 |
Periodic sync on VM |
Virtual machine |
Time synchronized |
32 |
Periodic sync on IoT device |
Embedded system |
Time synchronized |
33 |
Periodic sync on mobile device |
Smartphone/tablet |
Time synchronized |
34 |
Periodic sync on smart TV |
Consumer device |
Time synchronized |
35 |
Periodic sync on smart meter |
Utility device |
Time synchronized |
36 |
Periodic sync on smart camera |
Surveillance device |
Time synchronized |
37 |
Periodic sync on POS terminal |
Retail system |
Time synchronized |
38 |
Periodic sync on ATM |
Banking system |
Time synchronized |
39 |
Periodic sync on SCADA system |
Industrial control |
Time synchronized |
40 |
Periodic sync on NAS |
Storage device |
Time synchronized |
41 |
Periodic sync on router |
Network device |
Time synchronized |
42 |
Periodic sync on firewall |
Security appliance |
Time synchronized |
43 |
Periodic sync on printer |
Peripheral device |
Time synchronized |
44 |
Periodic sync on wearable |
Smartwatch |
Time synchronized |
45 |
Periodic sync on e-reader |
Kindle or similar |
Time synchronized |
46 |
Periodic sync on smart display |
Google Nest, Echo Show |
Time synchronized |
47 |
Periodic sync on load balancer |
Network appliance |
Time synchronized |
48 |
Periodic sync on server |
General-purpose system |
Time synchronized |
49 |
Periodic sync with logging enabled |
Track sync events |
Logs updated |
50 |
Periodic sync with alert on failure |
Notification triggered |
Alert sent |
Reference links