You are on page 1of 25

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

)

Internetworking With TCP/IP vol 1 -- Part 25

1

2005

On-Line File Sharing
d Always a popular application d Two basic paradigms
– – Whole-file copying Piecewise file access

d Piecewise access mechanism
– – Opaque: application uses special facilities to access remote file Transparent: application uses same facilities to access local and remote files

Internetworking With TCP/IP vol 1 -- Part 25

2

2005

File Transfer d Whole file copying d Client – – – – Contacts server Specifies file Specifies transfer direction Server – – – Maintains set of files on local disk Waits for contact Honors request from client Internetworking With TCP/IP vol 1 -.Part 25 3 2005 .

File Transfer Protocol (FTP) d Major TCP/IP protocol for whole-file copying d Uses TCP for transport d Features – – – Interactive access Format specification (ASCII or EBCDIC) Authentication control (login and password) Internetworking With TCP/IP vol 1 -.Part 25 4 2005 .

Part 25 .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 -.

but the control connection persists throughout a session.FTP’s Use of TCP Connections Data transfer connections and the data transfer processes that use them can be created dynamically when needed. Internetworking With TCP/IP vol 1 -. the session is terminated and the software at both ends terminates all data transfer processes. Once the control connection disappears.Part 25 6 2005 .

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 .Control Connection Vs. Data Connection d For data transfer.

oltre al tempo di trasmissione del file. invia la richiesta di trasferimento del file su questo canale. x 1/2 RTT perché la richiesta giunga al server.performance s s s s Il client apre la connessione TCP di controllo con il server. Per aprire ogni connessione si richiede un round-trip time di 1 RTT. aperta la connessione.5 RTT send request on control-channel 1 RTT file-channel OPEN 0. e un altro 1/2 RTT perché la risposta torni indietro. Tempo complessivo per una transazione FTP: 1 RTT control-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 . Il server quindi apre una separata connessione TCP per trasferirvi il file.

in termini di pacchetti inviati. le caratteristiche del: protocollo applicativo protocollo di trasporto 1. slowstart vs trasmissione vorace 1. 3. calcolo del troughput in termini di RTT AA 2009-2010 35 . connesso vs non connesso meccanismi di trasmissione 1.modello grafico-temporale s consente di evidenziare. 2.

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 ...

..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 . 0. Il server ricevuta la richiesta apre il canale per il trasferimento (in blu) slow start .Schema trasferimento file seguente Il control channel (in rosso) è già aperto.

Question For Discussion d What special relationship is required between FTP and NAT? Internetworking With TCP/IP vol 1 -.Part 25 8 2005 .

Part 25 9 2005 .Interactive Use Of FTP d Initially a command-line interface – – – – – – – – User invokes client and specifies 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 files User selects file for download d Currently Internetworking With TCP/IP vol 1 -.

Part 25 10 2005 .Anonymous FTP d Login anonymous d Password guest d Used for ‘‘open’’ FTP site (where all files are publicly available d Typically used by browsers Internetworking With TCP/IP vol 1 -.

Secure File Transfer Protocols d Secure Sockets Layer FTP (SSL-FTP) – – Uses secure sockets layer technology All transfers are confidential 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-file 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 .

. 1 octet 0 1 octet 0 Internetworking With TCP/IP vol 1 -.Part 25 13 2005 . (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.TFTP Packet Types 2-octet opcode READ REQ.. (1) 2-octet opcode WRITE REQ.

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 .

Sorcerer’s Apprentice Bug d Consequence of symmetric retransmission d Duplicate packet is perceived as second request.Part 25 15 2005 . which generates another transmission d Duplicate response triggers duplicate packets from the other end d Cycle continues Internetworking With TCP/IP vol 1 -.

ritrasmissione simmetrica? sorcerer’s apprentice bug AA 2009-2010 37 .

Network File System (NFS) d Protocol for file access. now part of TCP/IP standards d Transparent (application cannot tell that file is remote) Internetworking With TCP/IP vol 1 -.Part 25 16 2005 . not copying d Developed by Sun Microsystems.

Part 25 17 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 -.

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 .

and scp Internetworking With TCP/IP vol 1 -. sftp.Part 25 19 2005 .Summary d Two paradigms for remote file sharing – – Whole file copying Piecewise file access d File Transfer Protocol (FTP) – – – Standard protocol for file 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.

Summary (continued) d Trivial File Transfer Protocol (TFTP) – – – Alternative to FTP that uses UDP Symmetric retransmission scheme Packet duplication can result in Sorcerer’s Apprentice problem d Network File System (NFS) – – Standard protocol for piecewise file access Uses RPC and XDR Internetworking With TCP/IP vol 1 -.Part 25 20 2005 .