🎓 BookMCQ
← Back to 24. Transport Layer Protocols

📝 UDP services characteristics (18 MCQs)

Message-Oriented Transport Without Connection State

UDP provides a connectionless transport service in which each send operation produces a separate datagram. It uses ports for process addressing and an eight-byte header for length and checksum information. Unlike TCP, UDP does not establish a connection, guarantee delivery or ordering, retransmit missing data, suppress duplicates, or provide receiver flow control. It defines the boundary between application processes and packet delivery.

Preserving Messages While Avoiding Stream Management

Datagram boundaries are useful when an application treats each message independently, such as a DNS query or a voice packet. A byte-stream service can combine writes and does not preserve message boundaries. UDP therefore leaves message framing visible to applications, while avoiding the connection state and acknowledgment machinery required by reliable stream delivery.

UDP Send, Receive and Error Detection

The sender passes a message to UDP, which adds ports, length, and checksum before invoking IP. Each datagram is routed independently. At the receiver, checksum validation and destination-port lookup precede delivery to the application socket. If a datagram is lost, UDP has no sequence or acknowledgment state to trigger its own retransmission.

A Real-Time Voice Packet Arrives Out of Order

A voice application sends packets numbered at its own application level every 20 milliseconds. UDP carries each packet independently. If packet 102 arrives after packet 103, UDP does not reorder them; the application can use its timestamps and sequence information to decide whether to buffer, discard, or conceal the late packet.

Datagram Boundaries, Overhead and Congestion

UDP's small header and absence of handshake can reduce overhead for short exchanges, but large datagrams risk IP fragmentation and loss of an entire datagram. UDP supplies neither congestion control nor reliability. Modern UDP applications commonly add pacing, acknowledgments, or retransmission when appropriate, rather than assuming the underlying protocol manages these concerns.

Three Misconceptions About UDP Service

'UDP is unreliable because it has no checksum' is incorrect: it has a checksum but no guaranteed recovery. 'UDP preserves packet order' is false: independent datagrams may be reordered. 'UDP applications never retransmit' is false: applications may implement their own recovery, although it is not a built-in UDP service. These distinctions separate similar mechanisms that are often confused.

Exam Focus: Service Properties Versus Application Features

Distinguish protocol-provided properties from functions added by an application. State that UDP is connectionless, message-oriented, and checksum-protected, but provides no built-in ordering, retransmission, or flow control. Explain how an application can add sequence numbers or retries, and evaluate the overhead and delay trade-offs of doing so. Use the assumptions stated in each question when calculating.

Key Terms for UDP Services and Characteristics

  • Connectionless - No transport setup state is established.
  • Message-oriented - Each datagram retains its boundary.
  • Checksum - Detects corruption in a datagram.
  • Reordering - Arrival order differs from sending order.
  • Pacing - Controls the rate of datagram sending.
  • Application recovery - Loss handling implemented above UDP.
5
Easy
7
Medium
6
Hard

📝 All UDP services characteristics MCQs

Q1. If a service uses UDP port 69, which of the following statements must be true about its transport protocol?

A.It can also use TCP for the same port number. ✅
B.It only uses UDP and cannot use TCP at all.
C.It must use TCP to guarantee reliability.
D.It must use a different port number for TCP.
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: UDP and TCP are separate transport protocols; the same numeric port can be bound by both protocols simultaneously. Therefore a service that listens on UDP 69 may also have a TCP listener on port 69, but the two are independent. This makes statement A the only universally true option.

Q2. Which of the following best distinguishes well‑known ports from dynamic ports regarding registration?

A.Well‑known ports are assigned by ICANN and must be registered; dynamic ports are unregistered and freely chosen.
B.Well‑known ports are unregistered; dynamic ports are assigned by ICANN.
C.Both ranges are registered by ICANN, but only well‑known ports are publicly documented. ✅
D.Dynamic ports are reserved for future use, while well‑known ports are currently in use.
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Well‑known ports (0–1023) are officially assigned by IANA/ICANN and appear in public registries such as /etc/services. Dynamic ports (49,152–65,535) are not allocated by any authority, so they are not required to be registered. Option C correctly captures this distinction.

Q3. When configuring a firewall to allow TFTP traffic, which ports should be opened?

