Академический Документы
Профессиональный Документы
Культура Документы
By
Phanindra
Contents
1. Introduction
2. Features
3. Architecture
a. Client/Server Architecture
b. Data connections
i. Active Connection
ii. Passive Connection
c. Types of Data transfer
4
5
5
6
6
7
7
7
8
10
13
14
16
16
18
6. FTP session
a. FTP session Demonstration
b. FTP commands
19
19
20
7. Limitations of FTP
21
21
22
Introduction
FTP stands for "File Transfer Protocol."It is a protocol for transferring files from one
computer to another over a network connection (internet or Intranet).
FTP is a commonly used protocol for exchanging files over any TCP/IP network
(Internet or intranet). Any company or individual programmer is able to create FTP
server or client software of ones own as the protocol is an open standard. There are
many existing FTP client and server programs available. But I would be focusing
upon two widely used FTP Programs later in this Document viz WS_FTP and CUTE
FTP.
The base specification of FTP is RFC 959 and is dated October 1985. FTP was one of
the first efforts to create a standard means of exchanging files over a TCP/IP network,
so the FTP has been around since the 1970's. Lately, FTP was designed with as much
flexibility, so it could be used over any computer platform, and has the capability of
exchanging files with a broad variety of machines.
Features
As we have discusses earlier, File Transfer Protocol enables file sharing between
hosts. For this to happen, FTP uses TCP to create a virtual connection to control the
information and then creates a separate TCP connection for data transfers. The control
connection uses an image of the TELNET protocol to exchange commands and
messages between hosts.
The Key Features of FTP are mentioned below:
1. Allows file sharing between any two computers that are connected (through
internet/intranet).
2. Encourages indirect (via programs) usage of remote computers. FTP, though
usable directly by a user at a terminal, is designed mainly for use by programs.
3. Shields a user from variations in file storage systems among hosts
4. Transfers data reliably and efficiently.
Architecture
Before getting into the architecture, lets focus on how the FTP session gets
established. One computer requests a file from another computer. The second
computer fullfills the request made by the first computer. The requests can be like
uploading the file, downloading a file, moving, copying or deleting a file. This
information must give you a vague idea of how the FTP works. Now lets take a look
at the architecure of FTP in detail.
System B
2
System C
Figure
In this figure, as you can see, there are three systems involved.
1. System A which is the client for system B is initiating a session.
2. System B which is a server for system A, is a client for system C and is initiating
a session.
With this Illustration, it is clear mentions that one system can take up the role of a
client and server at the same time. The role of a system can change depending on
which computer has initiated the session.
4
Data Connections
In an FTP session, there exist two connections between the client and the server. They
are Control connection and Data connection. The Control connection takes the
responsibility of establishing and maintaining the FTP session where as Data
connection is to provide a smooth path for the data to be transmitted in the session
where control connection takes care of problems that occur due to firewalls, routers,
proxies which want to restrict or delegate TCP connections.
FTP does not mandate a particular port number or a direction that a data connection
uses. The easiest solution would be to mandate all data connections originate from
the client machine and terminate at port 20 on the server machine. Instead, for
maximum flexibility, the protocol allows the client to choose one of two methods:
1. Active data connection and
2. Passive data connection
Active data connection
This is the default way of transmission in an FTP session. In this kind of a session, the
client requests the server to originate a data connection and terminate at an IP address
and port number of the client's choosing. The below diagram illustrates in more detail
about this connection.
Server
Port 20
Data
Client
Port 21
Cmd
Port 1026
Cmd
Port 1027
Data
1
2
3
4
Figure
1. Client request to open an FTP session on port 1027 from port 1026.
2. Server Acknowledgment.
3. Server connecting to port 1027 of the client (as per the request).
4. Client is starting up an FTP session with the server.
Passive data connection
This is the alternate way for the clients to establish an FTP session with the FTP
server in order to avoid problems with the routers and firewalls. In this kind of a
session, the client requests the server to assign an IP address and port number on the
server side and the client will originate a connection to the server address.
5
Server
Port 20
Data
1
Client
Port 21
Cmd
Port 1026
Cmd
Port 1027
Data
Port 1027
2
3
4
Figure
1.
2.
3.
4.
enabled. The IIS snap-in or Internet Information Service Manager are used to
configure the FTP service.
When an FTP Site is configured with User isolation, only the active directory users
have the right to access their Home directory only in the FTP site. Here is how we can
configure the FTP site with user Isolation:
1. In IIS Manager, click the local computer, right-click the FTP Sites folder,
point to New, and click FTP Site.
2. In the Welcome to the FTP Site Creation Wizard, click next.
3. In FTP Site Description, type a description for the FTP site, and then click
next.
4. In IP Address and Port Settings, type an IP address for the FTP site and port
number, which is defaulted to 21 (can be changed), and then click next.
5. In FTP User Isolation, click Isolate users using Active Directory, and then
click Next.
8
6. In the User name text box, type the user name, using the Domain\User
format, or browse to the user name. In the Password text box, type the
password of the user. In the Enter the default Active Directory domain text
box, type or browse to the default domain name
(This user name is used to access Active Directory and read the home directory properties.)
7. Click Next. You are prompted to re-enter the password for the user entered
in the previous steps
8. Enable the Read and Write permissions as appropriate, and then click Next,
and click Finish
9
3. In FTP Site Description, type a description for the FTP site, and then click
next.
10
4. In IP Address and Port Settings, type an IP address for the FTP site and port
number which is defaulted to 21 (can be changed), and then click Next
5. In FTP User Isolation, click any of the first two options for anonymous
access as per the requirement. If the option Do not isolate users is selected
then the FTP users can access the home directories of the other FTP users with
is not the case with the other option Isolate Users and then click Next.
11
6. In the FTP Site Home Directory, Choose the Path of the directory that you
want to load into the site
7. Enable the Read and Write permissions as appropriate, and then click Next, and
click Finish
12
3. Click the Home Directory tab and select the Read and Log visits check
boxes (if they are not already selected), and then click to clear the Write
check box so that the anonymous users do not have any other access except
for Read
13
Prerequisites
The prerequisites to make a PC an FTP server are:
1. A Windows PC
2. An always-on broadband (DSL or cable) Internet connection, preferably with a
static IP
3. An FTP Server Application software.
Yes, to make a PC an FTP server we dont need to have a Server operating system (to
install IIS and FTP services and configuring FTP sites on it). The preferable option
would be to choose and download software from a variety of FTP Server Application
Softwares that are available in the Internet that best suites your requirement. No
matter which software you install the procedure for configuring the software would
remain the same however there will be some differences in the steps involved. So, it
would be a better idea for me to explain the procedure rather than explaining the steps
for each one.
FTP Clients
FTP clients are the applications, which enable the user to communicate with the FTP
server. With out an FTP client, it is not possible to connect to the FTP server. There
are a lot of FTP client software available in the Internet that have various flavors and
features. At the same time Windows also has some in-build FTP clients. First we will
take a look at the in-build FTP clients in windows and later on we will discuss about
the 3rd party FTP clients that available on the Internet.
Internet Explorer
As we all know that this application is used for browsing the web sites (http:// sites
through port 80), we can also make some changes and get this application working for
FTP sites as well. This application provides a GUI interface to the FTP server where
in you would be able to see the folder icons.
15
FTP.exe
This is an executable file that gets installed by default in all windows client and server
operating systems. Through this executable file, we get the CUI interface of the FTP
site, where we need to use all the FTP commands to perform operations in the FTP
session (which are mentioned in the next section).
To run this executable file, it can be opened from the folder %systemroot%/system32
where you can file this file ftp.exe. It can also be run from the command line by
simply typing in ftp.
Once the ftp window opens you can see the CUI interface with an FTP prompt as
shown below
16
With this we have just opened the FTP client application. Now we need to connect to
one of the FTP servers. To create a connection to an FTP server we need to use the
Open command as follows
Ftp> open <ipaddress/domain name of the FTP server> <enter>
This command would create a connection. Here on, we can start off with the FTP
commands and do the necessary manipulations of fetching or uploading or deleting or
modifying the files.
FTP explorer
Smart FTP
WS_FTP:
http://www.ipswitch.com/Products/WS_FTP/
Cute FTP:
http://www.cuteftp.com/cuteftp/
Once you have chosen an FTP client, the profile or configuration values for your
client will need to be set. The steps to reach these settings vary depending on the FTP
client you decide to use and some FTP clients may use different terminology. So, it is
recommended to go through the users guide of that particular Client application
before you begin the configuration.
17
FTP session
Till now we have discussed about installing and configuring FTP sites. Now in this
section I would like to focus on how to start off with an FTP session from a basic FTP
client MS-DOS (that every body is familiar with). If you are using a 3rd party GUI
FTP client, at the background the client would be using the same commands that the
user would be using in classic FTP clients like MS-DOS or a Unix Shell.
The protocol is interactive, because clients and servers actually have a conversation
where they authenticate themselves and negotiate file transfers. In addition, the
protocol specifies that the client and server do not exchange data on the conversation
channel. Instead, clients and servers negotiate how to send data files on separate
connections, with one connection for each data transfer. Note that a directory listing
is considered a file transfer.
FTP Commands
FTP allows users to browse the file much like you would with a regular MS-DOS
prompt. An FTP session contains is a sequence of one or more transactions. Each
command is considered as a transaction between the client and the server. Below are
the commands that can be used to communicate with the FTP server:
! - Runs the specified command on the local computer
? - Displays descriptions for ftp commands
Append - Appends a local file to a file on the remote computer
ASCII - Sets the file transfer type to ASCII, the default
Bell - Toggles a bell to ring after each file transfer command is completed (default =
OFF)
Binary - Sets the file transfer type to binary
Bye - Ends the FTP session and exits ftp
Cod - Changes the working directory on the remote computer
Close - Ends the FTP session and returns to the command interpreter
Debug - Toggles debugging (default = OFF)
19
Limitations of FTP:
1. Passwords and file contents are sent in clear text, which can be intercepted by
easily. There are protocol enhancements that override this disability.
2. More than one TCPIP connection is used to transfer data.
3. In active mode where the Client opens a port for data communication, it is
difficult for the firewall to filter traffic on the client side, resulting less number
20
6.
7.
No error detection. FTP relies on the underlying TCP layer for error control,
Appendix I
FTP server result codes
100 Series
110
120
125
150
200
202
211
212
213
214
215
220
221
225
226
or file abort).
227
230
231
232
250
: The requested action is being initiated; expect another reply before proceeding with
a new command.
: Restart marker reply. In this case, the text is exact and not left to the particular
implementation.
: Service ready in nnn minutes.
: Data connection already open; transfer starting.
: File status okay; about to open data connection.
: Command okay.
: Command not implemented, superfluous at this site.
: System status, or system help reply.
: Directory status.
: File status.
: Help message. On how to use the server or the meaning of a particular non-standard
command. This reply is useful only to the human user.
: NAME system type. Where NAME is an official system name from the list in the
Assigned Numbers document.
: Service ready for new user.
: Service closing control connection.
: Data connection open; no transfer in progress.
: Closing data connection. Requested file action successful (for example, file transfer
: Entering Passive Mode (h1,h2,h3,h4,p1,p2).
: User logged in, proceed. Logged out as appropriate.
: User logged out; service terminated.
: Logout command noted, will complete when transfer done.
: Requested file action okay, completed.
21
257
331
332
350
421
425
426
450
451
452
500
501
502
503
504
530
532
550
551
552
553
: "PATHNAME" created.
: User name okay, need password.
: Need account for login.
: Requested file action pending further information
: Service not available, closing control connection. This may be a reply to any
command if the service knows it must shut down.
: Can't open data connection.
: Connection closed; transfer aborted.
: Requested file action not taken.
: Requested action aborted. Local error in processing.
: Requested action not taken. Insufficient storage space in system.File unavailable
(e.g., file busy).
: Syntax error, command unrecognized. This may include errors such as command
line too long.
: Syntax error in parameters or arguments.
: Command not implemented.
: Bad sequence of commands.
: Command not implemented for that parameter.
: Not logged in.
: Need account for storing files.
: Requested action not taken. File unavailable
: Requested action aborted. Page type unknown.
: Requested file action aborted. Exceeded storage allocation (for current directory or
dataset).
:Requested action not taken. File name not allowed.
22