FTP, TFTP, and NFS

Download Report

Transcript FTP, TFTP, and NFS

FTP, TFTP, and NFS
LESSON 25
(December 1, 1995)
Daniel Z. Tabor Jr.
New Jersey Institute of Technology
Lesson 25 - (1 of 37)
Outline:
FTP, TFTP, and NFS
• File Sharing:
– On-line Access
– Whole-file Copying
– Requirements
– Version Control
• File Transfer Protocol (FTP)
• Control and Data Transfer
Connections
• Interactive Transfer System
• Anonymous FTP
• Control and Error
Information Messages
• Trivial File Transfer
Protocol (TFTP)
• Network File System:
– NFS Architecture
• Remote Procedure Call:
– Message Specification
• External Data
Representation (XDR)
Lesson 25 - (2 of 37)
File Sharing:
• Client / Server File Interaction:
– File sharing is used to reduce storage costs.
– Remote file access extends the reach of system
resources, further leveraging these costs.
– Distributed file storage and remote access
allows multiple users to work on and modify
the same file from anywhere on the network.
• There are two distinct forms of file sharing.
Lesson 25 - (3 of 37)
File Sharing:
On-line Access
• On-line access:
– Allows multiple programs to access a single file
concurrently.
– This should be integrated with local files and
access should be transparent.
• Advantage - no visible changes in the
environment.
• Disadvantage - congested networks make file
access slower.
Lesson 25 - (4 of 37)
File Sharing:
Whole-file Copying
• Whole-file copying:
– This transfer scheme requires a two-step
process in which the user first obtains a local
copy of a file and then operates on it.
– This is not integrated with the local file-system
and requires the use of a client program.
• Advantage - efficient manipulation operations.
• Disadvantage - applying updates to stored file on
server.
Lesson 25 - (5 of 37)
File Sharing:
Requirements
• Both methods of file sharing are difficult with
heterogeneous machines.
• They must agree on:
– Authorization.
– Notions of file ownership and access
protections.
– Data formats.
Lesson 25 - (6 of 37)
File Sharing:
Version Control
• Another major concern when sharing files is
version control:
– Each user may make changes either locally or
shared remotely.
– The operating system must know which user’s
changes to write first, and then notify all other
users that the file has now changed.
– This same issue plagues many different
computer science areas.
Lesson 25 - (7 of 37)
File Transfer Protocol (FTP):
• File Transfer Protocol (FTP) - is a reliable file
transfer protocol used within TCP/IP.
• It offers:
– Interactive access with a human friendly
interface.
– File format specifications (ASCII, Binary)
– Authentication Control (including login names
and passwords)
Lesson 25 - (8 of 37)
Control and
Data Transfer Connections:
• FTP allows concurrent access by multiple clients,
using the transmission control protocol.
• Slave processes are used in FTP to accept and
handle the control connection from the client.
• However, they use an additional process (or
processes) to handle the separate data transfer
connection(s) needed to send and receive files.
Lesson 25 - (9 of 37)
Image source: Internetworking with TCP/IP vol I
(1995 Prentice Hall, Douglas Comer)
Lesson 25 - (10 of 37)
Control and
Data Transfer Connections:
• Control processes and the control connection
remain alive as long as the FTP “session” is going.
• A separate data transfer connection is setup and
taken down for each file transfer.
Lesson 25 - (11 of 37)
Control and
Data Transfer Connections:
• In addition to passing user commands to the
server, FTP uses the control connection to allow
the client and server control processes to
coordinate their use of:
– Dynamically assigned TCP protocol ports.
– The creation of data transfer processes that use
those ports.
Lesson 25 - (12 of 37)
Control and
Data Transfer Connections:
• FTP uses Telnet's Network Virtual Terminal
specification when passing data across the control
connection.
• The basic definition of service is only used, no
option negotiation is allowed.
• Commonly, FTP is shown to conceptually reside
above TELNET in a layered protocols stack,
strictly for this reason.
Lesson 25 - (13 of 37)
Interactive Transfer System:
• Interactive Transfer System (client performs
operations repeatedly):
– Read a line of input.
– Parse the line to extract the command and
arguments.
– Execute the command with it’s arguments.
Lesson 25 - (14 of 37)
Anonymous FTP:
• Anonymous FTP access means the user does not
need an account or password, but can freely login
to a remote machine.
– Login name: Anonymous
– Password:
Guest or full e-mail address.
Lesson 25 - (15 of 37)
Anonymous FTP:
Terminal-Based
• When anonymously logging into a remote site via
an text-based connection, the user must explicitly
interact with the machine using a set of commands
(? from prompt).
• To download a file, the user must:
– Login and send guest password
– Select the directory the file exists in.
– Change the transfer option based on file type.
– Explicitly get the file and then exit.
Lesson 25 - (16 of 37)
Anonymous FTP:
WWW-based
• When accessing a FTP server through a web client
(Netscape), no interactive commands are needed.
• Differences between terminal and WWW access:
– No login required or file-type transfer option
setting.
– Graphical traversal of subdirectories.
– No file uploading (PUT) allowed, only GET.
– Applications can be spawned locally based on
file type transferred.
Lesson 25 - (17 of 37)
Control and Error
Information Messages:
• Control and error information messages between
the FTP client and server begin with a 3-digit
number followed by text.
– The software interprets the number.
– The text is solely meant for humans.
Lesson 25 - (18 of 37)
Control and Error
Information Messages:
• The PORT command, used by a client, reports that
a new TCP port number has been obtained for use
in a data connection.
• The port number used for this connection
increases each time a connection is made (by any
client).
• To see more detailed interaction information,
execute ftp with verbose mode on:
– ftp -d hertz.njit.edu
Lesson 25 - (19 of 37)
Trivial File Transfer
Protocol (TFTP):
• Trivial File Transfer Protocol (TFTP) - This
simple transfer protocol:
– Does not need a reliable stream transport
service (uses UDP).
– Is intended for applications that do not need
complex interactions between the client and
server.
Lesson 25 - (20 of 37)
Trivial File Transfer
Protocol (TFTP):
• TFTP:
– Restricts operations to small file transfers.
– Does not provide authentication.
– And is much smaller (software) than FTP.
Lesson 25 - (21 of 37)
TFTP:
Encoding and Transmission
• TFTP is commonly encoded in ROM (Read-Only
Memory) on workstations and is used to obtain the
initial bootstrap memory image (BOOTP).
• A TFTP transmission is symmetric (implements a
time-out and retransmission mechanism) which
helps ensure transfer will not fail after a single
packet loss.
Lesson 25 - (22 of 37)
TFTP:
Encoding and Transmission
• Sorcerer’s Apprentice Bug:
– This anomaly arises when an ACK for data
packet K is delayed, but not lost.
– It creates a cycle which continues indefinitely,
with each packet transmitted at least twice.
• TFTP supports multiple file types and can be
integrated with electronic mail.
Lesson 25 - (23 of 37)
Network File System (NFS):
• Network File System (Sun NFS):
– Provides on-line shared file access that is
transparent and integrated within operating
systems.
– NFS is usually embedded within the UNIX
operating system and is commonly referred to
NFS Mount.
– NFS refers to the complete family of products
(Sun calls it Open Network Computing).
Lesson 25 - (24 of 37)
Application
Local
File
System
Local
Disk
NFS
Client
Internet Connection
to NFS Server
Lesson 25 - (25 of 37)
Network File System (NFS):
• NFS has been extended from UNIX to allow PCs
to access other computers using PC-NFS.
• NFS provides a resource-sharing network system
with similar features to Novell Netware or
Microsoft LAN Manager.
Lesson 25 - (26 of 37)
Network File System (NFS):
• The major difference is that NFS bases the major
part of its functionality on the native O.S.
available on the server hosts.
• NFS is not proprietary, yet is just as if not more
powerful than commercial resource-sharing
systems.
• NFS is usually implemented over TCP/IP, but is
not exclusive to it.
Lesson 25 - (27 of 37)
NFS Architecture:
• NFS is made up of three layers:
– RPC - which defines the format of messages
used by remote procedure calls.
– XDR - the eXternal Data Representation is a
consistent representation of data between
different machine architectures.
– NFS - the Network File System is an application
interface for file transfer, access, and
management.
Lesson 25 - (28 of 37)
Network File System (NFS):
NFS
XDR
RPC
UDP
TCP
IP
Data Link
Physical
Lesson 25 - (29 of 37)
NFS Architecture:
• The functionality of the layers maps very closely
to the OSI functionality available in its equivalent
layers (application, presentation, session).
• The operation of NFS is based on a stateless
relationship between the client and server.
• NFS uses UDP and fixed retransmission time-outs
to provide a low consistent delay over local area
networks.
Lesson 25 - (30 of 37)
Remote Procedure Call (RPC):
• Remote Procedure Calls (RPC):
– These are general purpose remote execution
mechanisms which hide all details of lowerlevel protocol use.
– They are used (in part) to implement NFS and
other client / server programs.
– RPC is used in realizing distributed computing
systems.
Lesson 25 - (31 of 37)
Remote Procedure Call (RPC):
• RPC and distributed computing has the ability to
reduce the amount of data transferred across a
network, especially where databases are
concerned.
• The RPC protocol sends messages over the
network to handle transactions, verification, and
authorization.
Lesson 25 - (32 of 37)
RPC Message Specification:
• Transaction ID
• Call / Response
• RPC Protocol Version
Number
• Program Number:
– Portmapper
– NFS
– Mountd
– Rstatd
• Program Version
Procedure Number
• Authorization
Information:
– User ID
– Group ID
– UNIX Machine Name
• Authorization Verification
• Procedure Call Parameters
Lesson 25 - (33 of 37)
External Data Representation (XDR):
• External Data Representation (XDR):
– Provides a way to pass data among
heterogeneous machines without the need for
conversion routines.
• A program using XDR must know (in advance)
what type of data to expect and provision for it
accordingly.
• In an OSI system, each value is labeled with its
type and size.
Lesson 25 - (34 of 37)
External Data Representation (XDR):
• XDR defines data in multiples of four bytes (32bits), which is a definition of how the data should
formed before network transmission.
• An NFS client formats data based on XDR so an
NFS server will translate data into the form
understood by the destination computer.
• UNIX and PC operating systems use the
combination of NFS, RPC, and XDR to provide
distributed system features.
Lesson 25 - (35 of 37)
Questions
FTP, TFTP, and NFS
• Name equivalent OSI layer protocols to those
found in NFS (NFS, RPC, XDR).
• How do FTP and Trivial FTP differ? In what
ways?
• What part of the Telnet protocol does FTP borrow
or use?
• Why are two end-to-end connections required to
transfer a single file? Could it be done with one?
• How do WWW browsers shield an end-user from
Lesson 25 - (36 of 37)
having to specify a file type to download?
Reference Materials
FTP, TFTP, and NFS
• RFC 959: File Transfer Protocol - FTP
(http://www.cis.ohio-state.edu/htbin/rfc/rfc959.html)
• PC-NFS: Product Home Page
(http://www.intergraph.com/nfs/nfs_ovr.htm)
• Protocols used in the World-Wide Web:
(http://www.w3.org/hypertext/WWW/Protocols/RelevantProtocols.html)
• Internet Information: Quick Reference
(http://www.kme-lab.co.jp/internet/resource.html)
• RFC 1350: TFTP PROTOCOL (REVISION 2)
(http://www.cis.ohio-state.edu/htbin/rfc/rfc1350.html)
Lesson 25 - (37 of 37)