Short answer
FTP works as two TCP connections: a control connection for commands, and a data connection for the file. RFC 959 sets the control service port at 21 and the server's default data port at the adjacent port, L minus 1. USER and PASS log in. PORT or PASV arranges the data port. RETR reads a file and STOR writes one. The server side of that pair is a separate topic.
Last verified against the sources listed below.
Key takeaways
- RFC 959 is the File Transfer Protocol specification, dated October 1985.
- The control connection uses service port 21, written L=21 in the RFC.
- The server's default data port is the adjacent port, L minus 1.
- PASV tells the server to listen, instead of the client sending a PORT address.
- RETR downloads a file and STOR uploads one, both on the data connection.
How FTP works is a conversation with two sockets. One socket carries commands and replies. The other carries the file. RFC 959, the October 1985 specification, is the document that names both.
The process that waits for those commands is an FTP server. This guide stays on the transfer itself: the ports, the commands, and the order of a single file move.
What is FTP meaning?
FTP means File Transfer Protocol. RFC 959 says the memo is the official specification, and that distribution is unlimited.
RFC 959 lists four objectives: promote sharing of files, encourage indirect or implicit use of remote computers via programs, shield a user from variations in file storage systems among hosts, and transfer data reliably and efficiently.
Those objectives are why the protocol splits control from data. The client can say what it wants in short commands. The file can move without those words sitting in the same byte stream.
A host panel that says “FTP access” is pointing at this protocol unless it names a different one. The letters alone are not a guarantee of encryption. The command list opened in RFC 959 includes USER, PASS, PORT, PASV, RETR, and STOR. It does not include a TLS handshake command.
How does the FTP protocol work?
The client opens a control connection to the server’s FTP service port. RFC 959 assigns that port as 21, written L=21.
Commands travel on that connection. Each command is a short word, often with an argument, ending in a line break. Replies come back on the same connection. The file does not.
Section 3.2 says both sides have a default data port. The user’s default data port is the same as its control port. The server’s default data port is the adjacent port, L minus 1. When L is 21, that adjacent port is 20.
The transfer byte size is 8-bit bytes. The RFC says that size is about the transfer, not about how the file is stored on either host.
You choose a representation before the move. ASCII is for text the protocol may adjust. Image type asks for a copy that is not treated as text. Use Image for archives, images, and any file that must arrive unchanged.
How FTP works step by step
One transfer, in the order the commands imply:
- Open the control connection to port 21 on the server.
- Send USER with the username.
- Send PASS with the password, if the server asks for one.
- Send ACCT only if the server also asks for account information.
- Send TYPE with a type code, such as ASCII or Image.
- Send PORT with the client’s host and port, or send PASV so the server listens.
- Send RETR with a path to download, or STOR with a path to upload.
- Read or write the bytes on the data connection, then close that connection.
QUIT ends the control connection when you are done. You can transfer more than one file before QUIT. Each file still needs a data connection. The control connection stays up across those transfers.
PASV is the step that avoids telling the server to call back to the client. RFC 959 says PASV requests the server data process to listen on a data port that is not its default, and to wait for a connection rather than initiate one. The reply includes the host and port where it is listening. The client then connects there.
PORT is the other arrangement. The argument is h1,h2,h3,h4,p1,p2, where the first four numbers are the client’s address and the last two encode the port.
The server then opens the data connection to that address. PASV is the command that makes the server listen instead. The RFC allows both.
How FTP works diagram
A diagram in words is the two connections and who speaks. No extra protocol is hiding under the boxes.
| Step | Connection | Who sends | What moves |
|---|---|---|---|
| 1 | Control, port 21 | Client | USER, then PASS |
| 2 | Control | Server | Reply codes and text |
| 3 | Control | Client | TYPE, then PORT or PASV |
| 4 | Data | Both, after setup | The file bytes |
| 5 | Control | Client | RETR or STOR, which starts the move |
| 6 | Control | Client | QUIT when the session should end |
The data row is the only one that carries the file. If that connection never opens, RETR and STOR have nowhere to put the bytes. A login success on the control connection is not, by itself, a finished download.
Active mode is the PORT path: the server calls the client. Passive mode is the PASV path: the client calls the server. The file format does not change between them. Only the direction of the data-connection setup changes.
What is FTP in networking?
In networking, FTP is an application protocol on top of TCP. It uses a well-known control port and a separate data port so that commands and file bytes do not share one stream.
That design is from a time when a second connection was an acceptable way to move a large file. The control connection can stay small. The data connection can be closed when the file ends, which RFC 959 describes as the normal end of a transfer.
Web hosting is where many people still meet the name. The host stores the site, and an FTP login is one old way to put files in that storage.
Visitors who read the site do not use your FTP username. They use HTTP. A private transfer account is not a public page.
The reliability goal in the RFC is about the transfer, not about hiding the traffic. Commands, including PASS, are arguments on the control connection.
If the path crosses a network you do not trust, use an encrypted file transfer. The server guide compares those options. This page stops at how the 1985 protocol moves a file.
What is FTP access?
FTP access is an account the server will accept on the control connection, plus whatever paths that account may read or write.
USER names the account, and PASS supplies the password. Some servers also want ACCT.
After the replies say the login worked, access means you may send transfer commands. It does not mean every directory is yours. The server can refuse a path.
A person can type the commands, but RFC 959 expects a program, the user-FTP process, to send them. A desktop client is that program with fields for host, username, and password.
It still sends USER, PASS, and RETR. The form is a convenience. The protocol underneath is the same list.
IANA’s registry, updated 2026-11-30, lists ftp on TCP port 21 as File Transfer Protocol control, citing RFC 959, and ftp-data on TCP port 20 as the default data port. Python’s ftplib page, labeled 3.15.2, says the FTP class implements the client side of the protocol, and that quit sends QUIT.
The IETF datatracker lists RFC 959 as an Internet Standard from October 1985, by Postel and Reynolds. That is the same specification as the command list above.
Before you upload, shrink files that do not need to be large. An image compressor makes an image smaller in the browser. The FTP session then moves fewer bytes. Compression is not access control, and it does not encrypt PASS.
Frequently asked questions
What is FTP mean on a host menu?
On a host menu, FTP usually names the File Transfer Protocol in RFC 959. The same letters can label a client program that speaks it. The RFC's four objectives are sharing files, indirect use of remote computers, shielding the user from storage differences, and reliable transfer. A menu item that only says FTP does not say the session is encrypted. The command list opened in RFC 959 has no TLS request. The FTP server guide covers the server process and the encrypted alternatives.
What is the FTP file transfer protocol?
The FTP file transfer protocol is the rule set in RFC 959. A user process talks to a server process. Commands use the control connection, and the file bytes use a second connection. The transfer byte size is 8 bits, which does not have to match how the host stores the file. ASCII and Image are representation types. Use Image when the file must not be changed as text. A login on the control connection is not the file transfer itself.
Does the password stay on my screen only?
The PASS command sends the password as its argument on the control connection. That is the shape of the command in RFC 959's command list. Hiding the characters in the client window is a local display choice. It does not change the fact that the argument is part of the command the server receives. This guide does not repeat the full security write-up. The FTP server article covers why a plain session is a poor fit on a network you do not control, and how SFTP and FTPS differ.
What is FTP access if I only have a username?
FTP access means the server accepts your commands on the control connection. RFC 959 starts that with USER, then PASS, and sometimes ACCT for account information. A username without a password the server accepts does not open the session. After a successful login you can change directories, set a type, and transfer. Access is not the same as permission to every path. The server still applies its own file rules. A public website does not require visitors to have this login.
Sources
- RFC 959, File Transfer Protocol · IETF, 1985
- RFC 959, plain text · IETF, 1985
- File Transfer Protocol on the RFC Editor · RFC Editor, 2026