We will be solving SPPU INSEM PYQs.
This is the
portion for the question.
Each question carries 7 marks and its a theoretical paper so keep answers in brief
Understood! For the SPPU INSEM exam, your Unit II (Communication) portion includes:
Layered Protocols
Types of Communication
Remote Procedural Call (Basic RPC, Parameter Passing, RPC application support, Variations,
DCE example, Remote Method Invocation)
Message Oriented Communication (Simple Transient Messaging, Advanced Transient
Messaging, Persistent Messaging, Examples)
Multicast Communication (Tree-Based Multicasting, Flooding, Gossip-Based Dissemination)
Case studies: Apache Kafka, gRPC Open Source RPC Framework
For each PYQ, I will provide brief, 7-mark theoretical answers focused only on these topics.
Please upload or type the first PYQ you want to solve.
⁂
What is Communication in Distributed Systems?
Communication in distributed systems refers to the process by which different components,
often located on separate computers (nodes), exchange data and coordinate actions to achieve
a common goal. In distributed systems, communication is crucial because no single node has
complete knowledge or control over the entire system.
Key Points:
Purpose: Communication enables nodes to cooperate, share resources, synchronize
processes, and provide a unified service to users.
Techniques: Common communication methods include message passing (where nodes
send and receive messages), remote procedure calls (RPC), remote method invocation
(RMI), and message-oriented middleware.
Protocols: Standard protocols and layered architectures (such as the OSI or TCP/IP
models) provide reliability, error handling, and security for data exchange.
Challenges: Communication in distributed systems must handle issues like network delays,
data consistency, partial failures, and varying node speeds.
Examples: Practical examples include sending data over sockets, using middleware like
Apache Kafka for event streaming, or employing RPC frameworks such as gRPC.
In summary, communication is the fundamental mechanism that connects and enables
interaction among the autonomous components of a distributed system, making coordinated,
reliable, and efficient distributed computing possible.
⁂
these are small answers make answers bigger
Certainly! Here is an expanded, brief-theory answer suitable for a 7-mark question while
staying within your syllabus portion:
What is Communication in Distributed Systems?
Communication in distributed systems is the process through which multiple computers, often
geographically separated, coordinate and share information to perform tasks collaboratively.
Unlike centralized systems, distributed systems rely on communication to exchange data since
their components do not share a single physical memory or clock.
Explanation:
Purpose:
Communication is essential in distributed systems because individual nodes (computers,
processes) must cooperate to achieve common objectives such as resource sharing,
computation, and data consistency. Without effective communication, nodes would act
independently, and distributed functionality would not be possible.
Communication Models:
The two primary models used are:
Message Passing: Nodes send and receive discrete messages using protocols over the
network. Common mechanisms include sockets and message queues.
Remote Procedure Call (RPC): Nodes invoke procedures or functions on remote
systems as if they were local, hiding the actual message passing from the user.
Examples: gRPC, DCE RPC.
Layered Protocols:
Distributed systems use layered protocol architectures (such as OSI or TCP/IP) to enable
reliable, standardized communication. Each layer (e.g., application, transport, network)
provides specific functions like addressing, error correction, and flow control.
Types of Communication:
Synchronous communication: Sender waits for the receiver to acknowledge each
message.
Asynchronous communication: Sender continues without waiting, allowing for higher
concurrency.
Common Techniques:
Socket Programming: Direct communication using TCP or UDP sockets.
Message-Oriented Middleware: Intermediate software (e.g., Apache Kafka) enables
scalable, decoupled communication between distributed services.
Challenges:
Communication in distributed systems must address:
Network delays and latency
Packet loss and unreliable networks
Security and data integrity
Partial failures (e.g., one node crashes)
Examples:
Web applications communicating with backend servers
Distributed databases replicating data
Microservices interacting via REST APIs or message brokers
Conclusion:
In short, communication is the backbone of distributed systems. It enables multiple
independent components to function as a single, cohesive system, ensuring data, commands,
and status updates are exchanged reliably and efficiently.
This answer covers the purpose, models, protocols, types, key mechanisms, challenges, and
examples, making it comprehensive for a 7-mark theoretical question.
image.jpg
Here is a detailed answer suitable for a 7-mark theoretical question:
What is DCE Remote Procedure Call? Explain with example.
DCE Remote Procedure Call (DCE RPC) is a standard protocol enabling function calls between
programs located on different computers in a distributed system, as if the function was called
locally. It is part of the Distributed Computing Environment (DCE), developed by the Open
Software Foundation (OSF) to provide a framework for building distributed applications.
Key Features of DCE RPC:
Transparency: DCE RPC hides the complexity of network communication from the
programmer. Functions can be invoked on remote servers using the same syntax as local
function calls.
Interface Definition Language (IDL): Interfaces are defined using an IDL, which specifies
the types of procedures and the format of arguments exchanged.
Stubs: DCE RPC uses client and server stubs. The client stub sends the procedure call
request, and the server stub receives and processes it.
Binding and Directory Services: DCE RPC supports network-wide naming and directory
services to locate and connect to remote objects efficiently.
Interoperability: DCE RPC is designed to work across different platforms and operating
systems.
Working of DCE RPC (with Example):
Suppose you have a distributed banking application. The client needs to retrieve the account
balance stored on a remote server. The steps are:
1. Define Interface using IDL:
float getBalance([in] int accountNumber);
This interface defines a procedure getBalance, which takes accountNumber as input and
returns the balance as float.
2. Client Side (Caller):
The user runs a client application and requests their balance using:
float balance = getBalance(12345);
DCE client stub packs (marshals) the request and sends it to the server over the network.
3. Server Side (Callee):
The server stub receives the request, unpacks it, runs the actual getBalance function on
account 12345, and returns the value back to the client.
4. Result:
The client receives the account balance and displays it, without needing to know where or
how the server is running.
Simple Example in Real World:
Distributed File Services: DCE RPC is widely used in file sharing systems, such as DFS
(Distributed File System), where file read/write operations are performed on remote servers
using RPC calls.
Enterprise Applications: Many enterprise apps use DCE RPC to access databases, perform
computations, or interact with remote resources securely and transparently.
Conclusion:
DCE RPC is a powerful communication mechanism in distributed computing, allowing different
systems to work together over networks with ease, scalability, and reliability. It abstracts low-
level network code, enabling developers to concentrate on application logic instead of message
handling intricacies.
⁂
image.jpg
Here is a detailed answer ready for a 7-mark theoretical question:
Explain Flooding-Based Multicasting in Detail with Example
Flooding-based multicasting is a simple technique used in distributed systems and networking
for delivering messages to all nodes in a network or a specific multicast group. In this approach,
a message is forwarded to all connected nodes except the one from which it was received. This
process continues until all nodes in the network have received the message.
How Flooding-Based Multicasting Works:
Message Propagation:
When a node (source) wants to multicast a message, it sends a copy of the message to all
its immediate neighbors.
Forwarding:
Each neighbor forwards the message to all its neighbors, except the one it received the
message from.
Termination:
To avoid infinite looping and repeated delivery, each node maintains a record of received
messages (using unique message IDs). If a node receives a message it has already
processed, it discards it.
Advantages:
Simplicity: The method is very easy to implement as it does not require a specialized
routing structure.
Reliability: High likelihood that all nodes will receive the message, even in the presence of
network failures.
Disadvantages:
Redundancy: Multiple copies of the message travel over the same links, leading to
excessive network traffic.
Inefficiency: Not suitable for large-scale or heavily loaded networks due to bandwidth
wastage and processing overhead.
Example:
Suppose we have five computers A, B, C, D, and E connected in the following way:
A is connected to B and C.
B is connected to A, D, and E.
C is connected to A and D.
D is connected to B, C, and E.
E is connected to B and D.
Let’s say node A wants to send a multicast message to all others:
1. A sends the message to B and C.
2. B receives the message from A and forwards it to D and E (but not A).
3. C receives the message from A and forwards it to D.
4. D receives the message from B and C. It forwards to E and ignores sending it back to B and
C.
5. E receives the message from B and D. It ignores duplicates but ensures all copies are
processed only once.
This way, the message quickly spreads throughout the network, but may result in the same
message passing through the same link multiple times.
Real-World Use Case:
Peer-to-Peer Networks: Flooding-based multicasting is commonly used in peer-to-peer
applications like file sharing or blockchain networks for rapid information dissemination.
Network Discovery: Protocols that need to discover all nodes in a network may use
flooding for initial contact.
Conclusion:
Flooding-based multicasting is a direct and effective way to reach all nodes in small or resilient
distributed systems. However, its inefficiency limits its use in large-scale systems where more
optimized multicast techniques are preferred.
image.jpg
Here is a concise yet detailed answer for a 7-mark theoretical question:
Short Note on Advanced Transient Messaging
Advanced Transient Messaging is a communication model used in distributed systems where
messages are delivered from sender to receiver only if both are active and connected to the
network at the same time. The term “transient” means messages are not stored or queued if the
receiver is unavailable—they are simply lost.
Key Features:
Synchronous Delivery:
Both sender and receiver must be available simultaneously for message exchange. If the
receiver is offline, the message is discarded.
No Message Storage:
The messaging system does not offer buffering, queuing, or retry mechanisms. Once sent, a
message that cannot be delivered immediately is lost.
Efficient for Real-Time Applications:
This approach is suitable where real-time or instantaneous feedback is needed, such as in
voice calls, video conferencing, or online collaborative tools.
Advanced Aspects:
Selective Recipients:
Advanced transient messaging can target specific recipients or groups dynamically, based
on availability or criteria set by the application.
Quality of Service (QoS):
It can include mechanisms for ensuring timely delivery, such as prioritizing certain message
types over others (e.g., urgent notifications).
Connection-Oriented Models:
Some advanced systems establish a transient session or channel, ensuring communication
only during the session’s lifetime.
Example:
Online Multiplayer Games:
In gaming, position updates or action commands use transient messaging. If an update is
missed, no queueing occurs—the latest update is always sent.
Live Chat Systems:
Many chat and collaboration tools use transient messaging for live “typing” indicators or
presence messages, which are relevant only in real time.
Advantages:
Low Overhead:
Minimal resource consumption as there is no message storage or retry logic.
Fast Communication:
Suitable for time-sensitive data where only the most recent information is relevant.
Disadvantages:
Unreliable Delivery:
Messages can be lost if the receiver is temporarily unavailable, making it unsuitable for
critical data exchange.
Conclusion:
Advanced transient messaging is ideal for applications where only real-time information
matters, providing fast, efficient communication without storage or delivery guarantees.
However, for applications requiring reliable message delivery, persistent or persistent-queue-
based messaging is preferred.
image.jpg
Here is a detailed answer suitable for a 7-mark theoretical question:
Explain the Concept of Remote Method Invocation in Communication
Remote Method Invocation (RMI) is a communication technique used in distributed systems
that allows a program running on one machine (the client) to invoke methods or functions
located on another machine (the server) as if they were local. It extends the concept of object-
oriented programming across network boundaries.
Key Features of RMI:
Transparency:
RMI hides the complexities of network communication, enabling developers to invoke
remote methods just like local ones, without worrying about low-level details.
Object-Oriented Approach:
RMI supports invoking methods on remote objects, allowing the use of inheritance,
polymorphism, and encapsulation over networks.
Stub and Skeleton Architecture:
The stub is a proxy object on the client side that represents the remote object.
The skeleton exists on the server side, receiving requests from the stub and invoking
the actual method implementation.
Marshalling and Unmarshalling:
Arguments, return values, and exceptions are serialized (converted to a format suitable for
network transmission) and deserialized as they are passed between client and server.
How RMI Works (Step-by-Step):
1. Define Remote Interface:
A remote interface specifies the methods that can be called remotely.
2. Implement the Remote Object:
The server provides code for the remote object and registers it with the RMI registry.
3. Client Requests Service:
The client looks up the remote object in the registry, obtains the stub, and invokes methods.
4. Communication:
The stub sends the method call and parameters over the network to the skeleton, which
passes them to the actual remote method.
Example:
Suppose you have an online library system. The server holds a remote object Library with a
method getBookDetails(String bookID).
The client invokes getBookDetails("B001") on the remote object.
The client’s stub forwards the request to the server.
The server skeleton receives the request, executes the method, and returns the result to the
client.
Advantages:
Ease of Use: Makes distributed programming simpler by abstracting network
communication.
Reusability: Promotes code reuse and modular system design.
Disadvantages:
Platform Dependent: Traditional RMI is Java-specific, though similar mechanisms exist in
other languages.
Performance Overhead: Serialization and network transmission add delays compared to
local method calls.
Real-World Use Cases:
Distributed applications: Enterprise business applications using Java RMI.
Cloud services: Microservices interacting over network boundaries via RPC or RMI models.
Conclusion:
RMI enables distributed object communication by allowing methods of remote objects to be
invoked seamlessly across network boundaries, thus making remote interactions as simple as
local method calls in a distributed, object-oriented system.
image.jpg
Here is a detailed answer suitable for a 6-mark/7-mark theoretical question:
Explain Message Oriented Persistent Communication in Detail with Example
Message Oriented Persistent Communication is a communication mechanism in distributed
systems where messages are stored by the messaging system until they are successfully
delivered to the intended recipient, even if the recipient is temporarily unavailable (offline). This
ensures that messages are never lost, providing reliability and durability.
How Persistent Communication Works:
Decoupling Sender and Receiver:
The sender and receiver do not need to be active at the same time. The sender can send a
message at any time, and the messaging system ensures its delivery when the receiver
becomes available.
Persistent Storage:
Messages are stored (persisted) in stable storage, such as disks or databases, ensuring that
even if the messaging server crashes, messages are not lost.
Delivery Guarantee:
The system guarantees that every message will be delivered at least once to the receiver,
making it suitable for mission-critical or business applications.
Steps in Persistent Messaging:
1. Sender transmits a message to the message-oriented middleware (like a message queue
or broker).
2. Message is stored until the receiver is ready or online to process it.
3. Receiver retrieves the message from the system at any time, ensuring reliable
communication.
Example:
Suppose a customer places an order using an e-commerce app. The order details are sent as a
message to a processing service (receiver).
If the processing service is busy, down, or undergoing maintenance, the message remains in
the queue.
Once the service is available, it retrieves and processes the order.
This guarantees that no customer order is lost, regardless of temporary failures or delays.
Real-World Examples:
Email Systems: Emails are stored on the server and delivered whenever the recipient logs
in.
Enterprise Messaging Services: Tools like Apache Kafka, RabbitMQ, or IBM MQ provide
persistent communication for business applications.
Banking Systems: Transaction messages are reliably stored and processed, ensuring no
financial operation is missed.
Advantages:
Reliability: Guarantees delivery even in the presence of network or system failures.
Decoupled Operation: Sender and receiver operate independently and do not need to be
online at the same time.
Fault Tolerance: Handles server or network failures gracefully by preserving messages.
Conclusion:
Message Oriented Persistent Communication plays a critical role in distributed systems by
ensuring that important messages are never lost, making it ideal for applications where data
integrity and reliability are essential.
image.jpg
Here is a detailed answer, ideal for 6–7 marks:
What is Communication? Explain it with Layered Protocols.
What is Communication?
Communication in distributed systems refers to the exchange of data, messages, or control
information between different processes, computers, or devices within a network. It enables
multiple, geographically separated systems to coordinate and work together, sharing resources
or services.
Purpose:
To make sure different components can cooperate, synchronize actions, or transfer data
efficiently and reliably.
Types:
Can be point-to-point (unicast), one-to-many (multicast), or many-to-many (broadcast).
Layered Protocols in Communication
Layered protocols are a conceptual model used to structure communication systems into
different levels (layers), where each layer is responsible for a specific set of functions. The most
common models are the OSI (Open Systems Interconnection) Model and TCP/IP Model.
1. OSI Model (7 Layers):
1. Application Layer:
Closest to the user. Handles protocols for applications like HTTP, FTP, SMTP.
2. Presentation Layer:
Formats and encrypts/decrypts data. Responsible for data representation.
3. Session Layer:
Manages sessions, i.e., continuous exchanges between applications.
4. Transport Layer:
Ensures error-free data transport (e.g., TCP, UDP).
5. Network Layer:
Handles routing and forwarding of data (e.g., IP).
6. Data Link Layer:
Handles node-to-node data transfer and error detection/correction (e.g., Ethernet).
7. Physical Layer:
Deals with the transmission of raw bit streams over a physical medium (e.g., cables, radio
waves).
2. TCP/IP Model (4 Layers):
1. Application Layer
2. Transport Layer
3. Internet Layer
4. Network Access Layer
Benefits of Layered Protocols:
Modularity: Each layer performs a well-defined function, making systems easier to design
and troubleshoot.
Interoperability: Standardization allows different hardware and software systems to
communicate reliably.
Flexibility: Changes in one layer do not affect the others, enabling innovation and updates.
Example:
When you send an email:
The Application Layer uses SMTP to compose the message.
The Transport Layer (TCP) splits the message into packets.
The Network Layer (IP) routes the packets toward the destination.
The Data Link Layer handles transmission over the physical network.
Conclusion:
Communication, enabled by layered protocols, provides a structure that ensures reliable,
efficient, and standardized data exchange among distributed system components. This
makes large-scale, interoperable, and robust networks possible.
image.jpg
Here is a focused 5-mark answer for the given question:
Explain with Suitable Example, Message Oriented Persistent Communication
Message Oriented Persistent Communication is a technique in distributed systems where
messages are sent by a sender and stored by the messaging system until the receiver is ready
to process them, even if the receiver is temporarily offline or unavailable.
Key Features:
Asynchronous: Sender and receiver do not need to be active at the same time.
Reliability: Messages are safely stored until delivered, ensuring no data is lost even if
system failures occur.
Persistence: Messages remain in a queue or storage until successfully received and
acknowledged.
Example:
Consider an online shopping application:
When a user places an order (sender), the order details are sent as a message to a backend
order processing system (receiver).
If the backend system is busy or down, the message is stored in a persistent queue (e.g.,
Apache Kafka, RabbitMQ).
Once the processing system becomes available, it retrieves the message from the queue
and processes the order.
Real-world analogy:
Email is a classic example of persistent communication—an email remains in the server’s inbox
and is delivered whenever the recipient comes online.
Conclusion:
Message oriented persistent communication guarantees reliable delivery, making it suitable for
mission-critical services where lost messages are unacceptable and the sender/receiver need
not be online together.
image.jpg
Here is a concise yet complete answer as required:
Explain in Short, RPC-based Application Support
RPC-based application support enables applications running on different systems within a
distributed environment to communicate and invoke procedures (functions) on remote systems
as if they were local calls.
Main Points:
Transparency: RPC (Remote Procedure Call) hides network details, making remote
interactions look like local function calls to the programmer.
Stubs: Client-side stubs package procedure requests and transmit them to the server;
server-side stubs unpack requests and execute the actual function.
Automatic Data Handling: Parameters and return values are automatically converted for
transmission (marshalling and unmarshalling).
Platform Independence: Many RPC systems use an interface definition language (IDL),
allowing communication between different hardware and OS.
Use Cases: Commonly used in client-server applications, microservices, and distributed
enterprise systems (e.g., gRPC, DCE RPC).
Example:
A banking client app invokes a remote function getBalance(accountNo) on a server using
RPC to fetch account details, without worrying about the underlying network or data
transmission process.
In summary, RPC-based application support simplifies distributed programming by
providing a seamless and transparent way to invoke services across networked systems.
⁂
image.jpg
Here is an ideal 5-mark answer for your question:
What is Multicast Communication? Explain Flooding-based Multicast
Communication.
Multicast Communication
Multicast communication is a method of sending a message from one sender to a selected
group of receivers in a network, rather than to all nodes (broadcast) or just one node (unicast). It
is efficient in distributing the same data to multiple recipients, saving bandwidth and reducing
network load.
Use Case: Video conferencing, stock market updates, multiplayer online games.
Advantage: Only one copy of the message is sent over each network link, and only nodes in
the multicast group receive it.
Flooding-based Multicast Communication
Flooding-based multicast is a basic technique where a multicast message is broadcast to all
directly connected neighbors except the sender. Each node that receives the message repeats
this process, forwarding it to all its neighbors (excluding the sender), until all nodes in the
network have been reached.
Working Principle:
Each node checks if it has already received the message using a unique message ID.
If yes, it discards the duplicate; if no, it forwards the message further.
This process continues until the message cannot be forwarded anymore.
Example:
Suppose node A sends a multicast message in a network:
1. A sends the message to B and C.
2. B forwards to D and E; C forwards to D.
3. D forwards to E if not already received.
4. All nodes eventually receive the message.
Pros and Cons:
Advantage: Simple to implement and robust—message will reach all nodes.
Disadvantage: Inefficient for large networks due to many duplicate messages and high
bandwidth usage.
Summary:
Multicast communication efficiently sends messages to multiple receivers. Flooding-based
multicast ensures delivery but can cause message duplication and extra network traffic.
⁂
image.jpg
Here is a full answer suitable for 5–7 marks:
What is RPC? Explain Basic RPC Operations.
What is RPC?
RPC (Remote Procedure Call) is a protocol that allows a program to request a service or
execute a procedure (function) on another computer in a network, as if it were a local procedure
call. The complexity of network communication is hidden from the programmer, making
distributed programming easier.
Purpose: To enable communication and coordination between distributed systems by
allowing direct invocation of remote services.
Transparency: Calls to remote functions look like local function calls to the programmer.
Basic RPC Operations
1. Procedure Call Initiation:
The client program calls a local procedure (the stub), which represents the remote function.
2. Marshalling:
The stub packages the procedure’s parameters into a message format that can be
transmitted over the network.
3. Message Transmission:
The client stub sends the marshalled message to the server via the transport protocol.
4. Unmarshalling at the Server:
The server receives the message and the server stub unpacks (unmarshals) the parameters.
5. Execution of Procedure:
The server executes the actual remote procedure using the unpacked parameters.
6. Return Transmission:
The server marshals the return value and sends it back to the client.
7. Result Unmarshalling:
The client stub receives the return value, unpacks it, and returns it to the client application.
Example:
If a client invokes getBalance(accountNo):
The call is sent to the client's stub.
The stub marshals the account number and sends the message to the server.
The server stub receives the message, unmarshals parameters, and calls the server's
function.
The result is sent back and unmarshalled for the client.
Conclusion:
RPC simplifies distributed application development by hiding communication details, making
remote interactions as simple as local function calls.
image.jpg
Here is a short note suitable for exam answers:
Short Note on: Remote Method Invocation (RMI)
Remote Method Invocation (RMI) is a communication mechanism in distributed systems, mainly
used in Java, which allows an object running on one machine (client) to invoke methods or
functions of an object located on another machine (server) as if they were local.
Key Features:
Object-Oriented: Enables remote invocation of methods on distributed objects, supporting
all Java object features like inheritance and polymorphism.
Transparency: Hides the complexity of network communications; method calls appear the
same whether local or remote.
Stub and Skeleton:
Stub: Present on the client side, acts as a proxy for the remote object.
Skeleton: Present on the server side, receives requests and calls the actual method.
Marshalling and Unmarshalling: Parameters and return values are converted for network
transmission and then restored.
Example:
A banking client can call a method getBalance() on a remote server object without knowing its
location, simply by referencing the remote interface.
Advantages:
Simplifies distributed application development.
Promotes modular, scalable, and reusable code.
Conclusion:
RMI enables transparent communication and execution of methods across networked
computers, making it a core technology in Java-based distributed computing.
1. image.jpg
2. image.jpg
3. image.jpg
4. image.jpg
5. image.jpg
6. image.jpg
7. image.jpg
8. image.jpg
9. image.jpg
10. image.jpg
11. image.jpg
12. image.jpg
13. image.jpg