Transcript Chapter 26t

Chapter 26
File Transfer And Access
Group 3 Presentation
Deepak Mittal
Nishit Ranjan
Venugopal Janapati
Amit Palshikar
Ref: Internetworking with TCP/IP
by D.E.Comer
Introduction
FILE TRANSFER & FILE ACCESS are parts
of TCP/IP suite.
In this chapter -Design and User Interface for these
application protocols.
Designs for File Access and
Transfer
To lower overall cost - use - 'centralized file
server' -- Users have inexpensive computers with no disk
space, e.g.. hand-held devices, diskless computers.

To
archive data (backup facility) -- use -'centralized computer' - users have computers with disk
storage.
Users send periodically, copies of files to the backup
computer. -- to recover files in case of loss at local
computer.
Ability
to share data across different programs, users,
sites -- to share data of a single on-line database across
organization.
On-line Shared Access
file sharing : 2 types 1. on-line access -- allowing multiple programs to
access a single file concurrently. Changes to the file take
immediate effect and available to all programs that
access the file.
2. whole-file copying -- a program gets only a local
copy of the file, when accessed. If the program wants to
modify, it makes changes and transfers the copy of the
file to the original site.
Online File Access & problems
-- on-line file sharing does not require a client program as
a database system does.
The operating system takes care of the remote file access
as for local files. Which means the remote file system is
'integrated' with local files and the file system provides
'transparent access' to the remote files.
Problems:
1. If the remote machine is not working or the network is
down or during network congestion the program on
the local machine does not work even though the
machine is working. The application becomes unreliable.
Online File Access & problems...
2. Implementing transparent file access is difficult.
-- This is because of heterogeneous environment file
names available on one computer may not map into
file namespace of another.
-- ownership, authorization, protection will be difficult to
handle.
-- file operations and file representations vary from
machine to machine and so difficult to implement all
operations on all files
Whole-file Sharing by file transfer
-- user uses a client program to obtain a copy of the file
and operate on it.
-- operation outside the file system.
-- user provides location of the file and authentication to
the client program which contacts the remote machine
to request a copy of the file.
-- the remote sends the copy of the file
-- user terminates the client program
-- an application program is used to open the file.
-- many computations run faster with whole-file on the
local machine than remote file access.
Whole-file sharing by file transfer
and problems
Whole-file transfer between heterogeneous machines can
be difficult.
-- Client and server have to agree on authorizations/
permissions and data formats.
-- Different data formats make inverse translations
impossible.
e.g.: A and B machines use different presentations for
floating point numbers , text files.
floating point numbers -- it is impossible to convert
format without losing some precision .
text-- Variable-length lines in one system and fixed line
lengths in another system - when file is copied to
and from cause padding and lose the originality.
-- Problems like the above can be handled by FTP.
FTP - The major TCP/IP file
transfer protocol
FTP is the most frequently used of TCP/IP applications.
Earlier forms of FTP existed for ARPANET before TCP/IP.
Features:
 Handles authorization, naming , representation
among
heterogeneous machines.
 Interactive access: provides user-friendly interface
with 'help'.
 Format representation/specification: user can
 specify format of the data in the remote file
-- text or binary etc.
-- whether text files use ASCII character set etc.
 Authentication control: user has to supply
