Network Working Group R. Braden
Request for Comment: 468 UCLA/CCN
NIC: 14742 March 8, 1973
FTP DATA COMPRESSION
I. INTRODUCTION
APOLOGIA
Braden [Page 1]
RFC 468 FTP Data Compression March 1973
Let us consider only simple linear compression schemes, such as the one proposed here. By linear, I mean that the CPU time to examine a source record is proportional to number of bytes in the record. A simple linear scheme could detect repeated single characters, for example. One could imagine quadratic schemes, which detected repeated substrings; but except for possible special circumstance where the source stings have some structure known to the compression algorithm, the CPU economics don't favor quadratic compression.
Braden [Page 2]
RFC 468 FTP Data Compression March 1973
However, certain details of the HASP bit formats are inappropriate or sub-optimal for FTP. Therefore, our proposal for compressed mode of FTP is only an adaptation of the HASP compression scheme.
n bytes of data
/--------/\--------\
1 B-1 / B B \
+---+------+ +--------+ +--------+
Byte String: | 0 | n | | d |. . .| d |
| | | | 1 | | n |
+---+------+ +--------+ +--------+
String of n data bytes d(1),...,d(n)
Count n must be positive
2 B-2 B
+----+------+ +---------+
Replicated Byte: | 1 0| n | | d |
+----+------+ +---------+
String consisting of n replications of the data byte d
2 B-2
+----+------+
Filler String: | 1 1| n |
+----+------+
String of n filler bytes. The filler byte is a "space"
character for ASCII or EBCDIC type, or a binary zero byte for Image or Local Byte Type.
B B
+----------+ +----------+
Control Escape Sequence: | 0......0 | | C | (see below)
+----------+ +----------+
Braden [Page 3]
RFC 468 FTP Data Compression March 1973
The control byte "C" which is the second byte of a control escape sequence is to have the same coding as the descriptor byte in Block Mode. This includes end-of-file and end-of-record indications. I will not specify this further because there is some question at present about the exact coding of the Block Mode descriptor byte.
Braden [Page 4]
RFC 468 FTP Data Compression March 1973
APPENDIX A: HASP MULTILEAVING
Braden [Page 5]
RFC 468 FTP Data Compression March 1973
(1) "Conversational" transmission line protocol using transparency (DLE STX, etc.).
Braden [Page 6]
RFC 468 FTP Data Compression March 1973
8
+---------+
End of Record: | 0 ... 0 |
+---------+
2 6 8 8
+---+---------+ +-------+ +--------+
Data String: |1 1| N | | d | ... | d |
| | | | 1 | | N |
+---+---------+ +-------+ +--------+
3 5
+---+--------+
N Duplicate Blanks |100| N |
+---+--------+
3 5 8
+---+---------+ +---------+
N Replicated Characters D |101| N | | D |
+---+---------+ +---------+
HASP is concerned only with 8-bit bytes. However, there is a provision (which was never implemented) in the Multileaving Protocol to set the unit of the counts N as 1 byte, 2 bytes, or 4 bytes.