🎓 BookMCQ
← Back to 23. Introduction to Transport Layer

📝 Connectionless vs connection oriented transport protocols (24 MCQs)

Two Transport Service Models Above the Network Layer

Connectionless and connection-oriented describe different ways transport protocols provide communication between application endpoints. UDP is the common Internet example of connectionless datagram delivery: each message is sent independently without transport connection establishment. TCP is connection-oriented: endpoints establish logical state, number bytes, acknowledge received data, and manage a continuing stream. Both operate above IP and use ports, but their guarantees and overhead differ.

Application Requirements That Shape the Choice

Some applications require complete, ordered delivery and can tolerate retransmission, while others prioritize timely messages or low setup overhead. A connection-oriented service maintains state to support sequencing, recovery, and flow regulation. A connectionless service avoids that setup and state, but it does not inherently correct loss, duplication, or reordering. The appropriate model depends on application semantics.

UDP Datagram Transmission Compared with TCP Setup

For UDP, the sender places each application message in a datagram and passes it to IP. For TCP, the endpoints first exchange SYN, SYN-ACK, and ACK segments to establish a connection. TCP then numbers bytes, acknowledges progress, retransmits missing data, and applies receive-window flow control. TCP termination commonly uses FIN exchanges, while a reset can abort a connection.

Three Readings Sent by a Network Sensor

A sensor sends three 40-byte readings to a monitoring server. With UDP, it can send three separate datagrams, and the application can process later readings even if one is lost. With TCP, the readings enter an ordered byte stream; a missing byte range must be recovered before later stream bytes are delivered to the receiving application.

Trade-Offs in Delay, Ordering and Recovery

TCP suits file transfer, web transactions, and remote login when completeness and order matter. UDP is common for DNS queries, voice, and interactive applications that implement their own timing or recovery. UDP does not guarantee low delay, and TCP does not guarantee constant delay. Congestion, retransmissions, path conditions, and application design affect actual performance.

Correcting Misconceptions About Logical Connections

'Connection-oriented means a dedicated physical circuit' is false: TCP maintains logical endpoint state while packets share routed links. 'Connectionless means no addressing' is false: UDP includes source and destination ports. 'UDP always arrives faster than TCP' is false: delay depends on congestion, loss, application recovery, and connection setup requirements, not simply on whether a protocol is connectionless.

Exam Focus: Comparing Setup, State and Delivery Guarantees

Compare connection setup, maintained state, reliability, ordering, message boundaries, and overhead. Trace the TCP three-way handshake and explain why UDP has no equivalent transport connection establishment. For scenario questions, justify a protocol choice using the application's tolerance for loss, delay, and reordering rather than relying on unsupported claims that one protocol is always faster.

Key Terms for Connection-Oriented and Connectionless Delivery

  • Connectionless - sends independent datagrams without setup.
  • Connection-oriented - maintains logical endpoint state.
  • Handshake - exchanges messages to establish a connection.
  • Byte stream - ordered sequence of TCP bytes.
  • Datagram - independently delivered message unit.
  • Socket - application communication endpoint.
4
Easy
14
Medium
6
Hard

📝 All Connectionless vs connection oriented transport protocols MCQs

Q1. A transport protocol initiates a three‑way handshake before transmitting data. Which logical consequence best explains the need for this handshake?

A.It reduces the packet size to fit within the MTU.
B.It ensures both endpoints agree on initial sequence numbers. ✅
C.It encrypts the payload for security.
D.It allows immediate data transmission without waiting.
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The handshake synchronizes sequence numbers and acknowledges receipt of the initial SYN, guaranteeing that both sender and receiver are ready. This coordination prevents data loss caused by unsynchronized state, which is essential for reliable, ordered delivery in a connection‑oriented service.

Q2. Compare connection‑oriented TCP with connectionless UDP in terms of reliability. Which statement accurately reflects their differences?

A.TCP guarantees in‑order delivery and retransmission of lost packets, while UDP provides no such guarantees. ✅
B.Both TCP and UDP provide identical reliability guarantees, differing only in header size.
C.UDP ensures reliability through checksum verification, whereas TCP does not perform checksums.
D.TCP and UDP both rely on application‑layer protocols for reliability, making them equivalent at the transport layer.
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: TCP implements acknowledgment, retransmission, and flow control, ensuring that data arrives intact and in order. UDP, by contrast, sends datagrams without tracking delivery status, so lost or out‑of‑order packets are not recovered, making TCP far more reliable for data‑sensitive applications.

Q3. Applying the principle of end‑to‑end reliability, which transport protocol would you choose for a real‑time video stream and why?

