📝 Communication in distributed system (8 MCQs)
Message Exchange Between Independent Networked Processes
Communication in a distributed system enables processes on separate computers to exchange data, coordinate actions, and access remote services. Unlike communication within shared memory, distributed processes generally interact through message passing over a network. Operating systems and communication middleware provide sockets, remote procedure calls, message queues, and protocol services to support reliable or best-effort information exchange.
Why Separate Address Spaces Require Message Passing
Processes on different machines cannot normally access one another's physical memory directly. They may also use different operating systems, hardware, and data representations. Communication mechanisms must therefore transfer information across network interfaces and handle delays, lost messages, duplicate delivery, and failures independently of local process scheduling.
Send, Receive and Request Response Operations
A process prepares a message and sends it to a destination address or service endpoint. The network stack divides or encapsulates data into protocol units and transmits them. The receiving system processes incoming packets and delivers the message to the destination process, which may send a response or acknowledgement.
Example of a Remote Service Request
A client sends a request containing an account number to a server through a TCP connection. The server receives the bytes, processes the request, and returns an account balance. Network delays may postpone the response, so the client uses timeouts and error handling rather than assuming immediate completion.
Communication Latency and Coordination Costs
Message passing supports distributed applications, remote resource access, and coordination without shared physical memory. Network latency, bandwidth limits, message serialization, and protocol processing affect performance. Applications must define failure behaviour, handle incomplete messages, validate remote data, and consider authentication because communication exposes services to network-based attacks.
Misconceptions About Distributed Communication
'Sending a message guarantees immediate delivery' ignores loss and delay. 'Processes on different machines share ordinary memory automatically' is false because they communicate through explicit mechanisms. 'TCP sends one complete application message per read' overlooks its byte-stream semantics.
Exam Focus: Message Passing and Socket Communication
Trace a message from sender through the network stack to the receiving process. Distinguish message-oriented communication from byte streams and local shared memory. Questions may compare synchronous and asynchronous communication or examine acknowledgements, timeouts, duplicate messages, and the role of transport protocols.
Key Terms of Distributed Communication
- Message passing - Exchanging data through messages.
- Socket - Communication endpoint for a process.
- Serialization - Converting data into a transferable format.
- Acknowledgement - Confirmation of message receipt.
- Timeout - Limit on waiting for a response.
📝 All Communication in distributed system MCQs
Q1. What term describes a node that provides resources to other nodes in a distributed system?
📖 Explanation: A server is the node that offers resources such as files, printers, or processing power to other nodes. The client requests those resources, while a site refers to a physical location and a host is a generic term for a machine. Choosing the server reflects the role of providing services, which matches the definition. The other options describe requesters or broader categories, not the provider.
Q2. Why does resource sharing increase overall system efficiency in a distributed environment?
📖 Explanation: Resource sharing lets multiple nodes work on different parts of a task simultaneously, which speeds up overall execution. By using remote resources, idle machines become productive, reducing the need to purchase duplicate hardware. Parallel processing is the key benefit, whereas the other choices either misstate the effect of locality, ignore the advantage of parallelism, or incorrectly claim that networks become unnecessary.
Q3. How does reliability improve when several nodes can provide the same service?
📖 Explanation: When multiple nodes can supply identical services, the system gains redundancy: if one node fails, others can take over, maintaining service continuity. Load balancing distributes work but does not directly address failure. Increased latency and decreased throughput are negative effects that would reduce reliability. Redundancy directly supports fault tolerance, which is why the correct answer is redundancy, reflecting the core principle of reliable distributed design.
Q4. A company has a high‑speed printer at site B, and users at site A need to print documents. Which action best uses a distributed‑system advantage?
📖 Explanation: Transmitting the print job across the network leverages resource sharing, allowing users to access a remote device without duplicate hardware. Installing a local printer ignores the sharing benefit, emailing still requires manual handling, and using a USB drive adds unnecessary latency. The networked approach demonstrates how distributed systems enable remote resource utilization efficiently.
Q5. A scientific task can run on a single 2.5 GHz supercomputer or be divided among three sites with speeds 2 GHz (A), 1.5 GHz (B), and 2.5 GHz (C). Which strategy gives the greatest speedup?
📖 Explanation: Dividing the workload proportionally matches each node’s processing capability, allowing faster nodes to handle more work while slower nodes still contribute. This parallelism reduces total execution time more than using any single node alone. Choosing only site C or A ignores the extra computing power available elsewhere, and using only site B would be the slowest option. The proportional distribution therefore yields the maximum speedup.
Q6. A distributed database must keep copies consistent after updates. Which communication pattern most reliably spreads changes?
📖 Explanation: Gossip protocols repeatedly exchange state information between random peers, ensuring that updates eventually reach all nodes even if some links fail. Broadcast sends to all nodes at once but can overwhelm the network; unicast targets a single node and would require many separate messages; multicast reaches a group but still depends on reliable group management. Gossip’s resilience and eventual consistency make it the best choice for reliable propagation in a distributed setting.
Q7. What is the key distinction between a \site\ and a \node\ in distributed‑system terminology?
📖 Explanation: A site refers to the geographic or network location where a machine resides, whereas a node denotes the actual computing entity (hardware and software) operating at that site. This separation clarifies design discussions. The other options incorrectly equate site with software, fix roles as client or server, or claim the terms are synonymous, which does not reflect standard terminology.
Q8. A user at site A needs to read a file stored on a server at site B. Which communication model is typically used?
📖 Explanation: In a client‑server model, the user’s machine (client) sends a request to the remote server, which then provides the file. Peer‑to‑peer treats all machines as equals, which is unnecessary for a simple request. Broadcast and multicast send data to many recipients, wasting bandwidth when only one client needs the file. Therefore, the client‑server approach correctly describes the typical interaction for remote file access.