File Transfer And Access

22
File Transfer And File Transfer And Access Access Chapter 26 Chapter 26 Group 3 Presentation Deepak Mittal Nishit Ranjan Venugopal Janapati Amit Palshikar Ref: Internetworking with TCP/IP Ref: Internetworking with TCP/IP by D.E.Comer by D.E.Comer

description

File Transfer And Access. Group 3 Presentation Deepak Mittal Nishit Ranjan Venugopal Janapati Amit Palshikar Ref: Internetworking with TCP/IP by D.E.Comer. Chapter 26. Introduction. FILE TRANSFER & FILE ACCESS are parts of TCP/IP suite. In this chapter -- - PowerPoint PPT Presentation

Transcript of File Transfer And Access

Page 1: File Transfer And Access

File Transfer And AccessFile Transfer And Access Chapter 26Chapter 26

Group 3 Presentation

Deepak MittalNishit Ranjan

Venugopal JanapatiAmit Palshikar

Ref: Internetworking with TCP/IP Ref: Internetworking with TCP/IP by D.E.Comerby D.E.Comer

Page 2: File Transfer And Access

IntroductionIntroduction

FILE TRANSFER & FILE ACCESS are FILE TRANSFER & FILE ACCESS are parts of TCP/IP suite.parts of TCP/IP suite.

In this chapter -- In this chapter --

Design and User Interface for these Design and User Interface for these application protocols.application protocols.

Page 3: File Transfer And Access

Designs for File Access Designs for File Access and Transferand Transfer

To lower overall costTo lower overall cost - use - 'centralized file - use - 'centralized file server' -- Users have inexpensive computers with server' -- Users have inexpensive computers with no disk space, e.g.. hand-held devices, diskless no disk space, e.g.. hand-held devices, diskless computers.computers.

To archive dataTo archive data (backup facility) -- use -- (backup facility) -- use -- 'centralized computer' - users have computers 'centralized computer' - users have computers with disk storage. with disk storage. Users send periodically, copies of files to the Users send periodically, copies of files to the backup computer. -- to recover files in case of loss backup computer. -- to recover files in case of loss at local computer.at local computer.

Ability to share dataAbility to share data across different programs, across different programs, users, sites -- to share data of a single on-line users, sites -- to share data of a single on-line database across organization.database across organization.

Page 4: File Transfer And Access

On-line Shared AccessOn-line Shared Access

file sharing : 2 types -file sharing : 2 types -

1. on-line access1. on-line access -- allowing multiple programs -- allowing multiple programs to access a single file concurrently. Changes to to access a single file concurrently. Changes to the file take immediate effect and available to all the file take immediate effect and available to all programs that access the file.programs that access the file.

2. whole-file copying2. whole-file copying -- a program gets only a -- a program gets only a local copy of the file, when accessed. If the local copy of the file, when accessed. If the program wants to modify, it makes changes and program wants to modify, it makes changes and transfers the copy of the file to the original site.transfers the copy of the file to the original site.

Page 5: File Transfer And Access

Online File Access & Online File Access & problemsproblems

-- on-line file sharing does not require a client -- on-line file sharing does not require a client program as program as a database system does.a database system does.

The operating system takes care of the remote file The operating system takes care of the remote file accessaccess as for local files. Which means the remote file as for local files. Which means the remote file system issystem is 'integrated' with local files and the file system 'integrated' with local files and the file system providesprovides 'transparent access' to the remote files.'transparent access' to the remote files.

Problems:Problems:1. If the remote machine is not working or the 1. If the remote machine is not working or the network isnetwork is down or during network congestion the program down or during network congestion the program onon the local machine does not work even though thethe local machine does not work even though the machine is working. The application becomes machine is working. The application becomes unreliable.unreliable.

Page 6: File Transfer And Access

Online File Access & Online File Access & problems...problems...

2. Implementing transparent file access is 2. Implementing transparent file access is difficult.difficult.

-- This is because of heterogeneous environment -- This is because of heterogeneous environment file file names available on one computer may not map names available on one computer may not map intointo file namespace of another.file namespace of another.

-- ownership, authorization, protection will be -- ownership, authorization, protection will be difficult todifficult to handle.handle.

-- file operations and file representations vary -- file operations and file representations vary fromfrom machine to machine and so difficult to machine to machine and so difficult to implement allimplement all operations on all filesoperations on all files

Page 7: File Transfer And Access

Whole-file Sharing by file Whole-file Sharing by file transfertransfer

-- user uses a client program to obtain a copy of -- user uses a client program to obtain a copy of the filethe file and operate on it.and operate on it.-- operation outside the file system.-- operation outside the file system.-- user provides location of the file and -- user provides location of the file and authentication toauthentication to the client program which contacts the remote the client program which contacts the remote machinemachine to request a copy of the file.to request a copy of the file.-- the remote sends the copy of the file-- the remote sends the copy of the file-- user terminates the client program-- user terminates the client program-- an application program is used to open the file.-- an application program is used to open the file.-- many computations run faster with whole-file -- many computations run faster with whole-file on theon the local machine than remote file access.local machine than remote file access.

Page 8: File Transfer And Access

