PART XXV APPLICATIONS: FILE TRANSFER AND ACCESS (FTP, TFTP, NFS) Internetworking With TCP/IP vol 1 -- Part 25 1 2005
On-Line File Sharing Always a popular application Two basic paraigms Whole-file copying Piecewise file access Piecewise access mechanism Opaque: application uses special facilities to access remote file Transparent: application uses same facilities to access local an remote files Internetworking With TCP/IP vol 1 -- Part 25 2 2005
File Transfer Whole file copying Client Contacts server Specifies file Specifies transfer irection Server Maintains set of files on local isk Waits for contact Honors request from client Internetworking With TCP/IP vol 1 -- Part 25 3 2005
File Transfer Protocol (FTP) Major TCP/IP protocol for whole-file copying Uses TCP for transport Features Interactive access Format specification (ASCII or EBCDIC) Authentication control (login an passwor) Internetworking With TCP/IP vol 1 -- Part 25 4 2005
FTP Process Moel client system server system client ata connection ata transfer operating system control process client control connection server control connection control process operating system ata transfer server ata connection TCP/IP internet Separate processes hanle Interaction with user Iniviual transfer requests Internetworking With TCP/IP vol 1 -- Part 25 5 2005
FTP s Use of TCP Connections Data transfer connections an the ata transfer processes that use them can be create ynamically when neee, but the control connection persists throughout a session. Once the control connection isappears, the session is terminate an the software at both ens terminates all ata transfer processes. Internetworking With TCP/IP vol 1 -- Part 25 6 2005
Control Connection Vs. Data Connection For ata transfer, client sie becomes server an server sie becomes client Client Creates process to hanle ata transfer Allocates port an sens number to server over control connection Process waits for contact Server Receives request Creates process to hanle ata transfer Process contacts client-sie Internetworking With TCP/IP vol 1 -- Part 25 7 2005
performance Il client apre la connessione TCP i controllo con il server; aperta la connessione, invia la richiesta i trasferimento el file su questo canale. Il server quini apre una separata connessione TCP per trasferirvi il file. Per aprire ogni connessione si richiee un roun-trip time i 1 RTT. 1/2 RTT perché la richiesta giunga al server, e un altro 1/2 RTT perché la risposta torni inietro, oltre al tempo i trasmissione el file. Tempo complessivo per una transazione FTP: AA 2009-2010 1 RTT control-channel OPEN 0.5 RTT sen 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 32
moello grafico-temporale consente i evienziare, in termini i pacchetti inviati, le caratteristiche el: 1. protocollo applicativo 2. protocollo i trasporto 1. connesso vs non connesso 3. meccanismi i trasmissione 1. slowstart vs trasmissione vorace calcolo el troughput in termini i 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 sen 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 What special relationship is require between FTP an NAT? Internetworking With TCP/IP vol 1 -- Part 25 8 2005
Interactive Use Of FTP Initially a comman-line interface User invokes client an specifies remote server User logs in an enters passwor User issues series of requests User closes connection Currently Most FTP initiate through browser User enters URL or clicks on link Browser uses FTP to contact remote server an obtain list of files User selects file for ownloa Internetworking With TCP/IP vol 1 -- Part 25 9 2005
Anonymous FTP Login anonymous Passwor guest Use for open FTP site (where all files are publicly available Typically use by browsers Internetworking With TCP/IP vol 1 -- Part 25 10 2005
Secure File Transfer Protocols Secure Sockets Layer FTP (SSL-FTP) Uses secure sockets layer technology All transfers are confiential Secure File Transfer Program (sftp) Almost nothing in common with FTP Uses ssh tunnel 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) Alternative to FTP Whole-file copying Not as much functionality as FTP Coe is much smaller Intene for use on Local Area Network Runs over UDP Diskless machine can use to obtain image at bootstrap Internetworking With TCP/IP vol 1 -- Part 25 12 2005
TFTP Packet Types 2-octet opcoe n octets 1 octet n octets 1 octet READ REQ. (1) FILENAME 0 MODE 0 2-octet opcoe n octets 1 octet n octets 1 octet WRITE REQ. (2) FILENAME 0 MODE 0 2-octet opcoe 2 octets up to 512 octets DATA (3) BLOCK # DATA OCTETS... 2-octet opcoe 2 octets ACK (4) BLOCK # 2-octet opcoe 2 octets n octets 1 octet ERROR (5) ERROR CODE ERROR MESSAGE 0 Internetworking With TCP/IP vol 1 -- Part 25 13 2005
TFTP Retransmission Symmetric (both sies implement timeout an retransmission) Data block is request for ACK ACK is request for next ata block Internetworking With TCP/IP vol 1 -- Part 25 14 2005
Sorcerer s Apprentice Bug Consequence of symmetric retransmission Duplicate packet is perceive as secon request, which generates another transmission Duplicate response triggers uplicate packets from the other en Cycle continues Internetworking With TCP/IP vol 1 -- Part 25 15 2005
ritrasmissione simmetrica? sorcerer s apprentice bug AA 2009-2010 37
Network File System (NFS) Protocol for file access, not copying Develope by Sun Microsystems, now part of TCP/IP stanars Transparent (application cannot tell that file is remote) Internetworking With TCP/IP vol 1 -- Part 25 16 2005
NFS Implementation application local / remote ecision local file system NFS client local isk network connection to NFS server Internetworking With TCP/IP vol 1 -- Part 25 17 2005
Remote Proceure Call (RPC) Also evelope by Sun Microsystems, now part of TCP/IP stanars Use in implementation of NFS Relies on external Data Representation (XDR) stanar for conversion of ata items between heterogeneous computers Internetworking With TCP/IP vol 1 -- Part 25 18 2005
Summary Two paraigms for remote file sharing Whole file copying Piecewise file access File Transfer Protocol (FTP) Stanar protocol for file copying Separate TCP connection for each ata transfer Client an server roles reverse for ata connection Examples of secure alternatives to FTP SSL-FTP, sftp, an scp Internetworking With TCP/IP vol 1 -- Part 25 19 2005
Summary (continue) Trivial File Transfer Protocol (TFTP) Alternative to FTP that uses UDP Symmetric retransmission scheme Packet uplication can result in Sorcerer s Apprentice problem Network File System (NFS) Stanar protocol for piecewise file access Uses RPC an XDR Internetworking With TCP/IP vol 1 -- Part 25 20 2005