FTP - File Transfer Protocol Explained

File Transfer Protocol (FTP) is a protocol that is part of the TCP/IP suite. It is the standard for transferring large amounts of data from server to server and from servers to clients. There is a very good chance that you have downloaded files from FTP sites many times, though it may have seemed you were only downloading from a website. FTP allows you to transfer files over a variety of hosts with different operating systems and file systems. There are so many FTP servers on the Internet, some are private with secure logon names, other ones are public with anonymous logins.

This paper will give a very brief outline of how the FTP Protocol functions and give the basic commands used during an FTP session. Keep in mind that these commands are generally automatic and are executed by either an FTP Client application, or done via your web browser. Though these methods are generally quicker than manually connecting to an FTP, it doesn't mean we should ignore the background behind how the technology works.

The FTP Protocol uses two connections to transfer a file. Each of these connections is quite a bit different, but work in conjunction with each other. The first connection is the Control Connection, which as the name implies controls the connection in regards to initiating the data streams and executing the commands. The second type of connection is the Data Connection, this connection is the actual connection that passes the files back and forth between the client and server.

Control Connection:
The control connection starts in a normal client / server manner. The client does an active open connection to port 21 of the FTP server to establish the control connection. The server is listening on port 21 for any active queries. Please keep in mind that though the primary FTP port is designated as porn 21, many servers, especially private ones are running on non-standard ports. The control connection as I mentioned early is the connection that allows you to pass commands between the client and server. Commands that must be sent are ones like LIST, STOR, and RETR. Once you enter a command on the control connection, you initiate the data connection.

Data Connection:
The data connection is spawned each time a file is moved between the client and server. The Control connection initiates the transfer with the PORT command, this tells the server to open an active connection to the clients passive port. The port command is typically the IP address followed by a 16 bit port number. The PORT command is issued in the following fashion:

PORT 24,82,116,92,4,150

That command should spawn a response of: 200 PORT Command Successful

After the PORT command has been initiated and is successful the next command in the data connection will be issued from the control connection. As I mentioned before this is typically a LIST, RERT or STOR. I will outline the basic FTP commands below for reference.

FTP Commands (Basic):
ABOR - Abort command and any data transfers
LIST - List the directory contents
PASS password - Used during authentication of login
USER username - Used during authentication of login
QUIT - Logoff / Quit session
RETR filename - Retrieve file from server STOR filename - Send a file to the server
SYST - Show System information
TYPE - Set the type of data, for instance ASCII
PORT - n1,n2,n3,n4,n5,n6 ( 1-4 = ip address, 5-6 port data)
HELP - Will give you additional available commands and more information

Reply Codes:
Reply codes are simply confirmations of things happening. One example of a reply code was went we got "200 PORT Command Successful" there are a handful of other reply codes, though generally the main ones are as follows.

125: Data Connection Open Start Transfer
200: Command OK
221: Goodbye / Terminate Connection
252: Write Error
331: Username OK, Enter Password
425: Can't Open Data Connection
500: Syntax Error on Command
501: Syntax Error on Arguments

Client Applications:
There are many different clients for FTP, and really it's up to personal taste in the end. A couple of the major ones are CuteFTP and FlashFXP. Personally I use FlashFXP when I'm in the Windows Environment. Just go to a freeware website or search on the search engines for a FTP Client and try a few out!

Summary of FTP:
The File Transfer Protocol is a wonderful and useful standard that has helped move data around the world safely and reliably for years. Everyone uses it from uploading their website to their web server, backing up their data to an off-site location, sharing their pictures with friends, or disseminating large data files for scientific research!

For even more information on the FTP, check out RFC 959.

Ken Dennis
http://KenDennis-RSS.homeip.net/

In The News:


pen paper and inkwell


cat break through


Anti-Skip Protection on Mp3 Players

There have been some questions on anti-skip protection on mp3... Read More

Review of Rio MP3 Players

Below you will find some useful information and comments about... Read More

Cisco CCNA / CCNP Certification: OSPF ASBRs Explained And Illustrated

When I first started studying for my CCNP, some of... Read More

The Many Benefits of Owning a DVR

Has This Ever Happened To You? OK.. it's Friday night,... Read More

Learning To Navigate Ciscos Online Documentation

When studying for your Cisco CCNA, CCNP, or CCIE exam,... Read More

Ergonomics and Healthy Computing - Positioning Your Body For Maximum Comfort At Your Computer

Do you remember the old saw about how computers would... Read More

D2X Digital SLRCoolpix 8800 Actually Refers to Two Nikon Cameras

Addressing a D2X Digital SLRCoolpix 8800 search, this article provides... Read More

How Does a Palm Pilot Work?

Just The Facts, Ma'mPalm pilots are all the rage now.... Read More

Getting Started with HTML

The basic language of the internet is html. If you... Read More

Got Virus?

GOT VIRUS? Your Data is NOT lost forever!In the wake... Read More

2 PC Annoyances and How To Solve Them!

I have a love-hate relationship with my computer.In fact, often... Read More

What Are You Looking For In A Cheap MP3 Player?

Are you stymied by the vast offerings in cheap mp3... Read More

Bluetooth Technology: Tips for Buying Headsets or Headphones

The technological horizon has always got something new to offer,... Read More

DVD The Ultimate Consumer Digital Media

Digital Video Disc or as it is sometimes referred to... Read More

Reliable File and Folder Sharing in Windows Xp

This tip is on sharing files and folders on a... Read More

Temporary Fixes to Spyware, Ad-ware, and Virus Infections

So you've got some spyware, ad-ware, or viruses on your... Read More

Cisco Certification: The Most Important Cisco Study Youll Ever Do

All of us are familiar with the pyramids of Egypt.... Read More

Looking For an MP3 Player?

If you don't have an mp3 player, and even if... Read More

This Page Cannot Be Displayed ? What to Do When Your Internet Breaks

The DNS (Domain Name System) servers are what your computer... Read More

An All Too Familar Pain

Lost & Found for the 21st CenturyIn today's hectic world... Read More

5 Steps to Removing PC Clutter

It's hard enough as it is these days to get... Read More

COOKIES - What Are They!!

Cookies, not the kind that Mom makes, but the computer... Read More

How To Search Your PC With Google Desktop

In this era of Internet, most people are frequent users... Read More

The Benefits of the New Firefox Browser

You probably heard of the new Firefox browser version 1.0... Read More

How I Started Working With 3D Modeling Programs

So I'll start from the very beginning.One day I was... Read More

Digital Cameras + Photo Printers = Quality Instant Photographs

In the 1950's and 1960's Polaroid's instant cameras were all... Read More

Faster Browsing Tips

IF WE say that it was mainly because of the... Read More

How to Use SQLXML to Retrieve Data from SQL Server Database?

Using SQL Server 2000 and above versions you can retrieve... Read More

Top 9 Ways To Speed Up Your Surfing & Computing

It seems like fast never quite rates fast enough.No matter... Read More

Is Desktop Search Deserving?

Google, in their march to stay ahead of the pack... Read More

Compile .BAT Files into Native Windows Applications (.EXE)

Since the DOS days, batch files have been one of... Read More

How to Save an Image in a SQL Server Database?

Most of the web applications have a lot of images... Read More

How to Set Up Simple File Sharing WinXP

The first step is: Start > My DocumentsSo you have... Read More