Computer Networks Questions & Answers – UDP


This set of Computer Networks Multiple Choice Questions & Answers (MCQs) focuses on “UDP”.

1. Which of the following is false with respect to UDP?
a) Connection-oriented
b) Unreliable
c) Transport layer protocol
d) Low overhead
View Answer

Answer: a
Explanation: UDP is an unreliable, connectionless transport layer protocol that provides message-based data transmission. TCP is an example of connection-oriented protocols.

2. Return value of the UDP port “Chargen” is _______
a) String of characters
b) String of integers
c) Array of characters with integers
d) Array of zero’s and one’s
View Answer

Answer: a
Explanation: Using Chargen with UDP on port 19, the server sends a UDP datagram containing a random number of characters every time it receives a datagram from the connecting host. The number of characters is between 0 and 512.

3. Beyond IP, UDP provides additional services such as _______
a) Routing and switching
b) Sending and receiving of packets
c) Multiplexing and demultiplexing
d) Demultiplexing and error checking
View Answer

Answer: d
Explanation: De-multiplexing is the delivering of received segments to the correct application layer processes at the recipients end using UDP. Error checking is done through checksum in UDP.
Note: Join free Sanfoundry classes at Telegram or Youtube

4. What is the main advantage of UDP?
a) More overload
b) Reliable
c) Low overhead
d) Fast
View Answer

Answer: c
Explanation: As UDP does not provide assurance of delivery of packet, reliability and other services, the overhead taken to provide these services is reduced in UDP’s operation. Thus, UDP provides low overhead, and higher speed.

5. Port number used by Network Time Protocol (NTP) with UDP is ________
a) 161
b) 123
c) 162
d) 124
View Answer

Answer: b
Explanation: The Network Time Protocol is a clock synchronization network protocol implemented by using UDP port number 123 to send and receive time stamps.

6. What is the header size of a UDP packet?
a) 8 bytes
b) 8 bits
c) 16 bytes
d) 124 bytes
View Answer

Answer: a
Explanation: The fixed size of the UDP packet header is 8 bytes. It contains four two-byte fields: Source port address, Destination port address, Length of packet, and checksum.

7. The port number is “ephemeral port number”, if the source host is _______
a) NTP
b) Echo
c) Server
d) Client
View Answer

Answer: d
Explanation: Port numbers from 1025 to 5000 are used as ephemeral port numbers in Windows Operating System. Ephemeral port numbers are short-lived port numbers which can be used for clients in a UDP system where there are temporary clients all the time.

8. “Total length” field in UDP packet header is the length of _________
a) Only UDP header
b) Only data
c) Only checksum
d) UDP header plus data
View Answer

Answer: d
Explanation: Total length is the 16 bit field which contains the length of UDP header and the data. The maximum value of the Total length field and the maximum size of a UDP datagram is 65,535 bytes (8 byte header + 65,527 bytes of data).

9. Which is the correct expression for the length of UDP datagram?
a) UDP length = IP length – IP header’s length
b) UDP length = UDP length – UDP header’s length
c) UDP length = IP length + IP header’s length
d) UDP length = UDP length + UDP header’s length
View Answer

Answer: a
Explanation: A user datagram is encapsulated in an IP datagram. There is a field in the IP header that defines the total length of the IP packet. There is another field in the IP header that defines the length of the header. So if we subtract the length of the IP header that is encapsulated in the IP packet, we get the length of UDP datagram.

10. The ______ field is used to detect errors over the entire user datagram.
a) udp header
b) checksum
c) source port
d) destination port
View Answer

Answer: b
Explanation: Checksum field is used to detect errors over the entire user datagram. Though it is not as efficient as CRC which is used in TCP, it gets the job done for the UDP datagram as UDP doesn’t have to ensure the delivery of the packet.

Sanfoundry Global Education & Learning Series – Computer Networks.

To practice all areas of Computer Networks, here is complete set of 1000+ Multiple Choice Questions and Answers.

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.