🎓 BookMCQ
← Back to 17. Distributed Systems

📝 TCP/IP example of Communication Protocols (18 MCQs)

TCP/IP as a Layered Network Communication Suite

TCP/IP is a family of communication protocols that enables data exchange across interconnected networks. It provides a layered architecture commonly described using application, transport, internet, and link layers. Distributed operating systems and applications rely on this suite for addressing, packet routing, process-to-process communication, and access to remote services across heterogeneous computers.

Why Interconnected Systems Need Standard Protocols

Different computers and networks require common rules to exchange data regardless of hardware or operating system. TCP/IP separates application messages from transport and routing functions. This layered design allows local network technologies to change while applications continue using established protocols and addressing conventions.

Encapsulation Through TCP, IP and Link Layers

An application generates data, which a transport protocol such as TCP or UDP processes. IP adds source and destination addresses and forwards packets across networks. The link layer places packets into frames for the next network segment. At the receiver, the layers remove headers and deliver data upward to the application.

Example of a TCP Based Web Request

A client sends an HTTP request to a web server. TCP establishes a connection and carries the application bytes reliably, while IP routes packets toward the server's address. Ethernet or Wi-Fi transmits each frame on the local link. The server reverses the process and provides the response.

Reliable Transport and Best Effort Routing

TCP provides sequencing, acknowledgements, retransmission, and flow and congestion control. IP provides connectionless best-effort packet delivery without guaranteeing arrival or order. UDP offers lower transport overhead but no built-in reliability. The protocol combination must match application requirements, while TLS can add encryption and authentication to suitable communication.

Misconceptions About TCP/IP

'IP guarantees packet delivery' is false because IP is best effort. 'TCP preserves application message boundaries' is incorrect because TCP provides a byte stream. 'TCP and IP perform the same function' ignores the transport and network layer distinction.

Exam Focus: TCP/IP Layers and Data Flow

Map HTTP, TCP or UDP, IP, and Ethernet to their respective layers. Trace data encapsulation and decapsulation between a client and server. Questions may compare TCP with UDP, explain IP routing, or identify which protocol handles addressing, sequencing, retransmission, and local frame delivery.

Key Terms of TCP/IP

  • TCP - Reliable ordered transport protocol.
  • IP - Provides logical addressing and routing.
  • UDP - Connectionless transport protocol.
  • Encapsulation - Wrapping data with protocol headers.
  • Port - Identifies a transport service endpoint.
5
Easy
8
Medium
5
Hard

📝 All TCP/IP example of Communication Protocols MCQs

Q1. A web client sends an HTTP request that travels down the protocol stack. Which layer is responsible for adding the TCP header before the segment is handed to the network layer?

A.Application layer
B.Transport layer ✅
C.Network layer
D.Data-link layer
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The Transport layer adds the TCP header because it provides end‑to‑end services such as segmentation and reliability. The Application layer only creates the data payload, while the Network layer adds the IP header and the Data‑link layer adds its own frame header. Thus option B is correct. The other layers do not manipulate TCP fields, so they are incorrect. This reflects how real HTTP traffic is encapsulated in practice.

Q2. A large IP packet must be divided because the underlying network supports a maximum transmission unit of 15001500 bytes. After fragmentation at the data‑network layer, which layer on the receiving host reassembles the fragments into the original packet?

A.Physical layer
B.Data‑link layer
C.Network layer
D.Transport layer ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Reassembly is performed by the Transport layer because it receives the complete segment after the Network layer has removed the IP header. The Network layer only routes individual fragments; the Data‑link and Physical layers handle bits and frames, not reassembly. Therefore option D is correct, while the other layers lack the mechanisms to rebuild the original packet.

Q3. A network administrator wants to block all inbound traffic for a specific service. At which layer should the firewall inspect packet headers to enforce this rule?

