Explain the purpose of UDP?

User Datagram Protocol (UDP) provides a connectionless packet service that offers unreliable 'best effort' delivery. This represents that the packet's arrival is not guaranteed, and also there is no guarantee for the correct sequencing of forwarded packets.

An application that does not require an acknowledgement of data receipt. For example, audio or video broadcasting used UDP.

UDP is also used by application of the typical transmit of a small amount of data at one time. For example, UDP provides a protocol port to distinguish between multiple programs implemented on a single device

Each UDP message includes both a destination port number and a source port number. This makes it feasible for the UDP software at the destination to deliver the message to the correct application program and for the application program to send a reply.

Source PortLengthDestination PortUDP Checksum

UDP Datagram

The UDP header is classified into the following 16-bit fields.

Source Port

Source Port is an optional field when it is relevant. It denotes the port of the sending process and can be assumed to be the port that should address a reply in the absence of any other data. If not utilised, a value of zero is added.

Destination Port

A destination port has a meaning within the context of a particular internet destination address.


This is the size in bytes of the UDP packet, including the header and data. The minimum length is 8 bytes which is the length of the header alone

UDP Checksum

This is used to verify the integrity of the UDP header. The checksum is performed on a pseudo-header consisting of information obtained from the IP header (Source and destination address) and the UDP header.

UDP pseudo Header

The purpose of using a pseudo-header is to test that the UDP packet has reached its correct destination. Here, the correct destination includes a specific machine and a particular protocol port number within that machine.

The UDP header itself determines only the protocol port number. Thus, to authenticate the destination UDP on the sending devices computes a checksum covering the destination IP address and the UDP packet

UDP software determines the checksum at the ultimate destination by using the destination IP address which is obtained from the IP packet header that carried the UDP message.

If the checksum agrees, that it is true that the packet has reached the intended destination host and the correct protocol port within the host.

Source Address
Destination Address
ZeroProtocolUDP Length

UDP pseudo header

User Interface

A user interface should allow the creation of new received ports, receive operations on the data octets and an indication of the source port and source address, and a procedure that enables a datagram to be sent, specifying the data, source and destination ports and addresses to be sent.

IP Interface

The UDP module must decide the source and destination internet addresses and the internet header's protocol field. One possible UDP/IP interface will return the entire internet datagram, including the whole Internet header, to receive operation.

Such an interface would also enable the UDP to pass the whole internet datagram, complete with a header to the IP to send. The IP would verify specific fields for consistency and compute the internet header checksum.

Protocol Application

This protocol's significant uses are the Internet Name Server and the Trivial File Transfer.

Protocol Number

The protocol number is 17 (21 octal) when used in the Internet Protocol.

Updated on: 04-May-2021

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started