What is User Datagram Protocol?
User Datagram Protocol (UDP) is a part of the Internet Protocol suite present in the Transport layer and is used by network programs running on different computers. The Internet Protocol suite consists of UDP in the form of a UDP/IP suite.UDP is an alternative to TCP or Transmission Control Protocol and as opposed to TCP, UDP is an unreliable and connectionless communication protocol. This means that once the data transfer happens, the connection need not be established.
Though most of the Internet services use Transmission Control Protocol (TCP) as it provides reliability, guaranteed and secured delivery, etc. In order to facilitate all these services, TCP is associated with an additional overhead cost and latency which can be considered as cons of using TCP. UDP, however, solves this problem by establishing low latency and connections that can tolerate losses.
UDP is majorly used for providing real-time services like live conferencing, voice or video communication, computer gaming. In case the packets being transferred is delayed, UDP will allow these packets to be dropped instead of being processed. This allows UDP to speed up the process and performance. UDP does not believe in checking errors thus saving the bandwidth. All this has made User Datagram Protocol (UDP) more efficient in latency as well as bandwidth. UDP, officially defined in RFC 768 and formulated by David P. Reed, is generally used to send short messages known as datagrams.
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.
4.6 (3,144 ratings)
- 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 –