Distributed Operating Systems:
System Architectures- Design issues –
Communication models – clock
synchronization – mutual exclusion –
election algorithms- Distributed
Deadlock detection.
🌐 What is a Distributed System?
A Distributed System is:
A system where multiple computers (or devices), connected by a network,
communicate and coordinate with each other by exchanging messages.
These components could be:
• Hardware (like servers or mobile devices)
• Software (like applications or services)
• They are physically separated but work together like a single system.
🔑 Characteristics of Distributed Systems
1. Concurrency (Multiple things happening at once)
In a distributed system, many computers can run programs at the same time.
For example:
You can edit a document on Google Docs.
At the same time, your friend, sitting far away, can also work on the same document.
Resources (like files, printers, or web pages) are shared, and more computers can be
added to improve performance.
✅ Advantage: Efficient use of resources and better speed.
2. No Global Clock
There's no single clock that all computers in the system can rely on.
This is because:
• Each computer has its own internal clock.
• Network delays mean time cannot be perfectly synchronized.
• So, coordination is done by sending messages, not by assuming all computers know the
same time.
📌 Example: When two users update a shared file at the same time, the system can't always
tell which update came first unless it carefully tracks the order of messages.
3. Independent Failures
Any component (a program, a computer, or the network itself) can fail at any time.
These failures are independent – one part may crash, others may still keep running.
The system must be designed to detect, handle, or recover from such failures.
🧠 Real-world example:
• A user tries to send money using an app.
• If the server processing the payment crashes, the app must detect this and retry or
alert the user.
• ✅ Why it’s challenging: Some failures are invisible to other parts of the system.
For example:
• A server may crash.
• Other systems won’t know if it crashed or if the network is just slow.
📚 Examples of Distributed Systems
1. The Internet
What it is: A massive collection of networks connected together.
Uses Internet Protocol (IP) to send messages between computers.
It supports services like:
• Websites (through HTTP)
• Emails
• Video calls
🛑 Important Note: The Web ≠ Internet
The Web is just one service on the Internet (like Google, YouTube).
The Internet includes many more systems beyond the web.
2. Intranet
A private network used within organizations (like schools, offices).
Same principles as the internet, but it's closed and secure.
Used for:
• Internal communications
• File sharing
• Employee services (like leave applications)
3. Mobile Computing
Devices like smartphones, tablets, laptops that access networked services anytime,
anywhere.
Mobile apps use distributed systems in the background:
• Cloud storage (like Google Drive)
• Streaming (like Netflix)
• Messaging (like WhatsApp)
🌐 RESOURCE SHARING IN DISTRIBUTED SYSTEMS
🔄 What is Resource Sharing?
In a distributed system, resources (like files, printers, databases, or websites) are
shared across multiple computers to:
• Reduce cost (e.g., sharing one printer instead of buying many)
• Improve access (users can access resources from different locations)
• Support collaboration (e.g., shared documents
📊 Two Main Types of Resources:
Type Examples
Hardware Resources Printer, camera, storage, etc.
High-level Resources Databases, websites, web pages, files
Users care more about the data than about where it comes from. For
example, you don’t need to know which server hosts a Google result —
you just care about the result.
🤝 Patterns of Resource Sharing
Depending on how users interact, sharing can happen in different ways:
1. Search Engine (No user contact)
• Users just send queries.
• No need to know or collaborate with other users.
• Example: Google, Bing
2. CSCW – Computer Supported Cooperative Working (Direct
cooperation)
• Users share and collaborate on files/documents in real time.
➕ To Share Resources Effectively:
Each resource must be controlled by a program that:
• Manages access.
• Provides a communication interface (API or protocol).
• Ensures consistency and reliability when multiple users try to access or update
it.
🖥️ CLIENT AND SERVER MODEL
➤ SERVER
A program running on a computer.
It waits for requests from other programs (clients) and provides services.
➤ Client
• A program that requests services from a server.
• Example: A web browser (like Chrome) is a client requesting pages from a web server.
➤ Remote Invocation
• When a client asks a server to perform an action.
• Example: When your browser opens www.wikipedia.org, it is invoking a service on the
Wikipedia server.
➤ Object-Based Access
• Resources can be encapsulated as objects.
• Clients access these by invoking methods on server-side objects.
• Common in object-oriented distributed systems (e.g., CORBA, Java RMI).
🌍 WORLD WIDE WEB (WWW)
✅ Definition:
The World Wide Web (WWW) is a global system for publishing and accessing
information and services over the Internet.
🔓 Key Features:
• It is an open system:
• Based on public standards (HTML, URL, HTTP).
• Anyone can publish or access content.
Uses hypertext:
• Web pages contain links to other documents/resources.
• These links form a web-like structure.
• The structure is unlimited and can be as complex as needed.
🔧 Technological Components of the Web
1. HTML (Hypertext Markup Language)
• Describes the content and layout of a web page.
• Examples:
• Content: Text, tables, forms, images, links, metadata
• Layout: Text styles, frames, colors, formatting
2. URL (Uniform Resource Locator)
• A URL uniquely identifies a web resource so the browser knows where to find it.
Format:arduino
scheme://location
3. HTTP (HyperText Transfer Protocol)
The protocol used by web browsers and servers to communicate.
Key Features:
• Request-reply model (client sends a request; server sends a
response).
• One resource per request (e.g., HTML, image, CSS, etc.).
• Concurrent requests supported (multiple resources at once).
• Can handle different content types (PDF, video, etc.).
• Supports access control and security (e.g., HTTPS).
• Supports dynamic content (generated on demand).
⚙️ Dynamic Web Technologies
1. CGI (Common Gateway Interface)
Allows web servers to run server-side scripts (like Perl) to handle forms.
2. JavaScript
A client-side scripting language.
Runs in the browser after being downloaded from the server.
Used for interactivity and dynamic behavior.
3. Applet
A small Java program downloaded from a server and run in the browser (less common
today due to security).
📌 Challenges in Distributed Systems
As distributed systems grow more powerful and complex, developers face many
technical challenges. These challenges must be addressed to build reliable, secure, and
scalable systems.
🔷 1. Heterogeneity
Heterogeneity means “diversity” – distributed systems must work across different types
of hardware, networks, and software platforms.
📌 Heterogeneity Appears In:
❗ Problem:
Different systems use different data formats, character sets, and protocols. These
must be standardized so that communication is possible between components.
✅ Solution: Middleware
• Acts as a software layer between applications and the network.
• Hides differences between OS, hardware, and languages.
• Examples: CORBA, RMI, .NET Remoting, Web Services, gRPC.
💡 Mobile Code:
• Program code that moves from one machine to another (e.g., Java applets).
• Challenge: The code must be compatible with the destination machine’s OS and
CPU.
🔷 2. Openness
An open distributed system is one that is extensible and based on published
standards.
📌 Openness Includes:
• Interoperability: Ability of systems to work together.
• Portability: Ability to move applications between environments.
• Flexibility: Easy to modify or add new components.
✅ Use Open Standards:
• Protocols like TCP/IP, HTTP, XML, REST APIs.
• Interface description languages (e.g., IDL, WSDL).
📌 Architectural Models of Distributed Systems
An architectural model describes how components are placed and interact in a
distributed system. It helps developers design a system that is:
✅ Reliable
✅ Manageable
✅ Adaptable
✅ Cost-effective
🔷 What is an Architectural Model?
• It's a high-level blueprint of the system's structure.
• It describes components (hardware/software) and their relationships.
• It shows how clients, servers, and peers communicate to perform
tasks.
🔷 Why Architectural Models?
• Help manage complexity by breaking the system into simpler parts.
• Ensure the system can handle current and future needs.
• Guide deployment, development, and maintenance.
🏗️ Software Architecture in Distributed Systems
Distributed software is designed using layers and services to reduce complexity.
🔸 Layer
A collection of related functions.
Each layer provides services to the one above it.
🔸 Service
A functionality provided by one layer to another (e.g., file access, message transfer).
🧭 Variants of the Client-Server Model
The traditional client-server model is limited in terms of scalability and performance,
especially when:
• Too many clients overload a single server.
• Network bandwidth is insufficient.
• Services require dynamic or mobile interaction.
• To overcome this, several variants of the basic client-server architecture are used.
🧩 Fundamental Models in Distributed Systems
Fundamental models provide abstract frameworks to describe core properties that exist in all
architectural models of distributed systems, irrespective of how they are structured.
🧠 Purpose of Fundamental Models
To describe common features of all architectural models in a formal, general way.
To help understand and predict system behavior under different conditions like delays,
failures, or concurrent operations.
Fundamental models deal with:
1.Interaction Model
2.Failure Model
3.Security Model
2.🔹 Failure Model in Distributed Systems
A Failure Model defines and classifies the types of faults that may occur in a distributed
system. In such systems, both processes and communication channels may fail,
deviating from the expected or correct behavior.
• Process p sends a message m → it enters outgoing buffer.
• Communication channel may fail to deliver it to process q's incoming buffer.
• This is termed “dropping the message.”
🔐 Security Model in Distributed Systems
The security model is concerned with protecting distributed systems against
malicious attacks, ensuring the confidentiality, integrity, and availability of system
resources.
✅ Purpose of Security Model
• Defines and classifies types of attacks.
• Provides a basis for analyzing potential threats.
• Supports the design of secure systems that can resist or mitigate such threats
✅ Time and Global States in Distributed Systems
✅ Logical Time and Logical Clocks in Distributed Systems
📌 Marker Messages
• Used as special messages:
• Help a process know when to record its state.
• Help differentiate between messages sent before and after the snapshot.
✅ Coordination and Agreement
Introduction
• In a distributed system, a set of processes must coordinate their actions.
• A common need is to agree on one or more values (used in consensus, election,
synchronization).
• Avoid a fixed master-slave model to reduce the risk of a single point of failure.
🔸 Types of Election Algorithms:
Bully Algorithm:
• Highest-ID process becomes coordinator.
• Higher-ID processes override lower ones during
election.
Ring Algorithm:
• Processes are organized in a logical ring.
• Tokens are passed to determine the new leader.
📘 Multicast Communication in Distributed Systems
🧩 Introduction
Multicast communication allows a process to send a message to a group of processes
simultaneously instead of sending it individually to each one. It is an essential communication
model in distributed systems, where coordination and consistency among multiple processes
is required.
🎯 Goals of Multicast Communication
1.Efficient Group Messaging: Every member of the group should receive the message with
minimal overhead.
2.Ordering Guarantees: Ensure proper order of message delivery across processes.
3.Reliability: Even if some failures occur, the message must be delivered consistently.
🚧 Challenges
Efficiency: Reduce network bandwidth use, improve throughput.
Consistency: Ensure all correct processes get the message once and in the same
order.
Fault tolerance: Handle process crashes or message losses
📘 Types of Message Ordering in Distributed Systems
In distributed systems, multiple processes communicate by exchanging messages.
However, due to the absence of a global clock and varying transmission delays, it is
difficult to ensure that all processes see messages in the same order.
To maintain consistency and coordination, message ordering is needed. There are three
key types:
Interprocess
Communication
INTRODUCTION:
The java API for inter process communication in the internet provides both
datagram and stream communication. The two communication patterns that
are most commonly used in distributed programs.
Client-Server communication :
The request and reply messages provide the basis for remote method
invocation (RMI) or remote procedure call (RPC). Group communication The
same message is sent to several processes. This chapter is concerned with
middleware
Remote Method Invocation (RMI)
It allows an object to invoke a method in an object in a remote process. E.g.
CORBA and Java RMI Remote Procedure Call (RPC) It allows a client to call a
procedure in a remote server.
🔄 Characteristics of Interprocess Communication (IPC)
In a distributed system, processes running on different machines or within the same
machine need to communicate and coordinate their actions. This is done through
interprocess communication (IPC). Here are the main characteristics:
1️⃣ Synchronous vs. Asynchronous Communication
✅ Synchronous Communication
• Both send and receive are blocking.
• The sender waits until the receiver acknowledges receipt.
• Ensures tight synchronization between sender and receiver.
Three approaches to external data representation and marshalling
are:
CORBA
Java’s object serialization
XML
🧠 The Serializable interface is a marker
interface (no methods)—it tells the JVM
that this object can be serialized.
💻 Client-Server Communication in Distributed Systems
📌 Definition:
Client-server communication is a model in distributed systems where clients request
services, and servers provide responses over a network. This interaction often uses
request-reply protocols and supports Remote Procedure Calls (RPCs)
🌐 Group Communication in Distributed Systems
✅ What is Group Communication?
In distributed systems, sometimes a single process needs to send the same message to
multiple processes. Instead of sending messages one-by-one (pairwise communication), a
multicast operation is used.
🔄 Multicast Communication
• A single message is sent to a group of processes.
• More efficient than sending N separate messages.
• Common in systems with replication, event notifications, or discovery services
🧠 Interprocess Communication (IPC) in UNIX
(Shared Memory and Message Passing)
In a distributed or multiprogramming system, Interprocess Communication (IPC) allows
processes to coordinate and exchange data.
There are two major IPC methods:
1.Shared Memory
2.Message Passing
• One process (Producer) generates data (items).
• Another process (Consumer) uses (consumes) that data.
• Both processes share a common buffer (shared memory), used as a communication
channel.
• In the bounded buffer version, the shared buffer has a fixed size (N).
• Producer can produce items and store them in the buffer until it is full.
• If buffer is full, Producer waits.
• Consumer can consume items from the buffer if it's not empty.
• If buffer is empty, Consumer waits.
• Sending Process sends a
message via the message
passing module.
• Receiving Process gets the
message through its own
module.
• Messages contain a header
(type, destination, source,
length, control info) and a
body (payload).
🧰 Resource Allocation Graph (RAG)
A Resource Allocation Graph (RAG) visually shows the relationships between
processes and resources in a system, helping to detect and analyze potential
deadlocks.
Graph Components:
• Process nodes: Represented by circles, one per process (e.g., P1, P2)
• Resource nodes: Represented by squares, potentially containing dots for multiple
resource instances
• Edges:
• Request edge: From process to resource (P→R), meaning the process is waiting for
the resource
• Assignment edge: From resource to process (R→P), meaning the resource is
currently held by that process
Banker's Algorithm in Operating
System