Status of this Memo: This document specifies an OASIS Send/Receive protocol for reliable, transparent binary file transfer between two computer systems, typically over a serial communication link. Distribution of this memo is unlimited.

Abstract

The OASIS Send/Receive protocol is a initiator/responder, ACK/NAK-based protocol designed for transferring files between OASIS operating systems. It employs packet-based communication with DLE (Data Link Escape) stuffing for transparency, a toggle-bit acknowledgment scheme for reliable delivery, run-length encoding for data compression, and an LRC (Longitudinal Redundancy Check) for error detection. This document details the protocol's packet structures, control characters, data encoding mechanisms, and operational flow.

1. Introduction

The OASIS Send/Receive protocol facilitates the transfer of various file types supported by the OASIS operating system. The protocol operates with a sender (initiator) and a receiver (responder), ensuring data integrity through checksums and acknowledgments. It supports transparent data transmission, allowing control characters to be embedded within the data through DLE stuffing.

2. Terminology

DLE
Data Link Escape (0x10)
STX
Start of Text (0x02)
ETX
End of Text (0x03)
EOT
End of Transmission (0x04)
ENQ
Enquiry (0x05)
ACK0
Acknowledge 0 (DLE followed by '0' (0x30))
ACK1
Acknowledge 1 (DLE followed by '1' (0x31))
NAK
Negative Acknowledge (0x15). An explicit control character sent by the responder to indicate a packet was not received correctly.
SI
Shift In (0x0F) - DLE SI indicates subsequent 7-bit data bytes should have their MSB set upon receipt.
SO
Shift Out (0x0E) - DLE SO indicates subsequent 7-bit data bytes should have their MSB cleared upon receipt.
VT
Vertical Tab (0x0B) - DLE VT count char is used for Run-Length Encoding.
CAN
Cancel (0x18) - DLE CAN represents an ESC character in the data stream.
ESC
Escape (0x1B) - If present in user data, it's transmitted as DLE CAN.
SUB
Substitute (0x1A) - Used as an EOF marker in ASCII mode text files.
RUB
Rubout / Delete (0x7F) - Used as a padding/terminator character after the LRC in sent data packets.
LRC
Longitudinal Redundancy Check.
DEB
Directory Entry Block - A 32-byte structure describing file metadata.
Initiator
The sending system.
Responder
The receiving system.

3. Protocol Overview

The communication is a initiator/responder relationship where the sender is the initiator. The initiator initiates the transfer and sends data packets. The responder acknowledges received packets. A toggle-bit ACK mechanism (ACK0, ACK1) ensures sequential packet reception.

General Flow

  1. Sender (Initiator) sends ENQ to Receiver (Responder).
  2. Receiver sends ACK0 (DLE '0').
  3. Sender sends Data Packet 1 (e.g., OPEN command with DEB).
  4. Receiver, if packet is valid, sends ACK1 (DLE '1').
  5. Sender sends Data Packet 2 (e.g., WRITE command with file data).
  6. Receiver, if packet is valid, sends ACK0 (DLE '0').
  7. This continues, alternating ACKs, until the file transfer is complete.
  8. If the sender receives an incorrect ACK (e.g., expecting ACK1 but receives ACK0 again) or no ACK after a timeout, it may send an ENQ to solicit a resend of the last ACK from the receiver. This can be repeated up to five times before the initiator disconnects.
  9. After the last data packet (e.g., CLOSE command), the sender may transmit EOT to terminate the session. (This can be suppressed with the NOEOT option in the SEND command).
  10. The receiver sends a final ACK for the EOT.

4. Packet Structure

4.1 Data Packet Format

All data packets (OPEN, WRITE, CLOSE) follow this general structure:

DLE STX <CMD> <Payload> DLE ETX <LRC> RUB

4.2 Control Signals

5. Message Types

5.1 Sender (Initiator) Messages

5.2 Receiver (Responder) Messages

6. Data Transparency, Encoding, and Compression

The protocol ensures transparent data transmission, allowing any byte value to be part of the payload.

6.1 DLE Stuffing

To allow control characters (like DLE, STX, ETX) to be part of the actual data payload, DLE stuffing is used:

6.2 Shift States (7-bit Transmission with 8th Bit Indication)

Message characters are always transmitted as 7-bit ASCII characters. To represent characters that originally had their 8th bit set:

The actual bytes on the wire remain 7-bit; the DLE SI/SO sequences instruct the receiver on how to reconstruct the original 8-bit data. Example: 81H, 0FEH, 8FH, 23H becomes DLE, SI, 01H, 7EH, 0FH, DLE, SO, 23H.

6.3 Run-Length Encoding (RLE)

Repetitive character sequences in the payload (after any 8th-bit processing, but before DLE stuffing of DLE/ESC themselves) can be compressed if a character is repeated four or more times:

Example: Six consecutive spaces (" ") would be sent as: SP DLE VT 0x05 (where 0x05 is the character with value 5).

7. Checksum (LRC)

A Longitudinal Redundancy Check (LRC) is used for error detection in data packets.

8. Handshake and Flow Control

9. Termination

The sender (initiator) signals the end of the entire transmission session by sending DLE EOT. The receiver (responder) should respond with a final ACK (with its current toggle state). The NOEOT option in the SEND command can suppress the EOT after a single file if more files are to follow.

10. PCAP Capturing

For analysis, packet captures (PCAP files) can be generated by utilities implementing this protocol (e.g., oasis-utils).

302 (DLT_OASIS) was assigned for the OASIS Send/Receive Protocol.

For PCAP files, this value shall be set in the global header's network field. Pcapng defines an Interface Description Block, its LinkType must be set to this value.

10.2 Packet Data

The packet data consists of an OASIS pseudo-header plus the captured OASIS protocol message.

Pseudo-header

Field Length (bytes) Description
version 1 Set to 1.
direction byte 1 Direction, relative to capturing utility:
0x00: received from the serial port.
0x01: transmitted to the serial port.
message n The OASIS protocol message (e.g., starting DLE STX or ENQ).

11. Security Considerations

This protocol was designed for direct serial connections and does not include any intrinsic security features such as encryption or authentication. It is vulnerable to eavesdropping and data manipulation if used over insecure channels.

12. References