A.Application layer ✅
B.Transport layer
C.Network layer
D.Data‑link layer
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Firewalls that filter by service (e.g., HTTP, FTP) examine the Application layer header because the service name and protocol details reside there. The Transport layer provides port numbers, but the rule is defined in terms of the application protocol. Network and Data‑link layers only contain routing and framing information, so they cannot identify the service directly. Hence option A is correct.

Q4. To achieve end‑to‑end encryption while still allowing routers to forward packets based on IP addresses, which layer should handle the encryption?

A.Physical layer
B.Data‑link layer
C.Network layer ✅
D.Application layer
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Encryption at the Network layer (IPsec) protects the payload while preserving the IP header, enabling routers to read destination addresses for forwarding. If encryption were applied at the Data‑link or Physical layers, routers could not see the IP header, breaking routing. Application‑layer encryption (e.g., TLS) would also work but would hide the data from the Network layer, not meeting the requirement of router visibility. Therefore option C is correct.

Q5. A developer needs guaranteed delivery of data between two hosts. Which layer of the TCP/IP stack provides this reliability?

A.Application layer
B.Transport layer ✅
C.Network layer
D.Data‑link layer
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Reliability, including acknowledgment, retransmission, and ordering, is a core function of the Transport layer (TCP). The Application layer relies on the Transport layer for these services; the Network layer routes packets without guaranteeing delivery, and the Data‑link layer only ensures local link reliability. Consequently, option B correctly identifies the layer that supplies reliable transport.

Q6. In a Voice over IP call, latency must be minimized. Which layer’s processing overhead is most often reduced to improve real‑time performance?

A.Physical layer
B.Data‑link layer
C.Network layer
D.Transport layer ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: The Transport layer (using UDP) adds minimal header overhead and avoids retransmission, which reduces latency compared to TCP’s reliability mechanisms. While the Physical, Data‑link, and Network layers are essential for transmission, their processing times are largely fixed by hardware and routing decisions. Therefore, minimizing Transport‑layer processing, especially by choosing UDP, directly improves real‑time voice quality, making option D correct.

Q7. A packet experiences loss at the data‑link layer due to a corrupted frame. Which layer will detect this loss and initiate recovery?

A.Physical layer
B.Network layer
C.Transport layer ✅
D.Application layer
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The Transport layer detects loss through missing acknowledgments and triggers retransmission. Although the Data‑link layer may notice a corrupted frame, it typically handles local error correction; if it cannot recover, the loss is reported upward. The Network and Application layers do not monitor individual packet acknowledgments. Hence, the Transport layer is responsible for detection and recovery, making option C correct.

Q8. A custom protocol runs on top of UDP. Which layer assigns the source and destination port numbers that identify the communicating processes?

A.Physical layer
B.Data‑link layer
C.Network layer
D.Transport layer ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Port numbers are a function of the Transport layer, which uses UDP or TCP to differentiate multiple applications on the same host. The Physical and Data‑link layers deal with bits and frames, while the Network layer handles IP addresses. Therefore, option D correctly identifies the layer that provides port‑based multiplexing.

Q9. A router receives an IP packet whose Time‑to‑Live (TTL) field has reached zero. What action does the router take?

A.Forward the packet unchanged
B.Decrease TTL and forward
C.Discard the packet and send an ICMP Time Exceeded message ✅
D.Reset the TTL to its original value
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: When TTL reaches zero, the router must discard the packet to prevent infinite looping and generate an ICMP Time Exceeded message back to the source. Simply forwarding the packet would violate the TTL purpose, and resetting TTL would defeat its function. Hence, option C accurately describes the required behavior.

Q10. Why does each layer of the TCP/IP stack add its own header to a message as it moves down the stack?

A.To encrypt the data at each step
B.To provide routing information for the next layer
C.To enable the receiving side’s equivalent layer to interpret the data correctly ✅
D.To increase transmission speed
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Each layer’s header contains control information specific to that layer’s responsibilities (e.g., ports, addresses, sequencing). This allows the corresponding layer on the receiving host to process and strip its header, ensuring correct interpretation. Encryption is optional, routing information is primarily in the Network layer, and adding headers does not inherently speed transmission. Thus, option C correctly explains the purpose of layered headers.

