perm filename FTP.CMU[NET,GUE] blob sn#017833 filedate 1972-12-29 generic text, type T, neo UTF8




                     **** WARNING! ****

     This document reflects the state as of  10/31/72  of  a
changing  program.   Rely  on this at your own risk.  I will
try to keep this reasonably up to date, and inform users  of
any  changes  before  they  find  out  the hard way.  At the
present time, the only form of transfer FTP will  do  is  36
bit  image.  Since this is not the network default, ftp will
ask for permission to send  commands  to  setup  the  server
properly.    Report  problems  and  comments  to  Ric  Werme
[S430EW13] at CMU-10B.

     This file  contains  documentation  for  the  FTP  user
interface  program  developed  by Ric Werme for use until Ed
Snow writes the real thing.

     Although this document was written for people  familiar
with  the  File Transfer Protocol, lay users have had little
trouble using FTP.  A couple  words  on  the  protocol  will
improve  matters  further.   File  transfer  is  done by two
programs.  The first is this program (I will  call  it  FTP)
which  is  run  by the user and acts as an interface between
the user and network.  The second is the server end (I  will
call  it the server) which runs at the foreign site and acts
as the interface between the foreign file  system  and  FTP.
These  two  programs  communicate  through a software entity
called a 'socket'.  FTP sends ASCII messages to the  server,
which  replys  with  ASCII  messages preceded with a decimal
message code.  The decimal code is meant for FTP to look at,
and  the rest is meant for the user.  FTP will print both on
the user's TTY.

     FTP still does not handle all network errors correctly,
so  if  you have trouble making connections, use the monitor
command 'IMP CLOSE/SELF' and try again.

                    * * * COMMANDS * * *

     The FTP commands are broken  down  into  three  groups:
network control, server control, and miscellaneous.  Many of
the commands will copy data directly from  the  teletype  to
the  server,  so  one must be careful to end commands with a
carriage return.  Each command is one  character  long,  and
may or may not require an argument.

              * * NETWORK CONTROL COMMANDS * *

     The  network  control  commands  control  the   network
connection  to various hosts.  While there is no connection,
commands are prompted by a *.  While the connection is open,
the  prompt  character is !.  While in ! mode, the interface
never goes into TTY iowait, but alternately checks  for  TTY
or TELNET activity.  If a message comes over the network and

FTP USER PROGRAM DOCUMENTATION  2
Version 2.3


you have not started typing a command, that message will  be
printed and you will be prompted with another !.

                     * H is for host. *

     The host command takes a decimal argument, which is the
host  number  to  connect to.  After the connection is made,
FTP will ask if you want the default type and byte  commands
sent  (The  only mode of transfer FTP will handle is not the
ARPA default, so you should type y).  Successful  completion
puts  FTP  into  !  mode.  While in ! mode, any messages the
server sends will be printed on  the  teletype,  unless  you
have started to type a command.  (A minor bug in the monitor
causes FTP to think you have typed  something  if  you  have
backspaced  over  it,  so  be  careful.) IF THE FOREIGN SITE
CLOSES THE TELNET connections, then FTP  will  automatically
return  to * mode.  It is a condition that will not normally
occur.  Hosts with servers include all TENEX sites, Stanford
(11),  CMU-10B  (14), CMU-10A (78), MIT-AI (134), and MIT-ML
(198).
Example:
*H 11
SEND TYPE I AND BYTE 36 CMDS (Y OR CR): Y
000 WELCOME TO STANFORD'S FTP SERVER
050 PLEASE REPORT ANY PROBLEMS.......
200 TYPE OK
200 BYTE SIZE OK
!

                    * L is for local. *

     The local command sets the local socket  number  to  be
used in future connections.  It takes a decimal argument.
Example:
*L 20                         ;the initial value is 20.
*
                     *Q is for quit. *

     The Q command does different functions  depending  upon
the current prompt character.  In ! mode, it will fake a bye
command (see below) if  you  haven't  done  one,  close  the
telnet connections and return to * mode.  In * mode, it will
return to monitor mode (.  mode if you wish).  Please  don't
↑C  FTP  while  in  !  mode.   if  you  do,  it will lead to
difficulties when you reuse FTP and will hang a job  on  the
foreign host (at least if it's CMU.
Examples:
!Q
231 SEE YOU AGAIN LATER       ;only if you didn't do a B
*Q

.

FTP USER PROGRAM DOCUMENTATION  3
Version 2.3


              * * SERVER CONTROL COMMANDS * *

     All server control commands must be executed in ! mode,
since they all need to be able to output to the network.

                     * U is for user. *

     The U command should be the first server  command  used
after  making  the  TELNET  connection.   it  takes a string
argument which  it  passes  to  the  server.   This  command
identifies  yourself  to  the  server for billing and access
checking purposes.  The server currently running at  CMU  is
not  intelligent  enough  to  let  people log in under their
PPN's (it would have to read ACCT.SYS and do  other  strange
gyrations), but it will accept any PPN for use on the LPT's.
This will allow people on the  10B  to  print  on  the  Data
Products LPT and get the output under their own name.
Examples:
!U NET,GUE                    ;for places like Stanford
!U N900AR00                   ;for CMU

                   * P is for password. *

     The P command may not be necessary on all systems.   it
