FTP and File Transfer

FTP is a protocol used for transfering complete files across IP networks.

Entities

Diagram: ftp client/server | FTP proto | TCP | IP | ...

client -  GUI, CLI, web browser
server - ftp daemon
FTP proto - commands and data for authentication, type of exchange, managing interation, exchanging files

Separate control and data transfer connections are used.

Server

Usually concurrent due to potentially long service times.

Separate control and data connections (both built on TCP), usually two separate processes.

The control connection manages the interaction with the client. It remains in place.

The data connections are created and used as needed for each file transfer.

Server listens on port 21 for control connection requests.

To set up a data transfer connection, the server creates a socket on port 20, listening for connection from a specific port on the client. The client tells the server this port number when it makes the transfer request. This is a good example of a selective receive (by IP and port).

Client

Manages interaction with user and communication with server.

Many commands, most never used. Some handy:

get
put
prompt
mkdir
binary
cd
chmod
delete
lcd
ls
mget, mput
user

FTP control protocol

A subset of the commands defined for TELNET.  Some important commands are:
PORT
USER
ABOR
Responses are 3 digits, followed by explanatory text (ignored by client and server but handy for humans).

Authentication

Handled by having a login/password on the machine on which the ftp daemon is running.

Anonymous access, limited visibility of files.