Write Short Notes on FTP (File Transfer Protocol)
FTP is an application-layer protocol designed to upload/download files between a client and a server. It uses a control connection for commands and replies, and a separate data connection for the actual file content and directory listings. FTP commonly operates using TCP and uses different ports for control vs data connections.
Key learning idea: FTP is command-driven—the client sends FTP commands on the control channel (e.g., login, directory listing, retrieve/upload), and the server responds with numeric reply codes. Then, for operations that move data, the server and client establish the data connection (in either active or passive mode).]
FTP
Control connection
Data connection
Active mode
Passive mode
Footnotes
-
RFC 959 — File Transfer Protocol (FTP) - Defines FTP model, commands/replies, and connection behavior including control/data channel usage. ↩
FTP Basics (Control vs Data Connection, Active vs Passive)
1) Core concepts to mention in “short notes”
When writing short notes on FTP, include these points:
- Client and server roles.
- Two-channel design: control connection and data connection.
- Command/reply model: control channel carries commands like authentication and transfer requests; numeric reply codes indicate status.
- Modes for data transfer: active mode vs passive mode.
2) Ports and connections (what to write)
FTP is standardized by RFC 959. In typical deployments, FTP uses:
- TCP port 21 for the control connection.
- TCP port 20 for the data connection in active mode (because the server connects from its data port).]
What to emphasize in short notes:
- “FTP uses two separate TCP connections: one for commands (control) and one for file transfer (data).”
- “Because the data connection differs from the control connection, NAT/firewalls often require passive mode.”
Writing a short FTP note (practical outline)
- 1Step 1
Mention it transfers files between hosts using a client/server model.
- 2Step 2
Note control connection (commands/replies) vs data connection (file/directory bytes).
- 3Step 3
Mention TCP port 21 for control and TCP port 20 for data in active mode.
- 4Step 4
Briefly contrast who initiates the data connection (server vs client).
- 5Step 5
Mention USER/PASS (login) and LIST/RETR/STOR (listing/retrieve/upload), then QUIT.
- 6Step 6
State that classic FTP sends credentials in plaintext; many deployments use FTPS/TLS or switch to SFTP.
3) Active mode vs passive mode (high-yield)
In active mode, the client tells the server which port it is listening on for data, and the server opens the data connection back to the client. This can fail when the client is behind a firewall/NAT because inbound connections to the client may be blocked.
In passive mode, the client asks the server to open a data connection, but the client initiates the data connection to the server. This typically works better through NAT/firewalls because the client is the side that opens outbound connections.
Active mode
Passive mode
NAT
Firewall
Footnotes
-
RFC 959 — File Transfer Protocol (FTP) - Includes details of FTP reply codes and the separate channel concept used for transfers. ↩ ↩2
4) Common FTP commands (short-note list)
A compact “short note” usually lists a few representative commands:
- USER
- PASS
- LIST
- RETR
- STOR
- QUIT
These commands are carried over the control connection, while operations like LIST/RETR/STOR involve the separate data connection to transfer bytes.
Footnotes
-
RFC 959 — File Transfer Protocol (FTP) - Defines FTP model, commands/replies, and connection behavior including control/data channel usage. ↩
Pro tip for exam-style notes
Write one sentence per heading: (1) purpose, (2) control vs data channels, (3) ports, (4) active/passive, (5) examples of commands, (6) security limitation.
Security limitation of classic FTP
Classic FTP transmits credentials and data without encryption, so it is vulnerable to interception. Many systems use FTPS (FTP over TLS) or SFTP instead.
FTP session lifecycle (what happens, in order)
Control connection established
1. ConnectClient connects to FTP server for command/reply exchange."
USER/PASS
2. AuthenticateClient supplies username and password on the control channel."
Active/PASV negotiation
3. Prepare data transferClient selects mode; in PASV it asks server to provide a data endpoint."
LIST/RETR/STOR
4. TransferServer and client use the data connection to list/download/upload."
QUIT
5. CloseSession ends; control connection is terminated."
What travels on each FTP channel?
A quick comparison to remember for short notes.
Common edge points to add (optional but good)
FTP short-notes flashcards
Knowledge Check
In FTP, the control connection is mainly used to: