You are on page 1of 3

NOTRE DAME UNIVERSITY

Electrical, Computer and Communications Engineering Department

Course Reference EEN 342


Student Name
Course Name Computer Networks
Course Instructor Dr. Maurice Khabbaz
Student ID
Semester Fall 2020
Subject Project 2 Signature

Objective:

Design and implementation of a custom-built FTP protocol using Python.

Requirements:

The first requirement of this project is to read and understand the concept of File
Transfer Protocol (FTP) and then develop your own customized version of this protocol.

An FTP has the objective of managing a file repository remotely. Precisely, it can be
used to copy, move, delete, store and transfer files and folders to/from the repository in
a remote manner. It operates according to a client/server model where the client initiates
any of the above-mentioned file operations and the server acts as the remote file host.
The custom-designed protocol should be able to:
1. Upon starting the FTP client, contact must be established with the FTP server using
TCP on port 21. If the connection is successfully established, the client displays a
menu on the screen as follows:

Choose one of the following options:


1. Register New User.
2. Log-In to FTP Server.
Enter your choice [1 or 2] and press the ENTER key:

2. If choice [1] is entered, the server would then request from the user to enter a
new username followed by a request to enter a password. Once this is done the
server must store the newly entered username and password in a user credentials
file called userCred.dat. This file is to be loaded first thing every time the
server application is executed. Note that, if the file userCred.dat already
exists, the server must open it. Then, any newly registered user credentials must
be appended to the already existing ones in such a way that each line of the file
will first have a user’s username followed by a semi-colon and the corresponding
password as follows:

Sample of userCred.dat file


username1 ; password1
username2 ; password2
username3 ; password3
username4 ; password4
.
.
.

Following the registration process, the server must then move to item number 3
described below.
3. Identify the user upon log-in:
a. Server must explicitly request the user to enter his log-in name.
b. Once a log-in name is entered, server must verify the existence and validity
of the entered log-in name:
• If valid, server must then request a password corresponding to
that log-in name.
• If invalid, the server must re-request a valid log-in name for a
number of three times. Failure to enter a valid log-in name causes
the server to terminate the connection.
c. Upon entering a password, server must verify the correctness of the
password:
• If password is valid, server will then request the user to initiate a
file operation.
• If password is invalid, the server will re-request the password for
a number of three times. Failure to enter a correct password will
cause the server to close the connection.

Sample authentication output


Enter username: mkhabbaz
Enter password: *********************
Password incorrect. Re-enter password: *************
Access granted…
Enter Command:_

4. Allow the user to:


a. Create a folder in the file repository:
• e.g. createFolder <folder_name>
b. Delete a folder from the file repository:
• e.g. deleteFolder <folder_name>
c. Upload a file to a specific folder:
• e.g. upload <file_name>: uploads the file <file_name>
and stores it in the root directory of the file repository.
• e.g. upload <file_name> <folder_name>: uploads the
file <file_name> and stores it in the folder
<folder_name>.
d. Download a file from the file repository:
• e.g. download <file_name>: downloads the file
<file_name> from the file repository.
e. Move files from one folder to another:
• e.g. move <file_name> <source_folder>
<destination_folder>: moves the file <file_name>
from folder <source_folder> to folder
<destination_folder>.
f. Delete files:
• e.g. deleteFile <file_name>: deletes the file
<file_name> from the file repository.
g. Rename files:
• e.g. rename <old_name> <new_name>: renames a file
from <old_name> to <new_name>.
h. List all files and folders in the current folder of the file repository using the
command list.
5. Upon completion, the user must be allowed to log-out and, hence, close the
application using the command quit.

It is worthwhile noting at this stage that data transfers (i.e. upload and download of files)
have to be done over a dedicated TCP data connection on port 20 which different from
the TCP control connection on port 21. Also appropriate return codes have to be returned
and displayed on the client’s screen upon completion/termination of any one of the above
commands as explained in class. Proper exceptions (i.e. errors) must be also captured and
returned to the user.

Deliverables:

The following items are required to be delivered:

1. Well commented Python source code and executable files for the FTP client and
server.
2. Well organized typed report including:
a. A short Introduction.
b. A description of the implemented FTP commands.
c. Important implementation aspects as well as any difficulties encountered
during the implementation process.
d. Ideas and possible extensions for this project that can be classified as future
work.
e. A short conclusion.
3. The above must be presented as both hard copy and soft copy sent through e-mail in
a ZIP file named as: <firstName_LastName_ID_Project2.zip>.
4. A short 10 minutes DEMO of the project online as scheduled by the professor.

You might also like