Blogs

Introduction to Network Time Protocol (NTP)

2022.03.03

Network Time Protocol (NTP) is a protocol designed to enable synchronizing the clocks of computer systems and devices on a TCP/IP-based network to a shared time source. First developed by David L. Mills of the University of Delaware in the early 1980s, NTP is now on its fourth version (NTPv4).

NTP supports four modes of operation: Client/Server mode, Symmetric (Peer) mode, Multicast mode and Broadcast mode. This blog briefly introduces the Server/Client mode, which is supported by some of our devices.

In Client/Server mode, both the client and the server have a time axis that represents their respective clock times. The workflow of time synchronization between the client and the server is as follows:

  1. When the client wants to synchronize itself to the time of the server, the client will send an NTP request message to the NTP server. This message includes a record of the time when it leaves the client (t1);
  2. After receiving the message, the server will add a record to the message indicating the time the message reached the server (t2);
  3. After a period of processing, the message is returned to the client, and the time it leaves the server is recorded in the message (t3);
  4. The client receives the message and records the time it arrives at the client (t4). 

The round-trip delay of the NTP message can be calculated as (t4-t1) - (t3-t2), and the time difference between the client and the server is ((t2-t1) + (t3-t4)) / 2. The client can adjust its own time based on the above two parameters to synchronize itself with the server time.

NTP is typically applied in scenarios which require the clocks of all devices on the network to be consistent to efficiently achieve highly accurate time synchronization. For example, the clocks of all devices in a parking lot billing system are synchronized.

Magewell Ultra Encode devices and Pro Convert encoders can be configured to use public or private NTP servers as a reference time source. This allows multiple encoders to be synchronized, and allows multiple decoders receiving the streams to synchronize them for output based on timecode in the SEI information in the streams.