Network Component  Version 6.6
MDK-Professional Middleware for IP Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SNTP Client

Simple Network Time Protocol (SNTP) is a networking protocol for clock synchronization between computer systems over IP based, variable-latency data networks. SNTP does not require the storage of the state over extended periods of time, so that it is used mostly in memory limited embedded devices and in applications where high accuracy timing is not required.

The protocol provides Coordinated Universal Time (UTC) including scheduled leap second adjustments. No information about time zones or daylight saving time is transmitted. This information must be obtained separately.

The SNTP Client in the Network Component enables the retrieval of UTC coded time information from a given NTP server. The IP address of the server can be specified separately.

The following function is included in the Network Component library rl_net.h:

  • sntp_get_time - retrieve the current time from a network time server.

SNTP Client Configuration

net_config_sntp_client_h.png
SNTP Client Configuration File

The SNTP client configuration file Net_Config_SNTP_Client.h contains the following settings:

  • Broadcast Mode enables or disabled the broadcast mode of SNTP Client service. In broadcast mode, SNTP Client opens UDP port for receiving broadcasted NTP messages in local network. This option should be disabled to access a public NTP server located on internet.
  • NTP Server specifies the IP address of the NTP Server which receives get time requests in unicast mode (usually a public NTP server on internet) or broadcasts NTP messages in broadcast mode (local NTP server in local network). This IP address is used when the NTP Server IP is not specified in sntp_get_time() function parameter.