0% found this document useful (0 votes)
2 views25 pages

Distributed Systems Unit 2

The document discusses the role of operating system support in distributed systems, highlighting the need for specialized OS support due to the complexities of managing multiple nodes, resources, and failures. It outlines different forms of OS support, including Network Operating Systems (NOS), Distributed Operating Systems (DOS), and middleware, along with key functions such as process management and communication support. Additionally, it covers protection mechanisms, processes and threads, and communication and invocation methods essential for coordination and resource management in distributed environments.

Uploaded by

charishma ramya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views25 pages

Distributed Systems Unit 2

The document discusses the role of operating system support in distributed systems, highlighting the need for specialized OS support due to the complexities of managing multiple nodes, resources, and failures. It outlines different forms of OS support, including Network Operating Systems (NOS), Distributed Operating Systems (DOS), and middleware, along with key functions such as process management and communication support. Additionally, it covers protection mechanisms, processes and threads, and communication and invocation methods essential for coordination and resource management in distributed environments.

Uploaded by

charishma ramya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

DISTRIBUTED SYSTEMS

UNIT II
Operating System Support- Introduction
🔹 What Is It About?
In a Distributed System (DS), multiple computers (nodes) work together to appear as a
single coherent system to the user. The Operating System (OS) plays a central role in
making this illusion of a unified system a reality.
The goal of OS support in DS is to manage resources, provide abstraction, and enable
communication and coordination between processes on different machines seamlessly.

🔹 Why Special OS Support Is Needed?


Traditional OSes like Windows or standard Linux distributions are designed for centralized
systems — one machine, one OS. But in distributed systems, you’re dealing with:
 Multiple nodes
 Geographically separated resources
 Independent failures
 Heterogeneous hardware and software
To handle this complexity, distributed systems need OS-level support for:
 Transparency (access, location, replication, concurrency, failure)
 Resource Management
 Communication and Security
 Process Coordination

🔹 Forms of OS Support in Distributed Systems


1. Network Operating Systems (NOS)
o Each node has its own independent OS.
o Communication is possible through standard protocols (e.g., TCP/IP).
o Examples: Windows with shared folders, traditional UNIX systems with NFS.
🔸 Limitation: Lack of transparency and tight integration.
2. Distributed Operating Systems (DOS)
o OS acts as a single system image across all machines.
o Users feel they’re using one system, not many.
o Examples: Amoeba, Sprite, Plan 9, Mach.
🔸 Challenge: Complex to implement and maintain.
3. Middleware Support
o Positioned between the OS and distributed apps.
o Provides APIs and services for transparency, communication, fault tolerance.
o Examples: CORBA, Java RMI, .NET Remoting.

🔹 Key OS Functions in DS Context


Function Description

Process Management Supports distributed process creation, migration, and termination.

Offers inter-process communication (IPC) mechanisms across


Communication Support
machines (sockets, RPC, RMI).

Manages resources globally, handles load balancing, replication,


Resource Management
and access control.

Naming and Directory Maintains consistent naming and locating of distributed


Services objects/processes.

Security and
Ensures secure access control and encrypted communications.
Authentication

🔹 Transparency and the OS


The OS in a distributed environment contributes to several forms of transparency:
 Access Transparency – Uniform interface to access local or remote resources.
 Location Transparency – Users don’t need to know where a resource resides.
 Concurrency Transparency – Allows multiple users to access the same resources
without interference.
 Failure Transparency – System recovers from node or communication failure
invisibly to the user.
🆚 Network OS (NOS) vs Distributed OS (DOS)

Network Operating System Distributed Operating System


Feature
(NOS) (DOS)

Users see a collection of


System View Users see a single unified system
independent systems

Low transparency: Users are High transparency: Hides


Transparency
aware of multiple systems complexity of distribution

Resource Each OS manages its own local OS manages global resources


Management resources collectively

Built-in IPC mechanisms like


Handled via standard protocols
Communication message passing, shared memory,
like TCP/IP, FTP, etc.
etc.

