You are on page 1of 25

PART XXV APPLICATIONS: FILE TRANSFER AND ACCESS (FTP, TFTP, NFS)

Internetworking With TCP/IP vol 1 -- Part 25

2005

On-Line File Sharing


d Always a popular application d Two basic paradigms
Whole-le copying Piecewise le access

d Piecewise access mechanism


Opaque: application uses special facilities to access remote le Transparent: application uses same facilities to access local and remote les

Internetworking With TCP/IP vol 1 -- Part 25

2005

File Transfer
d Whole le copying d Client
Contacts server Species le Species transfer direction

Server Maintains set of les on local disk Waits for contact Honors request from client

Internetworking With TCP/IP vol 1 -- Part 25

2005

File Transfer Protocol (FTP)


d Major TCP/IP protocol for whole-le copying d Uses TCP for transport d Features
Interactive access Format specication (ASCII or EBCDIC) Authentication control (login and password)

Internetworking With TCP/IP vol 1 -- Part 25

2005

FTP Process Model


client system
data transfer control process

server system
control process data transfer

client data connection


operating system

client control connection server control connection

server data connection


operating system

TCP/IP internet

d Separate processes handle


Interaction with user Individual transfer requests
5
2005

Internetworking With TCP/IP vol 1 -- Part 25

FTPs Use of TCP Connections

Data transfer connections and the data transfer processes that use them can be created dynamically when needed, but the control connection persists throughout a session. Once the control connection disappears, the session is terminated and the software at both ends terminates all data transfer processes.

Internetworking With TCP/IP vol 1 -- Part 25

2005

Control Connection Vs. Data Connection


d For data transfer, client side becomes server and server side becomes client d Client
Creates process to handle data transfer Allocates port and sends number to server over control connection Process waits for contact

d Server
Receives request Creates process to handle data transfer Process contacts client-side
7
2005

Internetworking With TCP/IP vol 1 -- Part 25

performance
s

s s

Il client apre la connessione TCP di controllo con il server; aperta la connessione, invia la richiesta di trasferimento del file su questo canale. Il server quindi apre una separata connessione TCP per trasferirvi il file. Per aprire ogni connessione si richiede un round-trip time di 1 RTT. x 1/2 RTT perch la richiesta giunga al server, e un altro 1/2 RTT perch la risposta torni indietro, oltre al tempo di trasmissione del file. Tempo complessivo per una transazione FTP:
1 RTT control-channel OPEN 0.5 RTT send request on control-channel 1 RTT file-channel OPEN 0.5 RTT file starts to arrive on file-channel Ftrans time to transmit the file -------3 RTT + Ftrans = time to get the first file in FTP

AA 2009-2010

32

modello grafico-temporale
s

consente di evidenziare, in termini di pacchetti inviati, le caratteristiche del: protocollo applicativo protocollo di trasporto 1. connesso vs non connesso meccanismi di trasmissione 1. slowstart vs trasmissione vorace

1. 2.

3.

calcolo del troughput in termini di RTT


AA 2009-2010
35

Schema trasferimento primo file


In rosso le interazioni con il control channel in blu quelle sul canale per il trasferimento file

slow start ...

AA 2009-2010

33

Schema trasferimento file seguente


Il control channel (in rosso) gi aperto. Il server ricevuta la richiesta apre il canale per il trasferimento (in blu)

slow start ...


0.5 RTT send request on control-channel 1 RTT file-channel OPEN 0.5 RTT file starts to arrive on file-channel Ftrans time to transmit the file -------2 RTT + Ftrans = time to get subsequent files

AA 2009-2010

34

Question For Discussion


d What special relationship is required between FTP and NAT?

Internetworking With TCP/IP vol 1 -- Part 25

2005

Interactive Use Of FTP


d Initially a command-line interface
User invokes client and species remote server User logs in and enters password User issues series of requests User closes connection Most FTP initiated through browser User enters URL or clicks on link Browser uses FTP to contact remote server and obtain list of les User selects le for download

d Currently

Internetworking With TCP/IP vol 1 -- Part 25

2005

Anonymous FTP
d Login anonymous d Password guest d Used for open FTP site (where all les are publicly available d Typically used by browsers

Internetworking With TCP/IP vol 1 -- Part 25

10

2005

Secure File Transfer Protocols


d Secure Sockets Layer FTP (SSL-FTP)
Uses secure sockets layer technology All transfers are condential

d Secure File Transfer Program (sftp)


Almost nothing in common with FTP Uses ssh tunnel

d Secure Copy (scp)


Derivative of Unix remote copy (rcp) Uses ssh tunnel

Internetworking With TCP/IP vol 1 -- Part 25

11

2005

Trivial File Transfer Protocol (TFTP)


d Alternative to FTP d Whole-le copying d Not as much functionality as FTP d Code is much smaller d Intended for use on Local Area Network d Runs over UDP d Diskless machine can use to obtain image at bootstrap

Internetworking With TCP/IP vol 1 -- Part 25

12

2005

TFTP Packet Types


2-octet opcode READ REQ. (1) 2-octet opcode WRITE REQ. (2) 2-octet opcode DATA (3) 2-octet opcode ACK (4) 2-octet opcode ERROR (5) n octets FILENAME n octets FILENAME 2 octets BLOCK # 2 octets BLOCK # 2 octets ERROR CODE n octets ERROR MESSAGE 1 octet 0 1 octet 0 1 octet 0 n octets MODE n octets MODE up to 512 octets DATA OCTETS... 1 octet 0 1 octet 0

Internetworking With TCP/IP vol 1 -- Part 25

13

2005

TFTP Retransmission
d Symmetric (both sides implement timeout and retransmission) d Data block is request for ACK d ACK is request for next data block

Internetworking With TCP/IP vol 1 -- Part 25

14

2005

Sorcerers Apprentice Bug


d Consequence of symmetric retransmission d Duplicate packet is perceived as second request, which generates another transmission d Duplicate response triggers duplicate packets from the other end d Cycle continues

Internetworking With TCP/IP vol 1 -- Part 25

15

2005

ritrasmissione simmetrica?

sorcerers apprentice bug

AA 2009-2010

37

Network File System (NFS)


d Protocol for le access, not copying d Developed by Sun Microsystems, now part of TCP/IP standards d Transparent (application cannot tell that le is remote)

Internetworking With TCP/IP vol 1 -- Part 25

16

2005

NFS Implementation

application

local / remote decision

local file system

NFS client

local disk

network connection to NFS server

Internetworking With TCP/IP vol 1 -- Part 25

17

2005

Remote Procedure Call (RPC)


d Also developed by Sun Microsystems, now part of TCP/IP standards d Used in implementation of NFS d Relies on eXternal Data Representation (XDR) standard for conversion of data items between heterogeneous computers

Internetworking With TCP/IP vol 1 -- Part 25

18

2005

Summary
d Two paradigms for remote le sharing
Whole le copying Piecewise le access

d File Transfer Protocol (FTP)


Standard protocol for le copying Separate TCP connection for each data transfer Client and server roles reversed for data connection

d Examples of secure alternatives to FTP


SSL-FTP, sftp, and scp

Internetworking With TCP/IP vol 1 -- Part 25

19

2005

Summary
(continued)
d Trivial File Transfer Protocol (TFTP)
Alternative to FTP that uses UDP Symmetric retransmission scheme Packet duplication can result in Sorcerers Apprentice problem

d Network File System (NFS)


Standard protocol for piecewise le access Uses RPC and XDR

Internetworking With TCP/IP vol 1 -- Part 25

20

2005

You might also like