BGU System Programming (SPL) 3rd assignment. Written in Java and build with Maven.
This is an implementation extended TFTP protocol (Trivial File Transfer Protocol) and an implementation of a server that utilize the protocol for bi-directional file transfer between a server and multiple clients.
- Clone the Repository
- Build the Project: using Maven
mvn clean compile mvn exec:java -Dexec.mainClass="bgu.spl.net.impl.tftp.TftpServer" -Dexec.args="PORT"
- Run the Server:
java -jar ./server.jar PORT
- Run the client
./client/Tftpclinet IP PORT
The original repo for the Rust client provided by the course staff is available at The course Github repo
The TFTP server is a file transfer protocol allowing multiple users to upload and download files from the server and announce when files are added or deleted to the server. The communication between the server and the client(s) is be performed using a binary communication protocol, which support the upload, download, and lookup of files.
- User Authentication: Users can log in to the server by providing a username that uniuqly identifies them, and log out at the end of use.
- File Operations: Users can read files from and write files into the server, and delete files from the server.
- Directory Listing: Users can perform files lookup.
- Broadcast Notifications: The server broadcasts notifications to all logged-in users when files are added or deleted.
- TCP Usage: unlink the original TFTP protocol, which is based on UDP - This implementation is based on TCP.
The implementation of the server is based on the Thread-Per-Client (TPC) architecture, which creates a working thread for every client connecting to the server. The server itself is generic and have no dependence of the specific protocol.
The server's comminication is based on TCP (Transmission Control Protocol) as a design choice for a session orianted commonication.
The clients can interact with the server with following commands:
-
LOGRQ: Login to the server with a username. two clients can't have the same username.
- Format:
LOGRQ <Username>
- Example:
LOGRQ Puck
- Format:
-
DELRQ: Delete a file from the server.
- Format:
DELRQ <Filename>
- Example:
DELRQ example.txt
- Format:
-
RRQ: Download a file from the server to the current directory.
- Format:
RRQ <Filename>
- Example:
RRQ example.txt
- Format:
-
WRQ: Upload a file from the current directory to the server.
- Format:
WRQ <Filename>
- Example:
WRQ example.txt
- Format:
-
DIRQ: List all filenames available on the server.
- Format:
DIRQ
- Format:
-
DISC: Disconnect from the server and exit the client. freeing the client's usename.
-
Format:
DISC
-
Data: The Data packets that transfer information or files between machines. Max size per pakcet: 518 Bytes.
-
ACK: used to acknowledge different packets, send to the sender after every packet is received. (and between data packets for a large file)
-
BCAST: used to notify all logged-in clients that a file was deleted/added. This is a Server to client message only.
-
ERROR sent in case some error have occoured. list of errors:
Is available here at pages 12-13
- Java
- Maven version 3.6.3 or later
- Stable internet connection (or LAN connection)