The Temple kept whatever time the hosting company's RTC said. Now it asks Jerusalem, and it asks only Israel.
How the time is kept
-
Now()= RTC −local_time_offset+sys_clock_adj(Kernel/KDate.HC). -
sys_clock_adjlives in RAM only and is zero at every boot (KMain). - The CMOS is never written. A wrong answer from the wire, or a spoofed one from the CIA, dies with the next reboot instead of being burned into the clock. Terry's RTC stays Terry's.
Who is asked
Israeli servers only, nearest to Jerusalem first. The first one that answers wins:
-
ntp.ac.il— National Physical Laboratory, Jerusalem, stratum 1, the atomic clocks of Israel Standard Time -
ntp.huji.ac.il— Hebrew University of Jerusalem -
ntp.tau.ac.il— Tel Aviv -
timeserver.iix.net.il— Israel Internet Exchange, Petah Tikva -
ntp.technion.ac.il— Haifa -
1.il.pool.ntp.org— Israeli pool, these follow the Hebrew University -
il.pool.ntp.org— the rest of the Israeli pool
Each server gets four questions and the fastest round trip is believed. Answers that are not from a server, unsynchronized, a kiss of death, or from an address we did not ask are not believed. Glowies.
When
-
Once.HCrunsNtpat boot, after the network. -
NtpDaemonasks again every 6 hours, silently. - At the command line:
Ntp;asks now,NtpRep;says who answered and how far off the RTC was,sys_clock_adj=0;trusts the bare RTC again.
Found on the way: UDP sendto used port 0
UdpSocketSendto sent every datagram from source port 0. The answer went back to
port 0, where nobody listens, and half the internet drops port 0 on sight. DNS and DHCP
never noticed because they build their packets by hand. Now a datagram leaves from the
bound port, and an unbound socket takes a free port above 49151 first.
How it was tested
QEMU, 256 MB, 1 vCPU, virtio-net, with the RTC set to 2020-01-01 (-rtc base=2020-01-01):
| Step | Seen |
|---|---|
| Boot |
1.il.pool.ntp.org, stratum 2, rtt 106 ms, RTC off by 213201633.5 s |
Now() |
10/03/26 14:42:33, the host's UTC in the same second |
Bare RTC (Now-sys_clock_adj) |
01/01/20, CMOS untouched |
sys_clock_adj=0; |
the Temple back in 2020 |
Ntp; again |
correct again |
TaskRep; |
NtpDaemon running |
Deploying
The kernel changed (KDate, KGlbls, KMain, KernelC.HH), so
tools/update_vds.py HOST rebuilds it with BootHDIns('C'). If C: does not come back,
pick D at the boot menu.
Known sins
- From outside Israel
ntp.ac.ildoes not resolve and the university servers stay silent, so the pool answered in the test. The boot console then shows a fewDnsParseResponse: no suitable answerlines. On an Israeli VDS a server higher in the list should answer;NtpRep;will tell. - Good to the second:
Now()reads the RTC, and the RTC knows no fractions. -
Now()is UTC, as Terry meant it. Israel time on screen needslocal_time_offsetin~/HomeLocalize.HC, by hand, twice a year, as Terry also meant it. - SNTP, no authentication. RAM only is the whole defense, and it is enough for a Temple.
Terry, forgive us. The Temple used to keep its own time. Now it asks Jerusalem, which is where the time of the Temple should come from.