More scalable, as nodes can be Less scalable due to tight


Scalability
added easily integration

Generally manual recovery Has automatic failure detection and


Fault Tolerance
needed recovery

Users need to log in to different Users interact as if using a single


Ease of Use
machines separately system

Windows Server, UNIX with


Examples Amoeba, Sprite, Plan 9, Mach
NFS

Development
Simpler to develop and maintain Complex to develop and maintain
Complexity

Remote file access via network Global file system accessible


File Access
file sharing uniformly
OS LAYER

Q: Explain in detail about the Operating System Layer in Distributed Systems.

Introduction:
In a Distributed System (DS), multiple autonomous computers are interconnected and work
together as a single coherent system. The Operating System (OS) layer is a crucial
component that provides the necessary support for communication, coordination, and
resource management across all nodes in the distributed environment.

Definition:
The Operating System layer in a Distributed System refers to the combination of local
operating systems, communication mechanisms, and middleware that together provide a
platform to manage distributed resources, processes, and services efficiently and
transparently.

Layered Structure of OS in Distributed Systems:


The OS layer in a DS can be visualized in multiple levels:
1. Hardware Layer:
 Comprises the physical components like CPU, memory, and I/O devices of each node
in the network.

 Every node (computer) in the distributed system has its own hardware.

 The distributed OS uses this hardware to run programs and store data.

2. Local Operating System(kernel):


 Each node runs its own operating system such as Windows, Linux, or UNIX.
 Manages local resources and provides process scheduling, file handling, and memory
management.
3. Communication Layer:
 Ensures message passing between nodes using protocols like TCP/IP.
 Supports remote procedure calls (RPC) and sockets for inter-process communication.
4. Middleware Layer/Distributed services:
 Acts as a bridge between distributed applications and local OS services.
 Provides higher-level services like remote object invocation (e.g., Java RMI), naming,
authentication, and transaction management.
5. Application Layer:
 Includes distributed applications that rely on the OS and middleware for accessing
distributed resources.

(Programs you use)

(Makes computers work


together)

(How computers talk)

(Each computer's
manager)

(The computers)

Functions of the OS Layer in Distributed Systems:


Function Description

Handles creation, scheduling, and migration of processes across


Process Management
nodes.

Communication Offers mechanisms like message passing, RPC, and shared


Management memory.

Controls and allocates resources globally, including files,


Resource Management
memory, and devices.

Resolves names to addresses or resources in a distributed


Naming Services
environment.
Function Description

Security and
Provides secure access, data protection, and user verification.
Authentication

Fault Tolerance Detects and recovers from node or network failures.

Ensures correct operation when multiple processes access


Concurrency Control
shared resources.

Transparency Goals Achieved:


The OS layer supports the following types of transparency:
 Access Transparency – Uniform access to local and remote resources.
 Location Transparency – Resource location is hidden from the user.
 Concurrency Transparency – Supports simultaneous operations without
interference.
 Failure Transparency – Masks partial failures from users.
 Replication Transparency – Hides details of resource replication.

Types of OS Support in Distributed Systems:


1. Network Operating System (NOS):
o Independent OS on each node.
o Limited transparency and cooperation.
o Example: UNIX with NFS.
2. Distributed Operating System (DOS):
o Single system image to users.
o High level of integration and transparency.
o Example: Amoeba, Plan 9.
PROTECTION
Sure, Shubh! Here's a well-structured and detailed exam-writing format answer for the
topic "Protection in Distributed Systems" based on the JNTUH R18 syllabus for
CS812PE – Distributed Systems. This version is formal, crisp, and tailored for university
answer sheets.

Q: Explain in detail about Protection in Distributed Systems.

Introduction:
In a Distributed System (DS), multiple autonomous nodes share resources such as files,
memory, services, and devices across a network. Protection refers to the mechanisms that
control the access of programs, processes, or users to system resources, ensuring that only
authorized entities can access or modify data in the system.
Protection is essential to maintain data integrity, privacy, and system stability, especially
when users and resources are distributed over a network.