takes  a  string  argument  which  it  passes to the server.
According to FTP definition, after a U command you  will  be
prompted  with  a  3xx type message if you need to specify a
password, and a 2xx message if you don't.
Example:
!P ARPA

                   * R is for retrieve. *

     The R command is one  of  the  file  transfer  commands
(about  time  we're  getting to them).  It accepts a not too
PIP-like string either on either the same line or the  next.
The  format  of  this  string  is: <local filename>;<foreign
filename>.  The  foreign  filename  is  usually  called  the
pathname,  after  network  jargon.  The local filename is of
standard format,  I.E.   DEV:FILE.EXT[(PPN  OR  P,P)].   the
FILE, EXT and PPN (or P,P) must be respecified each command.
DSK will be used as the default for all R  and  S  commands.
The  command  will be aborted by FTP if it cannot create the
named file.  As the server and FTP  start  passing  data,  a
couple of messages will be printed.  The first will be a 255
command, which specifies the socket   the  server  will  use
for output.  Ignore it.  the second will be a message saying
either transfer is starting or that it  couldn't  find  that
file.   As  data  is  being  transferred,  hash marks can be
printed for each buffer transferred if desired  (see  the   
command).  Each buffer corresponds to an undetermined number
of words.  The server will send a message when  the  end  of
the  file  is found, and FTP will print transfer statistics,

FTP USER PROGRAM DOCUMENTATION  4
Version 2.3


then ask for another command.
Example: (assume connection to MIT-AI):
!R GREET;SYS;SYSTEM MAIL      ;copy MIT's greet 
                              ;(SYS;SYSTEM MAIL) to our
                              ;system as file GREET.
255 SOCK 939
250 LOOK OUT!  HERE IT COMES.
239 WORDS, 8.9 KBD
252 FINIS
!R                            ;if you type R<CR>,
FILENAME;PATHNAME LPT:;....   ;FTP reminds you of the order.

                    * S is for store. *

The S command acts just like the R command, except that  the
direction  of  data  transfer  is reversed.  Everything else
looks about the same.

                     * # is for hash? *

     The # command complements the value of the  hash  flag.
Initially  off, the # command wil cause the R and S commands
to print a # character after every buffer is transfered.

                     * B is for bye. *

     When you are done transferring files  back  and  forth,
the  B command will tell the server that you are going away.
Some servers (Stanford) will not say goodbye to  you,  since
they  expect  you  won't be listening.  Others (MIT-AI) will
send a friendly see you later message.  Since the Q  command
will now do a B, if you haven't, the B command might as well
be ignored.  (NOW he tells us!)


       * * DEBUGGING AND MISCELLANEOUS COMMANDS. * *

                * @ is for a command file. *

     The @ command takes a filename argument which  it  will
treat  as  a series of FTP commands.  The file must not have
line numbers.  Unlike  most  command  file  processors,  all
commands  will  be  echoe so you can watch it bomb.  A minor
bug: the extension will be defaulted to  CMD,  even  if  you
specify a null extension (e.g.  '@ORK.') - this may be fixed
sometime in the future.
Example:
To produce the sample run at the end of  this  listing,  one
could use this command file:
    H 11
    Y
    U NET,GUE
    R APE.LST;APE.ME[UP,DOC]

FTP USER PROGRAM DOCUMENTATION  5
Version 2.3


    B
    Q
    Q
To use it:
.R FTP
FTP.....
*@FTP.STN
*H 11.....

                     * C is for copy. *

     The C command copys everything after the C directly  to
the  server,  thus  providing a convienient way to implement
any FTP command not previously covered.
Example:
!CTYPE I                      ;tell the foreign site you
                              ;want image IO
200 TYPE OK                   ;it tells you it likes you
!

                     * D is for DDT. *

     The D command will put you into DDT,  if  it's  loaded.
What  you'll  do  there  I'm  not really sure, but I find it
handy at times.

                      * I is for ICP *

     The I command redefines which socket is to be used  for
the  ICP.   It  takes a decimal argument, like the L command
and others.

                  * X is for crosspatch? *

     The X command has even less use.  It crosspatches  your
teletype  to  the server, so anything you type goes directly
to the server without echoing.  I put it in for a  easy  way
to make a CMU TELNET connection before our server was up.


                  AN EXAMPLE OF USING FTP.

.R FTP
FTP V2.3
SEND TYPE I AND BYTE 36 CMDS (Y OR CR): Y
*H 11                         ;connect to Stanford
000 WELCOME TO STANFORD'S FTP SERVER.
!050 IMPLEMENTED COMMANDS: USER,TYPE,MODE,BYTE,RETR,STOR.
050 IMAGE TYPE ONLY AT PRESENT
050 PLEASE REPORT PROBLEMS TO RALPH GORIN (REG)
200 TYPE OK
200 BYTE SIZE OK
!U NET,GUE                    ;standard network number

FTP USER PROGRAM DOCUMENTATION  6
Version 2.3


!230 USER NUMBER OK
!R APE.LST;APE.ME[UP,DOC]     ;transfer Stanford's AP line
                              ;documentation.
255 SOCK 163
250 RETR OK, FTP TRANSFER IS BEGINNING
7968 WORDS, 7.9 KBD
252 EOF FOR DATA, US TO YOU
!B                            ;not really necessary
!Q
*Q

.                             ;back in monitor mode.