A.TCP, because it guarantees delivery of every frame regardless of timing.
B.UDP, because it minimizes latency and tolerates occasional loss.
C.TCP, because it provides built‑in congestion control suitable for streaming. ✅
D.UDP, because it encrypts video data at the transport layer.
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Real‑time video tolerates some loss but cannot afford the delay introduced by TCP’s retransmission mechanisms. While TCP offers reliability, its acknowledgment and recovery processes increase latency, which degrades the viewing experience. Therefore, a protocol that prioritizes timely delivery, such as UDP, is generally preferred for live streaming.

Q4. What does the acronym TCP stand for?

A.Transmission Control Protocol ✅
B.Transport Connection Procedure
C.Transfer Communication Process
D.Transient Control Package
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: TCP is one of the core protocols of the Internet protocol suite. Its name reflects its role in providing reliable, ordered, and error‑checked delivery of a stream of bytes between applications, distinguishing it from connectionless alternatives.

Q5. If a packet loss is detected after the third segment of a TCP flow, what is the most likely effect on the congestion window?

A.It is increased by one MSS for each ACK received.
B.It is reset to the initial value of one MSS.
C.It is halved and then grows exponentially again.
D.It remains unchanged until the loss is recovered. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: When loss is detected, TCP typically reduces its congestion window (cwnd) dramatically, often to one maximum‑segment size (MSS) or a reduced value, to alleviate congestion. Afterward, the window grows slowly (slow‑start or congestion‑avoidance) until stability is regained, reflecting the network’s response to loss.

Q6. Evaluate the impact of using UDP for a file‑transfer application compared to TCP. Which outcome is most probable?

A.Higher throughput with guaranteed integrity of the transferred file.
B.Lower latency but frequent file corruption due to missing packets.
C.Reduced reliability leading to incomplete or corrupted files. ✅
D.Improved error detection without any need for retransmission.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: File transfer requires complete and accurate data. UDP’s lack of acknowledgment and retransmission means lost packets are never recovered, resulting in corrupted or incomplete files. TCP’s reliability mechanisms ensure every byte arrives correctly, making UDP unsuitable for this use case despite its lower overhead.

Q7. Apply the concept of port numbers to explain why a server can host both HTTP and FTP services simultaneously. Which statement best captures this idea?

A.Both services share the same port, and the server distinguishes them by IP address.
B.Each service uses a distinct port number, allowing the operating system to route traffic to the correct process.
C.Port numbers are irrelevant; the protocols are identified by packet size. ✅
D.The server multiplexes traffic on a single port using timestamps.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Port numbers act as endpoints for transport‑layer communication. HTTP typically listens on port 80, while FTP uses ports 20/21. By binding separate processes to different port numbers, the server can differentiate incoming traffic and deliver it to the appropriate service without ambiguity.

Q8. Which layer directly above the transport layer is responsible for session management?

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

📖 Explanation: In the TCP/IP model, the transport layer is followed by the application layer, which encompasses session‑related functions such as establishing, maintaining, and terminating communication sessions. Although the OSI model defines a distinct Session layer, the TCP/IP suite incorporates these responsibilities within the Application layer.

Q9. When a client sends a SYN packet to a server that is overloaded, what inference can be made about the server's response time?

A.The server will respond immediately with a SYN‑ACK regardless of load. ✅
B.The server may delay or drop the SYN, increasing connection‑setup latency.
C.The server will convert the SYN to a UDP packet to reduce load.
D.The server will reject the SYN with a reset packet.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: An overloaded server often experiences queueing delays or may drop incoming SYN packets to protect resources. Consequently, the client’s connection‑setup time can increase, or the client may need to retransmit the SYN after a timeout, reflecting the server’s limited capacity to process new connections promptly.

Q10. Contrast the flow‑control mechanisms of TCP and UDP. Which statement correctly describes the difference?

A.Both protocols use a sliding window to regulate data flow.
B.TCP employs a receiver‑advertised window, while UDP provides no flow‑control feedback.
C.UDP uses congestion‑avoidance algorithms, whereas TCP does not. ✅
D.TCP and UDP share identical flow‑control strategies but differ in error detection.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: TCP’s flow control relies on the receiver’s advertised window size, ensuring the sender does not overwhelm the receiver. UDP lacks any built‑in flow‑control mechanism, transmitting packets at the application’s rate regardless of network or receiver conditions, which can lead to congestion or packet loss.

Q11. Synthesize a scenario where a hybrid approach using both TCP and UDP would be advantageous. Which description best fits?

A.A web server delivering static HTML pages over TCP while streaming video over UDP. ✅
B.A DNS resolver using TCP for all queries and UDP for zone transfers.
C.An email client sending both SMTP and POP3 traffic over UDP.
D.A file‑sharing application that encrypts UDP packets with TCP headers.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Web services often require reliable delivery for control messages (HTML, API calls) via TCP, while media streams benefit from low‑latency, loss‑tolerant delivery using UDP. Combining both allows the server to maintain reliability where needed and achieve real‑time performance for streaming content.

