🎓 BookMCQ
← Back to 23. Introduction to Transport Layer

📝 Transport Layer protocols (9 MCQs)

TCP, UDP and SCTP in the Internet Architecture

Internet transport protocols define how application data is exchanged above IP. TCP provides a reliable, ordered byte stream; UDP provides connectionless datagram service; and SCTP provides message-oriented communication through associations, with multistreaming and multihoming features. Their headers, endpoint state, and recovery procedures differ. Selecting a protocol therefore determines important application-facing behaviour without changing IP's basic role in forwarding packets between hosts.

Different Communication Needs Behind Protocol Design

Applications may need a byte stream, preserved message boundaries, minimal setup, or multiple independent delivery sequences. TCP's ordered stream can delay later data while a missing byte range is recovered. UDP leaves recovery and ordering to the application. SCTP carries messages and can separate streams within an association, addressing needs that do not map neatly to a single ordered TCP stream.

Header Fields, Endpoint State and Data Units

TCP uses source and destination ports, sequence and acknowledgment numbers, control flags, a window field, and a checksum. UDP has source port, destination port, length, and checksum fields. SCTP uses a common header followed by typed chunks, including DATA and control chunks. TCP maintains a connection; SCTP establishes an association; UDP has no transport connection setup.

A 900-Byte Message Across Three Transport Choices

Consider an application sending a 900-byte command. UDP preserves it as one datagram if it fits the path MTU and is not otherwise fragmented. TCP exposes its contents as a byte stream, so segment boundaries need not match the command. SCTP can carry the command as a message within a selected stream of an established association.

Where Each Protocol Fits and What It Cannot Promise

TCP is widely used where ordered reliable transfer is required; UDP is used for queries and real-time traffic where an application chooses its own recovery policy. SCTP appears in specialized signalling and message-oriented systems. QUIC runs over UDP and implements secure, reliable transport functions above it. Protocol choice affects overhead and semantics, but no protocol removes path congestion or application design constraints.

Clarifying Checksums, Message Boundaries and QUIC

'UDP has no checksum field' is false: its header includes a checksum, with different requirements for IPv4 and IPv6. 'TCP preserves application message boundaries' is false: TCP provides a byte stream. 'QUIC is a TCP variant' is false: QUIC is built over UDP and implements its own connection, reliability, and security mechanisms above the UDP service.

Exam Focus: Comparing Headers, Services and Protocol Roles

Compare TCP, UDP, and SCTP by service model, data unit, connection state, sequencing, and supported features. Memorize the four UDP header fields and recognize key TCP control and sequencing fields. Explain why TCP is stream-oriented, why UDP preserves datagrams, and why QUIC uses UDP carriage without becoming a TCP segment format or an IP-layer protocol.

Key Terms for Internet Transport Protocols

  • TCP - reliable ordered byte-stream protocol.
  • UDP - connectionless datagram transport protocol.
  • SCTP - message-oriented association-based protocol.
  • Association - SCTP communication relationship.
  • Multistreaming - separates delivery sequences within an association.
  • QUIC - secure transport protocol built over UDP.
3
Easy
4
Medium
2
Hard

📝 All Transport Layer protocols MCQs

Q1. Which well-known port number is officially assigned to the Hypertext Transfer Protocol (HTTP) by IANA?

A.80 ✅
B.443
C.21
D.25
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Port 80 is the standard IANA‑assigned number for HTTP. While 443 is used for HTTPS, 21 for FTP, and 25 for SMTP, the specific assignment of 80 to HTTP is defined in the IANA service name registry, making it the correct choice for this question.

Q2. If a TCP sender receives a zero‑window advertisement from its peer, what is the most immediate consequence for the sender's data flow?

A.Continue sending at previous rate
B.Reduce congestion window but keep sending
C.Pause transmission until window opens ✅
D.Reset the connection
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A zero‑window advertisement signals that the receiver cannot accept more data, so the sender must stop transmitting new bytes and wait for a window‑update segment. It does not alter the congestion window or terminate the connection; it simply pauses data flow.

Q3. Compare the reliability mechanisms of TCP and UDP. Which statement accurately reflects their differences?

