File Transfer Protocol - FTP (2024)

File transfer is among the most frequently used TCP/IP applications and it accounts for a lot of the network traffic on the Internet. Various standard file transfer protocols existed even before the Internet was available to everyone and it was these early versions of the file transfer software that helped create today's standard known as the File Transfer Protocol (FTP). Most recent specifications of the protocol are listed in RFC 959.

The Protocol

FTP uses TCP as a transport protocol. This means that FTP inherits TCP's robustness and is very reliable for transferring files. Chances are if you download files, you've probably used ftp a few hundred times without realising it ! And if you have a huge warez collection, then make that a couple of thousand times :)

The picture below shows where FTP stands in contrast to the OSI model. As I have noted in other sections, it's important to understand the concept of the OSI model, because it will greatly help you understand all this too :)

File Transfer Protocol - FTP (1)

Now, we mentioned that FTP uses TCP as a transport, but we didn't say which ports it uses! Port numbers 21 and 20 are used for FTP. Port 21 is used to establish the connection between the 2 computers (or hosts) and port 20 to transfer data (via the Data channel).

But there are some instances where port 21 is used for both, establishing a connection and data transfer and I will analyse them shortly.

The best thing you can do to "see" it yourself is to grab a packet sniffer which you will conveniently find in our download section and try to capture a few packets while you're ftp'ing to a site.

Both Ports - 20 and 21 - Active FTP Mode

Included below is a screenshot clearly showing TCP ports 20 and 21 being used:

File Transfer Protocol - FTP (2)

Only Port 21 - Passive FTP Mode

The next screenshot shows captures an FTP session using only TCP Port 21:

File Transfer Protocol - FTP (3)

FTP has two different modes of operation: Active and Passive. The mode used depends on a number of circ*mstances, but mainly if you are behind a firewall or not.

Active Mode FTP

Active mode is usually used when there isn't any firewall between you and the FTP server. In such cases you have a direct connection to the Internet. When you (the client) try to establish a connection to a FTP server, your workstation includes a second port number (using the PORT command) that is used when data is to be exchanged, this is known as the Data Channel.

The FTP server then starts the exchange of data from its own port 20 to whatever port was designated by your workstation (in the screen shot, my workstation used port 1086), and because the server initiated the communication, it's not controlled by the workstation client. This can also potentially allow uninvited data to arrive to your computer from anywhere posing as a normal FTP transfer. This is one of the reasons Passive FTP is more secure.

Passive Mode FTP

Using normal or passive FTP, a client begins a session by sending a request to communicate through TCP port 21, the port that is conventionally assigned for this use at the FTP server. This communication is known as the Control Channel connection.

At this point, a PASV command is sent instead of a PORT command. Instead of specifying a port that the server can send to, the PASV command asks the server to specify a port it wishes to use for the Data Channel connection. The server replies on the Control Channel with the port number which the client then uses to initiate an exchange on the Data Channel. The server will thus always be responding to client-initiated requests on the Data Channel and the firewall can correlate these.

It's simple to configure your client FTP program to use either Active or Passive FTP. For example, in Cute FTP, you can set your program to use Passive FTP by going to FTP--> Settings --> Options and then selecting the "Firewall" tab :

File Transfer Protocol - FTP (4)

If you remove the above options, then your workstation will be using (if possible) Active FTP mode, and I say "if possible" cause if your already behind a firewall, there is probably no way you will be using Active FTP, so the program will automatically change to Passive FTP mode.

So let's have a look at the process of a computer establishing an FTP connection with a server: .

File Transfer Protocol - FTP (5)

The above is assuming a direct connection to the FTP server. For simplicity reasons, we are looking at the way the FTP connection is created and not worring if it's a Passive or Active FTP connection. Since FTP is using TCP as a transport, you would expect to see the 3-way handshake. Once that is completed and there is data connection established, the client will send its login name and then password. After the authentication sequence is finished and the user is authenticated to the Server, it's allowed access and is ready to leach the site dry :)

Finally, below are the most commonly used FTP commands:

ABOR: abort previous FTP command

LIST and NLST: list file and directories

DELE: delete a file

RMD: remove a directory

MKD: create a directory

PWD: print current working directory ( show you which dir. your at)

PASS: send password

PORT: request open port number on specific IP address/port number

QUIT: log off from server

RETR: retrieve file

STOR: send or put file

SYST: identity system type

TYPE: specify type (A for ASCII, I for binary)

USER: send username

And that just about complete's our analysis on the FTP protocol !

File Transfer Protocol - FTP (2024)

References

Top Articles
101 Aldi Recipes That Will Give You Dinner Ideas For Tonight
Healthy Ground Turkey Recipes: Turkey Taco Soup | Quick Easy Meals
Swgoh Darth Vader Mods
Indio Mall Eye Doctor
Clothes Mentor Overland Park Photos
Big 12 Officiating Crew Assignments 2022
Promiseb Discontinued
Elgin Il Building Department
Jocelyne Mirando
Dvax Message Board
True Or False Security Is A Team Effort
Rent A Center Entertainment Center
Folsom Gulch Covid
Her Triplet Alphas Chapter 32
Keci News
Icl Urban Dictionary
Birmingham City Schools Clever Login
Craigslist Ludington Michigan
Glenwood Apartments Logan Utah
Koal Bargain Bin
123Movies Evil Dead
Maryland Parole Hearing Schedule 2023
Genova Nail Spa Pearland Photos
Let Basildon Sniff Your Hand
Black Adam Showtimes Near Linden Boulevard Multiplex Cinemas
R Toronto Blue Jays
Pcc Skilled Nursing Login
Spiral Roll Unblocked Games Premium
Www.cvs/Otchs/Simply
Meet Kristine Saryan, Scott Patterson’s Wife
Tsymo Pet Feeder Manual Pdf
Poskes Parts
Hondros Student Portal
Lehigh Wheelmen Meetup
Official Klj
How To Use Price Chopper Points At Quiktrip
Latest News & Breaking News Coverage | Flipboard
My Perspectives Grade 10 Volume 1 Answer Key Pdf
Cvs Pharmacy Tb Test
Dinar Guru Recaps Updates
Bad Moms 123Movies
Rubmd.com.louisville
Jeld Wen Okta Com Login
What Is Opm1 Treas 310 Deposit
University of Nevada, Las Vegas
Leslie Pool Supply Simi Valley
Understanding DeFi The Roles, Tools, Risks, and Rewards of -- Alexandra Damsker -- 2024 -- O'Reilly Media -- 9781098120764 -- 79accdb00af9d0f41d97f44fa7970ff1 -- Annas Archive - Biblioteconomia
Aso Tools Vancouver
Al Horford House Brookline
Stuckey Furniture
Vorschau: Battle for Azeroth – eine Tour durch Drustvar
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6705

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.