A.Only UDP port 69.
B.Only TCP port 69. ✅
C.Both UDP and TCP port 69.
D.Any port above 1024.
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: TFTP can operate over both UDP and TCP, but the standard implementation uses UDP 69. Opening both protocols on the same port ensures compatibility with any variant that might fall back to TCP. Therefore the safest rule is to allow both UDP and TCP on port 69, making option B correct.

Q4. A server listens on a dynamic UDP port 50000 for a custom service while also running DNS on well‑known port 53. What is the most likely impact on NAT traversal for the custom service?

A.NAT will block the custom service because it prefers well‑known ports.
B.The NAT device will prioritize the well‑known port, causing delays for the dynamic port.
C.There is no direct impact; NAT treats each port independently.
D.The custom service will be automatically mapped to the well‑known port by NAT. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Network Address Translation creates separate mappings for each distinct (IP,port,protocol) tuple. Because the custom service uses a dynamic port, its mapping is independent of the DNS mapping on port 53. Consequently, NAT does not interfere with the custom service, making option D the correct inference.

Q5. Which port range poses the greatest risk of accidental exposure when outbound traffic is not explicitly restricted?

A.Well‑known ports (0–1023)
B.Dynamic ports (49,152–65,535) ✅
C.Registered ports (1024–49,151)
D.All ranges are equally risky
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Dynamic ports are often chosen by applications without coordination, and many firewalls have default rules that allow outbound traffic on high‑numbered ports. Because these ports are not centrally managed, an administrator may inadvertently permit traffic that should be blocked, making the dynamic range the riskiest option.

Q6. To avoid port collisions with existing services, which strategy best ensures uniqueness for a new UDP‑based sensor network?

A.Use a dynamically chosen port from the range 49,15249,152–65,53565,535 and register it with a central authority. ✅
B.Select any unused port below 1024 and document it locally.
C.Hard‑code a port number and rely on OS enforcement.
D.Reuse a well‑known port and implement application‑level multiplexing.
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Choosing a port from the dynamic range and recording the assignment in a central registry (or in /etc/services) prevents accidental reuse and provides a traceable reference. This method combines the flexibility of dynamic ports with the safety of registration, making option A the optimal approach.

Q7. Given that /etc/services lists TFTP on port 69 for both UDP and TCP, what can be inferred about the operating system's handling of protocol‑specific entries?

A.The OS binds a single socket to both protocols on the same port.
B.The OS creates separate sockets for UDP and TCP, each identified by the protocol field.
C.The OS ignores the protocol field and treats the entry as protocol‑agnostic.
D.The OS only supports UDP for port 69 regardless of the entry. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Each line in /etc/services includes a protocol column, allowing the OS to differentiate between UDP and TCP entries that share the same numeric port. Consequently, the system creates distinct sockets for each protocol, confirming that protocol information is essential. Option D captures this behavior.

Q8. How does the behavior of UDP port 53 (DNS) differ from TCP port 53 in terms of connection management?

A.UDP 53 is connectionless, while TCP 53 establishes a reliable session. ✅
B.Both UDP and TCP 53 use connection‑oriented communication.
C.UDP 53 requires a three‑way handshake, whereas TCP 53 does not.
D.TCP 53 is stateless, while UDP 53 maintains stateful sessions.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: DNS queries typically use UDP 53 because the protocol is connectionless, sending a single datagram and awaiting a response. When larger responses are needed, the client falls back to TCP 53, which establishes a full three‑way handshake and maintains a session. Thus, the fundamental difference lies in connection management, making option A correct.

Q9. If a client sends a UDP packet to a well‑known port that is not listening, what response is typically generated by the network stack?

A.An ICMP Destination Unreachable – Port Unreachable message. ✅
B.A TCP Reset (RST) segment.
C.The packet is silently dropped with no notification.
D.A DNS error response indicating service unavailability.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When a UDP datagram arrives at a host where no socket is bound to the destination port, the kernel usually replies with an ICMP 3.3 (Port Unreachable) message. This informs the sender that the port is closed, whereas TCP would generate a RST. Therefore option A accurately describes the expected behavior.

Q10. An application uses a dynamic UDP port 60,000, but a firewall rule mistakenly blocks UDP traffic above 55,000. What is the most direct consequence for the application?

A.The application will fall back to TCP automatically.
B.Packets will be dropped, causing communication failure.
C.The firewall will rewrite the destination port to a permitted value. ✅
D.The application will switch to a well‑known port.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Firewalls enforce port‑based filtering without modifying packet headers. Because the rule blocks any UDP traffic with a destination port greater than 55,000, packets destined for 60,000 will be discarded, leading to a loss of connectivity for the application. Option C correctly predicts the outcome.

