Skip to content

Repository files navigation

Chaosnet support for TOPS-20

Based on old code for TOPS-20 version 5 from MIT and SRI, ported into the PANDA TOPS-20 version 7, but in a separate tree to perhaps make it easier to port to other TOPS-20 distros/versions.

See the Chaosnet report for documentation. See Chaosnet.net for more info about Chaosnet.

For transmitting and receiving Chaosnet packets, the standard Chaos-over-IP encapsulation is used (see description), so you need to have TCP/IP configured and working. (It pays off to specify the FQDN of your system in HOSTS.TXT.)

No AI please!

⚠️ This software is developed without the use of "AI", LLMs and such. I consider these techniques and their implementation harmful for many reasons, and I want to avoid contributing to their development and use. If you as a person need help using or understanding TOPS-20 or Chaosnet, please get in touch and I will do my best to help.

🚫 Large Language Models are not allowed to read, learn or otherwise process this repository, including the documentation. The files CLAUDE.md and AGENTS.md only try to stop them, not help them.

No AI Sans AI

Installation

Begin by installing a Panda system and get Internet working on it. For this, you probably need to be running on a KL (or emulator, such as KLH10 or perhaps simh). The Chaosnet code has only been tried on a KLH10-KL (but since it relies only on IP working, it "should" work on other systems too).

Then restore the tape file chaos.tps using DUMPER. (To read the tape under *nix, you can use read20 -x -b -f chaos.tps with read20 from this version of tapeutils.)

To generate the monitor, connect to <CHAOS.MONITOR-SOURCES> and submit MONGEN.CTL. Install MONITR.EXE in SYSTEM:, and CHAFDS.UNV and MONSYM.UNVin SYS: (e.g. <CHAOS.SUBSYS>, see below).

To generate the exec, connect to <CHAOS.EXEC-SOURCES> and submit EXCGEN.CTL. Install EXEC.EXE in SYSTEM:.

Then compile a new MIDAS with Chaosnet definitions, see <CHAOS.MIDAS>-READ-ME-.TXT.

You can compile the various programs in <CHAOS.SYSTEM> and install them as indicated in the <CHAOS.SYSTEM>-READ-THIS-.TXT file (see below).

You may then want to compile and install TELNET, FINGER and the MM mailsystem, see below.

Configuration

Add the file SYSTEM:CHAOSNET.ADDRESS, with the following parameters:

  • CHAOS-ADDRESS:nnnn where nnnn is your octal Chaosnet address
  • CHAOS-IP-GATEWAY:a.b.c.d where a.b.c.d is the IP address of a Chaosnet bridge program which is configured to accept Chaos-over-IP from the IP of your TOPS-20 system (see below).
  • CHAOS-ADDR-DOMAIN:dname to set the address DNS domain to dname, default CH-ADDR.NET, max len 50. (Optional: the default dname is coded in STG.MAC, at CHADDN.)

Example: the Chaosnet bridge has IP 10.0.1.1, and the TOPS-20 Chaosnet address is 3412 (octal).

CHAOS-ADDRESS:3412,CHAOS-IP-GATEWAY:10.0.1.1

The Chaosnet host name is initialized from the IP host name, using GTHST%, so they need to match, of course.

DNS resolver

To make parsing of Chaosnet host names work, you need to edit DOMAIN:RESOLV.CONFIG to use a DNS server which has CHaosnet class data, such as the DNS.Chaosnet.NET host (look up its IPv4 address and use it, but note that it does not handle the INternet class - SEE BELOW). Use the DSERVE directive in the config.

You may also want to include the domain Chaosnet.NET. in your RSEARCH directives, to get shorthand addresses to all ITS hosts on Chaosnet.

Example:

DSERVE 92.34.149.133    ;These are the current addresses of DNS.Chaosnet.NET
DSERVE 65.108.62.138
DSERVE 159.69.213.219
RSEARCH .                 ;Try fully qualified first
RSEARCH my.local.dom.ain. ; then my local domain
RSEARCH Chaosnet.NET.     ; then Chaosnet.NET

(Note that HOSTS.TXT is not used for Chaosnet host names, except for initializing the local host name using GTHST%, see above.)

Chaosnet bridge

You need to configure your Chaosnet bridge to accept Chaos-over-IP from your TOPS-20 system, e.g. using