Definition:
Protection in distributed systems is the process of enforcing rules that define which user or
process is allowed to access, use, or modify specific resources across the distributed
environment.
It is implemented through a combination of hardware, operating system controls, and
security policies.

Objectives of Protection:
1. Controlled Access – Prevent unauthorized access to resources.
2. Data Integrity – Ensure data is not altered by unauthorized processes.
3. System Stability – Prevent one process from interfering with another.
4. Fault Isolation – Minimize the impact of failures caused by malicious or buggy
programs.

Protection Domains:
 A protection domain is a collection of objects (resources like files, memory,
printers) and the access rights (like read, write, execute) associated with those
objects.
 Domains define what a process can do within the system.
There are two types:
1. Static Domains – Defined at the time of process creation and do not change.
2. Dynamic Domains – Can be changed during process execution.

Access Matrix Model:


The Access Matrix Model is a framework used in protection systems to define and enforce
access rights of various users or processes (called subjects) over different system resources
(called objects).
It provides a two-dimensional matrix representation of access rights where:
 Rows represent Subjects (e.g., users, processes)
 Columns represent Objects (e.g., files, printers, memory)
 Each cell in the matrix contains a set of rights or permissions that the subject has
over the object.

Structure of the Access Matrix:


Here’s a simple example:

Subjects \ Objects File A File B Printer

User 1 read write —

User 2 read — print

Admin read/write read/write Manage

In this table:
 User 1 can read File A, write to File B.
 User 2 can read File A, and print using the printer.
 Admin has full rights over everything.

Implementation of Protection Mechanisms:


1. Access Control Lists (ACLs):
 Each object has a list of subjects and their allowed operations.
 Easy to verify who can do what on a specific resource.
2. Capability Lists (C-Lists):
 Each subject holds a list of objects and allowed operations.
 More efficient when verifying what a subject can access.
3. Role-Based Access Control (RBAC):
 Access rights are assigned to roles, and users are assigned to roles.
 Simplifies management in large systems.
4. Authentication and Authorization:
 Authentication verifies identity (e.g., via passwords or tokens).
 Authorization checks what the authenticated user is allowed to do.

Challenges in Distributed Protection:


1. Lack of Central Authority – Difficult to coordinate access rules across multiple
nodes.
2. Heterogeneous Systems – Different OSes and platforms may use different protection
mechanisms.
3. Latency and Scalability – Distributed checks may delay access decisions.
4. Consistency – Ensuring all nodes have up-to-date access control information.

Solutions and Best Practices:


 Use middleware to enforce centralized or federated protection rules.
 Implement directory services like LDAP to manage user permissions.
 Use encryption and secure protocols to protect access data during communication.
 Apply audit trails and logging to track unauthorized access attempts.

Processes and Threads

Q: Explain in detail about Processes and Threads in Distributed Systems.

Introduction:
In Distributed Systems (DS), computation is performed across multiple interconnected nodes.
The fundamental units of execution in such systems are processes and threads. They are
responsible for carrying out tasks such as managing communication, performing
computations, and accessing distributed resources. Understanding their behavior is crucial for
ensuring coordination, communication, and concurrency in distributed environments.
Definition:
 A Process is an independent unit of execution with its own memory space, code, and
data.
 A Thread is a lightweight unit of execution within a process. Multiple threads can
run in a single process and share the same memory space.

1. Processes in Distributed Systems:


❖ Characteristics:
 Processes run on different machines connected via a network.
 Each process has its own local OS and resource control.
 Communication between processes is done using message passing, such as RPC
(Remote Procedure Call) or RMI (Remote Method Invocation).
❖ Process Lifecycle:
1. Creation – A new process is created by the system or a user program.
2. Execution – The process runs its code.
3. Waiting – The process may wait for data or a response.
4. Termination – The process finishes its task and is destroyed.
❖ Role in Distributed Systems:
 Resource Allocation – Each process manages its own resources (memory, files, etc.).
 Isolation – Faults in one process do not affect others.
 Coordination – Processes may need synchronization to maintain consistency.
 Migration – Some systems allow processes to move between nodes for load
