Difference between revisions of "Chaos RTAPE protocol"

From Computer History Wiki
Jump to: navigation, search
(A fabulous start.)
 
(Category: Network Application Protocols)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The [[Chaosnet]] '''RTAPE''' [[protocol]] is used to provide a remote [[Magnetic tape|tape]] [[server]] on a Chaos [[network]].  The protocol is structured as a sequence of messages called a ''record stream'', and each message specifies an operation to be performed or data to transmit.
+
The [[Chaosnet|Chaos]] '''RTAPE''' [[protocol]] is used to provide a remote [[magnetic tape|tape]] [[server]] on a Chaos [[network]].  The protocol is structured as a sequence of messages called a ''record stream'', and each message specifies an operation to be performed or data to transmit.
  
 
A description of the protocol—as reverse engineered from ITS' DUMP backup program and the [[MIT]]/[[Symbolics]] RTAPE.c server for [[BSD]] [[Unix]]—follows.
 
A description of the protocol—as reverse engineered from ITS' DUMP backup program and the [[MIT]]/[[Symbolics]] RTAPE.c server for [[BSD]] [[Unix]]—follows.
Line 9: Line 9:
 
After that, both sides will exchange messages.  Each message begins with an octet which is the opcode.  After that comes two octets, in big-endian order, which is the size of the data that follows.  Finally come as many octets of data as specified by the size.
 
After that, both sides will exchange messages.  Each message begins with an octet which is the opcode.  After that comes two octets, in big-endian order, which is the size of the data that follows.  Finally come as many octets of data as specified by the size.
  
The data portion may be an ASCII text string, or binary data to transmit tape blocks.
+
The data portion may be an ASCII text string, or binary data to transmit tape blocks.  If text data has several fields, they are separated by a space characters; numbers are in decimal with an optional minus sign.
  
 
===Operations===
 
===Operations===
Line 58: Line 58:
  
 
The <code>Read</code> operation may transmit several tape blocks, but the client can interrupt this at any time by sending a <code>Probe</code>.
 
The <code>Read</code> operation may transmit several tape blocks, but the client can interrupt this at any time by sending a <code>Probe</code>.
 +
 +
The data in a mount message needs further explanation:
 +
{| class="wikitable"
 +
! Field || Description
 +
|-
 +
| Type || Mode: <code>READ</code>, <code>WRITE</code>, or <code>BOTH</code>
 +
|-
 +
| Reel || ?
 +
|-
 +
| Drive || The name of the tape drive, as understood by the server
 +
|-
 +
| Size || (Preferred? max?) tape block size
 +
|-
 +
| Density || Tape density, in bytes per inch
 +
|-
 +
| Options || A space-separated list.  May include <code>NOREWIND</code> and <code>OFFLINE</code>
 +
|}
  
 
===Status information===
 
===Status information===
Line 82: Line 99:
 
| 15 || 2 || Retries in last operation ||
 
| 15 || 2 || Retries in last operation ||
 
|-
 
|-
| 17 || 1 || Length of next string ||
+
| 17 || 1 || Length of drive name ||
 
|-
 
|-
| 18 || ''n'' || Name of drive ||
+
| 18 || 16 || Name of drive ||
 
|-
 
|-
| 18+''n'' || 2 || Flags ||
+
| 34 || 2 || Flags ||
 
|-
 
|-
| 20+''n'' || ? || Optional error message ||
+
| 36 || ? || Optional error message ||
 
|}
 
|}
  
Line 116: Line 133:
 
|}
 
|}
  
[[Category:Network Protocols]]
+
[[Category: Chaos]]
 +
[[Category: Network Application Protocols]]

Latest revision as of 07:07, 30 July 2024

The Chaos RTAPE protocol is used to provide a remote tape server on a Chaos network. The protocol is structured as a sequence of messages called a record stream, and each message specifies an operation to be performed or data to transmit.

A description of the protocol—as reverse engineered from ITS' DUMP backup program and the MIT/Symbolics RTAPE.c server for BSD Unix—follows.

Record stream

Once a connection has been established, the server sends a packet with the string RECORD STREAM VERSION 1. The client responds with the same string. Presumably the parties can negotiate another version, but so far only version 1 is known.

After that, both sides will exchange messages. Each message begins with an octet which is the opcode. After that comes two octets, in big-endian order, which is the size of the data that follows. Finally come as many octets of data as specified by the size.

The data portion may be an ASCII text string, or binary data to transmit tape blocks. If text data has several fields, they are separated by a space characters; numbers are in decimal with an optional minus sign.

Operations

Client-to-server opcodes:

Opcode Name Data
1 Login  ?
2 Mount Text: type reel drive size density options
3 Probe Binary: two octets with an ID
4 Read Nothing (read all records until file mark),
or text: number-of-records
5 Write Text: block-size (decimal)
6 Rewind Nothing
7 Rewind-sync Nothing
8 Rewind-unload Nothing
9 Space file Text: number-of-files
10 Space record Text: number-of-records
12 Write file mark Nothing
13 Close Nothing

Server-to-client opcodes:

Opcode Name Data
33 Login response  ?
34 Read data Binary: tape block data
35 Read file mark Nothing
36 Status See below

Status messages may be solicited by the Probe opcode, or the server can send them at any time to signal an error.

The Read operation may transmit several tape blocks, but the client can interrupt this at any time by sending a Probe.

The data in a mount message needs further explanation:

Field Description
Type Mode: READ, WRITE, or BOTH
Reel  ?
Drive The name of the tape drive, as understood by the server
Size (Preferred? max?) tape block size
Density Tape density, in bytes per inch
Options A space-separated list. May include NOREWIND and OFFLINE

Status information

The Status message has this data:

Offset Size Description Data
0 1 Version Only 1 is known
1 2 ID Matching the Probe ID (Solicited flag set),
or 0
3 3 Number of blocks read
6 3 Number of blocks skipped
9 3 Number of blocks discarded
12 1 Last operation received
13 2 Density
15 2 Retries in last operation
17 1 Length of drive name
18 16 Name of drive
34 2 Flags
36  ? Optional error message

The two-octet flags field, when taken as a little-endian number:

Bit Description
0 Solicited, e.g. requested by Probe
1 Drive is at beginning of tape
2 Drive is past end of tape
3 Last operation reached a file mark
4 Not logged in
5 Tape is mounted
6 Error message follows
7 Hard error
8 Soft error
9 Drive is offline