FTP - Towson University

Download Report

Transcript FTP - Towson University

File Transfer & Access
(FTP, TFTP, NFS)
Chapter 25
File Access & Transfer
Many network systems provide file access
on remote machines

Lots of designs; each optimized for some goals
Lower overall cost; use centralized file server
Data archive
Data sharing by multiple users, programs or sites
On-line Shared Access
Two distinct forms of file sharing

On-line access
Multiple programs can access single file concurrently
Changes take affect immediately; available to all

Whole-file copying
Program obtains local copy to access a file
Often used for read-only data
If must be modified, changed copy is transferred back
File sharing is usually easy to use


Advantage: no change to application programs
Disadvantages may be less obvious
Network/Remote machine down: application may not work
Remote could be overloaded or network congested
Application appears unreliable
Implementing integrated, transparent access
may be difficult



File names may be hard to map
Mechanism must handle notions of ownership,
authorization, and access protection
Different file representations may make it difficult or
impossible to implement all operations on all files
Sharing by File Transfer
Alternative to transparent, integrated, online access



User obtains local copy; operates on the copy
Transfer mechanism not integrated w/file system
Special client program used to transfer files
Specify remote machine & any login information
Client contacts server and asks for copy of file
After transfer, user terminates client

Have efficient usage of file once have copy
Whole-file transfer can be difficult

Client & server must agree on:
Ownership, protection, authorization, data format

Exact detail of differences in representation
techniques depends on the systems involved
Information can be lost during translations
FTP – File Transfer Protocol
The major TCP/IP file transfer software
File transfer one of most used TCP/IP
applications



Accounts for much network traffic
Early ARPANET transfer protocols evolved into
current standard
Other functions offered beyond file transfer:
Interactive interface with remote server
File format specification
Authentication control
FTP Process Model
FTP servers allow concurrent access by
multiple clients


Clients use TCP to connect
Have usual master/slave functions
Except, slave not perform all necessary computation


Slave handles control connection from the client
Carries commands telling which file to transfer
Separate processes handle data transfer connection
Also uses TCP as the transport protocol
Figure 25.1
TCP Port Number Assignment
Multiple connections require multiple ports

Control connection:
Client: random, locally assigned port
Server: uses well-known port (21)

For data transfer:
Client: unused port; server process: FTP data transfer port (20)
Server cannot accept connection from any process
 Control connection used to communicate port number
 Client control process gets port for data transfer; creates
transfer process to listen; sends number to server over
control connection; waits for server to connect to the port

Use NVT protocol for data on the control connection
Anonymous FTP
FTP contains access authorization facilities


Strict enforcement keeps arbitrary users away
Anonymous FTP used to access public files
Client does not need an account or password
Uses login name of anonymous; password guest
Have access, but only to public files
ftp> open ftp.cs.purdue.edu
Connected to lucan.cs.purdue.edu.
220 lucan.cs.purdue.edu FTP server (Version wu-2.6.2(1) Mon Feb 28 15:45:56 EST
2005) ready.
User (lucan.cs.purdue.edu:(none)): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230230Purdue University
230Department of Computer Sciences
230230- Access is allowed all day. Local time is Thu Aug 3 12:46:43 2006.
230230- All transfers are logged with your host name and email address.
230- If you don't like this policy, disconnect now!
230230- If your FTP client crashes or hangs shortly after login, try using a
230- dash (-) as the first character of your password. This will turn off
230- the informational messages which may be confusing your ftp client.
230230- Report any problems to [email protected]
230230 User ftp logged in. Access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 14
drwx-----2 0
0
512 Jan 17 2001 OLD
d--x--s--x
2 0
0
512 Jun 15 2000 bin
d--x--s--x
2 0
0
512 Jun 15 2000 dev
d--x--s--x
3 0
0
512 Apr 3 1997
d--x--s--x
2 0
0
512 Jun 15 2000 lib
drwxr-sr-x 57 0
0
1024 May 2 14:00 pub
d--x--s--x
2 0
0
512 Apr 3 1997 usr
226 Transfer complete.
ftp> help
Commands may be abbreviated.
Commands are:
!
debug
mdir
put
size
$
dir
mget
pwd
status
account
direct
mkdir
quit
struct
append
disconnect
mls
quote
system
ascii
form
mode
recv
sunique
bell
get
modtime
reget
tenex
binary
glob
mput
rstatus
trace
bye
hash
newer
rhelp
type
case
help
nmap
rename
user
cd
idle
nlist
reset
umask
cdup
image
ntrans
restart
verbose
chmod
lcd
open
rmdir
win
close
ls
prompt
runique
?
cr
macdef
proxy
send
delete
mdelete
sendport
site
ftp> quit
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 1476 bytes in 1 transfers.
221-Thank you for using the FTP service on lucan.cs.purdue.edu.
221 Goodbye.
TFTP
FTP is the most general file transfer
protocol in the TCP/IP suite



Also most complex & difficult to program
Many applications do not need full functionality
Has second file transfer protocol
Provides inexpensive, unsophisticated service
Trivial File Transfer Protocol (TFTP)
Intended for applications with less complex
interactions between the client and the server
Secure File Transfer
Original FTP has password mechanism

Password and data are unencrypted
Other protocols have added security

Secure Sockets Layer FTP (SSL-FTP)
Uses secure socket mechanism

Secure File Transfer Program (sftp)
Alternative to FTP; uses SSH tunnel

Secure Copy (scp)
Uses same syntax as Unix copy command
Uses SSH
Summary
Two forms of remote data access


Whole-file copying
Shared on-line access
FTP uses whole-file copying


Provides transfer and user interface facilities
TFTP provides simple alternative for FTP
Are secure alternatives to FTP