balancing.

2. Threads in Distributed Systems:


❖ Characteristics:
 Threads are smaller units that exist within a process.
 They share memory and state, which allows for efficient communication.
 Threads are ideal for performing concurrent tasks within the same application.

❖ Types:
 User-level threads – Managed by user-level libraries.
 Kernel-level threads – Managed by the operating system.
❖ Benefits:
 Faster context switching than processes.
 Shared address space makes inter-thread communication easy.
 Efficient use of multiprocessor systems.
❖ Role in DS:
 Used for handling multiple client requests simultaneously in servers.
 Ideal for non-blocking I/O operations.
 Common in multi-threaded servers, such as in web applications, file servers, and
database servers.
Comparison: Processes vs Threads
Feature Process Thread

Shared memory with other


Memory Separate memory space
threads

Communication Complex (via IPC, RPC) Simple (shared memory)

Higher (more context switch


Overhead Lower (lightweight switching)
time)

Fault Isolation Strong (isolated failures) Weak (can crash entire process)

Concurrency Lower Higher

Example Use Distributed computations Multi-threaded web server

Use Cases in Distributed Systems:


 Processes: Ideal for large-scale components like database nodes, computation
modules, etc.
 Threads: Ideal for handling multiple client requests, background tasks, or I/O
operations within a single node.

Communication and Invocation

🔷 Q: Explain in detail about Communication and Invocation in Distributed Systems.

1. Introduction:
Distributed systems consist of multiple independent computers (nodes) connected via a
network. These nodes need to communicate and coordinate with each other to perform
distributed tasks.
Two key mechanisms that enable this cooperation are:
 Communication – for data exchange between processes across machines.
 Invocation – for remote execution of functions or methods on other systems.
These mechanisms ensure transparency, modularity, and fault isolation in distributed
environments.
🔹 2. Communication in Distributed Systems:

2.1 Definition:
Communication refers to sending and receiving data between processes running on different
machines. It is essential for synchronization, data sharing, and cooperation in a distributed
setup.

2.2 Types of Communication Models:


➤ (a) Message Passing Model:
 Each process has its own memory and communicates via explicit messages.
 No shared memory.
 Suitable for distributed systems with loosely coupled nodes.
 Implemented using sockets, MPI, or custom protocols.
➤ (b) Distributed Shared Memory (DSM) Model:
 Emulates a shared memory space across multiple machines.
 Processes appear to read/write to shared memory, but the system handles data
consistency and replication.
 Easier for programmers but complex in implementation.

2.3 Communication Protocols:


 TCP (Transmission Control Protocol):
 Reliable, connection-oriented.
 Ensures ordered and complete delivery of messages.
 UDP (User Datagram Protocol):
 Connectionless, faster.
 No guarantee of delivery or ordering.

2.4 Basic Communication Primitives:


These are fundamental operations used in message passing:
 send(destination, message)
 receive(source, message)
 These primitives form the basis of low-level inter-process communication (IPC).
 Can be blocking (waits for response) or non-blocking (returns immediately).
 Used in socket programming, MPI, and other message-based systems.

🔹 3. Invocation in Distributed Systems:

3.1 Definition:
Invocation is the process where a client process calls a procedure/method located on a
remote server machine, as though it were local.
It hides the network complexity and provides location transparency.

3.2 Types of Invocation Mechanisms:

🔸 (a) Remote Procedure Call (RPC):


 Allows a process to call a function on a remote server.
 Appears to the programmer like a local function call.
 Handles:
o Marshalling – converting parameters into transmittable format.
o Unmarshalling – decoding parameters at the receiving end.
o Stubs – auto-generated code that acts as proxy on both sides.
Steps in RPC:
1. Client calls local stub.
2. Stub marshals parameters.
3. Sends the request to the remote server.
4. Server receives, unmarshals, and executes the procedure.
5. Result is sent back and unmarshalled on the client side.