Whole-file sharing by file Whole-file sharing by file transfer and problemstransfer and problems

Whole-file transfer between heterogeneous Whole-file transfer between heterogeneous machines can be difficult.machines can be difficult.-- Client and server have to agree on -- Client and server have to agree on authorizations/authorizations/ permissions and data formats.permissions and data formats.-- Different data formats make inverse -- Different data formats make inverse translationstranslations impossible.impossible.e.g.: A and B machines use different e.g.: A and B machines use different presentations for presentations for floating point numbers , text files.floating point numbers , text files. floating point numbers -- it is impossible to floating point numbers -- it is impossible to convertconvert format without losing some precision .format without losing some precision .text-- Variable-length lines in one system and text-- Variable-length lines in one system and fixed linefixed line lengths in another system - when file is lengths in another system - when file is copied tocopied to and from cause padding and lose the and from cause padding and lose the originality.originality.-- Problems like the above can be handled by FTP.-- Problems like the above can be handled by FTP.

Page 9: File Transfer And Access

FTP - The major TCP/IP file FTP - The major TCP/IP file transfer protocoltransfer protocolFTP is the most frequently used of TCP/IP FTP is the most frequently used of TCP/IP applications.applications.Earlier forms of FTP existed for ARPANET before Earlier forms of FTP existed for ARPANET before TCP/IP.TCP/IP.Features:Features: Handles authorization, naming , representation Handles authorization, naming , representation among among heterogeneous machines.heterogeneous machines. Interactive access:Interactive access: provides user-friendly provides user-friendly interfaceinterface with 'help'.with 'help'. Format representation/specification:Format representation/specification: user user cancan specify format of the data in the remote file specify format of the data in the remote file -- text or binary etc.-- text or binary etc. -- whether text files use ASCII character set -- whether text files use ASCII character set etc.etc. Authentication control:Authentication control: user has to supply user has to supply name/password to the server to request a file.name/password to the server to request a file.

Page 10: File Transfer And Access

FTP - Process ModelFTP - Process Model

Most FTP servers allow concurrent access by Most FTP servers allow concurrent access by several clients. Clients use TCP to connect to several clients. Clients use TCP to connect to server.server. - master process awaits connections- master process awaits connections - creates a slave process to handle each - creates a slave process to handle each connectionconnection - slave process accepts requests through this - slave process accepts requests through this "control connection" . "control connection" . - client’s control process and server's(slave) - client’s control process and server's(slave) control control process communicate using this connection.process communicate using this connection.

- slave then creates another connection to - slave then creates another connection to transfertransfer data - This is "data transfer connection".data - This is "data transfer connection". - The data transfer process on server (slave) - The data transfer process on server (slave) andand client communicate through this connection.client communicate through this connection.Refer: Fig 26.1 shows FTP connection between client and Refer: Fig 26.1 shows FTP connection between client and server server using TCP.using TCP.

Page 11: File Transfer And Access

FTP - Process Model…FTP - Process Model…On client sideOn client sideControl process uses control connection to Control process uses control connection to request the data file. The data transfer process request the data file. The data transfer process uses data transfer connection to receive the data.uses data transfer connection to receive the data.-- TCP is used in both connections on client and -- TCP is used in both connections on client and server server side. Control connection is alive as long as user side. Control connection is alive as long as user keepskeeps FTP session open.FTP session open.-- FTP starts a new data transfer connection for -- FTP starts a new data transfer connection for each fileeach file transfer.transfer.-- In most cases , data transfer connection and -- In most cases , data transfer connection and datadata transfer process are created whenever server transfer process are created whenever server needsneeds to send information to client.to send information to client.-- When session is ended by client control -- When session is ended by client control connection,connection, data transfer connection and the correspondingdata transfer connection and the corresponding processes terminate.processes terminate.

Page 12: File Transfer And Access

TCP port number assignmentTCP port number assignment

When does the control process create new TCP When does the control process create new TCP connection for data transfer and what port is used connection for data transfer and what port is used ??????-- Client obtains an unused port on its machine to -- Client obtains an unused port on its machine to makemake connection with data transfer process on the connection with data transfer process on the server.server.-- It creates transfer process on the client -- It creates transfer process on the client machine tomachine to listen at that port listen at that port -- Communicates the port number to the server -- Communicates the port number to the server over theover the control connection and then waits for the control connection and then waits for the server toserver to establish a TCP connection to the port.establish a TCP connection to the port.-- The data transfer process on the server uses -- The data transfer process on the server uses well-well- known port reserved for FTP data transfer --port known port reserved for FTP data transfer --port 20.20.-- When the server issues TCP ‘active open’ -- When the server issues TCP ‘active open’ request itrequest it specifies the port that will be used on the client specifies the port that will be used on the client asas well as the local portwell as the local port

Page 13: File Transfer And Access

FTP connection - propertiesFTP connection - properties

Format of data on control connectionFormat of data on control connection

TELNET network virtual terminal protocol.TELNET network virtual terminal protocol.

Why FTP connection is simpler to manage Why FTP connection is simpler to manage than TELNET connection :than TELNET connection :