Q11. Considering that dynamic ports are not registered, which explanation best accounts for two unrelated applications unintentionally using the same port?

A.Both applications query the same DNS record for the port number.
B.Both applications randomly select a port from the dynamic range without coordination. ✅
C.A malicious actor forces both applications to use the same port.
D.The operating system enforces a global port allocation table that both apps share.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Since dynamic ports lack a central authority, applications often choose a free port by scanning the range or using OS‑assigned ephemeral ports. Without a shared registry, two independent programs can independently select the same number, leading to a collision. Option B captures this scenario.

Q12. Design a method to dynamically allocate UDP ports for a microservice architecture while avoiding collisions and ensuring discoverability. Which approach is most effective?

A.Assign ports randomly at startup and rely on OS error handling. ✅
B.Use a central registry service that assigns ports and updates /etc/services for all nodes.
C.Hard‑code a unique port for each microservice in its source code.
D.Allow each service to bind to port 0 and broadcast the chosen port via multicast.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A central registry that hands out ports and records them in a shared configuration (such as /etc/services) provides deterministic allocation and visibility across the cluster. This prevents accidental reuse and enables other services to discover the correct endpoint, making option A the best solution.

Q13. If a DNS resolver prefers UDP for queries but falls back to TCP when the response exceeds 512 bytes, what underlying protocol behavior does this illustrate?

A.UDP truncation triggers a TCP fallback for large responses.
B.TCP is always used first, then UDP is tried if it fails. ✅
C.Both protocols are used simultaneously for redundancy.
D.The resolver switches to ICMP for oversized messages.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Standard DNS operation sends queries over UDP; if the answer would be larger than the UDP payload limit (traditionally 512 bytes), the server sets the Truncation (TC) flag. The resolver then re‑issues the query over TCP to retrieve the full response. This fallback mechanism is captured by option B.

Q14. Compare the security implications of using a well‑known versus a dynamic port for a UDP‑based streaming service. Which statement is most accurate?

A.Well‑known ports are more secure because they are monitored closely.
B.Dynamic ports reduce predictability, making targeted attacks harder. ✅
C.Both port types offer identical security profiles.
D.Well‑known ports automatically encrypt traffic, while dynamic ports do not.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Attackers often scan well‑known ports because services are predictable. Using a dynamic port obscures the service location, increasing the effort required for a successful scan or exploit. While not a substitute for proper security controls, dynamic ports provide an additional layer of obscurity, making option B correct.

Q15. When troubleshooting intermittent loss in a UDP‑based file transfer that uses port 69, which OSI layer should be examined first?

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

📖 Explanation: UDP operates at the Transport layer (Layer 4). Intermittent loss is most frequently caused by issues such as packet drops, checksum errors, or socket buffer overflows, all of which manifest at this layer. Consequently, investigators should begin their analysis at the Transport layer, making option A the appropriate choice.

Q16. What is the highest number in the well‑known port range?

A.1024
B.65535
C.49152
D.1023 ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Well‑known ports are defined as the range from 0 to 1023 inclusive. The upper bound of this range is 1023, which is the highest well‑known port number. Therefore option D is the correct factual answer.

Q17. Which file on a Unix system typically contains the mapping of service names to well‑known ports?

A./etc/hosts
B./etc/resolv.conf
C./etc/services ✅
D./etc/network/interfaces
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The standard location for service‑to‑port mappings on Unix‑like systems is /etc/services. This file lists each service name alongside its assigned port number and protocol, enabling utilities such as grep to retrieve the information. Hence, option C is correct.

Q18. If a network administrator wants to ensure that a new UDP service does not conflict with any existing well‑known ports, which practice should they follow?

A.Use a well‑known port and rely on firewall rules to block conflicts.
B.Choose a port from the dynamic range and document it in /etc/services. ✅
C.Reuse an existing well‑known port with application‑level multiplexing.
D.Assign port 0 and let the OS select an arbitrary port.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Selecting a port from the dynamic (ephemeral) range avoids the reserved well‑known space, and recording the assignment in /etc/services provides a reference for future administrators. This combination prevents accidental collisions while maintaining system documentation, making option B the recommended practice.

🔗 Related Topics (MCQs)