🔸 (b) Remote Method Invocation (RMI):


 Object-oriented version of RPC (used in Java).
 Enables invocation of methods on remote objects.
 Supports pass-by-value and pass-by-reference.
Features:
 Used in Java RMI architecture.
 Objects are accessed via remote interfaces.
 Communication handled by RMI registry, skeletons, and stubs.

🔸 (c) Message-Oriented Middleware (MOM):


 Asynchronous message communication using message queues.
 Sender and receiver do not need to be active at the same time.
 Examples: Apache Kafka, RabbitMQ, JMS.
Best for: Event-driven systems, microservices, decoupled components.

🔹 4. Comparison Between RPC and RMI:


Feature RPC RMI

Language Style Procedural Object-Oriented

Platform C/C++, any language Java

Call Type Function Call Method Call on Object

Data Handling Marshalling of data Marshalling + Object References

Use Case System-level communication Java-based distributed systems

🔹 5. Challenges in Communication & Invocation:


1. Latency: Network delays may slow down remote invocations.
2. Partial Failures: One part may crash while others still run.
3. Concurrency: Handling simultaneous communication requests.
4. Security: Data in transit may be intercepted or tampered.
5. Heterogeneity: Different OS, hardware, and languages.
6. Marshalling Overhead: Adds computational cost during encoding/decoding.

🔹 6. Role of Middleware:
Middleware abstracts the complexity of communication and invocation:
 Examples: CORBA, Java RMI, gRPC, DCOM.
 Provides:
o Naming services
o Security layers
o Error handling
o Transparent invocation APIs

🔹 7. Use Cases:
Use Case Communication Type

Distributed database query RPC / RMI

Microservice-based app Message Queue (MOM)

UDP + Custom Message


Real-time multiplayer game
Protocol

Cloud service interaction gRPC or REST API

Operating system architecture,

🔷 Q: Explain in detail about Operating System Architecture in Distributed Systems.

1. Introduction:
An Operating System (OS) in a Distributed System (DS) acts as a software layer that
manages resources across multiple, geographically dispersed computers, making them
appear as a single cohesive system to users.
The OS architecture in DS determines how resources are accessed, shared, scheduled, and
protected across different nodes. The architecture influences transparency, scalability, fault-
tolerance, and performance of the system.

3. Operating System Architectures in Distributed Systems:


The OS architecture determines how the OS components are structured and how they
communicate. There are two main types:

🔹 1. Network Operating System (NOS):


➤ Definition:
A NOS is a traditional OS extended with networking capabilities. Each node runs its own
independent OS, and communication is handled via standard protocols like TCP/IP.
➤ Characteristics:
 Nodes are loosely coupled.
 Resource sharing is manual (via mounting, remote login, file transfer).
 Provides user-level services like remote file access, printing, and logins.
 Each node maintains control and autonomy.
➤ Examples:
UNIX with NFS, Windows Server, Novell NetWare
➤ Advantages:
 Simple and easy to implement.
 Each node can be independently managed.
➤ Limitations:
 Poor transparency (location, replication, concurrency).
 Lack of global coordination and uniform resource management.

🔹 2. Distributed Operating System (DOS):


➤ Definition:
A DOS provides a single system image (SSI) to users, making the distributed system appear
as one unified OS.
➤ Characteristics:
 Nodes are tightly coupled logically, even if physically apart.
 Provides global resource management and scheduling.
 Handles communication, synchronization, and security automatically.
 Supports transparency: location, access, migration, concurrency, and replication.
➤ Examples:
Amoeba, Sprite, LOCUS, Chorus, Mach, Inferno
➤ Advantages:
 Better resource utilization and fault tolerance.
 Easy for users/programmers (unified interface).
 Supports process migration, load balancing, and high availability.