Q12. If a TCP connection experiences a timeout after retransmitting a segment twice, what can be deduced about the network condition?

A.The network is experiencing intermittent congestion causing occasional packet loss.
B.The link is error‑free but the remote host is unresponsive.
C.The network path has a consistently high round‑trip time exceeding the timeout interval.
D.The connection has been intentionally terminated by the peer. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: A timeout after multiple retransmissions indicates that acknowledgments are not arriving within the expected interval, suggesting severe congestion, path failure, or that the remote endpoint is not responding. This situation typically prompts TCP to abort the connection after reaching its retransmission limit.

Q13. Analyze the effect of disabling Nagle's algorithm on TCP performance for small messages. Which outcome is most likely?

A.Increased throughput due to larger packet aggregation.
B.Higher latency for interactive applications because each small message is sent immediately. ✅
C.Reduced packet loss because fewer packets are transmitted.
D.Improved error detection through more frequent checksums.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Nagle’s algorithm batches small segments to reduce overhead. Disabling it forces the TCP stack to send each tiny payload immediately, which can raise latency for interactive applications (e.g., telnet) while slightly increasing bandwidth usage. The trade‑off is better responsiveness at the cost of efficiency.

Q14. Explain how checksum verification differs between TCP and UDP, and what implication this has for error detection.

A.TCP computes a checksum over the pseudo‑header and data, while UDP only checks the header. ✅
B.Both protocols use identical checksum algorithms, but TCP’s checksum is optional.
C.UDP’s checksum covers the pseudo‑header and payload, whereas TCP’s checksum also includes sequence numbers, providing stronger error detection.
D.TCP does not use checksums, relying solely on higher‑layer validation.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Both TCP and UDP include a checksum that incorporates a pseudo‑header (source/destination IP, protocol, length) plus the segment data. However, TCP’s checksum also protects sequence and acknowledgment numbers, offering more comprehensive integrity checks. UDP’s optional checksum can be omitted, making its error detection less robust.

Q15. Given that UDP does not guarantee ordering, what logical consequence follows for a multiplayer game that relies on positional updates?

A.The game will always display the most recent position first.
B.Players may see out‑of‑order or delayed positions, requiring client‑side prediction.
C.The server will reorder packets before delivery, eliminating any inconsistency. ✅
D.UDP will automatically retransmit lost position packets to ensure continuity.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Because UDP delivers datagrams independently, packets can arrive out of sequence. Multiplayer games typically implement client‑side prediction and interpolation to mask these irregularities, but without ordering guarantees, occasional visual glitches or position jumps may still occur if packets are delayed or lost.

Q16. Assess the trade‑off between latency and reliability when choosing between TCP and UDP for a live audio broadcast. Which statement is most accurate?

A.TCP provides lower latency but higher packet loss than UDP.
B.UDP offers higher reliability at the cost of increased latency.
C.TCP ensures reliable delivery but introduces jitter that can degrade audio quality.
D.UDP reduces latency and tolerates occasional loss, making it preferable for live audio. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Live audio cannot tolerate the delay introduced by TCP’s retransmission and acknowledgment processes. UDP’s best‑effort delivery minimizes latency, and minor packet loss is often imperceptible to listeners, making UDP the typical choice for real‑time streaming where timeliness outweighs absolute reliability.

Q17. In the context of the end‑to‑end principle, how does a connection‑oriented protocol embody this concept compared to a connectionless one?

A.It shifts error recovery to intermediate routers.
B.It delegates reliability responsibilities to the application layer.
C.It ensures that reliability mechanisms reside at the communicating endpoints rather than the network. ✅
D.It requires the network to guarantee packet delivery before reaching the endpoints.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The end‑to‑end principle states that reliability should be implemented at the hosts, not within the network. TCP, a connection‑oriented protocol, provides sequencing, acknowledgment, and retransmission at the endpoints, fulfilling this principle. UDP, being connectionless, leaves these responsibilities to higher‑level protocols or applications.

Q18. If a network administrator observes that UDP traffic has higher packet loss than TCP traffic under congestion, what inference can be drawn about their congestion control mechanisms?

A.Both protocols use identical congestion avoidance algorithms.
B.UDP’s lack of congestion control causes it to send packets regardless of network state, leading to higher loss. ✅
C.TCP deliberately drops packets to reduce congestion, while UDP avoids loss by throttling transmission.
D.UDP employs aggressive flow control that prevents loss, unlike TCP.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: TCP incorporates congestion control (slow‑start, congestion avoidance) that reduces sending rates when loss is detected, thereby limiting further loss. UDP lacks such mechanisms, so it continues transmitting at the application’s rate even during congestion, resulting in a higher observed loss ratio.

