RFC 683 UNKNOWN FTP · TENEX · FILE TRANSFER

FTPSRV - Tenex extension for paged files

How TENEX sites got FTP to send whole paged files, holes and all, with checksums and sequence numbers.

On rfc-editor.org ↗
PUBLISHED
April 1975
AUTHORS
R. Clements
STREAM
Legacy
BUILDS ON
RFC 354 — FTP
PAGE SIZE
512 words of 36 bits
PAGE TABLE ENTRIES
up to 2**18
HEADER WORDS AFTER THE COUNT
6
DATA PAGE NDW
1000 octal
FDB NDW
25 octal
CHUNK TYPES
0 data page, -3 FDB
DOI
10.17487/RFC0683

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
                              RFC 683, NIC 32251

                FTPSRV - TENEX FTP EXTENSIONS FOR PAGED FILES

                        R. Clements - BBN - 3 April 75





1   Introduction

    In response to a long-known need for the ability to transfer TENEX paged
files over the net via FTP, the TENEX FTP implementation has been extended.

    This implementation is an extension to the "OLD" protocol (RFC 354).  It
was built after useful discussions with Postel, Neigus, et al.  I do not mean
to imply that they agreed that this implementation is correct, nor for that
matter do I feel it is correct.  A "correct" implementation will be negotiated
and implemented in the "NEW" protocol (RFC 542), if funding ever appears for
that task.

2   The Problem(s)

    This extension attacks two separate problems: Network reliability and
TENEX disk file format's incompatibility with FTP.  A checksummed and
block-sequence-numbered transmission mode is seriously needed, in my opinion.
This mode should also allow data compression.

    It is also necessary to handle paged, holey TENEX files.  This latter
problem, seriously needed for NLS, is the motivation for the current
extension.

    The former problem requires a new MODE command, if done correctly;
probably two MODEs, to allow data compression in addition to checksumming.
Actually, I think that is the tip of an iceberg which grows as 2**N for
additional sorts of modes, so maybe some mode combination system needs to be
dreamed up.  Cf the AN, AT, AC, EN, ET, EC TYPEs.  Also, one should be able to
use MODE B and MODE C together (NEW protocol) to gain both the compression and
restart facilities if one wanted.

    The second problem, TENEX files, are probably a new kind of STRUcture.
However, it should be possible to send a paper tape to a disk file, or vice
versa, with the transfer looking like a paged file; so perhaps we are dealing
with a data representation TYPE.  This argument is a bit strained, though, so
a paged STRUcture is quite likely correct.  I admit to feeling very unsure
about what is a MODE, what is a TYPE and what is a STRUcture.

3   The (Incorrect) choices made

    Having decided that new MODEs and STRUctures were needed, I instead
implemented the whole thing as a single new TYPE.  After all, I rationalize,
checksumming the data on the network (MODE) and representing the data in the
processing system as a checksummed TYPE are really just a matter of where you
draw the imaginary line between the net and the data.  Also, a single new TYPE
command reduced the size of the surgery required on the FTP user and server
programs.

4   Implementation details

    The name of the new TYPE is "XTP".  I propose this as a standard for all
the Key Letter class of FTP commands: the "X" stands for "experimental" --
agreed on between cooperating sites.  The letter after the "X" is signed out
from the protocol deity by an implementor for a given system.  In this case,
"T" is for TENEX.  Subsequent letter(s) distinguish among possibly multiple
private values of the FTP command.  Here "P" is "Paged" type.

   TYPE XTP is only implemented for STRU F, BYTE 36, and MODE S.

    Information of TYPE XTP is transfered in chunks (I intentionally avoid the
words RECORD and BLOCK) which consist of a header and some data.  The data in
a chunk may be part of the data portion of the file being transferred, or it
may be the FDB (File Descriptor Block) associated with the file.

5   Diversion: the TENEX Disk File

    For those not familiar with the TENEX file system, a brief dissertation is
included here to make the rest of the implementation meaningful.

    A TENEX disk file consists of four things: a pathname, a page table, a
