Open In App

User Datagram Protocol (UDP)

User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol. So, there is no need to establish a connection before data transfer. The UDP helps to establish low-latency and loss-tolerating connections over the network. The UDP enables process-to-process communication.

What is User Datagram Protocol?

Though Transmission Control Protocol (TCP) is the dominant transport layer protocol used with most of the Internet services; provides assured delivery, reliability, and much more but all these services cost us additional overhead and latency. Here, UDP comes into the picture. For real-time services like computer gaming, voice or video communication, and live conferences; we need UDP. Since high performance is needed, UDP permits packets to be dropped instead of processing delayed packets. There is no error checking in UDP, so it also saves bandwidth. 



UDP Header

UDP header is an 8-byte fixed and simple header, while for TCP it may vary from 20 bytes to 60 bytes. The first 8 Bytes contain all necessary header information and the remaining part consists of data. UDP port number fields are each 16 bits long, therefore the range for port numbers is defined from 0 to 65535; port number 0 is reserved. Port numbers help to distinguish different user requests or processes. 



UDP Header

  1. Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
  2. Destination Port: It is a 2 Byte long field, used to identify the port of the destined packet.
  3. Length: Length is the length of UDP including the header and the data. It is a 16-bits field.
  4. Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s complement sum of the UDP header, the pseudo-header of information from the IP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.

Notes – Unlike TCP, the Checksum calculation is not mandatory in UDP. No Error control or flow control is provided by UDP. Hence UDP depends on IP and ICMP for error reporting. Also UDP provides port numbers so that is can differentiate between users requests.

Applications of UDP

Advantages of UDP

Disadvantages of UDP

UDP Pseudo Header

UDP pseudo header

UDP Pseudo Header Details

User Interface

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

IP Interface

GATE Questions for Practice

  1. GATE CS 2013, Question 12
  2. GATE CS 2012, Question 65
  3. GATE CS 2007, Question 20
  4. GATE CS 2005, Question 23
  5. GATE IT 2008, Question 66
  6. GATE Mock 2015, Question 5

Frequently Asked Questions on UDP – FAQs

1. Name the protocols that uses UDP?

The protocol that uses UDP Model are:

2. Which is faster: TCP or UDP?

UDP is faster than TCP.


Article Tags :