UDP, which stands for User Datagram Protocol, is a communications protocol that provides a limited amount of service when messages are exchanged between computers within a network using the Internet Protocol (IP). It is an alternative to the Transmission Control Protocol (TCP).
Designed by David P. Reed in 1980, UDP is sometimes referred to as the Universal Datagram Protocol. TCP and UDP have pertinent similarities and differences. Like TCP, UDP uses the Internet protocol to transfer a data unit called datagram from one computer to another. However, it does not divide the message (datagram) into packets and then reassemble it at the other end of transmission. UDP has very small data units to exchange so there is no guarantee that the entire message will arrive in its proper sequence.
Both TCP and UDP, and two other remaining protocols of IP and ICMP, have checksums. In all protocols, the checksums cover the protocol header and any present data. On the other hand, the use of checksums is only optional in UDP.
The many metrics built in TCP’s header, such as TCP sequence number and acknowledgment number, make it connection-oriented whereas the latter does not have built-in metrics in its header.
- UDP uses the Internet Protocol, much like TCP, to get a data unit called datagram from one computer to another.
TCP has an average header length of 20 bytes, while UDP has an average header length of 8 bytes. Therefore, UDP is much faster because there is less to transmit. Time-sensitive applications often use UDP because of its speed, albeit deliveries that are not guaranteed.
Some of the most common applications that use UDP are: Trivial File Transfer Protocol, Domain Name System (DNS), Voice over IP (VoIP), IPTV, and Online gaming.
UDP Segment Structure
The application data is found in the data field of the UDP datagram. For instance, the DNS data field contains either a response message or a query message. On the other hand, audio samples fill the data field for streaming audio applications. UDP headers have only four fields, each consisting of four bytes. The destination ports’ numbers allow the destination host to transfer the data to the appropriate process running in that host. Checksums are used by receiving hosts to check for errors that had been introduced during its transmission from host to destination.
The UDP segment structure is completely defined in RFC 768.