link chip x.y.z.w host nnnn myaddr mmmm

where x.y.z.w is the IP of your TOPS-20 system, nnnn is its Chaosnet address, and mmmm is the Chaosnet address of your cbridge on that subnet (in case it is on more than one).

Greetings (optional)

The contents of SYSTEM:CHAOSNET-LOGIN-MESSAGE.TXT, if it exists, is printed on new Chaosnet TELNET connections, just like SYSTEM:INTERNET-LOGIN-MESSAGE.TXT is printed on new TCP TELNET connections.

The content of SYSTEM:MONNAM.TXT, if existing, up to the first non-[A-Za-z0-9_-] character is used as system name in STATUS replies (to allow for a FQDN as host name while keeping those replies brief). Remark: another option would be to use all of MONNAM.TXT in STATUS replies, similar to how LISPMs use their pretty-name (which is "human readable" and often longer than the system name). What do you think?

What works

Out-of-the-box, the system responds on STATUS packets, e.g. sent by HOSTAT or CHATST programs (see here). It only sends two meters: the number of input and output packets.

Both simple RFC-ANS protocols and stream protocols seem to work.

GTDOM% handles the CHaosnet class (3). (There are not yet MACRO symbols for the classes.)

CHANM% uses GTDOM%, so works. See documentation.

See further documentation on source code edits here.

Surprisingly, the TELNET and MMAILR programs of the Panda distribution already handled Chaosnet! Both have been fixed to change the priority order between TCP/Internet and Chaosnet, to prefer Chaosnet. A new SMTCHA program which implements an SMTP server for Chaosnet has been added (see below).

Sending and receiving "SEND" messages and mail works, if you install the modified MM mailsystem (see below) and the server for the SEND contact (see below).

Server programs

If you install CHARFC.EXE in SYSTEM:, and start it in a SYSJOB, it will get all unclaimed RFC packets, and search for server programs SYSTEM:CHAOS.contact and start them. See the Chaosnet report for documentation of CHARFC.

There are simple server programs for the TIME, UPTIME, NAME, LIMERICK, FILE, LOAD, TELNET, and SEND contacts, see <CHAOS.SYSTEM>-READ-THIS-.TXT.

The TELNET server program, TELSER.FAI, needed a fix to set AN%NTP in the ATNVT% call, to mark the connection as "new Telnet".

Client programs

I suggest installing client programs in PS:<CHAOS.SUBSYS> and put that on the system-wide definition of SYS: (by editing SYSTEM:7-1-CONFIG.CMD, and putting it before PS:<SUBSYS>).

The FINGER program has been fixed to finger Chaosnet hosts and accept a /CHAOSNET switch (to show only Chaosnet connections). You will need to compile it (see <CHAOS.FINGER>-READ-THIS-.TXT) and install it (in <CHAOS.SUBSYS>).

Although TELNET already could make Chaosnet connections, I have changed the priority order between TCP and Chaos to prefer Chaos. Connect to <CHAOS.TELNET>, submit TELNET.CTL, and install TELNET.EXE in <CHAOS.SUBSYS>.

The MM mailsystem has modifications (in <CHAOS.MM>) to prefer Chaos over Internet/TCP connections. Connect to <CHAOS.MM> and submit BUILD-MM.CTL, and read <CHAOS.MM>-READ-ME-.TXT. A <CHAOS.SUBSYS> directory with pre-compiled binaries is provided for your convenience, but the binaries for MAISER and MAPSER live in SYSTEM: and are not included. The SMTCHA program should be started in SYSJOB/SYSJB1 (similarly to SMTJFN), not as SYSTEM:CHAOS.SMTP.

EXEC modifications

