What is an FTP Connection?

Instructor: Martin Gibbs

Martin has 16 years experience in Human Resources Information Systems and has a PhD in Information Technology Management. He is an adjunct professor of computer science and computer programming.

This lesson will cover FTP (File Transfer Protocol) connections. This protocol is used to transfer files between computers. FTP connection types will be discussed (active and passive), an example of an FTP connection between client and server is shown, and a sample FTP client is presented.

What is FTP?

FTP stands for File Transfer Protocol, and it is basically what it implies: The protocol, or procedure, for transferring files between computers. However, the term transfer is a little misleading: Files are not actually moved over to the source system; rather, they are copied from one computer to another. This exchange of files happens over Internet channels, formally referred to as a TCP/IP network. TCP/IP (Transmission Control Protocol/Internet Protocol) stands for the standard protocol of communication over the internet.

FTP is a standard protocol, and any computer with the ability to use FTP can make use of the protocol.

FTP Connection

For FTP to work, there needs to be a client and a server. The client connects to the service. The client and server communicate back and forth; the server must validate that the client has access to parts of the server it is trying to access; and then the client copies the files to the directories.

Below is a sample of how a connection would look:

Client: Connect to FTP service at Port 18 on IP address 172.22.22.90.
Server: Hello, this is Old Time Radio Server
Client: USER XYZ124
Server: Password required to access user account XYZ124
Client: User enters password
Server: Logged in
Client: Access directory named Suspense
Server: /home/XYZ124/Suspense is new working directory
Client: Download Episode 123.txt
Server: The server connects to the file in its directory and transfers to client's directory
Server: Transfer completed
Client: Logs out

FTP Connection Modes: Active vs. Passive.

FTP may work in either active or passive mode, which sets how the data connection is setup. Each type involves the client creating a connection to the FTP server on a certain port (usually port 21). A port is a number assigned to servers in a TCP/IP network: They simply indicate the purpose of the data being transferred (e.g., web page, voice call, etc.). Servers will monitor a given port to know when data starts coming in; FTP servers usually watch port 21.

Active Mode

In active mode, the client connects, indicating that it will be monitoring port 21 for incoming data from the server. Behind the scenes, the client sends a command PORT to tell the server which port it's on. However, most clients are now behind firewalls, either personal or corporate, and the firewall doesn't let in incoming connections. For that purpose, passive mode will work better.

Active mode requires most of the setup to be completed on the client side. If using a firewall, it must be configured to allow ports for incoming connections.

Passive Mode

In passive mode, the client sends a PASV command to the server; the server then sends back an IP (Internet) address and port number. The client can use this connection to the server and data transfer/copying can occur.

For this connection mode, most of the work is on the server side. The server needs to setup the system so that it can accept incoming data, not only from port 21 but from a range of possible ports for incoming connections.

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support