(possibly empty) set of pages, and a set of attributes.

    The pathname is specified in the RETR or STOR verb.  It includes the
directory name, file name, file name extension, and version number.

    The page table contains up to 2**18 entries.  Each entry may be EMPTY, or
may point to a page.  If it is not empty, there are also some page-specific
access bits; not all pages of a file need have the same access protection.

    A page is a contiguous set of 512 words of 36 bits each.

    The attributes of the file, in the FDB, contain such things as creation
time, write time, read time, writer's byte-size, end of file pointer, count of
reads and writes, backup system tape numbers, etc.

    NOTE: there is NO requirement that pages in the page table be contiguous.
There may be empty page table slots between occupied ones.  Also, the end of
file pointer is simply a number.  There is no requirement that it in fact
point at the "last" datum in the file. Ordinary sequential I/O calls in TENEX
will cause the end of file pointer to be left after the last datum written,
but other operations may cause it not to be so, if a particular programming
system so requires.

    In fact both of these special cases, "holey" files and end-of-file
pointers not at the end of the file, occur with NLS data files.  These files
were the motivation for the new TYPE.

6   Meanwhile, back at the implementation,...

    Each chunk of information has a header.  The first byte, which is the
first word (since TYPE XTP is only implemented for BYTE 36) of the chunk, is a
small number, currently 6, which is the number of following words which are
still in the header.  Next come those six words, and then come some data
words.

   The six header words are:
      Word 1: a checksum.
         This is a one's complement sum (magnitude and end-around carry) of
         the six header words and the following data words (but not the
         leading "6" itself).  The sum of all words including the checksum
         must come out + or - zero.
      Word 2: A sequence number.
         The first chunk is number 1, the second is number 2, etc.
      Word 3: NDW,
         the number of data words in this chunk, following the header.  Thus
         the total length of the chunk is 1 (the word containing NHEAD) +
         NHEAD +NDW.  The checksum checks all but the first of these.
      Word 4: Page number.
         If the data is a disk file page, this is the number of that page in
         the file's page map.  Empty pages (holes) in the file are simply
         not sent.  Note that a hole is NOT the same as a page of zeroes.
      Word 5: ACCESS.
         The access bits associated with the page in the file's page map.
         (This full word quantity is put into AC2 of an SPACS by the program
         reading from net to disk.)
      Word 6: TYPE.
         A code for what type of chunk this is. Currently, only type zero
         for a data page, and type -3 for an FDB are sent.

    After the header are NDW data words.  NDW is currently either 1000 octal
for a data page or 25 octal for an FDB.  Trailing zeroes in a disk file page
will soon be discarded, making NDW less than 1000 in that case.  The receiving
portions of FTP server and user will accept these shortened pages.  The sender
doesn't happen to send them that way yet.

Verification is performed such that an error is reported if either:
   The checksum fails,
   The sequence number is not correct,
   NDW is unreasonable for the given chunk type, or
   The network file ends at some point other than immediately following the
data portion of an FDB chunk.

7   Closing comments

    This FTP server and user are in operation on all the BBN systems and at
some other sites -- the user being more widely distributed since fewer sites
have made local modifications to the user process.

    I believe the issues of checksumming and sequencing should be addressed
for the "NEW" protocol.  I hope the dissertation on TENEX files has been
useful to users of other systems.  It may explain my lack of comprehension of
the "record" concept, for example.  A TENEX file is just a bunch of words
pointed to by a page table.  If those words contain CRLF's, fine -- but that
doesn't mean "record" to TENEX. I think this RFC also points out clearly that
net data transfers are implemented like the layers of an onion: some
characters are packaged into a line.  Some lines are packaged into a file.
The file is broken into other managable units for transmission.  Those units
have compression applied to them.  The units may be flagged by restart markers
(has anyone actually done that?).  The compressed units may be checksummed,
sequence numbered, date-and-time stamped, and flagged special delivery.  On
the other end, the process is reversed.  Perhaps MODE, TYPE, and STRU don't
really adequately describe the situation. This RFC was written to allow
implementors to interface with the new FTP server at TENEX sites which install
it.  It is also really a request for comments on some of these other issues.