Q11. How does the OSI model differ from the TCP/IP model in terms of layer organization?

A.OSI has more layers, separating functions that TCP/IP combines ✅
B.OSI combines all functions into a single layer
C.TCP/IP has exactly seven layers, matching OSI
D.Both models are identical in layer count
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The OSI model defines seven distinct layers, while the TCP/IP model merges some functions (e.g., the OSI Transport and Session layers are combined into a single Transport layer). Therefore, OSI’s finer granularity results in more layers, making option A correct. The other statements misrepresent the relationship between the two models.

Q12. What is the primary purpose of the data‑network (Internet) layer in the TCP/IP suite?

A.To provide end‑to‑end reliability
B.To determine physical transmission media
C.To route packets across multiple networks ✅
D.To encrypt user data
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The Internet layer is responsible for logical addressing (IP) and routing packets from source to destination across heterogeneous networks. Reliability is handled by the Transport layer, media selection by the Data‑link layer, and encryption by higher layers. Consequently, option C accurately captures the core function of the data‑network layer.

Q13. How does encapsulation enable interoperability between devices using different hardware technologies?

A.It hides hardware details behind a universal address ✅
B.It forces all devices to use the same physical medium
C.It converts data into analog signals for transmission
D.It eliminates the need for error checking
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Encapsulation wraps data with protocol headers that abstract the underlying hardware, allowing devices with diverse physical media to exchange information using common logical addresses. By standardizing the format at each layer, devices need not share the same hardware. The other options either misstate the role of encapsulation or ignore its purpose. Hence, option A is correct.

Q14. Why is the application layer considered the highest layer even though it is the first to generate data for transmission?

A.Because it adds the most headers
B.Because it directly interacts with end users and software ✅
C.Because it controls the physical medium
D.Because it routes packets across the internet
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The application layer sits at the top of the logical hierarchy, providing services directly to user applications. It does not add headers for lower layers; rather, it creates the payload that lower layers encapsulate. Routing is a function of the Network layer, and the Physical layer handles media. Thus, option B correctly explains the layer’s position.

Q15. In what way does the transport layer ensure that data arrives in the correct order?

A.By assigning IP addresses
B.By using sequence numbers and acknowledgments ✅
C.By encrypting each segment
D.By selecting the shortest path
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: TCP, the primary Transport‑layer protocol, attaches a sequence number to each segment and requires the receiver to acknowledge received data. Out‑of‑order segments are reordered based on these numbers. IP addresses belong to the Network layer, encryption is optional, and path selection occurs at the Network layer. Therefore, option B accurately describes the ordering mechanism.

Q16. What role does the physical layer play in the overall protocol stack?

A.It defines logical addressing schemes
B.It ensures end‑to‑end reliability
C.It transmits raw bits over a medium ✅
D.It manages port numbers for applications
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The Physical layer is responsible for converting frames into electrical, optical, or radio signals and sending those bits over the chosen medium. Logical addresses, reliability, and port management are handled by higher layers. Hence, option C correctly identifies the Physical layer’s function.

Q17. What does TCP stand for?

A.Transmission Control Protocol ✅
B.Transport Communication Procedure
C.Transport Control Program
D.Transmission Channel Protocol
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: TCP is the abbreviation for Transmission Control Protocol, a core Transport‑layer protocol that provides reliable, ordered delivery of data. The other options are fabricated variations and do not represent the actual name. Therefore, option A is the correct expansion.

Q18. Which layer in the TCP/IP model corresponds to the OSI model’s network layer?

A.Application layer
B.Transport layer
C.Internet layer ✅
D.Data‑link layer
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The Internet layer of TCP/IP performs the same logical addressing and routing functions as the OSI Network layer, using IP addresses to move packets between hosts. The Application, Transport, and Data‑link layers map to different OSI layers. Thus, option C correctly matches the layers.

🔗 Related Topics (MCQs)