➤ Limitations:
 Complex to implement.
 Harder to maintain consistency across nodes.

🔹 Comparison between NOS and DOS:


Feature Network OS (NOS) Distributed OS (DOS)

System Image Multiple OS views Single system image

Transparency Support Limited High (location, access, etc.)

Resource Management Local to each node Global, unified

User Interaction Requires user to manage Automatic and transparent

Fault Tolerance Minimal High

Examples UNIX + NFS, Windows Server Amoeba, Chorus, Mach

4. OS Layered Architecture in Distributed Systems:


The Operating System in DS is organized in layers from hardware up to user-level
applications:

🔸 Layer 0: Hardware Layer


 Physical CPUs, memory, I/O devices, network cards of individual nodes.
🔸 Layer 1: Local OS Kernel
 Each node runs a kernel (Linux, Unix, etc.) managing:
o Local CPU scheduling
o Memory and I/O management
o Device drivers
o Local IPC (Interprocess Communication)
🔸 Layer 2: Communication Layer
 Implements protocols like TCP/IP.
 Supports RPC, RMI, message passing.
 Ensures nodes can send/receive data reliably.
🔸 Layer 3: Distributed OS Services (Middleware)
 Abstracts the network and presents a cohesive distributed environment.
 Includes:
o Distributed file systems (DFS)
o Distributed shared memory (DSM)
o Process migration and scheduling
o Naming, synchronization, fault tolerance
o Security and authentication
🔸 Layer 4: Application Layer
 User applications (web apps, distributed databases, etc.)
 Interact with the distributed OS transparently.

5. Goals of a Distributed Operating System:


1. Transparency – Hide the complexity of distributed resources.
2. Scalability – Work efficiently as nodes increase.
3. Reliability – Tolerate failures and recover quickly.
4. Resource Sharing – Efficient use of hardware/software.
5. Concurrency – Multiple tasks execute in parallel.
6. Security – Prevent unauthorized access in a distributed context.

🔷 Distributed File Systems – Introduction

1. Introduction
A Distributed File System (DFS) is a file system that allows files to be stored across
multiple machines and accessed as if they were stored locally. It provides a unified
interface for users to interact with files regardless of their physical location in the network.
The DFS plays a critical role in distributed systems by enabling transparent, consistent, and
scalable file access, thus supporting resource sharing and distributed computing.

2. Definition
A Distributed File System is a system that manages file storage and access across multiple
computers in a network, giving users and applications the illusion of a single centralized
file system.

3. Goals and Objectives of DFS


The main objectives of a DFS are:
1. Transparency:
o Access Transparency: Users access remote files just like local ones.
o Location Transparency: Users don’t need to know the file’s physical
location.
o Concurrency Transparency: Multiple users can access the same file
simultaneously without conflict.
o Replication Transparency: Multiple copies of files are handled
automatically.
o Fault Tolerance Transparency: System continues to operate during partial
failures.
2. Scalability: Capable of handling growth in users, files, and requests.
3. Fault Tolerance: Maintains data availability even if a server or storage device fails.
4. Security: Ensures file access control, authentication, and data protection.
5. Performance: Optimized to provide fast and reliable file access over the network.

4. Basic Architecture of a DFS


A DFS consists of the following components:
 Clients: Systems that access files using the DFS interface.
 Servers: Systems that store and manage file data and metadata.
 Communication Network: Connects clients and servers.
 Naming Service: Maintains mappings from logical file names to physical locations.
Clients send file requests (read/write) to servers through a communication protocol (like
RPC), and servers respond accordingly.

5. Features of DFS
Feature Description

A single logical file system view, regardless of the underlying


Global Namespace
hardware.

File Sharing Multiple users can access and share files concurrently.

Location
Files can be moved without affecting user access.
Independence

Frequently used files are stored temporarily on the client side to


Caching
improve performance.

Replication Files can be duplicated across servers to ensure availability.

6. Examples of Distributed File Systems


DFS Description

