Skip to main content

Short note: FTP

Short answer

FTP is a TCP-based protocol for transferring files using a control connection on port 21 and a data connection on port 20. It requires authentication but sends passwords in plain text, so SFTP or FTPS are recommended.

Write a short note on FTP (File Transfer Protocol).

FTP (File Transfer Protocol) is an application-layer, TCP-based protocol used to transfer files between a client and a server over a network. It is defined in RFC 959 and uses the client-server model.

Key features

  • Uses two connections: a control connection on port 21 (commands and replies such as USER, PASS, LIST, RETR, STOR) and a data connection on port 20 (active mode) or a negotiated port (passive mode) for the actual file transfer.
  • Needs a user name and password, though anonymous FTP allows public downloads.
  • Supports upload (put/STOR), download (get/RETR), directory listing, rename and delete.
  • Transfer modes: ASCII (text) and binary (images, programs).
FTP client                        FTP server
   |==== control (port 21) ==========|
   |---- USER / PASS / RETR file --->|
   |<=== data connection ============|
   |        (file contents)          |

Uses

Uploading web pages to a web server, distributing software and sharing large files.

Limitations

Data, including passwords, is sent in plain text, so it is insecure. Secure alternatives are SFTP (over SSH) and FTPS (FTP over TLS). Popular clients: FileZilla, WinSCP, and the command-line ftp.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Web Technology chapter 2 questions →