Table of contents
- Introduction to User Datagram Protocol (UDP)
- History & Invention of User Datagram Protocol
- Features of User Datagram Protocol
- Structure and Frame Format of User Datagram Protocol
- Working principle of User Datagram Protocol
- List of Well-Known PORT for User Datagram Protocol (UDP)
- Applications of User Datagram Protocol
- Advantages of User Datagram Protocol
- Disadvantages of User Datagram Protocol
- Future Improvement of User Datagram Protocol
Introduction to User Datagram Protocol (UDP)
The User Datagram Protocol (UDP) is a communication protocol that operates at the transport layer of the Internet Protocol (IP) suite. Unlike the Transmission Control Protocol (TCP), which establishes a reliable connection-oriented communication channel, UDP is a connectionless and unreliable protocol that provides fast, low-overhead data transfer.
UDP is commonly used in applications that require fast, low-latency data transfer, such as online gaming, video conferencing, and VoIP (Voice over IP) communication. Unlike TCP, which adds overhead to the data transfer by establishing a reliable connection and retransmitting lost data, UDP simply sends the data and relies on the underlying network to deliver the data reliably.
UDP is also used in situations where the loss of some data is acceptable, as the protocol does not guarantee that all data will be delivered to the recipient. This makes UDP well-suited for real-time applications, such as streaming video or audio, where the data can be discarded if it arrives too late to be useful.
History & Invention of User Datagram Protocol
The User Datagram Protocol (UDP) was developed in 1980 as part of the development of the Internet Protocol (IP) suite. UDP was created by David P. Reed, who was working at the Massachusetts Institute of Technology (MIT) at the time.
The development of UDP was part of a larger effort to standardize and simplify the communication protocols used on the Internet. At the time, the Internet was growing rapidly, and there was a need for a fast and efficient way to transfer data across the network.
Reed recognized that the existing communication protocols, such as the Transmission Control Protocol (TCP), added significant overhead to the data transfer, which was becoming a bottleneck for the growing network. He designed UDP as a simple and efficient way to transfer data, without the overhead of establishing and maintaining a reliable connection.
UDP was designed to provide a fast and efficient way to transfer data, even in situations where the loss of some data was acceptable. This made UDP well-suited for real-time applications, such as online gaming and video conferencing, where fast and efficient data transfer was more important than guaranteed delivery.
UDP quickly became an important part of the Internet Protocol suite and was widely adopted for a variety of applications. Despite its limitations, UDP remains an important part of the Internet Protocol suite and continues to play a crucial role in enabling fast and efficient data transfer across the network.
Features of User Datagram Protocol
The User Datagram Protocol (UDP) has several key features that make it well-suited for certain types of applications:
- Connectionless: UDP is a connectionless protocol, meaning that it does not establish a reliable connection between the sender and receiver. Instead, UDP simply sends the data and relies on the underlying network to deliver the data.
- Unreliable: UDP does not guarantee that all data will be delivered to the recipient. This means that some data may be lost or duplicated during the transfer, which makes UDP less suitable for applications that require guaranteed delivery of data.
- Fast: UDP is a fast protocol, as it does not add any additional overhead to the data transfer. This makes UDP well-suited for applications that require fast, low-latency data transfer, such as online gaming and video conferencing.
- Simple: UDP is a simple protocol, with a minimal set of rules for transferring data. This makes UDP well-suited for embedded systems and other applications that have limited resources and require a lightweight communication protocol.
- Multi-cast Support: UDP supports multi-cast, which allows data to be sent to multiple recipients at the same time. This makes UDP well-suited for broadcast applications, such as streaming video or audio.
Structure and Frame Format of User Datagram Protocol
The User Datagram Protocol (UDP) is a transport layer protocol that is used for communication over the Internet. UDP is a lightweight protocol that provides a way to send data packets without establishing a connection, making it faster than the Transmission Control Protocol (TCP) but less reliable.
The UDP frame packet is also having 2 Parts.
- UDP Header.
- UDP Data.

