What is User Datagram Protocol?
User Datagram Protocol is a connectionless unreliable transport protocol, lies between the Application layer and transport layer. It does not add anything to the services of IP except for providing a process to process communication instead of the host to host evidence. User Datagram Protocol transfer data in packet format which has 8 bytes of the header that includes parameters like source port number, destination port number, total length, checksum each of 16 bits. UDP provides services like the process to process communication, connectionless services, flow control, error control, checksum, congestion control, encapsulation and decapsulation, queuing, multiplexing and demultiplexing
Understanding User Datagram Protocol
User datagram protocol (UDP) is a transport layer protocol in an open systems interconnection (OSI) for client-server network applications. UDP implements a simple transmission model. It, however, does not believe in handshaking in for reliability, order or data integrity.
UDP does not believe in error-checking or correction so that it avoids the time spent in processing at the network level. The order in which the packets are sent is not monitored by the UDP protocol and it permits these packets to be dropped and received in a different order than the one they were sent in. This helps UDP in better performance.
The network traffic of UDP is arranged in the form of datagrams. The datagrams are the smallest units consisting of one message unit. The header information is stored in the first eight units of a datagram. The remaining bytes of a UDP datagram consists of a message data. Eight units of the header information in a UDP datagram is divided into four fields of two bytes each containing the source port number, the destination port number, the size of the datagram and the checksum.
- Source Port – It is a service access point or SAP used to indicate the session on the local client from where the packet was originated.
- Destination Port –It is a service access point to indicate the services request made by the client to the remote server.
- UDP length- The total size of the datagram consisting of UDP header information and payload data
- UDP Checksum – A checksum is to verify the originality of the payload data and to make sure that it has not been corrupted by routers or bridges in the network. One of such checksum algorithm is the Standard Internet Checksum algorithm. It safeguards an application against receiving incorrect data in place of, or in addition to whatever was sent.
What can you do with User Datagram Protocol and why is it used?
- Mostly all application designers know that unlike Transmission Control Protocol, User Datagram Protocol does not provide any reliability, such as, if any packets are lost on the way UDP would not retransmit those lost packets. This often is the main reason to consider transporting messages via UDP. UDP is basically used in applications in which there is no requirement of a reliable protocol for delivering messages by implementing appropriate protocol mechanisms in their applications.
- The best-effort service of UDP is unable to protect the datagram from datagram duplication. This means that sometimes an application tends to receive multiple copies of the same datagram which are not automatically filtered by UDP. This means that the application designers are therefore expected to verify that the application that is being used is able to handle the datagram duplicacy gently along with implementing mechanisms capable enough to filter out the duplicate datagrams received.
- Sometimes due to traffic, congestion, routing transients, mobility, etc it might happen that there is a significant delay in some packets as compared to the other packets. This may lead to a disturbance in the order of the datagrams transmitted and the order of datagrams arrived at the receiver. This leads to reordering which can only be restored if the application has a mechanism to restore the datagrams order.
Advantages of User Datagram Protocol
- One of the very interesting features of UDP is neither it needs to retransmit the packets that are lost while transmission nor does it require any connection setup. Due to this feature, the data that is sent incurs a less delay in being received by the receiver. This lower delay makes UDP appropriate to be used in delay-sensitive applications like audio and video.
- Multicast applications use UDP as they do point to multipoint. In the case of TCP is used for multicast applications, the sender needs to record the retransmissions/sending rate for multiple receivers which would become highly complex.
- Much faster than TCP.
Disadvantages of User Datagram Protocol
- There is no guarantee of UDP.
- A packet might not be delivered or might be delivered multiple times and out of order without you getting any indication of it.
- UDP has no flow control or congestion control.
- UDP suffers from worse packet loss than TCP.
The service that is provided by User Datagram Protocol might be an unreliable service providing no guaranty for delivery or protection from datagram duplication but it is only because of this simplicity that using UDP reduces the overhead time, latency and prove very useful for applications requiring such features.
This has been a guide to User Datagram Protocol. Here we discussed the use of User Datagram Protocol, understanding, advantages and disadvantages. You can also go through our other suggested articles to learn more –