File Transfer on the Internet Trivial File Transfer Protocol TFTP File Transfer Protocol FTP - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

File Transfer on the Internet Trivial File Transfer Protocol TFTP File Transfer Protocol FTP

Description:

Used to transfer a file to/from remote host. Intended to be used when ... Client browses remote directory by sending commands over control connection. ... – PowerPoint PPT presentation

Number of Views:945
Avg rating:3.0/5.0
Slides: 9
Provided by: larry310
Category:

less

Transcript and Presenter's Notes

Title: File Transfer on the Internet Trivial File Transfer Protocol TFTP File Transfer Protocol FTP


1
File Transfer on the InternetTrivial File
Transfer Protocol (TFTP)File Transfer Protocol
(FTP)
2
TFTP Trivial file transfer protocol
LAN
file transfer
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
1
M
8
2
1
N
20
IP Header
UDP Header
Opcode (1RRQ) (2WRQ)
filename
mode
0
0
2
0-512
  • Mode
  • ASCII Each line ends with CRLF
  • octet binary

Opcode (3data)
block number
data
2
block number
Opcode (4ACK)
N
2
Opcode (5error)
error number
Error message
0
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
file transfer
user at host
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.
  • 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 Cant 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
Write a Comment
User Comments (0)
About PowerShow.com