ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY
COLLEGE OF ELECTRICAL AND COMPUTING
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING
Course Title: Distributed Systems
Course Code: CSEg5207
INDIVIDUAL ASSIGNMENT
Prepared by [Link]
1. Ashenafi Damena UGR/25579/14
Submitted to: Dr. Dr. Dereje Regassa Edessa
Submitted Date: January 6, 2026 GC
1. Discuss the different middleware models.
Middleware is software that lies between the operating system and applications, enabling
communication and coordination in distributed systems and it primarily serves as an
intermediary layer facilitating communication and integration in distributed environments, with
common models including message-oriented, remote procedure call (RPC), and object request
broker (ORB) by providing a unified programming model for distributed applications.
a) Remote Procedure Call (RPC) Model
Allows a program to call a procedure on a remote machine as if it were local.
It hides network communication details such as message passing via stubs and
marshaling/un-marshaling of parameters.
Example: gRPC, Java RMI.
Advantages:
Simple programming model
Location transparency
Disadvantages:
Network failures are harder to handle
Blocking calls can reduce performance
b) Message-Oriented Middleware (MOM)
Enables asynchronous communication via message queues. Processes send/persist
messages to queues, and receivers consume them when available
Sender and receiver are loosely coupled.
Supports decoupling and reliable delivery
Example: RabbitMQ, Apache Kafka.
Advantages:
Asynchronous communication
Fault tolerance
Disadvantages:
More complex logic
Message ordering issues
c) Object-Oriented Middleware
Object-Oriented Middleware is a middleware paradigm that extends the core principles of
object-oriented programming (encapsulation, inheritance, polymorphism) to a distributed
environment. It allows objects to be distributed across different processes and machines,
enabling remote method invocation (RMI) as if the objects were local
Distributed objects communicate through method invocations.
Example: CORBA, Java RMI.
Advantages:
Supports abstraction and reuse
Platform independent
Disadvantages:
Performance overhead
Complexity
2. Discuss distributed shared memory in detail, including its applications.
DSM is an abstraction that provides a shared memory space across physically distributed nodes,
even though each node has its own private memory. It creates the illusion of a single shared
address space, simplifying parallel programming.
Architecturally, DSM can be hardware-assisted (e.g., via cache coherence circuits) or software-
based. DSM architectures typically use page-based, variable-based, or object-based approaches
to share memory, with consistency models like release or entry ensuring data integrity.
Page-based: Memory divided into fixed-size pages, with virtual memory handling faults
(e.g., TreadMarks).
Shared-variable: Routines access variables across nodes.
Object-based: Shares data as objects, promoting modularity.
How DSM Works
Memory is physically distributed but logically shared.
The system handles data movement and consistency automatically.
Accessed using read/write operations like local memory.
Consistency Models
Strict consistency
Sequential consistency
Weak consistency
Advantages
Easier programming (no explicit message passing)
Simplifies parallel algorithms
Disadvantages
Performance overhead
Complexity in maintaining consistency
False sharing (unrelated variables on same page cause unnecessary transfers).
Scalability issues due to network latency and coherence overhead.
Consistency vs. performance trade-offs.
Applications
Multi-core and cluster computing
Shared data processing frameworks
Parallel Computing: Simplifies programming for scientific simulations, matrix
operations.
Distributed Databases: Can be used for caching and replication.
Collaborative Applications: Shared editing, multi-user games.
Cluster Computing: Allows legacy shared-memory applications to run on distributed
clusters.
3. Discuss the common issues that a designer of a heterogeneous distributed system
must deal with.
Heterogeneity refers to differences in hardware, OS, networks, programming languages, and data
representations.
Common Design Issues
1. Hardware Diversity
Different CPU architectures and performance levels
2. Operating System Differences
File systems, process management, and scheduling vary
3. Data Representation
Byte order (big-endian vs little-endian)
Data formats
character encoding, alignment. Middleware handles marshaling.
4. Communication Protocols
Incompatible network protocols different systems may use incompatible communication
protocols; requires gateways or middleware translation.
5. Security
Different authentication and authorization mechanisms or model and encryption
standards
6. Scalability
System must grow without performance degradation
7. Administrative Domains
Policies, pricing, and management may differ across organizations.
4. In a distributed system, what is a process, and how does it differ from a process in
a single (centralized) system? Explain how distributed processes communicate with
each other and discuss one challenge that arises from managing processes across
multiple machines.
What Is a Process?
A process is a running instance of a program with its own execution state.
Process in a Centralized System: A program in execution with its own address space,
resources, and state, managed by a single OS kernel.
Process in a Distributed System: Also a program in execution but may span multiple machines.
It can be:
Client Process: Requests services.
Server Process: Provides services.
Peer Process: Both client and server.
Distributed vs Centralized Process
Aspect Centralized System Distributed
Location Single machine Multiple machine
Communication Shared memory Message passing
Failure Easier to detect Partial failure
Control Centralized Decentralized
Process Communication
Message passing (send/receive) (sockets, MPI)
Remote method invocation (RPC/RMI)
Shared data(memory) abstractions (DSM)
One Key Challenge
Process coordination and failure detection If one machine crashes, others may not
immediately know, causing inconsistency. Challenge Example – Failure Handling: If a
process on Machine A crashes while communicating with Machine B, B may hang waiting for a
response. Solutions include timeouts, heartbeat mechanisms, and idempotent operations for
retries.
5. Explain the concept of communication in a distributed system. In your answer,
describe the different communication models used, explain how messages are
transmitted between processes, and discuss one challenge (such as latency,
synchronization, or reliability) with an example.
Concept
Communication allows distributed processes to exchange data and coordinate actions.
Communication Models
1. Message Passing
Explicit send/receive operations
Synchronous or asynchronous
2. RPC / RMI
Method calls across machines
3. Stream-Oriented Communication
Continuous data flow (e.g., video streaming)
4. Client-Server:
Request-reply pattern over protocols like HTTP, RPC.
5. Group/Multicast:
One-to-many or many-to-many communication (e.g., publish-subscribe).
Message Transmission
Marshaling: Packaging data into a transmittable format.
Sender encodes data
Addressing: Using IP addresses and ports.
Protocols: Transport layer (TCP/UDP) ensures reliability or speed.
Network transmits packets
Demarshaling: Unpacking at receiver.
Receiver decodes data
Challenge: Latency
Latency is the delay between sending and receiving a message.
Example1: A banking system with servers in different countries may experience delays, causing
slow transaction confirmation.
Example2: In a globally distributed database, a write in Ethiopia may take 100ms to replicate to
America. If a user in America reads immediately, they might see stale data (eventual consistency
issue). Solutions include:
Caching: But risks inconsistency.
Consensus Protocols: Like Paxos/Raft, but increase latency due to coordination.
6. Explain coordination and synchronization in a distributed system. Describe why
they are necessary, discuss at least two mechanisms used to achieve them (such
as clocks, mutual exclusion, or consensus), and illustrate your answer with a
practical example showing what could go wrong if synchronization is not
properly handled.
Coordination ensures orderly interaction among distributed processes; synchronization aligns
their actions in time or sequence.
Why They Are Necessary
To maintain data consistency (e.g., in distributed databases).
To avoid race conditions in shared resources.
To agree on system state (e.g., leader election, transaction commit).
Maintain correct execution order
Mechanisms
a). Logical Clocks (Lamport Clocks): Assign logical timestamps to events to establish a partial
ordering without a global clock. Used to order events
b) Mutual Exclusion
Ensures only one process accesses a resource at a time
Algorithms: Token-based, Ricart–Agrawala
Centralized Coordinator: Simple but single point of failure.
Distributed (e.g., Ricart-Agrawala): Uses message passing to grant permission.
c) Consensus
Processes agree on a value
Used in leader election and fault tolerance
Example: Paxos, Raft
Practical Example of Failure Without Synchronization
Distributed Bank System
Practical Example – Bank Transfer Without Synchronization: Scenario: Two processes, P1 and
P2, simultaneously read account balance (100birr). P1 adds 50birr, P2 subtracts 30birr. Without
synchronization:
Both read 100birr.
P1 writes 150birr, P2 writes 70birr.
Final balance is 70birr (or 150birr, depending on last write), instead of correct 120birr.
What Could Go Wrong: Lost updates, inconsistent state, financial loss.
Solution: Use distributed transactions with two-phase commit (2PC) or optimistic concurrency
control with versioning or Use distributed locking or consensus mechanisms to ensure correct
updates.