next up previous
Next: FTP Etiquette Up: The FTP Protocol Previous: Terminating the FTP Session:

The FTP Session with Protocols

Let us look at the same FTP session as in Section 4.6.4 but this time with the debug command turned on so that we can see the FTP protocol in action.

ftp> debug
Debugging on (debug=1).
ftp> open ftp.cs.cf.ac.uk
Connected to thrall.cs.cf.ac.uk.
220-************************************************************************
220- Cardiff Computer Science campus ftp access. Access is available
220- here as anonymous, by ftp group or by username/password.
220-
220- The programs and data held on this system are the property of the
220- Department of Computer Science in the University of Wales, Cardiff.
220- They are lawfully available to authorised Departmental users only.
220- Access to any data or program must be authorised by the Department
220- of Computer Science.
220- 
220- It is a criminal offence to secure unauthorised access to any programs
220- or data on this computer system or to make any unauthorised
220- modification to its contents.
220- 
220- Offenders are liable to criminal prosecution.  If you are not an
220- authorised user do not log in.
220-************************************************************************
220-
220-Cardiff University.  Department of Computer Science.
220-This is the WUSL ftp daemon.  Please report problems to
220-Robert.Evans@cs.cf.ac.uk.
220-
220 thrall.cs.cf.ac.uk FTP server (Version wu-2.6.1(1) Mon Sep 18 12:45:30 BST 2000) ready.
Name (ftp.cs.cf.ac.uk:dave): year1
---> USER year1
331 Password required for year1.
Password:
---> PASS year1ic
230-
230-Welcome to the guest ftp server for Year 1 Internet Computing
230-in the Department of Computer Science at the University of Wales, Cardiff.
230-
230-Please note that all commands and transfers from this ftp account
230-are logged and kept in an audit file.
230-
230-
230 User year1 logged in.  Access restrictions apply.
ftp> dir
---> PORT 131,251,42,151,155,230
200 PORT command successful.
---> LIST
150 Opening ASCII mode data connection for /bin/ls.
total 32
drwxrwxrwx   2 y1ftp       2048 Nov  8  1999 ex_gif
drwxrwxrwx   2 y1ftp       2048 Nov  8  1999 ex_hqx
drwxrwxrwx   2 y1ftp       2048 Nov  8  1999 ex_text
drwxrwxrwx   2 y1ftp       2048 Nov  8  1999 ex_uu
drwxrwxrwx   2 y1ftp       2048 Nov  8  1999 ex_zip
drwxr-xr-x   2 y1ftp        512 Oct 18  1999 exercise
drwxrwxr-x   2 gueftp      2048 Nov  5  1999 incoming
drwx--x--x   2 staff       1024 Nov 11  1999 marker
drwxrwxr-x   2 gueftp      2048 Nov 10  1999 test
226 Transfer complete.
489 bytes received in 0.0064 seconds (75.12 Kbytes/s)
ftp> cd exercise
---> CWD exercise
250 CWD command successful.
ftp> dir
---> PORT 131,251,42,151,155,231
200 PORT command successful.
---> LIST
150 Opening ASCII mode data connection for /bin/ls.
total 156
-rw-rw-r--   1 staff      25943 Dec  8  1997 ex.gif
-rw-rw-r--   1 staff      53104 Oct 18  1999 ex.txt
226 Transfer complete.
117 bytes received in 0.0022 seconds (52.60 Kbytes/s)
ftp> bin
---> TYPE I
200 Type set to I.
ftp> get ex.gif
---> PORT 131,251,42,151,155,232
200 PORT command successful.
---> RETR ex.gif
150 Opening BINARY mode data connection for ex.gif (25943 bytes).
226 Transfer complete.
local: ex.gif remote: ex.gif
25943 bytes received in 0.092 seconds (275.08 Kbytes/s)
ftp> prompt
Interactive mode off.
ftp> prompt
Interactive mode on.
ftp> mget *.*
---> PORT 131,251,42,151,155,233
---> TYPE A
---> NLST *.*
---> TYPE I
mget ex.gif? y
---> PORT 131,251,42,151,155,234
200 PORT command successful.
---> RETR ex.gif
150 Opening BINARY mode data connection for ex.gif (25943 bytes).
226 Transfer complete.
local: ex.gif remote: ex.gif
25943 bytes received in 0.1 seconds (252.73 Kbytes/s)
mget ex.txt? y
---> PORT 131,251,42,151,155,235
200 PORT command successful.
---> RETR ex.txt
150 Opening BINARY mode data connection for ex.txt (53104 bytes).
226 Transfer complete.
local: ex.txt remote: ex.txt
53104 bytes received in 0.17 seconds (297.91 Kbytes/s)
ftp> close
---> QUIT
221-You have transferred 104990 bytes in 3 files.
221-Total traffic for this session was 107294 bytes in 6 transfers.
221-Thank you for using the FTP service on thrall.cs.cf.ac.uk.
221 Goodbye.
ftp>

Make sure that you can pick out the different ftp PROTOCOl commands and responses and see how they relate to the ftp client commands in this output. Notice that the ftp commands and responses are only displayed when the debugging feature is turned on.



Dave Marshall
9/28/2001