Network File System by Sun Microsystems. Provides remote access to files over a
NFS
network.

AFS Andrew File System, known for scalability and caching.

HDFS Hadoop Distributed File System, used for storing large data sets in big data systems.

GFS Google File System, optimized for massive-scale data processing.

7. Advantages of DFS
 Facilitates centralized file management across multiple systems.
 Provides location transparency and ease of access.
 Enhances fault tolerance through file replication.
 Supports concurrent access with proper consistency mechanisms.
 Enables scalable and distributed storage solutions.

8. Challenges in DFS
 Maintaining consistency across multiple replicas.
 Ensuring security and authentication in a networked environment.
 Handling failures gracefully and maintaining availability.
 Managing data synchronization across distributed nodes.
 Latency issues in accessing remote files compared to local ones.

File Service architecture.


🔷 Q: Explain in detail about File Service Architecture in Distributed Systems.

1. Introduction
In a Distributed File System (DFS), the File Service Architecture defines how file services
are structured and how client applications interact with files stored across a network.
The architecture is designed to provide access transparency, efficient file sharing, and
reliable communication between clients and file servers in a distributed environment.

2. Definition
File Service Architecture refers to the logical structure and components used to deliver
file-related operations such as reading, writing, creating, deleting, and updating files in a
distributed file system.
The architecture separates logical file system functions from physical storage mechanisms,
promoting modularity and scalability.

3. Objectives of File Service Architecture


 Provide a clear interface for file operations.
 Support transparent access to remote files.
 Enable file sharing, protection, and synchronization.
 Manage consistency and concurrency across multiple clients.
 Allow for scalability and fault-tolerant access.

4. Major Models of File Service Architecture


There are two main models commonly used:

🔹 1. Flat File Service


➤ Description:
 Provides basic operations on file contents without exposing any file structure or
organization.
 Operates on files identified by unique identifiers (not file names).
➤ Features:
 Simplified, low-level access.
 Client has no knowledge of file naming or hierarchy.
 Typically used as the lowest layer of abstraction.
➤ Example Operations:
 read(fileID, offset, size)
 write(fileID, offset, data)

🔹 2. Directory Service
➤ Description:
 Maps human-readable file names to internal file identifiers used by the flat file
service.
 Provides naming, grouping, and file organization features.
➤ Features:
 Supports hierarchical file organization (folders/directories).
 Resolves file names to file IDs.
➤ Example:
 lookup("/user/shubh/notes.txt") → returns file ID
 create("/user/shubh/newfile.txt")

🔹 3. Client Module
 Provides user interface for performing file operations.
 Translates user requests into calls to directory or flat file service.
 May include caching mechanisms to improve performance.

5. File Service Architecture Layers (Layered Design)


File service architecture can be viewed as a 3-layer structure:
+----------------------+
| Client Interface | ← (User Applications)
+----------------------+
| Directory Service | ← (Maps names to file IDs)
+----------------------+
| Flat File Service | ← (Low-level file access using IDs)
+----------------------+
| File Storage | ← (Manages disk blocks on servers)
+----------------------+

6. Communication Between Client and Server


 Clients use Remote Procedure Call (RPC) or Message Passing to interact with the
file server.
 The server performs the operation and returns results to the client.
 Example: When a user opens a file:
o The directory service resolves the file name.
o The flat file service handles reading the contents.

7. Characteristics of File Service Architecture


Feature Description

Modular Design Different layers handle naming, data access, and storage independently.

Transparency Clients access files without knowing their physical location.

Security Layers can enforce authentication and authorization.

Efficiency Caching and replication improve performance.

8. Examples of File Services


System Architecture

NFS Combines flat file service with stateless servers.

AFS Offers location and access transparency using caching.

HDFS Uses a master-slave model with metadata and data blocks.

9. Advantages of File Service Architecture


 Promotes modularity and maintainability.
 Supports scalability for large distributed systems.
 Allows for fault isolation and security enforcement.
 Easy to enhance or replace individual components.

You might also like