Kole's Networking Journey

Time Synchronization

In networking, there are two main protocols used for synchronizing time; Network Time Protocol and Precision Time Protocol. It is important that devices on a network use a consistent clock as certain protocols rely on time-based events. This can include different security features such as scheduled password or encryption changes or thorough trouble shooting. Keeping track of time can help pinpoint when different changes occurred and help make it easier to find where issues on the network began when they arise.

NETWORK TIME PROTOCOL

Network Time Protocol (NTP) is a protocol used to synchronize clocks on network devices. NTP is a UDP-based protocol that works on a client/server architecture. One device is chosen as the NTP Server which is responsible for setting and managing the time system on the network. Other devices can then connect to the NTP server and synchronize their time with the serve, then operating as an NTP Client.

NTP Stratums - NTP clients can be several hops away from the main NTP Server. Each hop distance is referred to as a stratum and signifies the distance and accuracy of the time kept on that device. The higher the stratum number, the further away it is from the source, and the less accurate it is likely to be.

PRECISION TIME PROTOCOL

Precision Time Protocol (PTP) is another time synchronization protocol that is used for higher precision and accuracy, with time differences within nanoseconds. PTP is typically used in networks that require a higher degree of timing precision. Some examples are financial trading, video broadcasting and industrial automation.

PTP works by dynamically synching network devices with a Grandmaster Clock (GMC), which is the primary time source in a PTP domain. The grandmaster clock will set out synch messages to other devices in their domain, called Ordinary Clocks (OC), and will exchange timing information. The receiving devices will then calculate the offset and delay differences from the main clock and make necessary adjustments.

PTP exchanges two types of messages, Event and General. Event messages are tagged with a timestamp during sending while general messages do not.

Types of Event Messages:

Sync: Used to convey time

Delay_Request: Measures the delay from downstream devices

Pdelay_Request: Initiates the delay measurement

Pdelay_Response: Response to the measure delay request

Types of General Messages:

Announce: Determines which device will become the Grand Master Clock

Follow_Up: Acknowledges timestamp from SYNC message

Delay_Response: Measures the delay between devices

Pdelay_Response_Follow_Up: Follow up to the delay response to measure delay time

Managmenet: Used between management devices

Signaling: Used by clocks to deliver how messages are sent

Created with © systeme.io