Chapter 31 File Transfer & Remote File Access (NFS)

Download Report

Transcript Chapter 31 File Transfer & Remote File Access (NFS)

Chapter 31 File Transfer &
Remote File Access (NFS)
File Transfer Protocol (FTP)

A file transfer service that can move a copy
of a file from one computer to another,
either interactively or in batch mode
FTP Commands (fig 31.1)

Open, close
 Cd, lcd, pwd
 Ls, dir
 Prompt, binary
 Get, mget *
 Put, mput *
 quit
Anonymous FTP

Used for public access of data files
 Username “anonymous”
 No password required
Client-Server Interaction in
FTP

When user runs ftp and opens a connection to a
remote computer, the FTP client that uses TCP to
create a control connection to an FTP server.
 client and server use the FTP protocol when they
communicate across the control connection.
 user’s keystrokes are not passed directly to the
server; instead, they are interpreted by the client.
If interaction with server is needed, the client
sends a request using the FTP protocol
Control and Data Connections
A ‘control connection’ is used only to send commands
and receive responses. Server listens on TCP port 21.
 A separate ‘data connection’ is created prior to each file
transfer and closed at end of each file transfer. FTP client,
acting as server, listens on port 20 (fig 31.2).
 Having separate connections for transfer and control:

– helps make ftp protocol simpler and makes implementation
easier since data and FTP commands are not mixed together
– allows controls to be passed during middle of a file transfer,
allowing files to be aborted easily
– allows sender and receiver to use EOF condition on the data
connection to indicate end of file.
Trivial File Transfer Protocol
(TFTP)





uses UDP instead of TCP
small set of commands
only supports file transfer
does not use password authentication: file can be
transferred only if the file allows global access
useful for bootstrapping a hardware device that is
diskless or has no non-volatile memory to store
operating system.
– With minimal amount of ROM holding TFTP, UDP,
and IP software, a device can broadcast a TFTP request
across network for its binary operating system file.
Network File System(NFS)







designed for remote file access in TCP/IP networks
more efficient than FTP for reading or writing part of a file
stored remotely.
reduces network bandwidth requirements.
allows an application to open a remote file, move to a
specified position in the file, and read ore write data
starting at that position.
To append a file using NFS, the client sends the data to be
appended to the server, and the server updates the file and
returns an acknowledgement.
NFS allows shared file access. Multiple clients using NFS
client software can access a file on an NFS server.
Uses remote procedure calls (RPC)