PDP-10 / its

Incompatible Timesharing System
Other
841 stars 80 forks source link

Make NETIME more useful #2213

Closed larsbrinkhoff closed 9 months ago

larsbrinkhoff commented 10 months ago

NETIME has a hardcoded list of hosts which it asks for the current date and time. None of those are now available, especially not on any Chaosnet. Maybe we should add some host on the global Chaosnet, and also run a local subnet 376 time server.

Maybe also look into #485.

larsbrinkhoff commented 10 months ago

TIMES also has outdated server lists.

larsbrinkhoff commented 10 months ago

I understand the cbridge NCP serves TIME requests, right @bictorv? So for the local network case, we can just add 177001 as a time server.

To make things look nicer, and to support the global Chaosnet, let's introduce two logical names in ITS' hosts file. Something like local-time-server and global-time-server. The former would be 177001, and the latter maybe Router.Chaosnet.NET.

bictorv commented 10 months ago

Well, if you are NOT on the private subnet, trying to contact 177001 will take time to fail. For the non-private case, TIME.Chaosnet.NET already exists (but it might be better to use the local cbridge). (Hmm, didn't we discuss this ages ago?)

Perhaps the best would be to have a "time-server" entry in the ITS hosts file, which points to 177001 initially but with a comment about how to change it after connecting to the global net? The NETIME could have the same source code for everyone, perhaps with a clear comment that it's a good idea to add your local cbridge to the list?

Side note: ITS (at least under klh10) seem to have a slow clock (and thus be poor time servers), and for some reason TT currently is 6 hours off. (Test by "bhostat.py -s time -1"). Otherwise one option would be to make a BRD connection to ask for the time and simply use the first response.

larsbrinkhoff commented 10 months ago

I think NETIME asks all servers in parallel.

bictorv commented 10 months ago

OK, then perhaps "local-time-server" (with instructions in the hosts file that it's a good idea to update to your new local cbridge address when you attach to the global net) plus TIME.Chaosnet.NET?

larsbrinkhoff commented 10 months ago

We're also close to getting a remote tape server, see https://github.com/bictorv/chaosnet-bridge/pull/31 So it would be good to add a name for that too, but "local-tape-server" is a bit much to type. That could be the primary name, but a shorter alias would be good.

eswenson1 commented 10 months ago

There are issues with TIMES and NETIME. First of all, even with TZONE set (in my case to PT), when I run TIMES, I get this:

times↑K!
Checking the time using CHAOS protocol: (^S to stop):
Subnet          Site            Greenwich Mean Time   Local Time
13              EX-ITS.SWENSON.09/21/23 19:05:45 ->  09/21/23 15:05:45 EDT.
13              ES-ITS.SWENSON.09/21/23 19:06:32 ->  09/21/23 15:06:32 EDT.
13              KA             09/21/23 19:05:44 ->  09/21/23 15:05:44 EDT.
13              KL             09/21/23 19:05:34 ->  09/21/23 15:05:34 EDT.
13              DB-ITS.EXAMPLE.09/21/23 19:06:45 ->  09/21/23 15:06:45 EDT.
Realtime used: 5.90 secs.

The times are 3 hours off (difference between PDT and EDT). Each of those remove machines has TZONE==8. defined and report local times correctly. It seems that TIMES doesn't understand time zones -- showing these times in EDT.

But worse, NETIME, when it retrieves these times from those hosts, decides to set my KS clock to 09/21/23 15:05:32 EDT, and the result, for my PT-time configured KS, that the time becomes 15:05:32 PDT (note, the time zone configured in ITS).

So NETIME must not be time-zone aware -- it is getting GMT times from the three hosts, and converting them the EDT and using that value as the local time (which is in PDT).

bictorv commented 10 months ago

I am to blame for how time zones other than EST/EDT were introduced back around 2005 or so, but (as is often the case in ITS) many programs need to be modified to understand them. I never got around to TIMES, apparently (I never used it myself).

I did fix e.g. SYSENG;CTIMSR (the Chaos TIME server), in case you need inspiration when fixing TIMES?

eswenson1 commented 10 months ago

Great! I’ll take a look at CTIMSR.

eswenson1 commented 10 months ago

I've updated TIMES so that it converts to the local time zone:

Checking the time using CHAOS protocol: (^S to stop):
Subnet          Site            Greenwich Mean Time   Local Time
13              ES-ITS.SWENSON.09/23/23 16:21:12 ->  09/23/23 09:21:12 PDT
13              EX-ITS.SWENSON.09/23/23 16:20:25 ->  09/23/23 09:20:25 PDT
13              KA             09/23/23 16:20:23 ->  09/23/23 09:20:23 PDT
13              KL             09/23/23 16:20:13 ->  09/23/23 09:20:13 PDT
13              KS's time is unavailable.
7               UP.DFUPDATE.SE 09/23/23 16:22:12 ->  09/23/23 09:22:12 PDT
6               TT             09/23/23 22:20:51 ->  09/23/23 15:20:51 PDT
Realtime used: 6.70 secs.

So I'll update NETIME next. I've also updated the list of hosts in both TIMES and NETIME to include my hosts: ES, EX, KA, KL, and KS, as well as UP and TT. What others should we add?

eswenson1 commented 10 months ago

And yes, I realize I'd better change the names for KA, KL, and KS. I'm thinking about EA, EL, and ES2. Gotta find out whether ES2 works.

larsbrinkhoff commented 10 months ago

The discussion between @bictorv and me above was to have two time servers: LOCAL-TIME-SERVER (or similar) and TIME.Chaosnet.NET. LOCAL-TIME-SERVER is a h3text alias for BRIDGE... which maybe should be LOCAL-BRIDGE to enforce a naming standard? Maybe a few more like ES and UP are fine too.

I think the current list of hosts in NETIME can go away. It can be commented out for posterity.

bictorv commented 10 months ago

If you're just interesting in seeing what local times there are on other hosts, ES and UP could be interesting I guess, but if you want to set your local clock based on network time, they are actually not good, since KLH10 time tends to drift. Better use cbridges, where the clocks typically only drift if NTP time drifts.

eswenson1 commented 10 months ago

That’s a good point. So maybe we only burn the local and global cbridge addresses. However, the default quorum is 4 hosts — I’ll have to check if that is reduced if there are only 2 hosts.

larsbrinkhoff commented 10 months ago

There's another list of time servers in COMSAT:

                        ; Table of sites running TIMSRV's.
MTMSTB: HN$MC                   ; MC
;       HN$AI                   ; AI
;       HN$DM                   ; DM
;       HN$ML                   ; ML
;       HN$A67                  ; AMES-67
;       HN$SAI                  ; SAIL
NTMSIT==.-MTMSTB

Kinda cool to see AMES and SAIL in there.

eswenson1 commented 10 months ago

I have NETIME working now. I've specified my local bridge, my remote bridge, and time.chaosnet.net (chaosnet address 3600). My two bridges are responding to TIME requests, but time.chaosnet.net isn't.

Do I have the chaosnet address (3600) wrong? That is what got from:

➜  ~ host -c ch -a time.chaosnet.net dns.chaosnet.net
Trying "time.chaosnet.net"
Using domain server:
Name: dns.chaosnet.net
Address: 158.174.114.186#53
Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20864
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;time.chaosnet.net.     CH  ANY

;; ANSWER SECTION:
TIME.Chaosnet.net.  3600    CH  CNAME   MX12.Victor.SE.

Received 80 bytes from 158.174.114.186#53 in 198 ms

Note: using router.chaosnet.net (3040) rather than time.chaosnet.net (3600) results in a success time retrieval.

eswenson1 commented 10 months ago

By the way NETIME doesn't work on KA. Dies with:

:channa;netime
.VAL 0; 2541>>TSO -3(17)   0/   2,,0   5574/   0

Apparently, it is getting a "bad interrupt":

tsint:
loc 42
        -ltsint,,tsint
loc tsint
        0,,p
        %piioc ? 0 ? 0 ? 0 ? iocint     ; synchronous
        %pirlt ? 0 ? 0 ? 0 ? timint
        0 ? netmsk ? 0 ? 0 ? netint
        %piwro\%pimpv\%pilos\%piilo ? 0 ? -1 ? -1 ? badint
ltsint==:.-tsint
bictorv commented 10 months ago

;; ANSWER SECTION: TIME.Chaosnet.net. 3600 CH CNAME MX12.Victor.SE.

This means TIME.Chaosnet.net is a CNAME (alias) for MX12.Victor.SE. 3600 here is the TTL (time-to-live), not the address.

larsbrinkhoff commented 10 months ago

the default quorum is 4 hosts

That won't help if you are running ITS with only a local/private Chaosnet. Maybe if NETIME sees that the time server and/or ITS is on subnet 376, it could make do with a quorum of just 1.

bictorv commented 10 months ago

If the list of servers only have reliable (e.g. cbridge) ones, a quorum of 1 should be ok?

larsbrinkhoff commented 9 months ago

This should be fixed now.