Header in User Datagram Protocol (UDP)
The header of the User Datagram Protocol (UDP) is a fixed-length 8-byte structure that contains the necessary information to deliver the UDP datagram to the correct application.
The UDP header has four fields, each of which is 2 bytes in length:
- Source Port: A 16-bit field that specifies the source port of the sender. This field specifies the port number of the sending application. The port number is a 16-bit value that uniquely identifies the application on the sending host.
- Destination Port: A 16-bit field that specifies the destination port of the receiver. This field specifies the port number of the receiving application. The port number is a 16-bit value that uniquely identifies the application on the receiving host.
- Length: A 16-bit field that specifies the length of the UDP header and data payload in bytes. This field specifies the length of the UDP datagram, including the header and the data. The length field is a 16-bit value that can range from 8 to 65,535 bytes.
- Checksum: A 16-bit field that contains a checksum of the datagram, used for error detection. This field is used to ensure the integrity of the UDP datagram. The checksum is a 16-bit value that is computed over the entire UDP datagram, including the header and the data. The checksum is optional in UDP, but it is commonly used to ensure the reliability of the data.
The UDP header is minimal compared to other transport layer protocols, such as TCP, which has a more complex header that includes sequence numbers, acknowledgments, and other control information. The simplicity of the UDP header makes UDP a fast and efficient protocol for applications that require low overhead and high speed, such as multimedia streaming and online gaming.
Data Field in User Datagram Protocol (UDP)
The data field of the User Datagram Protocol (UDP) is the portion of the UDP datagram that contains the application data being sent from the source to the destination. The size of the data field varies depending on the amount of data being transmitted by the application.
The minimum payload size of the UDP data field is 0 bytes. This can occur when the application does not need to send any data along with the UDP datagram, such as in the case of a simple acknowledgement message.
The UDP datagram is carried in a single IP packet and is hence limited to a maximum payload of 65,507 bytes for IPv4 and 65,527 bytes for IPv6. This value is derived from the maximum length of a UDP datagram, which is 65,535 bytes (including the 8-byte header). Since the header is fixed at 8 bytes, the maximum payload size that can fit in a UDP datagram is 65,527 bytes.
Working principle of User Datagram Protocol
The working principle of the User Datagram Protocol (UDP) is based on the simple idea of transmitting data as separate units, called datagrams, without establishing a dedicated connection between the sender and receiver. Here is a step-by-step explanation of the working principle of UDP:
- Data Segmentation: The application layer divides the data into small segments, called datagrams, which are then passed down to the transport layer.
- UDP Header: The transport layer adds a header to each datagram, which contains information about the source and destination ports, the length of the datagram, and a checksum for error detection.
- IP Packet: The transport layer then passes the datagram to the network layer, where an IP header is added to create an IP packet. The IP header contains information about the source and destination IP addresses and the protocol used.
- Network Transmission: The IP packet is then transmitted over the network, following the routing information stored in the IP header.
- Destination Reception: The IP packet is received by the destination host, where the IP header is stripped off, and the datagram is passed up to the transport layer.
- UDP Processing: The transport layer checks the UDP header for errors and discards any datagrams with errors. The transport layer then passes the datagram up to the application layer, which reassembles the original data.
How Communication Happens in User Datagram Protocol?
The Communication in the User Datagram Protocol (UDP) starts when an application layer program on one host decides to send data to an application layer program on another host. The application layer program divides the data into small units, called datagrams, and passes them down to the transport layer.
The transport layer then adds a UDP header to each datagram, which contains information about the source and destination ports, the length of the datagram, and a checksum for error detection. The transport layer then passes the datagram to the network layer, where an IP header is added to create an IP packet.
The IP packet is then transmitted over the network to the destination host, following the routing information stored in the IP header. The IP packet is received by the destination host, where the IP header is stripped off, and the datagram is passed up to the transport layer. The transport layer checks the UDP header for errors and discards any datagrams with errors. The transport layer then passes the datagram up to the application layer, which reassembles the original data.
In this way, communication starts in the UDP protocol when an application layer program on one host decides to send data to an application layer program on another host, and the transport layer and network layer handle the transmission and delivery of the data.
List of Well-Known PORT for User Datagram Protocol (UDP)
PORT ID | Protocol | Description |
---|---|---|
7 | Echo | Echos a received datagram back to sender. |
9 | Discard | Discards any datagram that is received. |
11 | Users | Active Users. |
13 | DayTime | Returns Date and Time. |
17 | Quote | Returns a quote of the Day. |
19 | CharGen | Returns a string of characters. |
53 | Nameserver | Domain Name Service. |
67 | BOOTPs | Server PORT to download Bootstrap Information. |
68 | BOOTPc | Client PORT to download Bootstrap Information. |
69 | TFTP | Trivial File Transfer Protocol. |
111 | RPC | Remote Procedure Call. |
123 | NTP | Network Time Protocol. |
161 | SNMP | Simple Network Management Protocol |
162 | SNMPt | Simple Network Management Protocol (trap) |
Applications of User Datagram Protocol
The User Datagram Protocol (UDP) is widely used in several types of applications, including:
- Online Gaming: UDP is often used for online gaming, as it provides a fast and efficient way to transfer real-time game data. The loss of some data is acceptable in this context, as the game can continue even if some data is lost or delayed.
- Video Conferencing: UDP is used in video conferencing, as it provides fast and efficient data transfer with low latency. This is important in video conferencing, as it ensures that the video and audio are delivered in real-time without significant delays.
- Streaming Media: UDP is often used for streaming media, such as audio and video. The fast and efficient data transfer provided by UDP is well-suited for streaming applications, as it allows the media to be delivered in real-time without significant delays.
- Broadcasting: UDP supports multi-casting, which allows data to be sent to multiple recipients at the same time. This makes UDP well-suited for broadcast applications, such as the delivery of television or radio programming.
- Remote Procedure Calls (RPC): UDP can be used for Remote Procedure Calls (RPC), which allow a program on one machine to request services from a program on another machine. UDP is often used for this type of application because it provides a fast and efficient way to transfer data with low latency.
- Internet of Things (IoT): UDP is widely used in IoT applications, as it provides a simple and efficient way to transfer data between devices. The fast and efficient data transfer provided by UDP is well-suited for IoT applications, which often have limited resources and require lightweight communication protocols.
Advantages of User Datagram Protocol
The User Datagram Protocol (UDP) has several advantages over other transport layer protocols, such as TCP:
- Fast and Simple: UDP is a simple and fast protocol that requires minimal overhead. The small header size and lack of flow control mechanisms make it ideal for high-speed and low-latency applications.
- Low Latency: Because UDP has a small header and minimal overhead, it has lower latency than other transport layer protocols. This makes it ideal for real-time applications, such as online gaming and video conferencing.
- No Reliability: UDP does not guarantee reliable delivery of data, meaning that some packets may be lost in transit. This makes it unsuitable for critical applications that require reliable delivery, but ideal for applications that can tolerate some data loss.
- No Flow Control: UDP does not have flow control mechanisms, meaning that the sender can send data as fast as it wants without worrying about congesting the network.
- Multicast Support: UDP supports multicast, which allows a single datagram to be sent to multiple recipients at the same time. This makes it ideal for applications that need to broadcast data to multiple recipients, such as video streaming.
Disadvantages of User Datagram Protocol
The User Datagram Protocol (UDP) has several disadvantages compared to other transport layer protocols, such as TCP:
- No Reliability: UDP does not guarantee reliable delivery of data, meaning that some packets may be lost in transit. This makes it unsuitable for critical applications that require reliable delivery.
- No Flow Control: UDP does not have flow control mechanisms, meaning that the sender can send data as fast as it wants without worrying about congesting the network. This can result in network congestion and dropped packets.
- No Error Correction: UDP does not have any error correction mechanisms, meaning that any errors in the data will be present in the received data. This makes it unsuitable for applications that require accurate data transmission.
- No Congestion Control: UDP does not have any congestion control mechanisms, meaning that it cannot adjust its data transmission rate in response to network congestion. This can result in further network congestion and dropped packets.
- Limited Header Size: The header size of UDP is limited, meaning that it can only carry a limited amount of information about the datagram. This can make it unsuitable for applications that require a large amount of information to be transmitted with each packet.
Future Improvement of User Datagram Protocol
The future use and development of the User Datagram Protocol (UDP) is likely to focus on improving its reliability, flow control, and error correction capabilities while maintaining its speed and simplicity. Here are some areas where UDP is expected to see further development:
- Improved Reliability: Future versions of UDP may include mechanisms to ensure the reliable delivery of data, such as retransmission of lost packets and acknowledgment of received packets.
- Improved Flow Control: Future versions of UDP may include flow control mechanisms to prevent network congestion and ensure efficient data transmission.
- Improved Error Correction: Future versions of UDP may include error correction mechanisms to ensure accurate data transmission, such as checksum calculation and error detection codes.
- Improved Congestion Control: Future versions of UDP may include congestion control mechanisms to prevent network congestion and ensure efficient data transmission.
- Increased Header Size: Future versions of UDP may increase the header size to allow for more information to be transmitted with each packet, making it suitable for a wider range of applications.