.ps 60,64
.t3A55B       FTP-Transferring Files Across the Network
3A55B#####################################################Page#1
##########################################################Sep 80
.st                                                           Sep 80
.nap
.s10
.c64
FTP - TRANSFERRING FILES ACROSS THE ICF NETWORK
.s3
.nf
.s2
                       CONTENTS                            page	
.s2
1##BACKGROUND  .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..  2
.s
2##IMPLEMENTATION  . .. .. .. .. .. .. .. .. .. .. .. .. ..  2
.s
3##REQUESTING A TRANSFER   .. .. .. .. .. .. .. .. .. .. ..  2
.s
4##THE FTP PROGRAM   .. .. .. .. .. .. .. .. .. .. .. .. ..  3
.s
5##EXAMPLES  . .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..  5
.s
6##REQUIREMENTS FOR OTHER HOSTS ON SERCNET   .. .. .. .. ..  5
.s
7##FILE ACCESS PERMISSION  .. .. .. .. .. .. .. .. .. .. ..  7
.s
8##INTERROGATING THE QUEUES   .. .. .. .. .. .. .. .. .. ..  9
.s
9##KILLING A REQUEST  . .. .. .. .. .. .. .. .. .. .. .. ..  9
.s
10#LISTING AVAILABLE HOSTS  . .. .. .. .. .. .. .. .. .. .. 10
.s
11#LOG OF TRANSFERS  .. .. .. .. .. .. .. .. .. .. .. .. .. 10
.s
12#REFERENCES AND FURTHER READING . .. .. .. .. .. .. .. .. 10
.pg
.f
.lm4
.i-4
1.  BACKGROUND
.s2
FTP stands for File Transfer Protocol, a protocol designed to be
network independent.
It is implemented on the DEC-10 and allows the transfer of files
between two DEC-10's networked together via DECNET.
.s
With the advent of the DECNET/SERCNET gateway (2) it becomes
possible to transfer files across both networks to similar FTP 
processes on SERCNET hosts.
.s
The version of FTP described here will be replaced later by a 
more comprehensive system  which will allow multiple transfers 
and will be integrated into the Galaxy spooling system. 
It will appear on the DEC-10 in 1981.
.s2
.tp10
.i-4
2.  IMPLEMENTATION
.s2
This protocol has been implemented on the Edinburgh DEC-10 as a spooling
system with requests for transfers being generated by a monitor command called
FTP.
These requests are subsequently processed by a spooler called FTPSPL which is
run as an operator job.
It communicates with a similar job on the destination machine.
These spoolers handle the actual transfer and check the validity of access to
the specified files.
A note that the transfer has occurred is sent to each user involved through a
log file, FTP.LOG, in their directory (see 9 below).
There is no possibility of file security being breached, as each user is able
to control who has permission to read or write files in their directory and to
limit the type of access allowed (see 7 below).
.s
In general files may be transferred between any DEC-10 on SERCNET and any other
SERCNET host which supports FTP.
.s2
.tp10
.i-4
3.  REQUESTING A TRANSFER
.s2
Note: It is necessary to read this section carefully because the default
conditions are designed to ensure maximum file security across the network.
Thus it may be necessary to specify various switch settings, in order not to be
caught by file protection errors.
.s
The preliminary conditions necessary for a successful transfer are as follows:
.s
.lm11
.i-2
- That the user has sufficient knowledge of the nature of the remote computer's
filestore, namely, the format of file names, and whether a user identity (eg:
user name, number or PPN and password etc).
.s
.i-2
- That appropriate access permission has been granted to the submitter by the
sender and recipient of the file(s) to be transferred (see section 7).
If the submitter of the request is either the sender or recipient of the file,
full access permission is assumed.
.s
.i-2
- That the user is aware of the meaning and default settings of the ACCESS and
DELETE switches (see below in this section).
.lm4
.s2
.tp10
.i-4
4.  THE FTP PROGRAM
.s
This is run by issuing the monitor command FTP with arguments as follows:
.s
#####_.FTP#DESTINATION__SPEC/SWITCH1/SWITCH2/...
.br
#########################= SOURCE__SPEC/SWITCH1/SWITCH2/...
.s
.tp10
DESTINATION__SPEC and SOURCE__SPEC are specified as NODE__FILESPEC;
.s
NODE is the unabbreviated node name of the source or destination 
computer, if no node name is given the current host is assumed.
.b
FILESPEC for a DEC-10  may be the full DEC-10 file specification, eg:
.s
#####ERCC__DSKA:FOO.TXT[100,101]
.s
If no directory specification is given, one's own area is used and if 
no destination file name is given then the source file name is used.
.s
FILESPEC for any other computer is a full file specification which
will be recognised by that computer's filestore and takes no
default values.
.s
To read a file from another machine the source (input file) side of the 
FTP commands should refer to that file. 
To write a file to another machine the destination (output file) side 
of the FTP command should refer to that file.
.s
SWITCHES have the general form: /SWITCH:ARGUMENT, these arguments 
are described in detail in Section 4 but a brief description of the switch 
functions follows:
.s
.nf
#####HELP      type a list of the options available
#####LIST      list the FTP queue of requests,
               submitted on this machine