AI ELI5

On this page
PROBLEMTENEX stores files as a page table pointing at 512-word pages, with gaps and an end-of-file pointer that can sit anywhere. FTP had no way to move such files, and the author also wanted network transfers to be checksummed.
MECHANISMA new experimental TYPE called XTP sends the file as numbered chunks. Each chunk has a six-word header (checksum, sequence number, data word count, page number, access bits, chunk type) followed by a data page or the file descriptor block.
THE CATCHIt was running on all the BBN systems and some other sites. The author calls the single-TYPE approach incorrect and hopes a proper design will be negotiated in the NEW protocol (RFC 542).

§1The Problems and the Choices Made

RFC 683 extends the "OLD" FTP protocol (RFC 354) so TENEX paged files can cross the network. The author is open that this is not necessarily the correct design: a correct one was to be negotiated in the "NEW" protocol (RFC 542), if funding appeared.

Two problems are attacked. One is network reliability: the author wants a checksummed, block-sequence-numbered mode, ideally with data compression as well. The other is that TENEX disk files do not fit FTP, which is the motivation here, because NLS data files need it.

Done properly, these would be new MODEs and a new STRUcture. Instead the author implemented everything as one new TYPE, partly because that meant less surgery on the FTP user and server programs.

The author wanted two things: a way to check that pages arrive intact, and a way to send oddly shaped files. The quickest fix was one new setting, even though he admits a tidier one might exist.

§2What a TENEX Disk File Looks Like

A TENEX file has four parts: a pathname, a page table, a possibly empty set of pages, and a set of attributes kept in the FDB (File Descriptor Block). The page table holds up to 2**18 entries. Each entry is either empty or points to a page, and each non-empty entry has its own access bits.

A page is a contiguous set of 512 words of 36 bits each. Pages need not be contiguous in the table, so a file can have empty slots between occupied ones. The end-of-file pointer is just a number and need not point at the last datum. Both of these oddities occur with NLS data files.

Imagine a notebook with some pages torn out and a bookmark that is not on the last page. To copy it faithfully you must remember which pages are missing and where the bookmark is.

§3TYPE XTP and the Chunk Format

The new TYPE is named XTP. The author proposes the pattern for all key letters: "X" means experimental (agreed between cooperating sites), the next letter is signed out to an implementor for a system ("T" for TENEX), and the rest distinguish private values ("P" for Paged). XTP is only implemented for STRU F, BYTE 36 and MODE S.

Data travels in chunks. A chunk starts with a word holding the number of header words that follow, currently 6, then those six words, then the data words. The six header words are:

  • Word 1: a one's complement checksum over the six header words and the data words; the sum including the checksum must come out plus or minus zero.
  • Word 2: a sequence number, starting at 1.
  • Word 3: NDW, the number of data words after the header.
  • Word 4: the page number in the file's page map; holes are simply not sent, and a hole is not a page of zeroes.
  • Word 5: the access bits for the page.
  • Word 6: the chunk type, currently 0 for a data page and -3 for an FDB.

NDW is 1000 octal for a data page and 25 octal for an FDB. Trailing zeroes in a page may later be dropped, and receivers accept such shortened pages.

Each page goes into an envelope with a label: a check number, a count, which page it is, and what kind of thing is inside. Pages that were never there are just not mailed.

§4Verification and Closing Comments

An error is reported if the checksum fails, if the sequence number is not correct, if NDW is unreasonable for the chunk type, or if the network file ends anywhere other than right after the data of an FDB chunk. So the FDB comes last.

The author says the FTP server and user were in operation on all the BBN systems and some other sites. He thinks checksumming and sequencing should be addressed in the NEW protocol, and describes network transfers as layers of an onion: lines, files, units, compression, restart markers, checksums. He wonders whether MODE, TYPE and STRU describe this adequately. The RFC is also a request for comments.

The receiver checks every envelope and complains if one is damaged, out of order, the wrong size, or if the mail stops before the final description of the notebook.

§5References