[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #9581] Add "server reachability" register to SNTP

From: Tom Ferrin
Subject: [lwip-devel] [patch #9581] Add "server reachability" register to SNTP
Date: Wed, 7 Mar 2018 18:35:23 -0500 (EST)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:58.0) Gecko/20100101 Firefox/58.0


                 Summary: Add "server reachability" register to SNTP
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: tferrin
            Submitted on: Wed 07 Mar 2018 11:35:22 PM UTC
                Category: apps
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None



Currently there is no way for an application to determine if a time server is
reliably reachable. Since NTP is a UDP-based protocol, network congestion or
an overloaded server could easily mean that NTP packets are only occasionally
being received, but the application has no way of knowing this.

The additions in this patch implement a 8-bit “p.reach” server
reachability shift register, as described in section 9.2 of RFC 5905, and the
associated sntp_getreachability() function returns the value of this register
to the application layer. This can then be used by the application to
determine whether the server is reachable and, if not, this fact can be
reported and another server can be chosen.

The algorithm from RFC 5905 is simple and the implementation in this patch
requires very few lines of code. The reachability register is initialized to 0
and then shifted left by one bit when a request packet is sent. If a valid
response packet arrives, the rightmost bit is set to one. If the register
contains any nonzero bits, the server is considered reachable. The number of
one bits versus zero bits can also be used to determine how reliable the
reception of data packets is.


File Attachments:

Date: Wed 07 Mar 2018 11:35:22 PM UTC  Name: sntp.h  Size: 3KiB   By: tferrin

Date: Wed 07 Mar 2018 11:35:22 PM UTC  Name: sntp.c  Size: 26KiB   By: tferrin



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]