A.Both use checksums, but only TCP provides sequencing and retransmission ✅
B.UDP provides sequencing while TCP does not
C.TCP and UDP both guarantee delivery
D.UDP includes flow control like TCP
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: TCP and UDP both include a checksum for basic error detection, yet only TCP adds sequence numbers, acknowledgment, and retransmission mechanisms to ensure reliable, ordered delivery. UDP lacks these features, offering a best‑effort service without guarantees of delivery or ordering.

Q4. A TCP connection has an advertised receive window of 64 KB and a round‑trip time (RTT) of 100 ms. After half the data is sent, the receiver reduces its window to 32 KB. Assuming the sender fully utilizes the window, what is the new maximum throughput?

A.5.12 Mbps
B.2.56 Mbps
C.1.28 Mbps
D.2.62 Mbps ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Throughput ≈ window / RTT. The reduced window is 32 KB = 262 144 bits. Dividing by the RTT of 0.1 s yields ≈2.62 Mbps. This value reflects the new upper bound on data rate, assuming the sender immediately adapts to the smaller window and no other bottlenecks exist.

Q5. A NAT device maps internal source port 54321 to external port 40000. If two internal hosts simultaneously initiate connections to the same external server IP and port, what mechanism ensures the NAT can distinguish the flows?

A.Changing destination IP
B.Incrementing sequence numbers
C.Using different destination ports
D.Maintaining separate translation entries based on source IP and port ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: NAT maintains a distinct translation entry for each unique tuple of internal source IP and port, external destination IP and port, and protocol. By tracking these tuples, it can correctly route return traffic to the appropriate internal host even when the external port is shared.

Q6. Evaluate the impact of using a per‑packet checksum versus a per‑segment checksum in a transport protocol. Which outcome best describes the trade‑off?

A.Per‑packet checksum reduces processing overhead but may miss errors spanning multiple packets ✅
B.Per‑segment checksum increases latency due to larger data blocks
C.Per‑packet checksum provides stronger error detection at the cost of higher CPU usage
D.Per‑segment checksum simplifies implementation but cannot detect any errors
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A per‑packet checksum checks each packet individually, requiring less computation than aggregating checksums over an entire segment. However, errors that affect data spread across multiple packets might go undetected, illustrating the classic trade‑off between efficiency and comprehensive error coverage.

Q7. Design a transport protocol for constrained IoT devices that must minimize energy consumption while supporting occasional bursty data. Which combination of features best satisfies these constraints?

A.Reliable, connection‑oriented with large windows
B.Unreliable, connectionless with fixed small packets
C.Hybrid: occasional reliable sessions with adaptive window sizing ✅
D.Purely broadcast with no addressing
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: A hybrid approach allows devices to stay in a low‑power, connectionless mode for routine transmissions, while still enabling occasional reliable sessions that adapt window size to the burst size. This balances energy efficiency with the need for occasional guaranteed delivery during high‑traffic events.

Q8. Differentiate between TCP’s three‑way handshake and its four‑way termination. Which statement correctly captures their primary purposes?

A.Handshake establishes flow control; termination releases buffers
B.Handshake synchronizes sequence numbers; termination ensures both sides agree to close ✅
C.Handshake provides encryption; termination provides compression
D.Handshake and termination both serve to negotiate window sizes
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The three‑way handshake (SYN, SYN‑ACK, ACK) aligns initial sequence numbers and establishes connection state. The four‑way termination (FIN, ACK, FIN, ACK) lets each endpoint independently close its direction, guaranteeing that both sides have finished transmitting data before the connection is fully torn down.

Q9. After a TCP connection closes, the socket enters TIME_WAIT state for twice the maximum segment lifetime (MSL). How does this affect the reuse of the same local port number for a new connection?

A.The port can be reused immediately after TIME_WAIT expires ✅
B.The port is permanently blocked
C.The port can be reused only if the remote host also closes
D.The port is reused only after a forced reset
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: TIME_WAIT preserves the port for a period equal to 2 × MSL to ensure delayed packets are discarded. Once this interval elapses, the port becomes available again for new connections, preventing accidental mixing of old and new traffic while not permanently restricting port reuse.

🔗 Related Topics (MCQs)