The Network File System (NFS) is a distributed file system architecture that enables clients to interact with files stored on remote servers seamlessly. This implementation consists of three primary components:
- Clients: Systems or users requesting file operations (e.g., read, write, delete, stream) within the NFS.
- Naming Server (NM): A central hub coordinating client and server communications by locating the appropriate storage server for requested files or folders.
- Storage Servers (SS): Servers managing the physical storage and retrieval of files and directories, ensuring data persistence and accessibility.
- Writing a File/Folder: Create and update content within the NFS, including synchronous and asynchronous writes.
- Reading a File: Retrieve the contents of files stored in the NFS.
- Deleting a File/Folder: Remove files or directories to manage storage efficiently.
- Creating a File/Folder: Generate new files and directories within the system.
- Listing All Files and Folders: Navigate the file structure and retrieve directory contents.
- Getting File Metadata: Access file details such as size, permissions, and timestamps.
- Streaming Audio Files: Stream audio directly from the NFS.
- Naming Server Initialization:
- Manages directory structure and file locations.
- Registers with clients and storage servers dynamically, handling non-hardcoded IPs and ports.
- Storage Server Initialization:
- Storage servers register with the Naming Server by providing their IP, port, and accessible paths.
- Multiple storage servers can dynamically join the system during runtime.
- Dynamic Addition of Servers:
- New storage servers can register with the NM at any time.
- Commands from NM:
- Create Empty File/Directory: Initialize a new file or folder.
- Delete File/Directory: Remove specific data items.
- Copy Files/Directories: Transfer data between servers using NM-provided addresses.
- Client Interactions:
- Read and write operations.
- Retrieve file size and permissions.
- Stream audio files.
- Central Repository: Stores details about all connected storage servers and their accessible paths.
- Client Feedback: Provides clients with task status and server information for requested operations.
Clients interact with the Naming Server to perform various file-related tasks, such as:
- Path Resolution:
- E.g.,
READ dir1/dir2/file.txttriggers NM to locate the file and provide the correct SS details.
- E.g.,
- File/Folder Management:
- Reading/Writing Files: Access and modify file contents.
- Creating/Deleting Files: Initialize or remove data items.
- File Copying: Transfer files or directories between SSs.
- Listing Accessible Paths: Retrieve all available paths for exploration.
Client: READ <path>
NS: IP: 10.2.141.242 Port: 5050
Client sends request to SS.
SS: "File content response."Client: STREAM <path>
NS: IP: 10.2.141.242 Port: 5050
Client sends request to SS.
SS sends audio packets to client for streaming.Client: CREATE <path> <name>
NS checks availability of path.
NS sends request to SS to create file.
SS: "Acknowledgment sent to NM."
NM: "Acknowledgment sent to client."- GCC compiler
- Network-enabled environment
- Clone the repository:
git clone <repository-link>
- Compile the code:
make
- Start the Naming Server:
./naming_server
- Initialize Storage Servers:
./storage_server <server_id> <config>
- Run the Client:
./client
- IPs and ports must be dynamically assigned during runtime.
- Each SS should specify accessible paths during initialization.
- Asynchronous Writes: Optimized performance for large files.
- Dynamic Server Addition: Scale storage dynamically.
- File Metadata Retrieval: Comprehensive insights into stored files.
- Audio Streaming Support: Stream directly to media players.
- Add redundancy mechanisms for fault tolerance.
- Implement user authentication and access control.