Network Program Implementation
Due: 4:00pm, Thursday, December 12, 2024
Network Program Implementation – File Server
In this assignment you will develop a file server application The server will
be a concurrent, connection-oriented multi-client file server. The concurrent
server can be implemented utilizing either processes or threads. The client
application will be similar to the sftp
program and implement a subset of the
sftp
commands.
Server Specifications
The name of the compiled program must be
fileserver
.The input to the program must be in the form of command line arguments as follows:
-p <string>
(required) port-d <string>
(required) directory to serve files from
The server must ensure that files are only served and created from within the given directory and its subdirectories. It is a security risk if a client can obtain files from arbitrary ancestor directories. If a client requests such a file, this must be indicated to the client somehow.
The server must be able to gracefully shutdown. If the server receives a CTRL-c to kill it, the server should send a message to all clients indicating it will be shutting down in x seconds, then wait x seconds and gracefully close. This should be done by using a signal handler for the SIGINT signal.
Client Specifications
The name of the compiled program must be
fileclient
.The input to the program must be in the form of command line arguments as follows:
-h <string>
(required) host-p <string>
(required) port
The client must be a read-eval-print loop (REPL) application, that is, is a simple interactive application that takes single user inputs, executes them, and returns the result to the user. These are the commands that the client must implement:
exit
– quit the application.cd [path]
– Change remote directory to path. Ifpath
is not specified, then change directory to the one the session started in.get [-R] remote-path [local-path]
– Retrieve theremote-path
and store it on the local machine. If the local path name is not specified, it is given the same name it has on the remote machine.If the
-R
flag is specified then directories will be copied recursively.help
– Display help text.lcd [path]
– Change local directory topath
. Ifpath
is not specified, then change directory to the local user’s home directory.lls [path]
– Display local directory listing of eitherpath
or current directory if path is not specified.lmkdir path
– Create local directory specified by path.lpwd
– Print local working directory.ls
[path]Display a remote directory listing of either path or the current directory if
path` is not specified.mkdir path
– Create remote directory specified by path.put [-R] local-path [remote-path]
– Uploadlocal-path
and store it on the remote machine. If the remote path name is not specified, it is given the same name it has on the local machine.If the
-R
flag is specified then directories will be copied recursively.pwd
- Display remote working directory.
Makefile Specifications
The makefile should build both the
fileclient
andfileserver
applications.Add a rule called
clean
to remove any temporary files and thewebserver
executable.
Readme File Specifications
Each team will create a readme file for their application. The readme file will include the following sections, at a minimum:
ID block
How to build and run the client and server
File/folder manifest identifying the purpose of each file/folder included in the project
Responsibility list – a list with and item for each team member and the aspects of the project to which they contributed
Protocol – the specific details of your developed protocol, including the wire protocol (that is, how the data is serialized to be sent or received over the socket)
Assumptions – clearly list and describe any assumptions made about running the application or how the application works
Discussion on your development process, including any decisions and/or major problems you encountered and your solution for each
Status – current status of the applications in terms of specifications, and any known issues with the applications
Files to Submit
To submit your assignment, create a zip file of a DIRECTORY named
final-project
containing the required files. Then submit that file to the
appropriate folder on D2L.
The submission must include:
All source files
Makefile or equivalent script to compile all source files, if necessary
Readme file