DS Ia1
DS Ia1
DS Ia1
o Transparency
o Reliability
o Flexibility
o Performance
o Scalability
o Heterogeneity
o Security
1. Transparency
o Access Transparency: Users access remote and local resources the same way.
o Concurrency Transparency: Users feel they are the sole users of the system.
2. Reliability
▪ Distributed control
o Fault Detection and Recovery: Identify and correct system failures using:
▪ Atomic transactions
▪ Stateless servers
3. Flexibility
• Design should allow ease of modification and enhancement for open distributed
systems.
4. Performance
o Batch processing
o Caching
5. Scalability
• System should adapt to increased load and growth without significant disruption.
• Design guidelines:
6. Heterogeneity
• Challenges arise with different hardware and software systems in distributed setups.
• Heterogeneous systems are preferred for flexibility but require careful design.
7. Security
• For commercial success, new distributed operating systems should emulate existing
ones (e.g., UNIX).
• Allows new and existing software to run simultaneously, enabling easy migration.
Models.
o Minicomputer Model
o Workstation Model
o Hybrid Model
1. Minicomputer Model
• Utilizes idle workstations to process jobs from other users when their own workstations
lack sufficient power.
• Issues to address:
3. Managing remote processes when users log onto previously idle workstations.
• Users log onto their "home" workstation, with normal computations performed locally.
• Advantages:
1. Cheaper to use a few minicomputers with large disks than many small diskful
workstations.
2. Easier maintenance and software updates with fewer disks and servers.
• Processors are pooled and shared on a demand basis, managed by a special run server.
• Users access the system from network-attached terminals (e.g., diskless workstations).
• There is no concept of a "home" machine; users log onto the system as a whole.
5.
Hybrid Model
• Combines the workstation server model with the processor pool model.
• Ideal for environments with both interactive and computation-intensive tasks.
• Adds a processor pool to the workstation server model for large computations.
• Ensures efficient execution of computation-intensive jobs while guaranteeing
response time for interactive tasks.
• More expensive to implement than the other models.
The ABCAST protocol is a distributed method used for consistent ordering of messages that
avoids the single point of failure issue associated with sequencer-based methods. Here's how
the ABCAST protocol works:
1. Message Sending
o The sender collects all proposed sequence numbers from group members and
selects the largest one as the final sequence number for the message.
o The sender then sends a commit message with the chosen final sequence number
to all members, ensuring its uniqueness due to the term i/Ni/Ni/N used in the
calculation.
o On receiving the commit message, each member attaches the final sequence
number to the message.
o The committed messages are delivered to the application programs in the order
of their final sequence numbers.
This protocol ensures that all messages are processed consistently and in the same order by all
members of the group.
4. What is DCE? Explain the DCE components and DCE cells.
DCE (Distributed Computing Environment) is a software framework developed by
the Open Software Foundation (OSF) to facilitate the creation and management of distributed
computing systems. It integrates various tools and services, originally developed by
universities and industries, into a cohesive package that supports interoperability and
distributed computing capabilities.
COMPONENTS:
1. Threads Package:
o Includes operations to create and manage multiple threads within a process and
synchronize access to shared data.
o Synchronizes clocks across computers within the system and with external
sources like the U.S. National Institute for Standards and Technology (NIST).
4. Name Services:
o Includes the Cell Directory Service (CDS), Global Directory Service (GDS),
and Global Directory Agent (GDA).
5. Security Service:
CELLS:
1. Purpose:
o Machines used by users working on a common goal should be placed in the
same cell.
o There are two approaches:
▪ Product-oriented: Separate cells for each product, covering all
activities (design, manufacturing, etc.) for that product.
▪ Function-oriented: Separate cells for each function (e.g., design),
regardless of the product.
2. Administration:
o Each cell has an administrator responsible for user registration and access
management.
o Grouping machines and users known to and manageable by a single
administrator in the same cell simplifies management tasks.
3. Security:
o Machines whose users have a higher level of trust in each other should be
placed in the same cell.
o Cell boundaries act as firewalls, requiring stricter authentication for accessing
resources across cells.
4. Overhead:
o DCE operations like name resolution and user authentication are more
efficient within the same cell.
o Machines that frequently interact and access common resources should be in
the same cell to minimize cross-cell operations and improve performance.
5. Explain the absolute ordering, consistent ordering and casual
ordering of messages. Give a mechanism to implement each one.
1.Absolute Ordering:
• Definition: Ensures that all messages are delivered to all receiver processes in the exact
order in which they were sent.
• Delivery Mechanism: Messages are saved in a queue at each receiver, and a sliding-
window mechanism periodically delivers messages whose timestamps fall within a
specified time window.
• Consideration: The window size should accommodate the maximum time required for
messages to travel across the network.
2. Causal Ordering:
• Definition: Allows for weaker semantics where messages can be delivered out of order
as long as causally related messages are delivered in the correct order. If two events are
causally related, they must be delivered in the order of their sending.
1. Each member maintains a vector indicating the last message received from each
member.
2. To send a message, the process increments its own vector component and
includes the vector in the message.
▪ The sender has not received any messages the receiver hasn't.
1. Failure Recovery:
o Stateless servers allow clients to simply retry requests without needing to know
about server status.
o Clients do not need to track state information, making their design simpler.
o Error handling is easier since clients can reissue requests without worrying
about server state.
4. Scalability:
o Stateless servers can handle more requests without managing client state,
improving load distribution.
5. Flexibility:
o Any server can handle requests from any client, improving performance and
reliability.
6. Application Dependency:
o The choice between stateless and stateful servers depends on the specific
requirements of the application.
• Requires a well-designed set of system calls and a global resource naming facility.
2. Location Transparency
• Name Transparency: Resource names should not indicate their physical location.
Names must remain unique systemwide.
• User Mobility: Users can access resources with the same name regardless of the
machine they are using.
3. Replication Transparency
• The system must manage naming and mapping of resource replicas automatically.
4. Failure Transparency
• Users should not notice failures except for possible performance degradation.
5. Migration Transparency
• Migration decisions should be automated, and object names must remain unchanged.
6. Concurrency Transparency
• Mutual-exclusion Property: Only one process can access a shared resource at a time.
• No-starvation Property: Ensures all requests for resources will eventually be granted.
• No-deadlock Property: Prevents situations where processes block each other.
7. Performance Transparency
8. Scaling Transparency
10. Explain implicit and explicit process addressing along with the
primitives used.
11) What si Idempotency? How duplicate request messages are handled? (4)
1. Definition of Idempotency:
Idempotency refers to an operation that produces the same result no matter how many times it is performed
with the same input or arguments. There are no unintended side effects from repeating the operation.
Example: A function like GetSqrt(64) always returns 8, no matter how many times it is called.
2. Non-Idempotent Operations:
Non-idempotent operations, on the other hand, produce different results if executed multiple times with the
same input. For example, debiting an account multiple times reduces the balance incorrectly.
Example: A server process that debits money from a bank account is non-idempotent because multiple
executions with the same request (due to network failures or timeouts) could result in an incorrect balance.
3. Handling Duplicate Requests with Timeout:
When a client doesn’t receive a response from a server (due to network issues or timeouts), it may resend the
request. This could lead to the server processing the same request multiple times, which is problematic for
non-idempotent operations like debiting money from an account.
4. Exactly-Once Semantics:
To avoid incorrect behavior, "exactly-once" semantics can be implemented. This ensures that even if a request
is sent multiple times, the operation is executed only once. One common way to implement this is by:
o Using unique identifiers for each client request.
o Maintaining a reply cache on the server to store the results of previously processed requests.
If a duplicate request is detected (based on the identifier), the server retrieves the stored result from the cache
and sends it to the client without reprocessing the request.
12) Explain in brief any two commonly used semantics for ordered delivery of multicast messages (8)
1. Absolute Ordering
Definition:
Absolute ordering ensures that all messages are delivered to every receiver in the exact order they were sent,
maintaining a global sequence across the entire system.
Key Characteristics:
• Global Sequence: Every message is assigned a unique timestamp or sequence number that reflects the exact
order of sending.
• Clock Synchronization: Requires synchronized clocks across all participating machines to maintain the
global order.
• Implementation Method:
o Global Timestamps: Each message is tagged with a timestamp from a synchronized clock.
o Sliding-Window Mechanism: Receivers use a window to buffer incoming messages and deliver them in the
correct order based on their timestamps.
• Pros:
o Simple to understand and implement in systems with well-synchronized clocks.
o Guarantees a single, consistent order of message delivery across all receivers.
• Cons:
o Synchronizing clocks across distributed systems can be challenging and resource-intensive.
o Not flexible for applications that do not require a strict global order.
2. Causal Ordering
Definition:
Causal ordering ensures that messages are delivered in an order that respects the causality of events. If one
message causally affects another, the affected message is delivered after the causing message. However,
messages that are not causally related can be delivered in any order.
Key Characteristics:
• Happened-Before Relationship: Uses the concept of causality to determine the order of message delivery.
• Vector Clocks: Each process maintains a vector clock to track the causal relationships between messages.
• Implementation Method:
o Vector Clocks: Each message carries a vector timestamp indicating its causal dependencies.
o Buffering Mechanism: Receivers buffer messages until all causally preceding messages have been delivered.
• Pros:
o More efficient than absolute ordering as it allows for parallelism where causality is not a concern.
o Reduces the overhead of maintaining a global order, improving performance in many scenarios.
• Cons:
o More complex to implement due to the need for maintaining and comparing vector clocks.
o May require additional memory and processing to manage buffered messages.
Definition:
In tightly coupled systems, all processors share a common primary memory (address space), and
communication between processors typically occurs through this shared memory.
Key Characteristics:
• Shared Memory: Processors communicate by reading and writing to a single, system-wide memory.
• Synchronous Processing: Processors usually work closely together in a synchronized manner.
• Low Communication Overhead: Since communication happens through shared memory, the delay in
communication is minimal.
• Physical Proximity: The processors are typically located close to each other, as the system relies on fast
access to shared memory.
• Limited Scalability: As the number of processors increases, the shared memory can become a bottleneck,
limiting scalability.
Key Characteristics:
• Local Memory: Each processor has its own memory, and changes to one processor's memory are not visible
to others.
• Asynchronous Processing: Processors work independently and do not need to be tightly synchronized.
• Message Passing: Communication between processors occurs through messages, introducing network
latency.
• Greater Physical Separation: Processors can be distributed over wide geographical areas.
• High Scalability: Loosely coupled systems can scale to a large number of processors without significant
bottlenecks, as each processor operates independently.
Same as previous
16) What is stub? how are stubs generated? Explain how the use of stubs helps in making an RPC
mechanism transparent. (8)
What is a Stub?
A stub is a piece of code that acts as an intermediary for remote procedure calls (RPC). It allows a program to
execute a procedure on another system without the programmer having to explicitly manage the complexities
of network communication. A client stub represents the interface between the client and the RPC mechanism,
while a server stub serves the same role for the server. The primary function of stubs is to provide a normal
procedure call interface, making the RPC mechanism transparent to users.
How are Stubs Generated?
1. Manually: The RPC implementor writes custom translation functions to convert procedure arguments and
return values for communication between client and server.
2. Automatically: A more common approach, where an Interface Definition Language (IDL) is used to define
the client-server interface. The IDL compiler generates the client and server stubs based on this definition,
along with any necessary marshaling and unmarshaling operations (handling data formatting for
transmission).
Stubs play a crucial role in making the RPC mechanism transparent in the following ways:
1. Hiding Network Details: The client and server stubs handle the transmission of data between the client and
server, abstracting the network communication details from both sides. The programmer writes code as if
calling a local procedure, but in reality, the stub manages the remote call, making the network interactions
invisible to the user.
2. Marshaling and Unmarshaling: Stubs perform marshaling (packing of arguments into a message) and
unmarshaling (unpacking results from a message), which allows seamless transfer of data across systems. This
ensures that the data is transmitted correctly, regardless of where the client and server are located.
3. Error Handling: Stubs often handle retransmissions, acknowledgments, and error checks (like timeouts) in
the communication process, simplifying the error management for the client and server.
In essence, by using stubs, the complex networking operations involved in remote communication are
abstracted away, allowing the programmer to write code as if the procedure is being executed locally. This
enhances ease of use and promotes transparency in the RPC mechanism.
RPC systems support call-by-value semantics for parameter passing primarily because it ensures
simplicity and reliability in remote procedure calls, particularly when dealing with distributed systems.
Here’s why:
1. Isolation Between Client and Server: In call-by-value, all parameters are copied into a message and sent
from the client to the server. This creates a clear separation between the client and server memory spaces,
avoiding issues that might arise from sharing references or pointers across different systems, which might not
have access to each other’s memory.
2. Ensures Data Consistency: When parameters are passed by value, the server works with a copy of the data,
ensuring that the original data on the client side remains unchanged. This reduces the complexity of managing
data integrity and prevents accidental modifications to client data by the server.
3. Network Transparency: In distributed systems, call-by-value simplifies the network communication
process. Only the values are transmitted, avoiding the complications of trying to share memory references
across different machines with potentially different architectures or operating systems.
4. Encourages Efficient Interface Design: Since passing large data by value can be costly (in terms of
bandwidth and transmission time), RPC systems using call-by-value semantics encourage users to optimize
the client-server interface. By making users aware of the overhead involved, it promotes careful design
decisions, reducing unnecessary data transmission and improving the overall efficiency of the RPC system.
Thus, while call-by-value can be inefficient for large datasets, it provides simplicity, consistency, and
transparency in most common use cases, which is why it is often supported in RPC systems.
18) Explain two types of messages involved in the implementation of an RPC system. (8)
1. Call Messages
Purpose:
Call messages are used by the client to request the execution of a remote procedure on the server. They initiate
the RPC process by conveying the necessary information for the server to perform the desired operation.
Key Components:
Process Flow:
1. Client Invocation:
The client initiates an RPC by calling a local stub procedure, which behaves like a normal procedure call.
2. Marshaling:
The client stub packs (marshals) the procedure identifier and arguments into a call message.
3. Transmission:
The call message is sent over the network to the server via the RPC runtime system.
2. Reply Messages
Purpose:
Reply messages are sent by the server to the client in response to call messages. They convey the result of the
remote procedure execution back to the client.
Key Components:
Process Flow:
1. Procedure Execution:
Upon receiving a call message, the server stub unpacks the message and invokes the specified remote
procedure with the provided arguments.
2. Marshaling the Reply:
After executing the procedure, the server stub packs the result (or error information) into a reply message.
3. Transmission:
The reply message is sent back to the client via the RPC runtime system.
4. Unmarshaling the Reply:
The client stub unpacks the reply message, retrieves the result or handles the error, and passes the information
back to the client application.
Stubs (client and server) play a pivotal role in ensuring that RPC mechanisms are transparent to the user:
The Remote Procedure Call (RPC) mechanism enables a program to cause a procedure to execute in another
address space (commonly on another physical machine) as if it were a local procedure call, abstracting the
complexities of network communication. This transparency is achieved through the use of stubs and an RPC
runtime on both the client and server sides.
1. Client (Application)
o Role: Initiates the remote procedure call.
o Functionality: The client application invokes a procedure as if it were a local function. This invocation is
intercepted by the Client Stub.
2. Client Stub
o Role: Acts as a proxy for the remote procedure on the client side.
o Functions:
▪ Marshaling (Packing): Converts the procedure call and its arguments into a call message format suitable for
transmission over the network.
▪ Sending Call Message: Utilizes the RPC Runtime to send the marshaled call message to the server.
▪ Unmarshaling (Unpacking): Upon receiving the reply message, it unpacks the result and returns it to the
client application.
3. RPC Runtime (Client Side)
o Role: Manages the network communication for the client.
o Functions:
▪ Transmission: Handles the sending of call messages to the server and receiving of reply messages from the
server.
▪ Reliability Services: Manages retransmissions, acknowledgments, and error handling to ensure message
delivery.
4. Server Stub
o Role: Acts as a proxy for the remote procedure on the server side.
o Functions:
▪ Receiving Call Message: Receives the call message from the RPC Runtime.
▪ Unmarshaling (Unpacking): Converts the received call message back into procedure call and arguments.
▪ Executing Procedure: Invokes the actual procedure on the server application with the unpacked arguments.
▪ Marshaling Reply: Packs the result of the procedure execution into a reply message.
▪ Sending Reply Message: Sends the reply message back to the client via the RPC Runtime.
5. RPC Runtime (Server Side)
o Role: Manages the network communication for the server.
o Functions:
▪ Reception: Receives call messages from clients.
▪ Transmission: Sends reply messages back to the respective clients.
▪ Reliability Services: Ensures reliable message delivery through retransmissions, acknowledgments, and error
handling.
6. Server (Application)
o Role: Provides the remote services or procedures that clients invoke.
o Functionality: Executes the requested procedure upon invocation by the Server Stub and returns the result.
1. Procedure Invocation:
o The Client Application calls a remote procedure as if it were a local function. This call is intercepted by the
Client Stub.
2. Marshaling the Call:
o The Client Stub marshals (packs) the procedure identifier and arguments into a Call Message.
3. Sending the Call Message:
o The Client Stub uses the RPC Runtime to send the Call Message over the network to the Server Stub.
4. Receiving and Unmarshaling the Call:
o The Server Runtime receives the Call Message and forwards it to the Server Stub.
o The Server Stub unmarshals (unpacks) the message to retrieve the procedure identifier and arguments.
5. Executing the Procedure:
o The Server Stub invokes the actual procedure in the Server Application with the provided arguments.
6. Marshaling the Reply:
o After execution, the Server Stub marshals the result into a Reply Message.
7. Sending the Reply Message:
o The Server Stub sends the Reply Message back to the Client Stub via the Server Runtime.
8. Receiving and Unmarshaling the Reply:
o The Client Runtime receives the Reply Message and forwards it to the Client Stub.
o The Client Stub unmarshals the message to retrieve the result.
9. Returning the Result:
o The Client Stub returns the result to the Client Application as if it were a local procedure call.
20) Expain two types of transparencies required for RPC. Is it possible to achieve complete semantic
transparency? Justify your answer
In Remote Procedure Call (RPC), transparency is a key design goal, where the objective is to make remote
procedures indistinguishable from local ones for the programmer. Two types of transparency are important:
1. Syntactic Transparency:
• This refers to making the remote procedure call look identical to a local procedure call in terms of syntax. The
programmer should be able to invoke a remote procedure in the same way they call a local one, without
requiring additional steps or different syntax.
• Example: A local call like sum(a, b) and a remote call should appear identical to the user.
• Achievability: Syntactic transparency is relatively easy to achieve. By using stub functions (client and server
stubs), RPC systems can ensure that the syntax for invoking remote procedures mimics local procedure
invocation.
2. Semantic Transparency:
• Semantic transparency means that a remote procedure call behaves identically to a local procedure call in all
aspects, including data handling, error handling, and performance.
• Challenges:
1. Address Space Separation: In an RPC, the client and server run in separate address spaces, unlike local
procedures. Hence, the remote procedure does not have direct access to the caller’s memory. Passing
references (pointers) becomes problematic, as they point to different address spaces.
2. Failure Handling: Remote procedure calls are susceptible to network failures, machine crashes, or
communication delays, which do not occur in local procedure calls. Handling such failures requires explicit
mechanisms in RPC.
3. Performance Issues: Remote procedure calls incur network latency, making them much slower (100 to 1000
times) than local calls. This delay needs to be handled by the application, especially in time-sensitive
processes.
No, complete semantic transparency is nearly impossible. This is primarily due to the fundamental
differences between local and remote procedure calls:
• Memory Sharing: The lack of shared memory makes passing references and complex data structures (like
linked lists or graphs) difficult without changing the semantics of the call.
• Failure Vulnerability: The possibility of failures (network issues, machine crashes) necessitates mechanisms
to detect and handle failures, which do not exist in local procedure calls.
• Performance Overhead: The significant difference in call execution times means that applications must
manage the delays, making perfect transparency unrealistic.