#####KILL:xxxx remove the given request from the queue
               (xxxx is the sequence no of the request)
#####NODES     type a list of the hosts which FTP
               recognises
.f
.s
.lm4
Switches associated with the DESTINATION__SPEC are PASSWORD and ACCESS:
.s
.f
.lm18
.i-9
PASSWORD has as its argument the FTP password for the output file.
The passwords on the DEC-10 are not those used by LOGIN but 
special ones for FTP which are kept in a SWITCH.INI file in the same 
directory as the destination file (see section 7). 
The meaning of the password on other hosts varies from system to system 
(see section 6).
The password switch may be omitted; in which case the program will 
prompt the user later for the password if it is required.
.s
.i-9
ACCESS###has the following permitted arguments which control access 
to the files:
.s
.nf
CREATE  - create a new file only ( default)
WRITE   - replace an existing file only
CWRITE  - create or replace an existing file
APPEND  - append to an already existing file
CAPPEND - create or append to an existing file
SUBMIT  - enter file into the machine's batch
##########queue
PRINT   - spool file to the specified output
##########device (default for device "LPT" and 
##########"PLT")
.f
.s
.lm4
Switches associated with the SOURCE__SPEC are PASSWORD and
DELETE;
.s
.lm18
.i-9
PASSWORD#has as its argument the FTP password 
in the SWITCH.INI file in the same directory as the source file
(see section 6).
.s
.i-9
DELETE###relates to the deletion of the source file; 
it has three possible arguments:
.tp10
.s
.nf
NEVER  - do not delete ( default).
AFTER  - if deletion is to take place after
#########the transfer.
DURING - if deletion is to take place at the .
#########same time.
.f
.s
Deletion after the transfer will only result if
the transfer is successful.
.lm4
.f
.s
The defaults for ACCESS and DELETE may be overridden by the 
submitter of a request. 
The submitter's SWITCH.INI file may contain a line for FTP
giving the required switches. eg:
.s
#####FTP/ACCESS:CWRITE/DELETE:AFTER
.s
in a user's SWITCH.INI file would mean that every time 
a request was submitted
without giving an ACCESS or DELETE switch the defaults taken would be
CWRITE and AFTER respectively.
.s2
.tp10
.i-4
5.  Examples
.s
5.1 A user [72,15] on the ERCC DEC-10 typing:
.nf
.s
#####_.FTP =UMIST__FRED.TXT[66,21]
.s
would generate a request with the defaults set as follows:
.s
#####ERCC__FRED.TXT[72,15]/ACCESS:CREATE =
#####       UMIST__FRED.TXT[66,21]/DELETE:NEVER
.f
.s
Also the user would be prompted for the password for UMIST_[66,21], but
not for the file on his/her own area.
.s
5.2 The same user typing:
.s
.nf
#####_.FTP UMIST__JOHN.EXE[66,21]/ACC:WRITE=
                    JANE.EXE[27,14]/PASS:xyz
