Skip to main content
  • Products
  • Evaluate our Software
  • Downloads
  • Free Utilities
  • Purchase
  • Support
  • About Us
  • Blog
  • Forum
  • Search
    • Contact Us
    • Forum
    • Wiki
    • Web Shop
    • Newsletter
    • RSS
  •   Jobs
  •   Videos
  •   Blog
  •   Sustainability
  • emNet
  • SNTP Client
  • Technology
  • Add-Ons
  • Tools
SEGGER - emNet Ethernet Stack

emNet Add-Ons - SNTP Client

The emNet SNTP client implementation is an optional extension which can be integrated into your application seamlessly. It combines a maximum of performance with a small memory footprint. The SNTP client implementation allows an embedded system to use real timestamps from a remote NTP server without using a RTC or to initialize a RTC. The SNTP protocol is based on SNTP v4.

  • Low memory footprint.
  • Seamless integration with the emNet TCP/IP stack.
  • Time synchronization with a remote NTP server.
  1. 1.SNTP Backgrounds
  2. 2.Requirements
  3. 3.Resource Usage
  4. 4.Relevant parts

SNTP Backgrounds

The SNTP protocol is an API on top of the TCP/IP protocol, it provides a way of synchronizing the target time with a local or remote NTP server over the network.

SNTPc client application layer

Requirements

The emNet SNTPc implementation requires the emNet TCP/IP stack.

Using SNTP, an emNet application can synchronize its time with an NTP server either in the local network or in a remote network to use a timestamp with the current date and time or to initialize its own RTC with a good start value.

The NTP Timestamp

The NTP timestamp used is represented by a 64-bit value consisting of two 32-bit fields. The first 32-bit field contains the complete seconds passed since January 1st 1900. The second 32-bit field contains fractions of a second in 232 picoseconds.

More information about the NTP timestamp can be found in RFC 1305.

The Epoch Problem (year 2036 problem)

The NTP timestamp reserves only 32-bit for full seconds passed which equals a little bit more than 136 years. As the NTP time is based on January 1st 1900 this means that the timestamp will overlap back to 0 some time in 2036. A timestamp older than a reference timestamp can be interpreted as valid time, too, as long as it does not count up to the reference timestamp.

Based on this solution there are several possible ways of extending this period even more:

  • The easiest solution to extend the timestamp to be used for around 136 years is for the target to remember the date it was built or had its firmware changed. It can then use this timestamp as reference extending the NTP timestamp for further 136 years.
  • Storing the current year in non volatile memory using it as reference in which epoch the target runs.
  • Using other sources as reference for the epoch such as timestamps from other sources.

Resource Usage

The ROM usage depends on the compiler options, the compiler version and the used CPU. The memory requirements of the SNTP Client module presented in the tables below have been measured on an ARM7 and a Cortex-M3 system. Details about the further configuration can be found in the sections of the specific example.

ROM Usage on an ARM7 System

The following resource usage has been measured on an ARM7 system using IAR Embedded Workbench V6.30.6, Thumb mode, no interwork, size optimization.

Add-onROM
emNet SNTP Client moduleApproximately 0.5 KByte

ROM Usage on a Cortex-M3 System

The following resource usage has been measured on a Cortex-M3 system using IAR Embedded Workbench V6.30.6, size optimization.

Add-onROM
emNet SNTP Client moduleApproximately 0.5 KByte

RAM Usage

Add-onRAM
emNet SNTP Client module Approximately 24 Byte

Relevant parts

The SNTP client module implements the relevant parts of the following Request For Comments (RFC).

RFC#Description
[RFC 4330]Direct Link: Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6 and OSI
[RFC 1305]Direct Link: Network Time Protocol (Version 3) - Specification, Implementation and Analysis

More Information

Purchase

  • Pricing

Technology

  • Drivers
  • FIND protocol
  • IPv6
  • Performance
  • Port Multiplication
  • Resource usage
  • Structure
  • Tasks & Interrupt Usage
  • Ethernet-APL

Add-Ons

  • CoAP Server/Client
  • Domain name resolution
  • NetBIOS
  • NTP Client
  • PPP/PPPoE
  • PTP OC Client
  • SMTP Client
  • SNMP Agent
  • SNTP Client
  • UPnP
  • WebSocket

Tools

  • embOS/IP Switch Board

About us

  • The Company
  • Partners
  • Job Offers
  • Media
  • Contact us

Support

  • Technical Support
  • Blog
  • Forum
  • Wiki

Downloads

  • Application Notes
  • Embedded Studio
  • embOS
  • emCompress
  • emCrypt
  • emFile
  • emLib
  • emLoad
  • emModbus
  • emNet
  • emPower
  • emSecure
  • emSSH
  • emSSL
  • emUSB-Device
  • emUSB-Host
  • emVNC
  • emWin
  • Flasher
  • Free Utilities
  • IoT
  • J-Link / J-Trace
  • Linux Studio
  • SystemView
  • CE / REACH

Social Media

Headquarters

SEGGER Microcontroller GmbH

Ecolab-Allee 5
40789 Monheim am Rhein, Germany
info@segger.com
Tel.: +49-2173-99312-0
Fax: +49-2173-99312-28

Locations

USA: SEGGER Microcontroller Systems LLC

Boston area
101 Suffolk Lane
Gardner, MA 01440, USA
us-east@segger.com
Tel.: +1-978-874-0299
Fax: +1-978-874-0599

Silicon Valley
Milpitas, CA 95035, USA
us-west@segger.com
Tel.: +1-408-767-4068

China: SEGGER Microcontroller China Co., Ltd.

Room 218, Block A, Dahongqiaoguoji
No. 133 Xiulian Road
Minhang District, Shanghai 201199, China
china@segger.com
Tel.: +86-133-619-907-60

ISO 9001 certified

ISO 9001

30+ years of experience

First-class embedded software tools since 1992
  • Imprint
  • Disclaimer
  • Privacy Policy

© 2023 SEGGER - All rights reserved.