The original spec, MIT AIM 628, is sometimes not totally clear, and partly out-of-date (e.g. for the link layer and down). What is below might perhaps not be clearer, but more succinct. The real definition is in the behaviour of the implementations - “use the source, Luke!” 1)
Chaosnet addresses are 16 bits: 8 bits for subnet (MSB), 8 bits for host (LSB). Neither byte can be zero for an individual host, but the address 0 is used for broadcast (on the local subnet). They are almost always presented in octal.
|bits 0 - 7||bits 8-15|
|word 1||Opcode||Reserved (zero)|
|word 2||Fwd counter (4 bits)||Data length in bytes (12 bits)|
|word 3||Destination address|
|word 4||Destination index|
|word 5||Source address|
|word 6||Source index|
|word 7||Packet number|
|…||data of length||given||as||“Data length”,|
|…||padded to an even number of bytes|
Describe “hardware trailer” (cf Section 2.5 of MIT AI Memo 628).
The opcodes, briefly:
RFC(request for connection) is sent from the client to the server to start a connection. The data part of the packet starts with the contact name (e.g. “NAME”) which is optionally followed by a space and protocol-specific arguments (e.g. “/W VICTOR”). The destination index should be zero.
OPN(open) is sent as a response to an
RFCin order to start a stream protocol. The source index is initialized here, and the data initializes the local window size (16 bits) and a “receipt”, which is the highest packet number received so far (probably the RFC pkt number) but not necessarily delivered to the user process.
CLS(close) is sent to reject an
RFC, or to close the connection at other times. The data contains a message intended for the user, e.g. “No server for this contact name”. The connection is immediately closed at the sender end.
FWD(forward) is sent in response to an
RFC, to reject the connection but tell who should be contacted instead (the forwarding address is in the Acknowledgement field).
ANS(answer) is sent in response to an
RFCwhen the protocol is a “simple” transactional protocol (cf. UDP). The data contains the response data, and no connection is established.
SNS(sense) is sent to ask the other end to send a
STS(status) is sent to inform the other end about the current local window size and the “receipt”, which is the highest packet number received so far (probably the RFC pkt number) but not necessarily delivered to the user process.
RUT(routing information) is broadcast every 15 seconds, containing information about which subnets the sender is aware of and the “cost” of reaching them. Cf RIP.
LOS(lose) conveys an error message (cf
CLSabove), in response to various error conditions. If there was a connection, it is now closed.
EOF(end-of-file) is used in various application protocols to indicate the end of a record of information, e.g. in a file transfer.
UNC(uncontrolled data) is used to send data without Chaosnet flow-control, e.g. to encapsulate another protocol (maybe UDP or TCP or PUP).
BRD(broadcast) is used to send a “broadcast RFC” to specific subnets (not limited to the local subnet). Recipients of a BRD packet treat it as an RFC, and the sender deals with the responses as it sees fit.
DAT(data) is used to send data. Opcodes 0200-0277 are used for 8-bit data, while 0300-0377 are used for 16-bit data (in network order).
What is described here is not only “proper” link layers, but more generally in the sense of means of transporting individual Chaosnet packets.
Chaosnet packets are sent using the standard Ethernet protocol number (or EtherType) 0x0804. No “hardware trailer” is used, since the Ethernet header does the corresponding job (it includes source and destination hardware addresses, and a checksum). Packets are sent in “big-endian” (network) order.
When configured to use Ethernet, ARP packets are sent and received in a standard manner to find ethernet-chaos mappings, with the protocol type for Chaosnet (0x0804) and address length 2.
Chaosnet addresses are independent of IP/IPv6 addresses, but can be mapped to IP/IPv6 addresses either individually, or for a whole subnet (see Cisco's implementation, the PDP-10/X project, or cbridge).
Note that Chaosnet addresses where the host byte is 0xFF (which is legal by the specification) cannot be used with subnet mappings on IPv4, since they map to the broadcast address.
Chaosnet packets are encapsulated in UDP packets, using a four-byte header (version=1, function=1, 0, 0), and with a “hardware trailer” containing the destination and source addresses and an Internet Checksum.
In the current implementation (for klh10 and in cbridge), packets are sent in "little-endian", i.e. with the least significant byte of a 16-bit word before the most significant byte. (I'm really sorry about this, and might develop version 2 of the protocol with the only change being big-endian byte order.)
Chaosnet packets are sent over TLS, with a 2-byte header (length MSB, length LSB). Packets are sent in “big-endian” order, with a “hardware trailer”.
There are different reasons to want to use TLS:
When using TLS, some certificate infrastructure is needed. There is one for the Global Chaosnet.
Chaosnet packets are sent over a named Unix socket (typically
/var/tmp/chaosd_server), with a 4-byte
header (length MSB, length LSB, 1, 0). Packets are sent in
“big-endian” (network) order, with a “hardware
This has been implemented in usim (the CADR emulator) and in Python by Joe Oswald.
To the right is an approximate state diagram. The green box is where it starts, the red where it ends. Blue and brown text is sent by one end and the other. (Note that LSN is not really a packet sent over the network.)
In a simple protocol, an RFC is sent and the response is normally an ANS containing the answer. The response can also be CLS or FWD.
The RFC is retransmitted until a response is received, or some timeout occurs. The response is “uncontrolled” in the sense that it is not retransmitted, but since the RFC is retransmitted a new response will (probably) be sent.
In a stream protocol, an RFC is sent, and the response is normally an OPN which confirms the connection and informs of the local window size. The initiator then responds with an STS to inform of its window size, and then the connection is open.
Window management is done using the receipt and window-size values in STS packets. A sender is expected to respect the remote window size, of course. And retransmissions occur, for “controlled” packets (RFC, OPN, EOF, BRD, and DAT).
The connection is closed by a CLS (or in case of an error, by LOS, or a timeout).
All hosts are required to respond to the simple protocol
STATUS. The response indicates
Routers (or “bridges” in Chaosnet lingo) implement a “unidirectional” routing protocol using RUT packets, which contain the routing info for up to 122 (decimal) subnets. For each subnet, the next bridge address (or the local interface nr) and the cost is announced. The cost increases by 1 every 4 seconds, up to a maximum value (for most systems, 512, but for others, 1024).
For many protocols (e.g. FINGER, NAME, and FILE, see below), a special LISPM 8-bit character set us used 5), which includes some greek letters, arrows etc, and notably maps carriage return, linefeed, formfeed and tab to character codes +0200.
To check who is logged in to a host, the (stream)
NAME protocol can be used. The arguments can be a specific user name to check, optionally prefixed by “/W” to get longer (“whois”) information. For LISP machines, the (simple)
FINGER protocol can be used, where the ANSwer is the userid, location, idle time, full name, and group affiliation, separated by LISPM newlines (0215). 6)
For file transfer, the
FILE protocol can be used (a modernised version, used by Symbolics, appears in RFC 1037).
MLDEV protocol is used by ITS systems for remote general device access (including hard disk devices), also over TCP. 7)
SUPDUP (“SUPer DUPer image TELNET”) protocol can be used to connect to a host for an interactive command-line session (like
ssh, but no security, or
telnet, but smarter). It uses a “software terminal” abstraction which standardizes cursor motion, insert/delete operations etc. An implementation which uses the cbridge NCP for connecting to Chaosnet can be found here.
To send interactive “chat” messages, the
SEND protocol can be used. The
DOVER protocol was used for sending documents to be printed on a Dover printer.
You can also connect to TCP using Chaosnet gateways: use the contact name
TCP, using the host and port number as arguments, e.g.
TCP GOOGLE.COM 80.