.s
would generate the request:
.s
#####UMIST__JOHN.EXE[66,21]/ACCESS:WRITE =
#####       ERCC__JANE.EXE[27,14]/PASSWORD:xyz/DELETE:NEVER
.s
.f
and would be asked for the password for UMIST__[66,21].
.s
5.3 To print a file on the UMIST line printer the user would type:
.nf
.s
#####._FTP UMIST__LPT02:=FRED.LST/DEL:AFTER
.s
this would generate the request:
.s
#####UMIST__LPT02:FRED.LST/ACCESS:PRINT =
#####      ERCC__FRED.LST[72,15]/DELETE:AFTER
.f
.s
and no passwords would be required, being inappropriate for a line printer.
.s2
.tp10
.i-4
6.  REQUIREMENTS FOR OTHER HOSTS ON SERCNET
.s2
6.1 Introduction
.s
For each type of host on SERCNET, the DEC-10 FTP prompts for the necessary
information required for that machine. The user has only to provide the
right values for each argument.
.s
The arguments required from both the DEC-10 and the other machine in
question are given below.
.s
Note that in the examples the computer prompts are in lower case and the
users replies are in upper case.
Text including and to the right of the ';' is comment only.
.s
6.2 GEC 4000 series 
.s
Transfers to and from these machines require a filename, a username and
sometimes a password, eg:
.s2
.nf
_.FTP RLGAF__=JONAH.DAT                 ;send a file to the
                                      ;RL GEC machine 'A'
GEC filename or <cr> for device for RLGAF__ : .XYZ ;give file
GEC login name for RLGAF__   :SMITH    ;and username
GEC login password for RLGAF__   :<cr> ;user has no password
GEC account name for RLGAF__     :<cr> ;default to username
.f
.s
For transferring files from a GEC to the DEC-10, a filename, a GEC user
name and the appropriate DEC-10 FTP password must be given:
.s
.nf
ready                                  ;GEC prompt
TRANSFER                               ;FTP transfer command
TRANSFER process for MAFS, version 4   ;title from GEC
remote computer?
NET.EDXAF                              ;the ERCC DEC-10
local filename? (null implies a device)
_.XYZ                                   ;the file name
remote filename? (null implies a device)
JONAH.DAT[72,15]                       ;the ERCC filename
remote username?
<cr>               ;defaults to the GEC username
remote password? (this is not echoed)
MYPASS             ;the DEC-10 FTP password on [72,15]
local username?
STOP               ;do not prompt for any more arguments
options? (default is SEND, MAKE or APPEND)
FETCH              ;read the file from the DEC-10 to the GEC
.F
.s
For a full description of the TRANSFER facility on the ICF GEC MUMS see the
OS4000 Reference Manual.(3)
.s
.tp10
6.3 The IBM 360/195 at Rutherford (called RLIAF) 
.s
Transfers to and from this machine require the user identifier (ID) and user
account name. 
In addition, it should be noted that file transfers to and from RLIAF only
work for OS datasets.
Attempts to transfer ELECTRIC datasets will fail.
.s
When transferring to RLIAF, it should be noted that access can either be for
normal file transfer or for submission of batch jobs. 
See reference (1) for a description of the format of file to send to the HASP
system.
An example might be:
.s
.nf
_.FTP RLIAF__=IBMFOR.TXT                ;send a job to the IBM
                                      ;batch system at RL
Dataset name for RLIAF__    : OCT.10*RGD   
                                   ;not needed for batch job
IBM ID. (2 chars) for RLIAF__    : ID        ;give the ID
IBM account (4 chars) for RLIAF__    : 1234  ;give a/c name
.f
.s
.s
When transferring from the IBM to the DECsystem-10, it should be remembered
that although the ID and account name are both prompted for, the account
name is not echoed.
An example might be:
.s
.nf
     _.FTP ERCC__IBMFOR.TXT=RLIAF__OCT.10*RGD        
     IBM ID. (2 chars) for RLIAF__OCT.10*RGD  : ID
     IBM account (4 chars) for RLIAF__OCT.10*RGD     :
.s
     EXIT
.s
.f
At present it is only possible to initiate transfers to and from the IBM
from another host and not from the IBM itself.
.s
6.4 PRIME machines 
.s
Transfers to and from these machines require a filename, a username and 
sometimes a password, eg:
.s2
.nf
_.FTP RLPBF__=JONES.DAT                    ;send a file to the
                                         ;RL PRIME machine B