Support for the following has been added:

  • The Chaosnet-access privilege can be given and checked (BUILD and INFORMATION (ABOUT) DIRECTORY commands) (see RPCAP%/EPCAP%).
  • INFORMATION (ABOUT) SYSTEM-STATUS shows whether Chaosnet access control is enabled (see SMON%/TMON%).
  • ^ESET [no] CHAOSNET-ACCESS-CONTROL to enable/disable that.
  • INFORMATION (ABOUT) CHAOSNET shows some info about the Chaosnet configuration (whether it's enabled, whether access control is enabled, what host address and name you have)
  • SYSTAT, LOGIN, and INFORMATION (ABOUT) JOB-STATUS commands show the remote Chaosnet host suffixed with "(Chaos)".

Also, the FINGER command is allowed when not-logged-in, and takes a /CHAOSNET switch (to show only Chaosnet connections).

See further documentation on source code edits here.

Notes on programming

Some notes in addition to the Chaosnet report documentation.

  • To open a connection to a host, open CHA:host.contact as the documentation says. Here host can be an octal Chaosnet address or a host name whose address can be found in DNS (using the GTDOM% system call). If the name contains dots (.), make sure to quote them with ^V since the file name parsing will otherwise complain.
  • If the contact contains arguments, similarly quote special characters with ^V. You can/may/should use underscore (_) for space (they will become spaces again on the net).
  • Before closing the connection with CLOSF%, you may want to make sure your output has reached the other end. This can be done using SOUTR or the .MOSND operation for MTOPR, possibly followed by .MOEOF (to send an EOF) and .MONOP (to wait for it to get acked). This should arguably be default behaviour of a normal CLOSF% without CZ%ABT (or with CO%WCL?), but as it is, it is needed/useful. See e.g. <CHAOS.SYSTEM>CHAFIN.MAC.

New JSYSes

  • CHANM% (JSYS 460), to obtain information about Chaosnet hosts. (You can also use GTDOM%.)

Some supplemental documentation for JSYSes with extended functionality:

The following new JSYSes are only enabled with the VTSSW compile-time setting enabled:

  • VTSOP% (JSYS 635), to do display dependent operations (NYI)
  • RTMOD% (JSYS 636), to read terminal modes.
  • STMOD% (JSYS 637), to set terminal modes.
  • RTCHR% (JSYS 640), to read terminal characteristics.
  • STCHR% (JSYS 641), to set terminal characteristics.

What does not work yet

  • Supdup NVTs (Network Virtual Terminals) don't work (but regular TELNET NVTs do work, see here for a Chaosnet TELNET client.).
  • SDDT isn't updated with new symbols (but otherwise works).

What should be done later

  • SYSDPY should do things (show conns, windows, whatnot - like PEEK in ITS.)
  • DECnet now is enabled, and seems to work (with decnet=true on devdef ni0 config in klh10). It has also been tested with HECnet/PyDECnet too (using vde_switch/vde_plug2tap, see https://github.com/virtualsquare/vde-2 or you linux package manager.)
  • Summarise what changes were done to the original.

RESOLV

RESOLV should ideally be able to use separate DNS servers for IN and CH classes (but it doesn't), since CH can often be served by DNS servers which don't provide IN to just anyone (e.g. DNS.Chaosnet.NET), and IN servers in general have no clue about CH.

One workaround is to set up your own caching server to handle both IN and CH (see here).

Another workaround is to use nftables (or perhaps iptables) to reroute DNS queries from TOPS-20 to different DNS servers depending on the class (CH to DNS.Chaosnet.NET, IN to your standard server). You can find a python/nftables program to set up such forwarding in nft-dnschaos.py.

To make this work the TOPS-20 resolver in <CHAOS.CHIVES> needed a patch to use new source ports for each request. It is also patched to not insist on authoritative answers, which you typically don't get from a forwarding resolver these days.

Tips for running your TOPS-20 system

See here for some general tips about running your TOPS-20 system.

Limitations

A number of them.

LITES

The code in KLHSRV.MAC (to support LITES% in KLH10 when it is compiled with KLH10_DEV_LITES=1) is disabled. The LITES hack requires one of the rare Panda displays, but if you have one of those displays you need to enable the KLHSRV.MAC code again.

Bugs

Of course! Please report them to me.

Known things:

  • BUGINF FLKINT when creating outgoing connections.
    • This seems not to cause problems, but indicates some bug of course.
  • BUGCHK IPIBLP when lots of input coming in a connection.
    • This was related to a Chaosnet window handling bug in the Chaosnet bridge program but could still appear as the result of a DoS attack.
  • Filename parsing for CHA: only checks if the name begins with a digit and then uses that as address, so parsing "3com" will just return 3. (See HSTN$1 in CHAOS.MAC).
  • Here and there, 50 (decimal) is used as max host/domain name length.

About

TOPS-20 Chaosnet support

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Contributors

Languages