Q19. Critically evaluate why TCP's slow‑start algorithm may cause suboptimal throughput in high‑bandwidth, high‑delay networks, and propose a modification to mitigate this issue. Which answer best addresses the problem?

A.Increase the initial congestion window to several MSS to utilize available bandwidth sooner. ✅
B.Reduce the exponential growth factor to a linear increase from the start.
C.Disable slow‑start entirely and rely on constant window size.
D.Introduce a random back‑off timer to avoid synchronization with other flows.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: In networks with large bandwidth‑delay products, the default initial cwnd (often one MSS) and exponential growth can be too conservative, limiting throughput. Raising the initial cwnd to multiple MSS allows the sender to better match the available capacity early, improving utilization while still preserving congestion‑control safety.

Q20. Synthesize a design for a transport protocol that combines the reliability of TCP with the low‑latency of UDP for IoT sensor data. Which design element is essential?

A.Embedding a full TCP three‑way handshake before every sensor reading.
B.Using fixed‑size packets with no acknowledgment to minimize overhead.
C.Incorporating selective acknowledgments with optional immediate retransmission of critical data. ✅
D.Relying solely on application‑layer retries without transport‑layer support.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: A hybrid protocol should retain TCP‑like reliability for critical sensor updates via selective acknowledgments (SACK) that allow the receiver to indicate precisely which packets were missed, enabling prompt retransmission of only those packets while avoiding the latency of full handshakes for every message.

Q21. Assume a hybrid protocol switches from UDP to TCP after detecting packet loss. If the loss rate exceeds 5%, what is the expected impact on overall latency?

A.Latency will decrease because TCP provides faster retransmission. ✅
B.Latency will increase due to TCP's acknowledgment and congestion‑control overhead.
C.Latency will remain unchanged because the protocol continues to use UDP for all packets.
D.Latency will fluctuate randomly with no predictable pattern.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When loss surpasses a threshold, the protocol transitions to TCP, which introduces acknowledgment, retransmission timers, and congestion‑control delays. These mechanisms inherently raise end‑to‑end latency compared to pure UDP, where packets are sent without waiting for feedback.

Q22. Compare the resource consumption of maintaining TCP state versus stateless UDP on a server handling 10,000 concurrent clients. Which statement accurately quantifies the difference?

A.TCP requires per‑connection control blocks and buffers, consuming significantly more memory than UDP, which needs only minimal socket metadata.
B.Both protocols consume identical resources because the kernel allocates the same amount of memory per socket.
C.UDP consumes more resources because it must track sequence numbers for each datagram. ✅
D.TCP uses less memory because it reuses a single buffer for all connections.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: TCP maintains a Transmission Control Block (TCB) for each connection, storing sequence numbers, windows, timers, and buffers, leading to substantial memory and CPU overhead. UDP is connectionless; the kernel only tracks basic socket information, resulting in far lower per‑client resource usage.

Q23. Explain how the use of sequence numbers in TCP enables both flow control and retransmission, and why UDP lacks this capability. Which explanation is correct?

A.Sequence numbers allow TCP to reorder out‑of‑order packets and request missing ones, while UDP cannot because it does not assign numbers to its datagrams.
B.TCP uses sequence numbers solely for encryption purposes, whereas UDP relies on timestamps.
C.The presence of sequence numbers in TCP permits the receiver to advertise a window size, facilitating flow control; they also identify lost segments for retransmission. UDP sends datagrams without sequence numbers, so it cannot perform either function. ✅
D.Sequence numbers in TCP are optional and only used for debugging; UDP always includes them implicitly.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: TCP’s sequence numbers uniquely identify each byte of the data stream, enabling the receiver to acknowledge specific ranges, enforce a sliding window (flow control), and detect gaps that trigger retransmission. UDP lacks sequence numbers, so it cannot provide ordered delivery, flow control, or reliable recovery of lost packets.

Q24. If a firewall blocks all inbound TCP SYN packets but allows UDP datagrams, what logical effect does this have on a client's ability to establish a new TCP connection versus sending a UDP message?

A.The client can still establish TCP connections using SYN‑ACK packets alone.
B.The client cannot initiate new TCP connections but can communicate freely via UDP. ✅
C.Both TCP and UDP communications are blocked because the firewall filters all inbound traffic.
D.UDP traffic will be automatically converted to TCP SYN packets by the firewall.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Blocking inbound SYN packets prevents the three‑way handshake from completing, effectively stopping any new TCP connection attempts. Since UDP does not require a handshake, its datagrams pass through the firewall unimpeded, allowing the client to send messages without restriction.

🔗 Related Topics (MCQs)