- Full Name: Nitzan Saar
- Student ID: 8106373693
I have completed the main requirements of the project, including extra credit, which includes:
- Implementation of a distributed file management system with authentication
- Support for both member and guest access
- File operations (lookup, push, remove)
- Deployment functionality
- Operation logging
-
serverM.c
- Main server coordinating all operations
- Handles client connections and routes requests
- Manages communication with other servers
- Implements thread-safe logging
- Supports both TCP (for clients) and UDP (for backend servers)
- Handles authentication, file operations, and deployment requests
-
serverA.c
- Authentication server
- Handles user credential verification
- Manages encrypted password storage
- Implements Caesar cipher decryption
- Supports both member and guest authentication
- Reads from members.txt and original.txt for credential verification
-
serverR.c
- Repository server
- Manages file storage and operations
- Handles file lookup, push, and remove requests
- Maintains filenames.txt database
- Supports file overwrite confirmation
- Implements concurrent file access safety
-
serverD.c
- Deployment server
- Manages file deployment operations
- Maintains deployment logs in deployed.txt
- Coordinates with serverR for file information
- Timestamps all deployments
- Provides detailed deployment status reports
-
client.c
- Client application
- Handles user interaction
- Manages connection with main server using dynamic ports:
- System automatically assigns available ports for each connection
- Uses getsockname() to retrieve the assigned port number
- Supports multiple concurrent client connections
- Different ports for member (25693) and guest (25694) connections
- Supports all file operations
- Implements guest and member modes
- Provides colored output for better readability
- Reports port numbers in operation logs for debugging
-
Supporting Files
- members.txt: Encrypted user credentials
- original.txt: Unencrypted user credentials
- filenames.txt: Repository file database
- deployed.txt: Deployment history log
- server_logs.txt: Operation history log
- Makefile: Build and management scripts
- Client → ServerM:
AUTH username password
- ServerM → ServerA:
username password
- ServerA → ServerM:
[MEMBER_AUTH_SUCCESS|GUEST_AUTH_SUCCESS|AUTH_FAILED]
-
Lookup
- Client → ServerM:
LOOKUP username
- ServerM → ServerR:
LOOKUP username requesting_user
- ServerR → ServerM:
[file list or error message]
- Client → ServerM:
-
Push
- Client → ServerM:
PUSH filename
- ServerM → ServerR:
PUSH username filename
- ServerR → ServerM:
[success message or OVERWRITE_CONFIRM]
- Client → ServerM:
-
Deploy
- Client → ServerM:
DEPLOY
- ServerM → ServerD:
DEPLOY username
- ServerD → ServerM:
[deployment status message]
- Client → ServerM:
-
Remove
- Client → ServerM:
REMOVE filename
- ServerM → ServerR:
REMOVE username filename
- ServerR → ServerM:
[success or error message]
- Client → ServerM:
-
Log
- Client → ServerM:
LOG
- ServerM → Client:
[operation history]
- Client → ServerM:
- The system assumes all servers are running on localhost (127.0.0.1)
- File operations are limited to text files
- The system may fail under the following conditions:
- If any server is not running when needed
- If the network connection is unstable
- If file permissions are not properly set
- If the system runs out of memory
No code was reused from external sources. All code was written from scratch for this project, with reference to standard socket programming documentation and course materials.
- Ubuntu 20.04 LTS
- C compiler (clang)
- Standard C libraries
- Network connectivity for localhost communication
The project includes a Makefile for easy compilation and management:
make all
: Compiles all servers and clientmake serverM
: Compiles only the main servermake serverA
: Compiles only the authentication servermake serverR
: Compiles only the repository servermake serverD
: Compiles only the deployment servermake client
: Compiles only the client applicationmake clean
: Removes all compiled executablesmake kill
: Terminates all running server processes (requires sudo)
-
Compile all components:
make all
-
Start the servers in separate terminals in this order:
./serverM ./serverA ./serverR ./serverD
-
Run the client:
./client username password
Or for guest access:
./client guest guest