Presentation is loading. Please wait.

Presentation is loading. Please wait.

TFTP: Trivial file transfer protocol

Similar presentations


Presentation on theme: "TFTP: Trivial file transfer protocol"— Presentation transcript:

1 File Transfer on the Internet Trivial File Transfer Protocol (TFTP) File Transfer Protocol (FTP)

2 TFTP: Trivial file transfer protocol
LAN file transfer TFTP server TFTP client TFTP client remote file system Used to transfer a file to/from remote host Intended to be used when bootstrapping diskless systems with BOOTP or DHCP System Components TFTP Server – UDP port 69 TFTP Client TFTP Protocol

3 TFTP Commands Mode IP Header UDP Header
20 8 2 N 1 M 1 IP Header UDP Header Opcode (1=RRQ) (2=WRQ) filename mode 2 0-512 Mode ASCII: Each line ends with CRLF octet: binary Opcode (3=data) block number data 2 Opcode (4=ACK) block number 2 N Opcode (5=error) error number Error message

4 TFTP File Transfer Employs a “stop-and-wait” protocol
Server sends a block, waits for ACK, then sends the next block Server must to handle duplicate/lost packets. EOF: When the client receives a block that has less than 512 bytes, it knows this is the last block.

5 FTP: the file transfer protocol
user interface client file transfer FTP server user at host local file system remote file system Problem: Want to transfer file to/from remote host System Components FTP Server – TCP port 21 FTP Client FTP Protocol -- RFC 959

6 FTP: separate control, data connections
FTP client contacts FTP server at port 21, specifying TCP as transport protocol Client obtains authorization over control connection Client browses remote directory by sending commands over control connection. When server receives a command for a file transfer, the server opens a TCP data connection to client Uses the Port command After transferring one file, server closes connection. FTP client server TCP control connection port 21 TCP data connection port 20 Server opens a second TCP data connection to transfer another file. Control connection: “out of band” FTP server maintains “state”: current directory, earlier authentication

7 FTP commands, responses
Sample commands: sent as ASCII text over control channel USER username PASS password LIST return list of file in current directory CWD change current directory RETR filename retrieves (gets) file STOR filename stores (puts) file onto remote host PORT n1,n2,n3,n4,n5,n6 QUIT Sample return codes status code and phrase 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file

8 Example: RETRieving a file
Client Server SYN SYN + ACK ACK 220 FTP server ready USER cakinlar 331 Password required PASS cakinlar 230 User cakinlar logged in PORT 127,0,0,1,4,150 220 PORT command successful RETR a.c 150 Opening ASCII mode connection … Server opens a TCP connection to port 1174 of the client and transfers the data over the this data channel 226 Transfer complete


Download ppt "TFTP: Trivial file transfer protocol"

Similar presentations


Ads by Google