FTP does not allow option negotiationFTP does not allow option negotiation FTP uses only basic NVT definition.FTP uses only basic NVT definition.

Page 14: File Transfer And Access

Using FTP - CommandsUsing FTP - Commands

invoking FTPinvoking FTP % ftp% ftpcommandscommands ftp> ‘ftp> ‘command'command'

help help commandcommand -- description and usage of the -- description and usage of the

command.command.ls -- lists the contents of remote ls -- lists the contents of remote

directorydirectorycdup -- change remote working directory cdup -- change remote working directory

to to parent directoryparent directory

bell -- beep when command completedbell -- beep when command completed

Refer page 503 for more commands.Refer page 503 for more commands.

Page 15: File Transfer And Access

Trivial File Transfer Protocol Trivial File Transfer Protocol (TFTP)(TFTP)

FTP, though most general file transfer protocol, is FTP, though most general file transfer protocol, is complex and difficult to program.complex and difficult to program.

Many applications do not need the full functionality Many applications do not need the full functionality that FTP offers, neither can they afford complexity.that FTP offers, neither can they afford complexity.

TFTP is the second file transfer protocol that offers TFTP is the second file transfer protocol that offers inexpensive and unsophisticated service.inexpensive and unsophisticated service.

TFTP is intended for applications that do not need TFTP is intended for applications that do not need complex interaction between client and server.complex interaction between client and server.

Page 16: File Transfer And Access

Trivial File Transfer Protocol Trivial File Transfer Protocol (TFTP)(TFTP)

TFTP restricts operations to simple file transfers and TFTP restricts operations to simple file transfers and does not provide authentication. Consequently the does not provide authentication. Consequently the TFTP software is much smaller than FTP.TFTP software is much smaller than FTP.

TFTP does not need a reliable stream transport TFTP does not need a reliable stream transport service. It uses UDP or other unreliable packet service. It uses UDP or other unreliable packet delivery system and uses timeout and retransmission delivery system and uses timeout and retransmission to ensure that data arrives. to ensure that data arrives.

The sender transmits a file in fixed size blocks and The sender transmits a file in fixed size blocks and awaits an acknowledgment for each block before awaits an acknowledgment for each block before sending the next one. The receiver acknowledges sending the next one. The receiver acknowledges each block upon receipt.each block upon receipt.

Page 17: File Transfer And Access

TFTP - Process ModelTFTP - Process Model

The first packet being sent requests a file The first packet being sent requests a file transfer and establishes interaction between transfer and establishes interaction between client and server.client and server.

The first packet specifies a file name and The first packet specifies a file name and whether the file will be read or written. Blocks of whether the file will be read or written. Blocks of file are numbered consecutively starting from 1.file are numbered consecutively starting from 1.

The header of each data packet specifies the The header of each data packet specifies the number of block the packet carries and each number of block the packet carries and each acknowledgment specifies the number of blocks acknowledgment specifies the number of blocks being acknowledged. being acknowledged.

Page 18: File Transfer And Access

TFTP – Process ModelTFTP – Process Model

TFTP retransmission requires both sides to TFTP retransmission requires both sides to implement timeout and retransmission.implement timeout and retransmission.

If the side sending data times out, it retransmits If the side sending data times out, it retransmits the last data block. If the receiver side times the last data block. If the receiver side times out, it retransmits the last acknowledgment.out, it retransmits the last acknowledgment.

Though this scheme guarantees robustness, it Though this scheme guarantees robustness, it can lead to a problem known as can lead to a problem known as Sorcerer’s Sorcerer’s Apprentice Bug. Apprentice Bug.

When an acknowledgment is delayed, the When an acknowledgment is delayed, the sender retransmits the data packet. The sender retransmits the data packet. The receiver again receiver again

Page 19: File Transfer And Access

sends acknowledgment for the retransmitted sends acknowledgment for the retransmitted packet. Eventually both acknowledgments packet. Eventually both acknowledgments reach the sender and for each reach the sender and for each acknowledgment, the sender transmits the acknowledgment, the sender transmits the next packet.next packet.

Thus all the subsequent packets are Thus all the subsequent packets are transmitted twice and acknowledged twice. transmitted twice and acknowledged twice.

This cycle continues indefinitely with each packet being transmitted exactly twice.

TFTP – Process ModelTFTP – Process Model

Page 20: File Transfer And Access

Network File System (NFS)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.

Page 21: File Transfer And Access

RPC and XDRRPC 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.

Page 22: File Transfer And Access

SummarySummary

Data on remote files can be accessed byData on remote files can be accessed by- Whole-file copying.- Whole-file copying.- Shared online access.- Shared online access.

FTP uses whole file copying.FTP uses whole file copying. TFTP provides a small, simple alternative to FTP TFTP provides a small, simple alternative to FTP

and so it can be used for bootstrapping diskless and so it can be used for bootstrapping diskless machines.machines.

NFS provides online shared file access. It uses NFS provides online shared file access. It uses UDP for transport and RPC & XDR mechanisms.UDP for transport and RPC & XDR mechanisms.

As RPC and XDR are defined separately from NFS, As RPC and XDR are defined separately from NFS, they can be used to build distributed applications.they can be used to build distributed applications.