Project Report
Distributed File System
Operating System
By
UMAMA KHAN (2617-2022)
IQRA AKHTAR (2519-2022)
WARDA (2125-2022)
Course Instructor
Mam Ishmal
Faculty of Engineering Sciences and Technology
Hamdard University, Karachi, Pakistan
Distributed File System Project
Objective
The primary goal of this project is to design and implement a distributed file system (DFS) on a
Linux platform. The system ensures efficient, secure, and reliable file storage and retrieval while
providing redundancy through file replication.
Scope
The DFS project aims to provide a robust file-sharing solution by enabling clients to transfer files
to a server that manages storage and replication. Key functionalities include:
1. File transfer between clients and the server.
2. File replication to ensure redundancy.
3. Logging of file transfer activities.
4. Support for multi-client interactions.
5. Integration with a configuration file for server and user management.
Functionality
1. File Transfer:
○ Files are transferred from clients to the server in chunks for efficient handling.
○ The server replicates each file to a backup to ensure redundancy.
2. File Replication:
○
Incoming files are stored in a main location and replicated to a backup file for
fault tolerance.
3. Logging:
○Transfer details, including timestamps and client IPs, are logged in a dedicated
[Link] file.
4. Multi-client Support:
○ The server handles simultaneous connections from multiple clients efficiently.
Implementation Details
1. Client Code Highlights:
○ Establishes a connection to the server.
○ Implements a retry mechanism to ensure successful file transfer.
○ Sends files in defined chunks for efficiency.
2. Server Code Highlights:
○ Listens for client connections on a specified port.
○ Receives files in chunks and writes them to the main and backup storage.
○ Logs transfer details with timestamps and client IP addresses.
3. Configuration File:
○ Stores server details (e.g., IP and port) and user credentials.
Commands
Setting Up the Project:
Create the directory structure:
○ mkdir -p DistributedFileSystem/src DistributedFileSystem/conf
DistributedFileSystem/logs
○ Save the provided files into their respective directories.
Compiling the Code:
Navigate to the project directory and run:
○ make
○ This generates the client and server binaries.
Running the Server:
./server
Uploading a File from the Client:
./client <filename> <server_ip> <server_port>
Viewing Logs:
Check the [Link] file for transfer details and timestamps.
cat logs/[Link]
Conclusion
The distributed file system provides a reliable and redundant solution for file storage and
transfer. By integrating robust mechanisms for replication, logging, and multi-client support, it
serves as an efficient platform for distributed file management. Future enhancements could
include the addition of encryption for secure file transfers and advanced monitoring tools for
server performance.