PRIME filename for RLPBF__   : __ABCD      ;give suitable name
PRIME login name for RLPBF__   :SMITH     ;and username
PRIME login password for RLPBF__  :XYZ    ;user password
.f
.s
For transferring files from a PRIME to the DEC-10, a filename, a PRIME account
name and the appropriate DEC-10 FTP password must be given.
.s
.nf
ok,                                     ;PRIME prompt
FTP                                     ;FTP command
ftp v.6.4: default parameters(without passwords):
remote site = rlpa  local treepath = ......>     ;FTP header
> SITE EDXA                             ;specify ERCC DEC-10
> REMOTE username password              ;DEC-10 username and
                                        ;FTP password
> ACCOUNT accountname                   ;PRIME account name
.s
then either:
.s
> SEND __ABCD JONES.DAT[72,15]    ;send file __ABCD to DEC-10
.s
or:
.s
> FETCH JONES.DAT[72,15] __ABCD   ;get file __ABCD from DEC-10
>QUIT                            ;return to command level
.f
.s
For a full description of the PRIME FTP facility on the ICF PRIME MUMS see the
PRIME Reference Manual.(4)
.s2
.tp10
.i-4
7.  FILE ACCESS PERMISSION
.s2
Access to files in a DEC-10's directory is determined either by an FTP entry in a SWITCH.INI
file in that directory or by the standard DEC-10 file and UFD
protection system if no FTP entry is given in SWITCH.INI.
.s
The  access in SWITCH.INI is governed by the setting of two switches :
PASSWORD and USERS:
.s
.lm18
.i-9
PASSWORD#takes as a value, up to 12 alphanumeric characters 
A password is needed by anyone other than the user who wishes to read
or write in the users area.
.s
.i-9
USERS####specifies those who may access your directory and what type of 
access they may have. 
Its value is a list of other users, and access key letters, separated by
commas and enclosed in round brackets.
.b
DEC-10 users are specified by node name and project-programmer 
number, which may include wild project or programmer numbers.
.s
SERCNET users are specified either by their SERCNET title or the global
name 'GATEWAY' and the user name or user identifier, or '*' for all users.
.s
The access key letters may be a subset of the following:
.s
.nf
#####R - read
#####D - delete after read
#####C - create new files
#####W - write - replace old versions
#####A - append
#####* - all of the above
.i-18
.s
.lm4
eg: 
.s
#####/USERS:(ERCC__[100,*]=*,GATEWAY__SMITH=RWC,GATEWAY__*=CW)
.s
.f
Two or more USERS switches maybe used but in the absence of any,
no access privileges are assumed.
.s
.lm4
When attempting to read or write a file, if no SWITCH.INI file is found,
or PASSWORD and USERS switches are not present then the 
'all-other-users' field of the directory and file protection codes 
are used to determine access permission.
.s
A typical SWITCH.INI file might look as follows:
.nf
.s
#####LOGIN/DSKFUL:PAUSE/PAGE
#####FTP/PASS:friends/USERS:(UMIST__[100,*]=
                         RC,UMIST__[*,*]=R,GATEWAY__*=RCW)
#####FTP/ACCESS:CWRITE/DELETE:AFTER
.f
.s
This would allow anybody logged on to UMIST with project number 100
to read files from this directory and create new files, anybody 
else from UMIST to read them only and all users on a host on SERCNET 
(excluding the UMIST DEC-10) to read, create and write files.
For security reasons, it is important that the user  should protect 
his/her SWITCH.INI file against being read by unauthorised persons.
.s
Where the /USERS switch is used, the scan stops once a match
is found for a node and user. 
Therefore, in the above example, access for user UMIST__[100,100]
would be RC and not R.
It is therefore neccesary to specify individual users before wild
specifications in the list.
.s
The other two FTP switch settings in the example above are redefining
the default settings for /ACCESS and /DELETE.
.s2
.tp10
.i-4
8.  INTERROGATING THE QUEUES
.s2
The FTP command, if given on its own or with the /LIST switch, will 
list the queue of files waiting transfer to or from the Edinburgh 
DEC-10 but not those queued on any other machine. 
For example if the queues are interrogated after the previous 
example transfers have been requested the output would look as follows:
.nf
.s
.tp10
_.FTP/L
.s
  Seq#     User          Destination             Source
