OK, I've ordered the hardware, and this is what I intent to implement:
SETP
SETP (Simple Econet Time Protocol) is a client-server time synchronisation protocol, based on SNTP but adapted to the limitations of Econet. It does not cover peer-peer synchronisation between servers, but could probably be extended.
A synchronisation consists of three messages:
The Data-Block
All times are 64-bit unsigned fixed 32.32 format, with zero at 1900-01-01.00:00:00 UTC, ignoring leap seconds. This will roll-over at 2036-02-07.06:28:16 UTC. The precision is about 232 picoseconds.
Calculations
Roundtrip time = (DestTime - OrgTime) - (TransTime - RecvTime)
Correction to client clock = (RecvTime - OrgTime) + (TransTime - DestTime)) / 2
All suggestions for improvement welcome!
SETP
SETP (Simple Econet Time Protocol) is a client-server time synchronisation protocol, based on SNTP but adapted to the limitations of Econet. It does not cover peer-peer synchronisation between servers, but could probably be extended.
A synchronisation consists of three messages:
- The client sends a broadcast (address FF.FF) to port 7B. The 8-byte payload is a random identifier (SyncID) generated to avoid coincidences. The client records the time of transmission (OrgTime) as accurately as possible.
- The server receives the broadcast, and records the time of arrival (RecvTime) as accurately as possible, along with SyncID and client address.
- The server sends a broadcast (address FF.FF) to port 7B, with the same SyncID as its payload. The server records the time of transmission (TransTime) as accurately as possible.
- The client receives the broadcast (checking SyncID), and records the time of arrival (DestTime) as accurately as possible, along with the server address.
- The server sends a 48-byte data-block (based on NTP) to the client address, port &7B.
- The client receives the data block, and checks that both the SyncID and server address match the broadcast.
The Data-Block
All times are 64-bit unsigned fixed 32.32 format, with zero at 1900-01-01.00:00:00 UTC, ignoring leap seconds. This will roll-over at 2036-02-07.06:28:16 UTC. The precision is about 232 picoseconds.
| Byte | Name | Description | Details |
|---|---|---|---|
| 0 bits 0-1 | LI | Leap seconds due at end of month | 0=0, 1=+1, 2=-1, 3=error |
| 0 bits 2-4 | VN | Version number | Must be 4 (current version) |
| 0 bits 5-7 | Mode | Protocol mode | Must be 4 (server) |
| 1 | Stratum | No. of steps to primary clock | 0=kiss-of-death, 1=primary clock |
| 2 | Poll interval | Max time between poll messages | unsigned log2 seconds |
| 3 | Precision | Server clock precision | signed log2 seconds |
| 4-7 | Root delay | roundtrip time to primary clock | signed fixed 16.16 seconds |
| 8-11 | Root disp. | max error due to clock frequency | unsigned fixed 16.16 seconds |
| 12-15 | Ref. ID | Identifier for server time reference | see NTP for details |
| 16-23 | Ref. time | Time server clock was last set | fixed 32.32 seconds since 1900 |
| 24-31 | SyncID | The identifier used in broadcasts | (in NTP this is OrgTime) |
| 32-39 | RecvTime | Time query arrived, on server clock | fixed 32.32 seconds since 1900 |
| 40-47 | TransTime | Time reply sent, on server clock | fixed 32.32 seconds since 1900 |
Roundtrip time = (DestTime - OrgTime) - (TransTime - RecvTime)
Correction to client clock = (RecvTime - OrgTime) + (TransTime - DestTime)) / 2
All suggestions for improvement welcome!
Statistics: Posted by Barneyntd — Thu Sep 04, 2025 9:12 pm