DFTP is a multithreaded package; consist of a DTP Middleware
and an DFTP client. Goal is to distribute the file download among participating
client computers. DFTP Middleware provides the services necessary for
distributing the file among computers. DFTP client is a multithreaded client
application, which works in two modes, Using DFTP Middle ware, as well as a
standard FTP application if DFTP service is not available.
2. DFTP Client
Client works in two modes
In this mode the user can download
files from the ftp server as well as upload file to the server like a standard
FTP client. Multithreading enable the client to downloaded files in multiple
streams if supported by the server. Multiple files can also be downloaded at
the same time. Mutex technique allows only one instance of the application.
Internet Explorer Context menu
extension enables the user to directly select the file for download by
right clicking on the file and selecting “Download Using DTP” option. The
client will be featured with an attractive non rectangular skin. Skin changing
option enables the user to customize the skin.
DFTP Client will have all the
features of the standard ftp. Added advantage of using DFTP will be files can
be downloaded in multiple machines at the same time and then can be assembled
on the parent machine after download is completed. The user can also customize
the amount of download by each machine. “Download – No Transfer” if set will
download the files in the participating machines but will not transfer the
files to the parent machine, this is useful when u are downloading a huge file
and the clients are distributed over the internet.
3. DFTP Middleware
DFTP Middleware is the core of
DFTP Application. DFTP Middleware sits in between the client and FTP protocol.
DFTP Client can access the DFTP Middle ware by using COM interfaces which
allows the client to be language independent. Implementing the DFTP as a DAEMON
on a specific port is also under consideration allowing non MS programmer’s
java programmers to utilize this service. Target platform is Windows Machines
as they are the most widely used.
4. High Level Architecture
5. Modes Of Operation
- Multiple Clients downloading a single
file from a server from same different
- Multiple Clients downloading a single
file from a server from different network
6. Technical Details
7. DFTP Web
DFTP web page will be a standard
static HTML web site where users can download the DFTP application.
Implementation of a simple registration system is also under consideration (if
time permits). Registration system would keep tracks of the users and will
allow the application to be used only by users who has a valid registered
product. DFTP is freeware; this would be the first step in designing and
developing anti piracy software applications.
DFTP is Open Source, Freeware
users are free to use the application, modify the code.
9. Use Cases
Note: Use cases below do not
follow any specific standard or format. The interaction between the client and
the server is also represented in the form of use cases.
10. Class Diagram
11. DFTP FUNCTION
1. DownloadFile(URL, Username , Password,
Protocol, Merge Flag, (Participating Client IP , Number of bytes to download)*
Note: If the server
do not allow download by parts FTP protocol with single thread is chosen.
* URL of the file to download
User Name if
- 0 – Do not merge file after download,
leave the files in the respective clients
- 1 -
Merge the files using P2P
Client IP, Number of Bytes to download
IP Address of
participating client as well and the number of bytes that the client needs to
download. If IP numbers are not specified the client starts downloading using
FTP protocol on the same machine.
(Number of packets,
IP address of the
Online / Offline /
Download Complete / Error Number
To Identify user
by name, User can specify it in the
There can be n
number of Bytes download structures
- Local Path
- File Name
- Bytes Downloaded
current download initiated
Sets the DFTP
properties for the client middleware
Gets the DFTP
To Identify a
client by name , need not be unique , Internally IP is used to identify the
simultaneous download allowed
Number Of Threads
The number of
threads the client needs to spawn for each file
to download the files
Part size for each
Cache disk space
This specifies the
amount of disk space DFTP can use.
This directory is
used to download the files requested by other computers.
Imports the file
from the directory specified the user, Copies the file to the directory
identified by the structure and merge the files.
ON / OFF
Busy / Idle
Average Transfer Rate Bytes / Sec
Number of connections available for download. Eg. If the
user has allowed 3 simultaneous connections and if one is in use then it
This function checks if the file has is already been
downloaded by any of the clients. The function returns whether the file can be
downloaded from the local cache.
The Distributed Download function creates a “Middleware
Download Table” in the Host Middleware. The table is distributed among the
participating clients. Every client will hold the copy of files that are to be
downloaded by the client. The DistributedDownload() calls the SplitFile() to
calculates the best option to split the file, Table is populated with the
feedback from the client.
(Downloaded, Downloading, Queued)
PartDownload * PartDownload;
Split file function calculates the how to distribute the
file efficiently and assigns a timeout for each part.
Update Table is called by the middleware when the time out
is reached for that particular client. The client sends the table to all the
other participating clients. If a client fails to send a table and is detected
by one of the clients then the client uses GetConnectionStatus() to determine
if the connection is active.
Connection Not Active
Case1: if Merge File Flag = 0 (Do not Merge)
The remaining non downloaded portion of the file set to
download from the inactive participating computer need to be downloaded. The
remaining portion is distributed among the participating computers. The
Decision for distribution is taken by the participating computer which has the
least “participating client number” (In most of the cases this is going to be
the client that initiated the download.
Case1: if Merge File Flag = 1 (Merge Files)
The participating computer checks the merge file class to
determine how much of the files has been transferred to the initiator client,
the remaining non downloaded portion of the file set to download from the
inactive participating computer need to be downloaded. The remaining portion is
distributed among the participating computers. The Decision for distribution is
taken by the participating computer which has the least “participating client
number” (In this cases this is going to be the client that initiated the
A directory is created for every file downloaded. All the
participating clients should have File Name +
Client Number as the directory name. If directory already exist, append
zeros to the directory name. Directory name for a file has to be same in all
the participating computers.
For example if Download File Name is DownloadFileName.EXT
Participating Computer will have the names for file as
Download File Name + (Participating Computer Number * 10)
Participating Client 1: DownloadFileName10.EXT
Participating Client 2: DownloadFileName20.EXT
Participating Computer Part File Name
For Client 1
Part2 : DownloadFileName10200.EXT
Part2 : DownloadFileName10300.EXT
Last Zero’s is left for download part by parts, in case one
part fails to download and remaining parts are downloaded. In this case the
download part is split again for download.
Objective of DFTP project was to
learn different technologies involved in creation of a stand-alone application,
Middleware. UML & Project management techniques where also explored which
was a part of my Masters Course work. DFTP would be the first FTP Client to use
distributed middleware technology.
FTP server with multi part upload.
of client automatically within the Intranet.
List support to be provided by server.
enhancements to distribute the clients.
to use effective space utilization.
Rights Management Support.