📝 Communication Protocols in Distributed Systems (35 MCQs)
Rules Enabling Interoperability Between Distributed Nodes
Communication protocols define the formats, procedures, and rules that networked computers follow when exchanging information. They specify addressing, message structure, sequencing, error detection, flow control, and connection behaviour at different layers. Distributed systems depend on these standards so machines with different hardware and operating systems can communicate consistently across local and wide-area networks.
Why Common Communication Rules Are Necessary
Independent computers may use different processors, operating systems, and network technologies. Without agreed message formats and interaction rules, one system could not reliably interpret another's data. Layered protocols divide communication responsibilities, making it possible to develop and replace network technologies without redesigning every application.
Layered Protocol Processing and Encapsulation
An application creates data for a communication protocol, which adds its own control information. Lower layers encapsulate the data with transport, network, and link headers. At the destination, corresponding layers process and remove their headers before delivering information to the receiving application. Each layer relies on services from the layer below.
Example of Sending an Application Request
A client sends an HTTP request to a remote web server. HTTP defines the application message, TCP provides an ordered transport stream, IP addresses and routes packets, and Ethernet or Wi-Fi carries frames over the local link. The destination processes the layers in reverse to deliver the request.
Interoperability, Layer Overhead and Security
Standard protocols enable heterogeneous systems, modular networking, and predictable communication. Layering introduces headers and processing overhead, while mismatched configurations can prevent interoperability. Protocols also differ in security properties; basic network delivery does not automatically provide confidentiality or authentication, so secure protocols and cryptographic protections are required.
Misconceptions About Protocol Layers
'A protocol operates at every network layer' is false because each protocol has a defined role. 'IP guarantees reliable delivery' ignores its best-effort service. 'Layering removes all communication dependencies' is incorrect because higher layers still rely on lower-layer addressing, transport, and link services.
Exam Focus: Protocol Roles and Encapsulation
Identify the functions of application, transport, network, and link layers. Trace encapsulation at the sender and decapsulation at the receiver. Questions may ask which protocol provides addressing, reliable transport, or local frame delivery, and why security requires additional mechanisms beyond basic packet forwarding.
Key Terms of Communication Protocols
- Protocol - Agreed rules for communication.
- Encapsulation - Adding layer-specific control information.
- Transport layer - Provides process-to-process delivery.
- Network layer - Routes packets between networks.
- Interoperability - Ability of systems to communicate.
📝 All Communication Protocols in Distributed Systems MCQs
Q1. Which OSI layer is primarily responsible for converting data into electrical signals for transmission over a cable?
📖 Explanation: The Physical layer handles the mechanical and electrical aspects of transmitting bits, turning digital data into voltage changes or light pulses. The Data link layer manages framing and error detection, the Network layer routes packets, and the Transport layer ensures end‑to‑end reliability. Because the question asks directly about signal conversion, the Physical layer is correct, while the other layers serve higher‑level functions.
Q2. What is the main purpose of the transport layer in the OSI model?
📖 Explanation: The transport layer ensures that data sent from one host arrives correctly at another, handling flow control, segmentation, and error recovery. Routing is a function of the network layer, electrical standards belong to the physical layer, and encryption may be part of the presentation or application layers. Therefore, reliable end‑to‑end communication best describes the transport layer’s role.
Q3. In a network where hosts use IPv4 addresses, which layer resolves a host name like www.example.com to its IP address?
📖 Explanation: Name resolution, typically performed by DNS, operates at the application layer because it is a service used by applications to translate human‑readable names to IP addresses. The network layer routes packets based on IP addresses, while the presentation and session layers handle data formatting and session management, respectively. Hence, the application layer is the correct answer.
Q4. A router receives a packet with a destination address that is not in its routing table. What is the most likely action taken by the network layer?
📖 Explanation: When a routing table lacks a specific entry, the router typically uses a default route (gateway) to forward the packet toward its destination. Dropping the packet and sending an ICMP error would occur only if no default route exists. Encapsulation is done by the data link layer, and logging alone does not resolve forwarding. Therefore, forwarding to the default gateway is the appropriate network‑layer response.
Q5. Which of the following best describes a protocol that operates at both the data link and physical layers?
📖 Explanation: Ethernet defines both the frame format (data link) and the electrical characteristics of signals (physical), making it a protocol spanning those two layers. HTTP and TCP operate at the application and transport layers, respectively, while SMTP works at the application layer. Thus, Ethernet is the correct choice.
Q6. If a network engineer wants to reduce latency caused by retransmissions, which transport‑layer mechanism should they consider adjusting?
📖 Explanation: Increasing the transport layer’s window size allows more data to be sent before waiting for acknowledgments, reducing the chance of retransmissions due to waiting. The checksum algorithm detects errors but does not affect latency directly, port numbers identify processes, and sequence numbers order packets. Therefore, window size is the relevant parameter for latency reduction.
Q7. A peer‑to‑peer file‑sharing application uses UDP to send data. Which OSI layer is most likely handling error detection for the application’s own reliability?
📖 Explanation: Since UDP provides no built‑in reliability, the application itself must implement error detection, such as checksums or acknowledgments, at the application layer. The transport layer (UDP) does not guarantee delivery, while the data link layer handles frame errors locally, and the physical layer deals with raw signals. Hence, the application layer takes responsibility.
Q8. Recall the definition of a protocol in networking. Which statement is correct?
📖 Explanation: A protocol is a standardized set of rules that dictate how devices exchange information, ensuring interoperability. It is not a cable, hardware component, or specific application. Therefore, the first option correctly defines a protocol.
Q9. Which layer would you associate with establishing a virtual circuit before data transfer begins?
📖 Explanation: The session layer manages dialogs and can establish virtual circuits, coordinating the start, maintenance, and termination of communication sessions. The network layer routes packets, the physical layer transmits bits, and the presentation layer formats data. Hence, the session layer is responsible for virtual circuit setup.
Q10. A developer is designing a protocol that must guarantee ordered delivery and duplicate suppression. Which transport‑layer protocol should they choose?
📖 Explanation: TCP provides ordered delivery, flow control, and duplicate suppression through sequence numbers and acknowledgments. UDP is connectionless and does not guarantee order, IP is network‑layer routing, and ICMP is for control messages. Therefore, TCP satisfies the requirements.
Q11. In a scenario where two hosts communicate over a noisy channel, which layer adds a cyclic redundancy check (CRC) to detect errors?
📖 Explanation: The data link layer appends a CRC to each frame, enabling detection of transmission errors caused by noise. The physical layer deals with raw signal transmission, while the application and transport layers operate at higher abstraction levels without directly handling CRC for frames. Thus, the data link layer is correct.
Q12. What is the primary advantage of layering protocols in a communication system?
📖 Explanation: Layering isolates responsibilities, enabling each layer to be designed, implemented, and updated independently, which simplifies development and troubleshooting. It does not directly affect physical cabling, error checking, or raw speed, making the first option the correct advantage.
Q13. A network uses a protocol that requires each host to broadcast its MAC address before sending data. Which layer is this operation performed at?
📖 Explanation: Broadcasting MAC addresses is a function of the data link layer, which handles local addressing and framing. The network layer works with IP addresses, the transport layer with ports, and the application layer with user data. Therefore, the data link layer is the correct answer.
Q14. Which protocol is commonly used for secure remote login and operates at the application layer?
📖 Explanation: SSH (Secure Shell) provides encrypted remote command‑line access and functions at the application layer. ARP resolves MAC addresses at the data link layer, ICMP handles network diagnostics at the network layer, and UDP is a transport‑layer protocol. Hence, SSH is the appropriate choice.
Q15. In a layered model, if a change is made to the framing format, which layers are most likely to be affected?
📖 Explanation: Framing format dictates how bits are grouped into frames, a responsibility of the data link layer, and may also require adjustments to the physical layer’s signal encoding. Network, transport, session, presentation, and application layers operate on higher‑level data structures and are not directly impacted by framing changes.
Q16. A device needs to translate a hostname to an IP address without contacting a DNS server. Which local mechanism might it use?
📖 Explanation: A hosts file is a local text file that maps hostnames to IP addresses, allowing name resolution without network queries. The ARP cache maps IP to MAC addresses, the routing table determines packet forwarding, and the MAC address table is used by switches. Therefore, the hosts file is the correct mechanism.
Q17. Recall the function of the OSI presentation layer. Which description fits best?
📖 Explanation: The presentation layer is responsible for data representation, including syntax and semantics, ensuring that information sent by the application layer of one system is readable by the application layer of another. It does not manage connections, physical signals, or routing, making the first option correct.
Q18. If a network administrator wants to ensure that all devices use the same maximum transmission unit (MTU), which layer's protocol should they configure?
📖 Explanation: The MTU is defined for frames at the data link layer, specifying the largest packet size that can be transmitted without fragmentation. While the network layer may handle fragmentation, the actual MTU setting resides in the data link layer’s protocol (e.g., Ethernet). Therefore, configuring the data link layer is appropriate.
Q19. A client sends a request to a server using HTTP over TCP. Which layers are involved in delivering the request from the client’s application to the server’s network interface?
📖 Explanation: The request traverses the application (HTTP), transport (TCP), network (IP), data link (e.g., Ethernet), and physical layers before reaching the server’s NIC. Session and presentation layers are optional and not required for basic HTTP/TCP communication. Hence, the full stack listed in option A is accurate.
Q20. Which protocol provides a method for error‑free transmission over an unreliable physical medium by using acknowledgments and retransmissions?
📖 Explanation: Stop‑and‑wait Automatic Repeat reQuest (ARQ) operates at the data link layer, sending a frame and waiting for an acknowledgment before proceeding, ensuring error‑free delivery over noisy media. UDP is connectionless without retransmissions, ICMP Echo is for ping, and ARP resolves addresses. Therefore, stop‑and‑wait ARQ is correct.
Q21. A new IoT device must conserve bandwidth and cannot afford the overhead of establishing a connection before sending data. Which transport protocol is most suitable?
📖 Explanation: UDP is connectionless and incurs minimal overhead, making it ideal for bandwidth‑constrained IoT devices that send small, infrequent packets. TCP requires a handshake and flow control, SCTP provides multi‑streaming, and HTTP is an application‑layer protocol. Hence, UDP is the appropriate choice.
Q22. What is the main reason that protocols are often implemented in both hardware and software?
📖 Explanation: Implementing time‑critical functions in hardware yields high speed, while software offers easier updates and adaptability. This combination balances performance with flexibility. Power consumption, cable length, and error checking are not primary reasons for mixed implementation. Therefore, the first option is correct.
Q23. If two hosts communicate using a protocol that requires a three‑way handshake before data transfer, which layer is this handshake most likely occurring in?
📖 Explanation: A three‑way handshake (SYN, SYN‑ACK, ACK) is characteristic of TCP, which operates at the transport layer to establish a reliable connection. Physical and data link layers manage signal and frame synchronization, while the application layer may have its own handshakes but not the classic three‑step process. Hence, the transport layer is correct.
Q24. Recall the definition of a protocol stack. Which statement is accurate?
📖 Explanation: A protocol stack arranges multiple protocols into layers, each handling specific functions, enabling modular network design. It is not a single protocol, hardware router, or cable type. Therefore, the first description is accurate.
Q25. A network experiences frequent collisions causing packet loss at the data link layer. Which technique can be employed to mitigate this issue?
📖 Explanation: Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a MAC‑layer protocol that listens before transmitting and backs off after collisions, reducing loss. ARP spoofing is an attack, NAT traversal deals with address translation, and DNS caching speeds name resolution. Thus, CSMA/CD is the appropriate technique.
Q26. In a scenario where a host must locate another host on the same local network, which protocol is primarily used?
📖 Explanation: ARP (Address Resolution Protocol) maps IP addresses to MAC addresses within a local network, enabling a host to locate another device directly. TCP provides transport services, SMTP handles email, and HTTPS secures web traffic. Therefore, ARP is the correct protocol.
Q27. A company wants to ensure that its internal communications are encrypted end‑to‑end across all OSI layers. Which approach best meets this requirement?
📖 Explanation: Encrypting at each layer (e.g., using IPsec at the network layer, TLS at the transport layer, and application‑level encryption) provides comprehensive protection, whereas encrypting only at the application layer leaves lower‑layer metadata exposed. Physical shielding does not encrypt data, and TCP checksum only detects errors, not provides confidentiality. Hence, a layered security model is optimal.
Q28. If a protocol specifies that each bit must be held for a duration of ms during transmission, which layer is defining this timing?
📖 Explanation: Timing specifications such as bit duration are characteristic of the physical layer, which governs signal timing, voltage levels, and modulation. The data link layer manages framing, the network layer routes packets, and the presentation layer formats data. Therefore, the physical layer defines the bit‑holding time.
Q29. A developer is troubleshooting why a file transfer fails intermittently. They suspect the issue lies in flow control. Which transport‑layer mechanism should they examine?
📖 Explanation: The sliding window protocol controls how much data can be sent before receiving acknowledgments, directly affecting flow control and potentially causing intermittent failures if misconfigured. ARP cache and MAC tables belong to lower layers, and connector type is a physical concern. Hence, the sliding window mechanism is relevant.
Q30. Recall the purpose of the OSI session layer. Which function does it perform?
📖 Explanation: The session layer is responsible for creating, maintaining, and ending communication sessions, enabling coordinated exchanges between applications. Encoding data is handled by the presentation layer, routing by the network layer, and error‑free transmission by the data link layer. Therefore, the first description fits the session layer.
Q31. In a network that uses token ring topology, which layer governs the token passing mechanism?
📖 Explanation: Token passing is a media access control method managed by the data link layer, ensuring only the token holder transmits. The physical layer handles the signal itself, the network layer routes packets, and the transport layer manages end‑to‑end reliability. Thus, the data link layer controls token ring operations.
Q32. A system must support multiple simultaneous virtual circuits with different quality‑of‑service requirements. Which OSI layer should be configured to manage these requirements?
📖 Explanation: Quality of service for virtual circuits is typically handled by the transport layer, which can allocate resources, prioritize streams, and manage flow control per connection. The network layer routes packets but does not directly enforce per‑circuit QoS, while presentation and physical layers address formatting and signal transmission. Hence, the transport layer is appropriate.
Q33. If a network uses a protocol that adds a checksum at the end of each frame to detect errors, what is the probability that a random error goes undetected assuming a 16‑bit checksum?
📖 Explanation: A 16‑bit checksum can represent distinct values, so the chance that a random error produces the same checksum as the original is . This small probability reflects the checksum’s effectiveness. The other options correspond to different bit lengths or incorrectly claim zero chance. Therefore, the first option is correct.
Q34. A company's network policy mandates that all internal communications use a protocol that provides both reliability and ordered delivery, but also allows multiplexing of multiple streams over a single connection. Which protocol satisfies these criteria?
📖 Explanation: Stream Control Transmission Protocol (SCTP) offers reliable, ordered delivery and supports multiple streams within one association, reducing head‑of‑line blocking. TCP provides reliability and order but lacks native stream multiplexing. UDP is unreliable, and ICMP is for control messages. Hence, SCTP meets all requirements.
Q35. Recall the definition of encapsulation in networking. Which statement best describes it?
📖 Explanation: Encapsulation involves adding protocol-specific headers (and sometimes trailers) to data as it passes from higher to lower layers, preparing it for transmission. It is not compression, encryption, or translation. Therefore, the first description accurately defines encapsulation.