Simple Network Time Protocol Client
Switch system time can be achieved in two ways - the SNTP client where the SNTP server automatically synchronizes time; and the administrator's configuration.
The Simple Network Time Protocol (SNTP) is used for time synchronization between network devices. Normally, an SNTP server exists in the network and provides reference time for multiple SNTP clients. This way, time synchronization is achieved among all network devices.
SNTP can work in four modes: unicast, broadcast, multicast, and anycast.
-
In the unicast mode, the client initiates a request to the server. After receiving the request, the server constructs a response message based on the local time and sends the response message back to the client.
-
In the broadcast and multicast mode, the server periodically sends broadcast or multicast messages to the client, and the client receives the messages from the server.
-
In the anycast mode, the client initiates a local broadcast address or a multicast address to send a request. In this case, the server in the network responds to the client. The client selects the server that receives the response message as the server, and discards the messages sent by the other server. After electing out of the server, the work pattern is same as unicast.
In all modes, the client receives a response message to parse the message to obtain the current standard time, and calculates the network transmission delay and local time compensation through a certain algorithm. The data is used to calibrate the current time.