.s
*UMI168#[72,15]##ERCC__FRED.TXT[72,15]=UMIST__FRED.TXT[66,21]
 UMI653#[72,15]##UMIST__JOHN.EXE[66,21]=ERCC__JANE.EXE[27,14]
 UMI358#[72,15]##UMIST__LPT02:FRED.LST=ERCC__FRED.LST[72,15]
 RLG446#[72,15]##RLGAF__.XYZ=ERCC__JONAH.DAT[72,15]
 RLI465#[72,15]##RLIAF__OCT.IDFRED=ERCC__IBMFOR.TXT[72,15]
 RLP284#[72,15]##RLPBF____ABCD=ERCC__JONES.DAT[72,15]
.s
Where * indicates the job being transferred
.f
.s2
.tp10
.i-4
9.  KILLING A REQUEST
.s2
A file transfer request may be removed from the queue by appending 
the switch KILL to the FTP command.
This switch takes as its value the sequence
number given when the queue is listed. A request can only be killed
by the submitter of the request or by the operator.  Thus to kill
the second request shown in Section 4 above, one would type:
.nf
.s
#####_.FTP/KILL:UMI653
.s
the system would respond:
.s
#####Killed
.f
.s2
.tp10
.i-4
10. LISTING AVAILABLE HOSTS
.s
The switch NODES appended to an FTP command will cause the current 
set of hosts which offer an FTP service to be displayed at the 
terminal eg:
.s
#####_.FTP/NODES
.s
#####List of nodes to which file transfer is possible
.nf
#####Node    type    node    type    node    type
#####UMIST   DEC10   ERCC    DEC10   YORKF   DEC10
#####KELVIN  DEC10   IBMTST  IBM     IBM     IBM
#####NEGAF   GEC     BRGAF   GEC     RLGCF   GEC
#######.
#######.
#######.
#######.
.f
.s2
.tp10
.i-4
11. LOG OF TRANSFERS
.s2
A note of each transfer which has taken place is left in a log file 
FTP.LOG in the directory of the submitter of the request, and in the 
source and destination directories. 
The log includes an indication of whether or not the transfer was 
successful and if not, why it failed. 
Thus it is possible to keep track of who has been reading files 
from your directory and why a transfer to your directory failed.
.s
A log file for ERCC__[72,15] after the requests shown in section 8
had been proccessed would looks as follows:
.s
.nf
12:45:56  10-Apr-79
<<RECEIVING<< FRED.TXT[72,15] from UMIST__FRED.TXT[66,21]
  for user ERCC__[72,15] Unsuccessful - file already exists.
13:23:45  10-Apr-79
>>SENDING>> JANE.EXE[27,14] to UMIST__JOHN.EXE[66,21]
  for user ERCC__[72,15] Success
15:14:23  10-Apr-79
>>SENDING>> FRED.LST[72,15] to UMIST__LPT02:FRED.LST
  for user ERCC__[72,15] Success  queueing file succeeded
10:24:54  14-Jul-80
>>SENDING>> JONAH.DAT[72,15] to RLGAF__.XYZ
 for user ERCC__[72,15] Success
11:04:05  15-Jul-80
>>SENDING>> IBMFOR.TXT[72,15] to RLIAF__
 for user ERCC__[72,15] Success
11:05:16  14-Jul-80
>>SENDING>> JONES.DAT[72,15] to RLPBF____ABCD
 for user ERCC__[72,15] Success
.f
.s2
.s2
.tp10
.i-4
12. REFERENCES AND FURTHER READING
.s2
References.
.s
.f
.lm9
.i-5
(1)##3A55A - Submitting IBM Jobs From the DECsystem-10
.s
.i-5
(2)##3A55C - The DECsystem-10 Network Gateway
.s
.i-5
(3)##OS4000 Reference Manual - Interactive Computing Facility.
Rutherford Laboratory, Chilton, Didcot, Oxon. OX11 0QX.
.s
.i-5
(4)##PRIME Reference Manual - Interactive Computing Facility.
Rutherford Laboratory, Chilton, Didcot, Oxon. OX11 0QX.
.s
.i-5
Further Reading.
.s
.i-5
(5)##A Network Independent File Transfer Protocol,
High Level Protocol Group - EPSS Liaison Group. Dec 77