name/password to the server to request a file.
FTP - Process Model
Most FTP servers allow concurrent access by several
clients. Clients use TCP to connect to server.
- master process awaits connections
- creates a slave process to handle each connection
- slave process accepts requests through this
"control connection" .
- client’s control process and server's(slave) control
process communicate using this connection.
- slave then creates another connection to transfer
data - This is "data transfer connection".
- The data transfer process on server (slave) and
client communicate through this connection.
Refer: Fig 26.1 shows FTP connection between client and server
using TCP.
FTP - Process Model…
On client side
Control process uses control connection to request the
data file. The data transfer process uses data transfer
connection to receive the data.
-- TCP is used in both connections on client and server
side. Control connection is alive as long as user keeps
FTP session open.
-- FTP starts a new data transfer connection for each file
transfer.
-- In most cases , data transfer connection and data
transfer process are created whenever server needs
to send information to client.
-- When session is ended by client control connection,
data transfer connection and the corresponding
processes terminate.
TCP port number assignment
When does the control process create new TCP
connection for data transfer and what port is used ???
-- Client obtains an unused port on its machine to make
connection with data transfer process on the server.
-- It creates transfer process on the client machine to
listen at that port
-- Communicates the port number to the server over the
control connection and then waits for the server to
establish a TCP connection to the port.
-- The data transfer process on the server uses wellknown port reserved for FTP data transfer --port 20.
-- When the server issues TCP ‘active open’ request it
specifies the port that will be used on the client as
well as the local port
FTP connection - properties
Format of data on control connection
TELNET network virtual terminal protocol.
Why FTP connection is simpler to manage than
TELNET connection :


FTP does not allow option negotiation
FTP uses only basic NVT definition.
Using FTP - Commands
invoking FTP
% ftp
commands
ftp> ‘command'
help command
-- description and usage of the command.
ls
-- lists the contents of remote directory
cdup -- change remote working directory to
parent directory
bell
-- beep when command completed
Refer page 503 for more commands.
Trivial File Transfer Protocol (TFTP)

FTP, though most general file transfer protocol, is
complex and difficult to program.

Many applications do not need the full functionality
that FTP offers, neither can they afford complexity.

TFTP is the second file transfer protocol that offers
inexpensive and unsophisticated service.

TFTP is intended for applications that do not need
complex interaction between client and server.
Trivial File Transfer Protocol (TFTP)

TFTP restricts operations to simple file transfers
and does not provide authentication. Consequently
the TFTP software is much smaller than FTP.

TFTP does not need a reliable stream transport
service. It uses UDP or other unreliable packet
delivery system and uses timeout and
retransmission to ensure that data arrives.

The sender transmits a file in fixed size blocks and
awaits an acknowledgment for each block before
sending the next one. The receiver acknowledges
each block upon receipt.
TFTP - Process Model

The first packet being sent requests a file transfer
and establishes interaction between client and
server.

The first packet specifies a file name and whether
the file will be read or written. Blocks of file are
numbered consecutively starting from 1.

The header of each data packet specifies the
number of block the packet carries and each
acknowledgment specifies the number of blocks
being acknowledged.
TFTP – Process Model

TFTP retransmission requires both sides to
implement timeout and retransmission.

If the side sending data times out, it retransmits
the last data block. If the receiver side times out, it
retransmits the last acknowledgment.

Though this scheme guarantees robustness, it can
lead to a problem known as Sorcerer’s Apprentice
Bug.

When an acknowledgment is delayed, the sender
retransmits the data packet. The receiver again
TFTP – Process Model
sends acknowledgment for the retransmitted
packet. Eventually both acknowledgments reach
the sender and for each acknowledgment, the
sender transmits the next packet.

Thus all the subsequent packets are transmitted
twice and acknowledged twice.

This cycle continues indefinitely with each packet
being transmitted exactly twice.
Network File System (NFS)

NFS provides on-line shared file access that is
transparent and integrated.

When an application program executes, it calls the
operating system to open a file, or to store and
retrieve data in files.

The operating system accepts the request and
passes it to either the local file system software or
to the NFS client. The client software uses NFS
protocol to contact appropriate server on a remote
machine and performs requested operation.
RPC and XDR

NFS protocol consists three independent pieces.
- the NFS protocol itself
- RPC mechanism
- eXternal Data Representation (XDR)

RPC and XDR provide mechanisms that can be
used to build distributed programs.

XDR provides a way to pass data among
heterogeneous machines without need for
conversion among the hardware data
representation.
Summary





Data on remote files can be accessed by
- Whole-file copying.
- Shared online access.
FTP uses whole file copying.
TFTP provides a small, simple alternative to FTP
and so it can be used for bootstrapping diskless
machines.
NFS provides online shared file access. It uses UDP
for transport and RPC & XDR mechanisms.
As RPC and XDR are defined separately from NFS,
they can be used to build distributed applications.