đ 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.
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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.