ArticleslgStudy

computer science

File Transfer Protocol

File Transfer Protocol is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand File Transfer Protocol rather than just read about it. In short: The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client over a computer network. FTP is built on a client–server model architecture using separate control and data connections between the client and the server.

File Transfer Protocol — main illustration
File Transfer Protocol — illustration

Key takeaways

  • File Transfer Protocol belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect File Transfer Protocol to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of File Transfer Protocol from memory before moving on to harder problems.

Reference excerpt

The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client over a computer network. FTP is built on a client–server model architecture using separate control and data connections between the client and the server. FTP users may authenticate themselves with a plain-text sign-in protocol, normally in the form of a username and password, but can connect anonymously if the server is configured to allow it. For secure transmission that protects the username and password and encrypts the content, FTP is often secured with SSL/TLS (FTPS) or replaced with SSH File Transfer Protocol (SFTP). The first FTP client applications were command-line programs developed before operating systems had graphical user interfaces, and are still shipped with most Windows and Unix-like operating systems. Many dedicated FTP clients and automation utilities have since been developed for desktops, servers, mobile devices, and hardware, and FTP has been incorporated into productivity applications such as HTML editors and file managers.

An FTP client used to be commonly integrated in web browsers, where file servers are browsed with the URI scheme "ftp://". In 2021, FTP support was dropped by Google Chrome and Firefox, two major web browser vendors, due to it being superseded by the more secure SFTP and FTPS; although neither browser has implemented the newer protocols.

History of FTP servers The original specification for the File Transfer Protocol was written by Abhay Bhushan and published as RFC 114 on 16 April 1971. Until 1980, FTP ran on NCP, the predecessor of TCP/IP. The protocol was later replaced by a TCP/IP version, RFC 765 (June 1980) and RFC 959 (October 1985), the current specification. Several proposed standards amend RFC 959, for example, RFC 1579 (February 1994) enables Firewall-Friendly FTP (passive mode), RFC 2228 (June 1997) proposes security extensions, RFC 2428 (September 1998) adds support for IPv6 and defines a new type of passive mode.

Protocol overview

Communication and data transfer

FTP may run in active or passive mode, which determines how the data connection is established. (This sense of "mode" is different from that of the MODE command in the FTP protocol.)

In active mode, the client starts listening for incoming data connections from the server on port M. It sends the FTP command PORT M to inform the server on which port it is listening. The server then initiates a data channel to the client from its port 20, the FTP server data port. In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In this mode, the client uses the control connection to send a PASV command to the server and then receives a server IP address and server port number from the server, which the client then uses to open a data connection from an arbitrary client port to the server IP address and server port number received. Both modes were updated in September 1998 to support IPv6. Further changes were introduced to the passive mode at that time, updating it to extended passive mode. The server responds over the control connection with three-digit status codes in ASCII with an optional text message. For example, "200" (or "200 OK") means that the last command was successful. The numbers represent the code for the response and the optional text represents a human-readable explanation or request (e.g., <Need account for storing file>). An ongoing transfer of file data over the data connection can be aborted using an interrupt message sent over the control connection. FTP needs two ports (one for sending and one for receiving) because it was originally designed to operate on top of Network Control Protocol (NCP), which was a simplex protocol that utilized two port addresses, establishing two connections for two-way communications. An odd and an even port were reserved for each application layer application or protocol. The standardization of TCP and UDP reduced the need for the use of two simplex ports for each application down to one duplex port, but the FTP protocol was never altered to only use one port, and continued using two for backwards compatibility.

NAT and firewall traversal FTP normally transfers data by having the server connect back to the client after the PORT command is sent by the client. This is problematic for both NATs and firewalls, which do not allow connections from the Internet towards internal hosts. For NATs, an additional complication is that the representation of the IP addresses and port number in the PORT command refer to the internal host's IP address and port, rather than the public IP address and port of the NAT. There are two approaches to solving this problem. One is that the FTP client and FTP server use the PASV command, which causes the data connection to be established from the FTP client to the server. This is widely used by modern FTP clients. Another approach is for the NAT to alter the values of the PORT command, using an application-level gateway for this purpose.

Data types While transferring data over the network, five data types are defined:

… excerpt ends here. Continue reading the full article.

Illustrations

File Transfer Protocol: Illustration of starting a passive connection using port 21
Illustration of starting a passive connection using port 21
File Transfer Protocol: A model chart of how FTP works
A model chart of how FTP works
File Transfer Protocol: A computer at Amundsen–Scott South Pole Station logging into an FTP server and transferring a file, in 1994
A computer at Amundsen–Scott South Pole Station logging into an FTP server and transferring a file, in 1994
File Transfer Protocol illustration
File Transfer Protocol illustration

Worked examples

Example 1 — a first encounter with File Transfer Protocol

Start with the simplest possible case. Write down what File Transfer Protocol claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to File Transfer Protocol before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about File Transfer Protocol ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of File Transfer Protocol

In research
File Transfer Protocol appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses File Transfer Protocol in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
File Transfer Protocol is common in secondary-school and first-year university syllabi. It links to neighbouring topics Application layer protocols, Clear text protocols, Computer-related introductions in 1971, so understanding it makes those chapters shorter.
In everyday life
Look for File Transfer Protocol outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “File Transfer Protocol” →

How to study File Transfer Protocol in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what File Transfer Protocol means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain File Transfer Protocol out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is File Transfer Protocol in simple terms?

The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client over a computer network. FTP is built on a client–server model architecture using separate control and data connections between the client and the server.

Why does File Transfer Protocol matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study File Transfer Protocol?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on File Transfer Protocol.

Tags

  • Application layer protocols
  • Clear text protocols
  • Computer-related introductions in 1971
  • File Transfer Protocol
  • File sharing
  • History of the Internet
  • Internet Standards
  • Network file transfer protocols
  • OS/2 commands
  • Unix network-related software

Keep exploring